Richard Kettlewell
2020-04-17 15:44:37 UTC
https://pubs.opengroup.org/onlinepubs/9699919799/functions/sigprocmask.html
int sigprocmask(int how, const sigset_t *restrict set,
sigset_t *restrict oset);
Can anyone justify the restrict-qualification of the set and oset
arguments, which forbids an otherwise perfectly reasonable idiom for
modifying the signal mask while also capturing its old value for later
restoration?
The change history says “The restrict keyword is added to the
pthread_sigmask() and sigprocmask() prototypes for alignment with the
ISO/IEC 9899:1999 standard.” but these functions do not appear in
standard C, and the C standard does not actually require one to apply
restrict qualifiers to function arguments willy-nilly, this doesn’t
really explain the change.
int sigprocmask(int how, const sigset_t *restrict set,
sigset_t *restrict oset);
Can anyone justify the restrict-qualification of the set and oset
arguments, which forbids an otherwise perfectly reasonable idiom for
modifying the signal mask while also capturing its old value for later
restoration?
The change history says “The restrict keyword is added to the
pthread_sigmask() and sigprocmask() prototypes for alignment with the
ISO/IEC 9899:1999 standard.” but these functions do not appear in
standard C, and the C standard does not actually require one to apply
restrict qualifiers to function arguments willy-nilly, this doesn’t
really explain the change.
--
https://www.greenend.org.uk/rjk/
https://www.greenend.org.uk/rjk/