View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0000959 | 1003.1(2008)/Issue 7 | Base Definitions and Headers | public | 2015-06-18 11:10 | 2015-07-30 15:04 |
Reporter | joerg | Assigned To | ajosey | ||
Priority | normal | Severity | Editorial | Type | Clarification Requested |
Status | Closed | Resolution | Withdrawn | ||
Name | Jörg Schilling | ||||
Organization | |||||
User Reference | |||||
Section | Headers | ||||
Page Number | 335-336 | ||||
Line Number | 11179, 11185, 11218-11223 | ||||
Interp Status | --- | ||||
Final Accepted Text | |||||
Summary | 0000959: struct siginfo member si_pid is marked "CX" but is mandatory for the non-CX waitid() | ||||
Description | In order to make waitid() usable, the siginfo_t members si_pid si_code si_status need to be mandatory and siginfo_t as a whole needs to be mandatory as well. | ||||
Desired Action | Remove the "CX" marker for siginfo_t on line 11179 and remove the "CX" marker for si_pid on line 11185 and change Sending process ID. to Sending process ID or child pid for waitid(). Remove the "CX" marker for the constants CLD_EXITED .. CLD_CONTINUED at line 11218..11223. In order to make waitid() usable at shell level, it may be needed to require CLD_EXITED .. CLD_CONTINUED to use the range 1..6. | ||||
Tags | No tags attached. |
related to | 0000690 | Closed | 1003.1(2013)/Issue7+TC1 | clarify behavior when calling waitpid with SA_NOCLDWAIT |
|
Here is a test program that allows to check whether a implementation conforms to the standard: #include <stdlib.h> #include <unistd.h> #include <sys/wait.h> #include <stdio.h> /* * Non-standard compliant platforms may need * #include <signal.h> 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 signinfo should be %d (0x%x) but is %d (0x%x)\n", 1234567890, 1234567890, si.si_status, si.si_status); if (CLD_EXITED != 1) printf("CLD_EXITED is %d on this platform\n", CLD_EXITED); return (0); } |
|
This bug report seems to be the result of a misunderstanding of what the CX margin code means. Hint: it does not indicate that something is optional! |
|
So do you believe that this is just an extension to ISO C but mandatory for POSIX? The interesting thing here is that e.g. Mac OS X returns si_pid == 0 for waitid() and does not seem to implement a useable waitid() interface. |
|
See XBD 1.7.1 line 182. Something marked CX is mandatory in POSIX, and merely marked as a convenience to show that it is an extension to C99. |
|
> So do you believe that this is just an extension to ISO C but > mandatory for POSIX? Yes. Key quotes from the section Eric mentioned (XBD 1.7.1, definition of CX shading):
Note that 0000690 changed some shading; I don't recall whether there's any overlap with this bug report. |
Date Modified | Username | Field | Change |
---|---|---|---|
2015-06-18 11:10 | joerg | New Issue | |
2015-06-18 11:10 | joerg | Status | New => Under Review |
2015-06-18 11:10 | joerg | Assigned To | => ajosey |
2015-06-18 11:10 | joerg | Name | => Jörg Schilling |
2015-06-18 11:10 | joerg | Section | => Headers |
2015-06-18 11:10 | joerg | Page Number | => 335-336 |
2015-06-18 11:10 | joerg | Line Number | => 11179, 11185, 11218-11223 |
2015-06-18 11:11 | joerg | Note Added: 0002715 | |
2015-06-18 11:11 | joerg | Note Edited: 0002715 | |
2015-06-18 11:32 | geoffclare | Note Added: 0002716 | |
2015-06-18 11:46 | joerg | Note Added: 0002717 | |
2015-06-18 18:36 | eblake | Note Added: 0002722 | |
2015-07-10 21:39 | rhansen | Relationship added | related to 0000690 |
2015-07-10 21:48 | rhansen | Note Added: 0002753 | |
2015-07-10 21:48 | rhansen | Note Edited: 0002753 | |
2015-07-30 15:04 | Don Cragun | Interp Status | => --- |
2015-07-30 15:04 | Don Cragun | Status | Under Review => Closed |
2015-07-30 15:04 | Don Cragun | Resolution | Open => Withdrawn |