Re: Question about trap



|Normally, the termination value retrieved by wait() is a single integer,
|storing two values. One value, the process returncode, "consists of the
|least significant  8 bits of the status argument that the child specified
|in a call to exit(3) or _exit(2) or as the argument for a return  statement
|in main()." The other value, the process signal number, is a single 7-bit
|value indicating which signal terminated the process (or 0 if the process
|terminated on its own). The signal number is stored in the low order 7 bits
|of the process termination status (mask 0x7f), and the process returncode
|is stored in bits 8 through 15 of the process termination status (mask
|0xff00).

And the missing bit, corresponding to that mysterious error_code=128, is the
"core dumped" bit, which makes sense for a SEGV.

If you don't mind could you please explain a little bit more about the
core dumped bit?

From your example, 128 = 0x00000001 0000000
So the exit code of the process is 1 and the SIGNAL number is 0. Did I
get that right?

Thanks,
-Joel
.