From mboxrd@z Thu Jan 1 00:00:00 1970 From: david@kdbarto.org (David) Date: Tue, 3 Jan 2017 06:06:15 -0800 Subject: [TUHS] MacOS X is Unix (tm) In-Reply-To: <586a3a23.udW0nRrOopzHoQbP%schily@schily.net> References: <52C99F50-E24A-4BBF-A129-180A1271B4E3@kdbarto.org> <586a3a23.udW0nRrOopzHoQbP%schily@schily.net> Message-ID: <8168FD75-9C3E-47C1-9BA8-EADAD7D33C38@kdbarto.org> MacOS passes this except for the si_status test. MacOS uses a signed int there. I’m not sure what the standard says. David > On Jan 2, 2017, at 3:31 AM, Joerg Schilling wrote: > > David wrote: > >> MacOS X is a certified Unix (tm) OS. Not Unix-Like. > > Given that MacOS X is not POSIX compliant, I would call it a UNIX-alike. > > Note that passing the certification tests unfortunately does not grant > POSIX compliance :-( > > Try e.g. this program on Mac OS X: > > #include > #include > #include > #include > /* > * Non-standard compliant platforms may need > * #include or something similar > * in addition to the include files above. > */ > > int > main() > { > siginfo_t si; > pid_t pid; > int ret; > > if ((pid = fork()) < 0) > exit(1); > if (pid == 0) { > _exit(1234567890); > } > ret = waitid(P_PID, pid, &si, WEXITED); > printf("ret: %d si_pid: %ld si_status: %d si_code: %d\n", > ret, > (long) si.si_pid, si.si_status, si.si_code); > if (pid != si.si_pid) > printf("si_pid in struct siginfo should be %ld but is %ld\n", > (long) pid, (long) si.si_pid); > if (si.si_status != 1234567890) > printf("si_status in struct siginfo should be %d (0x%x) but is %d (0x%x)\n", > 1234567890, 1234567890, si.si_status, si.si_status); > if (si.si_code != CLD_EXITED) > printf("si_code in struct siginfo should be %d (0x%x) but is %d (0x%x)\n", > CLD_EXITED, CLD_EXITED, si.si_code, si.si_code); > if (CLD_EXITED != 1) > printf("CLD_EXITED is %d on this platform\n", CLD_EXITED); > return (0); > } > > Jörg > > -- > EMail:joerg at schily.net (home) Jörg Schilling D-13353 Berlin > joerg.schilling at fokus.fraunhofer.de (work) Blog: http://schily.blogspot.com/ > URL: http://cdrecord.org/private/ http://sourceforge.net/projects/schilytools/files/