I have been trying to explore the source code of the getcontext() and setcontext functions but I have not been able to spot the right file or resource. Any help in this regard will be helpful.

I was able to trace to http://fossies.org/dox/glibc-2.14.1/setcontext_8c_source.html but there is no info

These are system functions related to setjmp/longjmp instructions. They are probably part of the glibc library (just a guess). Look on the GNU web site (gcc) for the source code. According to the comments in /usr/include/ucontext.h (the header file for these instructions), it is part of the GNU C library, as I surmised.