int getcontext(ucontext_t *ucp);
This stores the context for the calling thread in the structure pointed to by ucp.