1
0
mirror of https://sourceware.org/git/glibc.git synced 2026-01-06 11:51:29 +03:00

signal: Deprecate additional legacy signal handling functions

This needs a few test adjustments: In some cases, sigignore was
used for convenience (replaced with xsignal with SIG_IGN).  Tests
for the deprecated functions need to disable
-Wdeprecated-declarations, and for the sigmask deprecation,
-Wno-error.

Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
This commit is contained in:
Florian Weimer
2020-05-25 18:32:28 +02:00
parent de42613540
commit 02802fafcf
12 changed files with 57 additions and 33 deletions

View File

@@ -148,7 +148,8 @@ extern void psiginfo (const siginfo_t *__pinfo, const char *__s);
#ifdef __USE_XOPEN_EXTENDED
# ifdef __GNUC__
extern int sigpause (int __sig) __asm__ ("__xpg_sigpause");
extern int sigpause (int __sig) __asm__ ("__xpg_sigpause")
__attribute_deprecated_msg__ ("Use the sigsuspend function instead");
# else
extern int __sigpause (int __sig_or_mask, int __is_sig);
/* Remove a signal from the signal mask and suspend the process. */
@@ -164,7 +165,9 @@ extern int __sigpause (int __sig_or_mask, int __is_sig);
simply do not work in many situations. Use `sigprocmask' instead. */
/* Compute mask for signal SIG. */
# define sigmask(sig) ((int)(1u << ((sig) - 1)))
# define sigmask(sig) \
__glibc_macro_warning ("sigmask is deprecated") \
((int)(1u << ((sig) - 1)))
/* Block signals in MASK, returning the old mask. */
extern int sigblock (int __mask) __THROW __attribute_deprecated__;
@@ -311,7 +314,8 @@ extern int sigreturn (struct sigcontext *__scp) __THROW;
/* If INTERRUPT is nonzero, make signal SIG interrupt system calls
(causing them to fail with EINTR); if INTERRUPT is zero, make system
calls be restarted after signal SIG. */
extern int siginterrupt (int __sig, int __interrupt) __THROW;
extern int siginterrupt (int __sig, int __interrupt) __THROW
__attribute_deprecated_msg__ ("Use sigaction with SA_RESTART instead");
# include <bits/sigstack.h>
# include <bits/ss_flags.h>
@@ -340,16 +344,21 @@ extern int sigstack (struct sigstack *__ss, struct sigstack *__oss)
/* Simplified interface for signal management. */
/* Add SIG to the calling process' signal mask. */
extern int sighold (int __sig) __THROW;
extern int sighold (int __sig) __THROW
__attribute_deprecated_msg__ ("Use the sigprocmask function instead");
/* Remove SIG from the calling process' signal mask. */
extern int sigrelse (int __sig) __THROW;
extern int sigrelse (int __sig) __THROW
__attribute_deprecated_msg__ ("Use the sigprocmask function instead");
/* Set the disposition of SIG to SIG_IGN. */
extern int sigignore (int __sig) __THROW;
extern int sigignore (int __sig) __THROW
__attribute_deprecated_msg__ ("Use the signal function instead");
/* Set the disposition of SIG. */
extern __sighandler_t sigset (int __sig, __sighandler_t __disp) __THROW;
extern __sighandler_t sigset (int __sig, __sighandler_t __disp) __THROW
__attribute_deprecated_msg__
("Use the signal and sigprocmask functions instead");
#endif
#if defined __USE_POSIX199506 || defined __USE_UNIX98