Skip to content

posix: implement pthread_sigmask() #59944

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Tracked by #51211
ycsin opened this issue Jul 3, 2023 · 0 comments · Fixed by #66065
Closed
Tracked by #51211

posix: implement pthread_sigmask() #59944

ycsin opened this issue Jul 3, 2023 · 0 comments · Fixed by #66065
Labels
area: POSIX POSIX API Library Feature Request A request for a new feature Good first issue Good for a first time contributor to take

Comments

@ycsin
Copy link
Member

ycsin commented Jul 3, 2023

There are currently 20 missing POSIX functions with trivial implementations, pthread_sigmask() is one of them.

pthread_sigmask, sigprocmask - examine and change blocked signals

The pthread_sigmask() function shall examine or change (or both) the calling thread's signal mask, regardless of the number of threads in the process. The function shall be equivalent to sigprocmask(), without the restriction that the call be made in a single-threaded process.

In a single-threaded process, the sigprocmask() function shall examine or change (or both) the signal mask of the calling thread.

If the argument set is not a null pointer, it points to a set of signals to be used to change the currently blocked set.

The argument how indicates the way in which the set is changed, and the application shall ensure it consists of one of the following values:

SIG_BLOCK
The resulting set shall be the union of the current set and the signal set pointed to by set.
SIG_SETMASK
The resulting set shall be the signal set pointed to by set.
SIG_UNBLOCK
The resulting set shall be the intersection of the current set and the complement of the signal set pointed to by set.
If the argument oset is not a null pointer, the previous mask shall be stored in the location pointed to by oset. If set is a null pointer, the value of the argument how is not significant and the thread's signal mask shall be unchanged; thus the call can be used to enquire about currently blocked signals.

If there are any pending unblocked signals after the call to sigprocmask(), at least one of those signals shall be delivered before the call to sigprocmask() returns.

It is not possible to block those signals which cannot be ignored. This shall be enforced by the system without causing an error to be indicated.

If any of the SIGFPE, SIGILL, SIGSEGV, or SIGBUS signals are generated while they are blocked, the result is undefined, unless the signal was generated by the action of another process, or by one of the functions kill(), pthread_kill(), raise(), or sigqueue().

If sigprocmask() fails, the thread's signal mask shall not be changed.

The use of the sigprocmask() function is unspecified in a multi-threaded process.

See https://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_sigmask.html

See RFC #51211 for more info.

@ycsin ycsin added Feature Request A request for a new feature Good first issue Good for a first time contributor to take area: POSIX POSIX API Library labels Jul 3, 2023
@ycsin ycsin added this to the v3.5.0 milestone Jul 3, 2023
@ycsin ycsin moved this from To Do to LTS3 Goals in Release Plan Jul 3, 2023
@cfriedt cfriedt assigned cfriedt and unassigned cfriedt Jul 4, 2023
@cfriedt cfriedt removed the status in Release Plan Sep 12, 2023
@nashif nashif removed this from Release Plan Sep 13, 2023
@cfriedt cfriedt removed this from the v3.5.0 milestone Oct 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: POSIX POSIX API Library Feature Request A request for a new feature Good first issue Good for a first time contributor to take
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants