View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0000925 | 1003.1(2013)/Issue7+TC1 | System Interfaces | public | 2015-02-19 11:42 | 2015-05-07 16:12 |
Reporter | dannyniu | Assigned To | |||
Priority | normal | Severity | Editorial | Type | Enhancement Request |
Status | Closed | Resolution | Rejected | ||
Name | DannyNiu | ||||
Organization | |||||
User Reference | |||||
Section | int raise(int sig); | ||||
Page Number | ./functions/raise.html | ||||
Line Number | In the Description. | ||||
Interp Status | --- | ||||
Final Accepted Text | |||||
Summary | 0000925: Equavilant to calling? | ||||
Description | The description for raise() says The effect of the raise() function shall be equivalent to calling: pthread_kill(pthread_self(), sig); What I've noticed is that in the Darwin implementation, and possibly FreeBSD wherence it inherented it from, it's being implemented as: int raise(int sig) { return kill(getpid(), sig); } | ||||
Desired Action | I would like the committee to consider if to change the description for the raise function to: shall be equivalent to calling: kill(getpid(), sig); , or determine that using pthread_kill is desired and a bugreport should be filed to Apple and FreeBSD. | ||||
Tags | No tags attached. |
|
In FreeBSD, the code in libc using kill(getpid(), sig) is only used in single-threaded processes. The threading library contains code equivalent to pthread_kill(pthread_self(), sig) (but with less locking and postponing signals). Newer versions of FreeBSD will use a thread-specific kill in libc's raise(). Given that the value of si_info for raise() and pthread_kill() are not specified (they may or may not be SI_USER), I think this scheme is fully compliant. |
|
The wording in the standard is what is intended. Implementations may have two different versions of raise(), one for single-threaded programs that uses kill() and one for multi-threaded programs that uses pthread_kill(). In both cases the behavior meets the requirements of the standard. |
Date Modified | Username | Field | Change |
---|---|---|---|
2015-02-19 11:42 | dannyniu | New Issue | |
2015-02-19 11:42 | dannyniu | Name | => DannyNiu |
2015-02-19 11:42 | dannyniu | Section | => int raise(int sig); |
2015-02-19 11:42 | dannyniu | Page Number | => ./functions/raise.html |
2015-02-19 11:42 | dannyniu | Line Number | => In the Description. |
2015-02-19 19:40 | jilles | Note Added: 0002550 | |
2015-05-07 16:12 | geoffclare | Interp Status | => --- |
2015-05-07 16:12 | geoffclare | Note Added: 0002660 | |
2015-05-07 16:12 | geoffclare | Status | New => Closed |
2015-05-07 16:12 | geoffclare | Resolution | Open => Rejected |