FreeBSD equivalent for SEGV_MAPERR?

J.T. Conklin jtc at acorntoolworks.com
Sat Mar 19 12:26:51 PST 2005


I'm working on autoconf support for ACE (A C++ framework) and TAO
(Real-time CORBA ORB).  

The resulting configuration is failing for FreeBSD, something I'd
like before the upcoming ACE/TAO release.  I downloaded FreeBSD 5.3
and installed it under vmware to reproduce (and hopefully fix) this
problem.

The configure script detects that FreeBSD supports SA_SIGINFO, the
siginfo_t struct, and the fact siginfo_t has a si_addr field so it
enables code to check for segmentation errors in the shared memory
pool class.  But that fails to compile due to the lack of a
SEGV_MAPERR macro.  The code in question is:

    else if (!(siginfo->si_code == SEGV_MAPERR
           && siginfo->si_addr < (((char *) this->base_addr_) + offset)
           && siginfo->si_addr >= ((char *) this->base_addr_)))
        ACE_ERROR_RETURN ((LM_ERROR,
                           "(%P|%t) address %u out of range\n",
                           siginfo->si_addr),
                          -1);

I wrote a little test program to force a SIGSEGV, and si_addr seems to
have the correct value.  But I don't know what macro/constant I should
be checking si_code against.

    --jtc

-- 
J.T. Conklin


More information about the freebsd-questions mailing list