On Wed, Jul 31, 2013 at 3:56 PM, David Korn <[email protected]> wrote: > cc: [email protected] > Subject: Re: [ast-developers] RFE: Renaming .sh.sig.code to match Opengroup > <signal.h> spec? >> I've a small RFE for the sake of writing shell signal traps which use >> .sh.sig a bit easier. >> >> Currently ksh either use custom names ("stopped", "exited", "dumped") >> or numbers in .sh.sig.code. This is frustrating from the viewpoint of >> script programmer who actually have to look into the ksh sources or >> try to trigger the matching event to figure out the string value ksh >> uses for a given si_code. >> >> Could we just avoid this and just use the uppercase names defined by >> Opengroup in <signal.h>, i.e. >> http://pubs.opengroup.org/onlinepubs/009696699/basedefs/signal.h.html? >> Otherwise ksh93(1) must be updated to list each signal and the names >> or numbers (which aren't portable BTW) used. > > I don't see the point of the prefixes but using uppercase names > as defined in the standard seems reasonable. > > We don't require the SIG prefix for signals,
Erm... you don't require them but you allow them... :-) > so I don't see the > point of the prefixes here either. This is shell, not C. Right... but IMO Cedric request indirectly uncovered an unfortunate issue: My patch in http://lists.research.att.com/pipermail/ast-developers/2013q3/002959.html adds support for the generic |SI_*| names defined in http://pubs.opengroup.org/onlinepubs/009696699/basedefs/signal.h.html ... the postfixes of the |SI_*| names defined in the standard are collision-free with the postfixes of the signal-specific |si_code| values... but that's not true for the OS-specific extensions... quick digging already revealed at least two collisions: 1. |SI_ERR| (generic) and |POLL_ERR| (for SIGPOLL). 2. |SI_DTRACE| (generic) and |TRAP_DTRACE| (for SIGTRAP) ... and there are likely more since I didn't do deeper digging (SIGTRAP may not be relevant but dtrace is... and implementing support for SIGPOLL would be at least intersting to have) AFAIK there is no way around having prefixes for the |si_code| string values... ;-/ ---- Bye, Roland -- __ . . __ (o.\ \/ /.o) [email protected] \__\/\/__/ MPEG specialist, C&&JAVA&&Sun&&Unix programmer /O /==\ O\ TEL +49 641 3992797 (;O/ \/ \O;) _______________________________________________ ast-developers mailing list [email protected] http://lists.research.att.com/mailman/listinfo/ast-developers
