On Oct 2, 2013, at 3:34 AM, Paulo Pinto <pj...@progtools.org> wrote:

> I don't do UNIX system programming at C level since 2002, but my POSIX 
> memories, is that it is as portable as C, with its share of undefined 
> behaviors and OS specific extensions.

Posix is super portable largely because the spec is very loose.  Not many 
functions actually have to be declared, and of those that must be declared, 
some can actually return an error when called that indicates they aren't 
implemented.  And what's allowed in signal handlers, for example, is very 
limited as well, for similar reasons.  This is one area where Windows really 
did things right.  As Don has noted in the past, SEH is really fantastic.  I 
still do systems level C programming as my primary job responsibility, and my 
dislike of signals is nearly boundless at this point.  Even for things that 
make sense like SIGCHLD, the limited options available within signal handlers 
make actually doing anything useful surprisingly hard.  I really wish Posix 
routines were required to use critical sections to delay signals until handling 
them wouldn't break anything.

Reply via email to