POSIX siginfo

John Baldwin jhb at freebsd.org
Thu Oct 13 08:32:22 PDT 2005


On Wednesday 12 October 2005 11:23 pm, David Xu wrote:
> I am trying to implement POSIX sigqueue, while staring some code
> in machdep.c and trap.c, I found our si_code for siginfo structure
> is not in POSIX standard, all are machine dependent magical values
> pushed by CPU. POSIX lists all these standard codes:
>
> http://www.opengroup.org/onlinepubs/009695399/basedefs/signal.h.html
>
> /* codes for SIGILL */
> ILL_ILLOPC
> ILL_ILLOPN
> ILL_ILLADR
> ILL_ILLTRP
> ILL_PRVOPC
> ILL_PRVREG
> ILL_COPROC
> ILL_BADSTK
>
> /* codes for SIGBUS */
> BUS_ADRALN
> BUS_ADRERR
> BUS_OBJERR
> BUS_RESERVED
>
> /* codes for SIGSEGV */
> SEGV_MAPERR
> SEGV_ACCERR
>
> /* codes for SIGFPE */
> FPE_INTOVF      1
> FPE_INTDIV      2
> FPE_FLTDIV      3
> FPE_FLTOVF      4
> FPE_FLTUND      5
> FPE_FLTRES      6
> FPE_FLTINV      7
> FPE_FLTSUB      8
>
> /* codes for SIGTRAP */
> TRAP_BRKPT
> TRAP_TRACE
>
> ...
>
> Note that, NetBSD and Linux had already used the POSIX codes, should we
> use them too?

Hmm, looks like we do use these values in some cases on i386 at least for 
SIGFPE and possibly SIGBUS.  I think you should fix all the archs to use 
these codes.  I would even go ahead and commit that on its own before the 
POSIX sigqueue stuff.

-- 
John Baldwin <jhb at FreeBSD.org>  <><  http://www.FreeBSD.org/~jhb/
"Power Users Use the Power to Serve"  =  http://www.FreeBSD.org


More information about the freebsd-arch mailing list