Mailing List Archive

Signals, POSIX vs. everybody else
Okay, Larry has issued us a challenge! Can we have perl use POSIX signals
instead of whatever signals happen to live on the system perl was compiled on?

HP-UX is particularly hairy -- we have POSIX (sigaction), SysV (signal),
and BSD signals (sigvector). It all depends on whether you have the
right flags to cc (-D_INCLUDE_POSIX_SOURCE or -D_INCLUDE_HPUX_SOURCE to get
POSIX) or simply call the relevant routines.

It looks like it should be simple enough to ifdef the sections of code in
mg.c, pp_sys.c, and util.c. Is that, plus stuff in Configure to check for
POSIX signals, enough?

Jeff
Re: Signals, POSIX vs. everybody else [ In reply to ]
> HP-UX is particularly hairy -- we have POSIX (sigaction), SysV (signal),
> and BSD signals (sigvector). It all depends on whether you have the
> right flags to cc (-D_INCLUDE_POSIX_SOURCE or -D_INCLUDE_HPUX_SOURCE to get
> POSIX) or simply call the relevant routines.

Are you sure that it's "-D_INCLUDE_POSIX_SOURCE"? For "plain"
HP-UX, I believe the correct #define is "-D_HPUX_SOURCE", not
"-D_INCLUDE_HPUX_SOURCE". Looking at /usr/include/sys/stdsyms.h, I see
lines like:

# ifdef _POSIX2_SOURCE
# if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE)

Yow. Not only do we have "POSIX", but we have POSIX variants ("POSIX"
vs "POSIX2"). I won't even attempt to mumble "XOPEN" ....

-- Darryl Okahata
darrylo@sr.hp.com
http://web.sr.hp.com/~darrylo/
Re: Signals, POSIX vs. everybody else [ In reply to ]
> Are you sure that it's "-D_INCLUDE_POSIX_SOURCE"? For "plain"
> HP-UX, I believe the correct #define is "-D_HPUX_SOURCE", not
> "-D_INCLUDE_HPUX_SOURCE".

Whoops, yes it should be _POSIX_SOURCE or _HPUX_SOURCE. Either one will get
you POSIX signals. The latter is a superset of the former.

Jeff
Re: Signals, POSIX vs. everybody else [ In reply to ]
apparently steven's unix prog book has a signal () clone so
broken sysV machines can use proper reliable signal sematnics.
i suggest digging it up.

--tom
Re: Signals, POSIX vs. everybody else [ In reply to ]
apparently steven's unix prog book has a signal () clone so
broken sysV machines can use proper reliable signal sematnics.
i suggest digging it up.

i have some code that i use in a few places that does this. i'll
send it in a different post (it's on another machine).

.mrg.
Re: Signals, POSIX vs. everybody else [ In reply to ]
Okay, Larry has issued us a challenge! Can we have perl use POSIX signals
instead of whatever signals happen to live on the system perl was compiled on?

HP-UX is particularly hairy -- we have POSIX (sigaction), SysV (signal),
and BSD signals (sigvector). It all depends on whether you have the
right flags to cc (-D_INCLUDE_POSIX_SOURCE or -D_INCLUDE_HPUX_SOURCE to get
POSIX) or simply call the relevant routines.

It looks like it should be simple enough to ifdef the sections of code in
mg.c, pp_sys.c, and util.c. Is that, plus stuff in Configure to check for
POSIX signals, enough?

the code i'm about to post has been verified to work ``correctly''
under hpux, but, it doesn't do anything like this as far as i'm aware.

.mrg.
Re: Signals, POSIX vs. everybody else [ In reply to ]
On Tue, 26 Sep 1995, Tom Christiansen wrote:

> apparently steven's unix prog book has a signal () clone so
> broken sysV machines can use proper reliable signal sematnics.
> i suggest digging it up.

Hmm. If this can give a reliable fallback, I'd seriously suggest that
MetaConfig take over signal handling functions (possibly using the
fallback code) and provide perl with a single interface. That's what it's
there for.

> --tom

--
Kenneth Albanowski (kjahds@kjahds.com, CIS: 70705,126)