View Issue Details

IDProjectCategoryView StatusLast Update
00009251003.1(2013)/Issue7+TC1System Interfacespublic2015-05-07 16:12
Reporterdannyniu Assigned To 
PrioritynormalSeverityEditorialTypeEnhancement Request
Status ClosedResolutionRejected 
NameDannyNiu
Organization
User Reference
Sectionint raise(int sig);
Page Number./functions/raise.html
Line NumberIn the Description.
Interp Status---
Final Accepted Text
Summary0000925: Equavilant to calling?
DescriptionThe 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 ActionI 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.
TagsNo tags attached.

Activities

jilles

2015-02-19 19:40

reporter   bugnote:0002550

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.

geoffclare

2015-05-07 16:12

manager   bugnote:0002660

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.

Issue History

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