I am running Ubuntu 9.10 (Karmic Koala), and I took a look at the jmp_buf
structure which is simply an array of 12 ints. When I use setjmp
, and pass in a jmp_buf
structure—4 out of 12 entries are saved off. These 4 entries are the stack pointer, frame pointer, program counter and return address. What are the other 8 entries for? Are they machine-dependent? Is another entry the segment table base register? What else is needed to properly restore a thread/process s environment? I looked through the man page, other sources, but I couldn t find the assembly code for setjmp
.
For example, let s say I want to find a particular word or number in a file. The contents are in sorted order (obviously). Since I want to run a binary search on the file, it seems like a real waste ...