Jan Engelhardt
On Monday 2012-08-06 22:26, Joerg Schilling wrote:
Jan Engelhardt
wrote: Windows is also omnipresent, and the POSIX guys are known to have strange ideas sometimes. So what?
You wanted to say that Linux guys are known to have strange ideas sometines?
(The GNU people say, and I would not distrust that statement that) df(1), in POSIX-compliant mode, is to show number of blocks in units of 512 bytes, rather than a more sane default like 1K.
And you are the person who decides what is sane? There is a rule in POSIX not to break existing software. df on UNIX did always report in multiple of 512 bytes. Later BSD changed this in an incompatible way. POSIX did not go the incompatible BSD path but rather introduced the -k option. As POSIX also introduced the alias command, there is no problem to make df -k the default.
Please explain me e.g. why on Linux, you don't get the full exit code from a program with waitid(). Both exit() and waitid() permit a full int, Linux masks the exit code with 0xFF.... so what is strange, POSIX or Linux?
That would be POSIX again, I suppose:
http://pubs.opengroup.org/onlinepubs/000095399/functions/exit.html
"""The value of status may be 0, EXIT_SUCCESS, EXIT_FAILURE, [CX] or any other value, though only the least significant 8 bits (that is, status & 0377) shall be available to a waiting parent process."""
Linux/glibc merely implement this POSIX-defined behavior.
No, Linux implements bugs in the descriptive text found in outdated verions. Your text is not the recent text. The correct text is rather: If the parent process of the calling process is executing a wait(), waitid(), or waitpid(), [XSI]and has neither set its SA_NOCLDWAIT flag nor set SIGCHLD to SIG_IGN,[/XSI] it shall be notified of termination of the calling process and the child's status shall be made available to it. If the parent is not waiting, the child?s status shall be made available to it when the parent subsequently executes wait(), waitid(), or waitpid(). and: the least significant 8 bits (that is, status & 0377) shall be available from wait() and waitpid(); the full value shall be available from waitid() and in the siginfo_t passed to a signal handler for SIGCHLD. Note that the description for SIGCHLD and si_status mentiones a full int since it exists, so Linux was always incorrect. Jörg -- EMail:joerg@schily.isdn.cs.tu-berlin.de (home) Jörg Schilling D-13353 Berlin js@cs.tu-berlin.de (uni) joerg.schilling@fokus.fraunhofer.de (work) Blog: http://schily.blogspot.com/ URL: http://cdrecord.berlios.de/private/ ftp://ftp.berlios.de/pub/schily -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org