mirror of
git://sourceware.org/git/glibc.git
synced 2024-11-21 01:12:26 +08:00
linux: Add pidfd_send_signal
This was added on Linux 5.1(3eb39f47934f9d5a3027fe00d906a45fe3a15fad) as a way to avoid the race condition of using kill (where PID might be reused by the kernel between between obtaining the pid and sending the signal). If the siginfo_t argument is NULL then pidfd_send_signal is equivalent to kill. If it is not NULL pidfd_send_signal is equivalent to rt_sigqueueinfo. Reviewed-by: Carlos O'Donell <carlos@redhat.com> Tested-by: Carlos O'Donell <carlos@redhat.com>
This commit is contained in:
parent
32dd8c251a
commit
56cf9e8eec
6
NEWS
6
NEWS
@ -16,9 +16,9 @@ Major new features:
|
||||
-z pack-relative-relocs option, which is supported for some targets
|
||||
in recent binutils versions. Lazy binding doesn't apply to DT_RELR.
|
||||
|
||||
* On Linux, the pidfd_open and pidfd_getfd functions have been added.
|
||||
The pidfd functionality provides access to a process while avoiding
|
||||
the issue of PID reuse on tranditional Unix systems.
|
||||
* On Linux, the pidfd_open, pidfd_getfd, and pidfd_send_signal functions
|
||||
have been added. The pidfd functionality provides access to a process
|
||||
while avoiding the issue of PID reuse on tranditional Unix systems.
|
||||
|
||||
Deprecated and removed features, and other changes affecting compatibility:
|
||||
|
||||
|
@ -302,6 +302,7 @@ libc {
|
||||
GLIBC_2.36 {
|
||||
pidfd_open;
|
||||
pidfd_getfd;
|
||||
pidfd_send_signal;
|
||||
}
|
||||
GLIBC_PRIVATE {
|
||||
# functions used in other libraries
|
||||
|
@ -2618,3 +2618,4 @@ GLIBC_2.35 epoll_pwait2 F
|
||||
GLIBC_2.35 posix_spawn_file_actions_addtcsetpgrp_np F
|
||||
GLIBC_2.36 pidfd_getfd F
|
||||
GLIBC_2.36 pidfd_open F
|
||||
GLIBC_2.36 pidfd_send_signal F
|
||||
|
@ -2715,6 +2715,7 @@ GLIBC_2.35 epoll_pwait2 F
|
||||
GLIBC_2.35 posix_spawn_file_actions_addtcsetpgrp_np F
|
||||
GLIBC_2.36 pidfd_getfd F
|
||||
GLIBC_2.36 pidfd_open F
|
||||
GLIBC_2.36 pidfd_send_signal F
|
||||
GLIBC_2.4 _IO_fprintf F
|
||||
GLIBC_2.4 _IO_printf F
|
||||
GLIBC_2.4 _IO_sprintf F
|
||||
|
@ -2379,3 +2379,4 @@ GLIBC_2.35 epoll_pwait2 F
|
||||
GLIBC_2.35 posix_spawn_file_actions_addtcsetpgrp_np F
|
||||
GLIBC_2.36 pidfd_getfd F
|
||||
GLIBC_2.36 pidfd_open F
|
||||
GLIBC_2.36 pidfd_send_signal F
|
||||
|
@ -498,6 +498,7 @@ GLIBC_2.35 epoll_pwait2 F
|
||||
GLIBC_2.35 posix_spawn_file_actions_addtcsetpgrp_np F
|
||||
GLIBC_2.36 pidfd_getfd F
|
||||
GLIBC_2.36 pidfd_open F
|
||||
GLIBC_2.36 pidfd_send_signal F
|
||||
GLIBC_2.4 _Exit F
|
||||
GLIBC_2.4 _IO_2_1_stderr_ D 0xa0
|
||||
GLIBC_2.4 _IO_2_1_stdin_ D 0xa0
|
||||
|
@ -495,6 +495,7 @@ GLIBC_2.35 epoll_pwait2 F
|
||||
GLIBC_2.35 posix_spawn_file_actions_addtcsetpgrp_np F
|
||||
GLIBC_2.36 pidfd_getfd F
|
||||
GLIBC_2.36 pidfd_open F
|
||||
GLIBC_2.36 pidfd_send_signal F
|
||||
GLIBC_2.4 _Exit F
|
||||
GLIBC_2.4 _IO_2_1_stderr_ D 0xa0
|
||||
GLIBC_2.4 _IO_2_1_stdin_ D 0xa0
|
||||
|
@ -2654,3 +2654,4 @@ GLIBC_2.35 epoll_pwait2 F
|
||||
GLIBC_2.35 posix_spawn_file_actions_addtcsetpgrp_np F
|
||||
GLIBC_2.36 pidfd_getfd F
|
||||
GLIBC_2.36 pidfd_open F
|
||||
GLIBC_2.36 pidfd_send_signal F
|
||||
|
@ -2603,6 +2603,7 @@ GLIBC_2.35 epoll_pwait2 F
|
||||
GLIBC_2.35 posix_spawn_file_actions_addtcsetpgrp_np F
|
||||
GLIBC_2.36 pidfd_getfd F
|
||||
GLIBC_2.36 pidfd_open F
|
||||
GLIBC_2.36 pidfd_send_signal F
|
||||
GLIBC_2.4 __confstr_chk F
|
||||
GLIBC_2.4 __fgets_chk F
|
||||
GLIBC_2.4 __fgets_unlocked_chk F
|
||||
|
@ -2787,6 +2787,7 @@ GLIBC_2.35 epoll_pwait2 F
|
||||
GLIBC_2.35 posix_spawn_file_actions_addtcsetpgrp_np F
|
||||
GLIBC_2.36 pidfd_getfd F
|
||||
GLIBC_2.36 pidfd_open F
|
||||
GLIBC_2.36 pidfd_send_signal F
|
||||
GLIBC_2.4 __confstr_chk F
|
||||
GLIBC_2.4 __fgets_chk F
|
||||
GLIBC_2.4 __fgets_unlocked_chk F
|
||||
|
@ -2553,6 +2553,7 @@ GLIBC_2.35 epoll_pwait2 F
|
||||
GLIBC_2.35 posix_spawn_file_actions_addtcsetpgrp_np F
|
||||
GLIBC_2.36 pidfd_getfd F
|
||||
GLIBC_2.36 pidfd_open F
|
||||
GLIBC_2.36 pidfd_send_signal F
|
||||
GLIBC_2.4 __confstr_chk F
|
||||
GLIBC_2.4 __fgets_chk F
|
||||
GLIBC_2.4 __fgets_unlocked_chk F
|
||||
|
@ -499,6 +499,7 @@ GLIBC_2.35 epoll_pwait2 F
|
||||
GLIBC_2.35 posix_spawn_file_actions_addtcsetpgrp_np F
|
||||
GLIBC_2.36 pidfd_getfd F
|
||||
GLIBC_2.36 pidfd_open F
|
||||
GLIBC_2.36 pidfd_send_signal F
|
||||
GLIBC_2.4 _Exit F
|
||||
GLIBC_2.4 _IO_2_1_stderr_ D 0x98
|
||||
GLIBC_2.4 _IO_2_1_stdin_ D 0x98
|
||||
|
@ -2730,6 +2730,7 @@ GLIBC_2.35 epoll_pwait2 F
|
||||
GLIBC_2.35 posix_spawn_file_actions_addtcsetpgrp_np F
|
||||
GLIBC_2.36 pidfd_getfd F
|
||||
GLIBC_2.36 pidfd_open F
|
||||
GLIBC_2.36 pidfd_send_signal F
|
||||
GLIBC_2.4 __confstr_chk F
|
||||
GLIBC_2.4 __fgets_chk F
|
||||
GLIBC_2.4 __fgets_unlocked_chk F
|
||||
|
@ -2703,3 +2703,4 @@ GLIBC_2.35 epoll_pwait2 F
|
||||
GLIBC_2.35 posix_spawn_file_actions_addtcsetpgrp_np F
|
||||
GLIBC_2.36 pidfd_getfd F
|
||||
GLIBC_2.36 pidfd_open F
|
||||
GLIBC_2.36 pidfd_send_signal F
|
||||
|
@ -2700,3 +2700,4 @@ GLIBC_2.35 epoll_pwait2 F
|
||||
GLIBC_2.35 posix_spawn_file_actions_addtcsetpgrp_np F
|
||||
GLIBC_2.36 pidfd_getfd F
|
||||
GLIBC_2.36 pidfd_open F
|
||||
GLIBC_2.36 pidfd_send_signal F
|
||||
|
@ -2695,6 +2695,7 @@ GLIBC_2.35 epoll_pwait2 F
|
||||
GLIBC_2.35 posix_spawn_file_actions_addtcsetpgrp_np F
|
||||
GLIBC_2.36 pidfd_getfd F
|
||||
GLIBC_2.36 pidfd_open F
|
||||
GLIBC_2.36 pidfd_send_signal F
|
||||
GLIBC_2.4 __confstr_chk F
|
||||
GLIBC_2.4 __fgets_chk F
|
||||
GLIBC_2.4 __fgets_unlocked_chk F
|
||||
|
@ -2693,6 +2693,7 @@ GLIBC_2.35 epoll_pwait2 F
|
||||
GLIBC_2.35 posix_spawn_file_actions_addtcsetpgrp_np F
|
||||
GLIBC_2.36 pidfd_getfd F
|
||||
GLIBC_2.36 pidfd_open F
|
||||
GLIBC_2.36 pidfd_send_signal F
|
||||
GLIBC_2.4 __confstr_chk F
|
||||
GLIBC_2.4 __fgets_chk F
|
||||
GLIBC_2.4 __fgets_unlocked_chk F
|
||||
|
@ -2701,6 +2701,7 @@ GLIBC_2.35 epoll_pwait2 F
|
||||
GLIBC_2.35 posix_spawn_file_actions_addtcsetpgrp_np F
|
||||
GLIBC_2.36 pidfd_getfd F
|
||||
GLIBC_2.36 pidfd_open F
|
||||
GLIBC_2.36 pidfd_send_signal F
|
||||
GLIBC_2.4 __confstr_chk F
|
||||
GLIBC_2.4 __fgets_chk F
|
||||
GLIBC_2.4 __fgets_unlocked_chk F
|
||||
|
@ -2604,6 +2604,7 @@ GLIBC_2.35 epoll_pwait2 F
|
||||
GLIBC_2.35 posix_spawn_file_actions_addtcsetpgrp_np F
|
||||
GLIBC_2.36 pidfd_getfd F
|
||||
GLIBC_2.36 pidfd_open F
|
||||
GLIBC_2.36 pidfd_send_signal F
|
||||
GLIBC_2.4 __confstr_chk F
|
||||
GLIBC_2.4 __fgets_chk F
|
||||
GLIBC_2.4 __fgets_unlocked_chk F
|
||||
|
@ -2742,3 +2742,4 @@ GLIBC_2.35 epoll_pwait2 F
|
||||
GLIBC_2.35 posix_spawn_file_actions_addtcsetpgrp_np F
|
||||
GLIBC_2.36 pidfd_getfd F
|
||||
GLIBC_2.36 pidfd_open F
|
||||
GLIBC_2.36 pidfd_send_signal F
|
||||
|
@ -2125,3 +2125,4 @@ GLIBC_2.35 writev F
|
||||
GLIBC_2.35 wscanf F
|
||||
GLIBC_2.36 pidfd_getfd F
|
||||
GLIBC_2.36 pidfd_open F
|
||||
GLIBC_2.36 pidfd_send_signal F
|
||||
|
@ -2757,6 +2757,7 @@ GLIBC_2.35 epoll_pwait2 F
|
||||
GLIBC_2.35 posix_spawn_file_actions_addtcsetpgrp_np F
|
||||
GLIBC_2.36 pidfd_getfd F
|
||||
GLIBC_2.36 pidfd_open F
|
||||
GLIBC_2.36 pidfd_send_signal F
|
||||
GLIBC_2.4 _IO_fprintf F
|
||||
GLIBC_2.4 _IO_printf F
|
||||
GLIBC_2.4 _IO_sprintf F
|
||||
|
@ -2790,6 +2790,7 @@ GLIBC_2.35 epoll_pwait2 F
|
||||
GLIBC_2.35 posix_spawn_file_actions_addtcsetpgrp_np F
|
||||
GLIBC_2.36 pidfd_getfd F
|
||||
GLIBC_2.36 pidfd_open F
|
||||
GLIBC_2.36 pidfd_send_signal F
|
||||
GLIBC_2.4 _IO_fprintf F
|
||||
GLIBC_2.4 _IO_printf F
|
||||
GLIBC_2.4 _IO_sprintf F
|
||||
|
@ -2512,6 +2512,7 @@ GLIBC_2.35 epoll_pwait2 F
|
||||
GLIBC_2.35 posix_spawn_file_actions_addtcsetpgrp_np F
|
||||
GLIBC_2.36 pidfd_getfd F
|
||||
GLIBC_2.36 pidfd_open F
|
||||
GLIBC_2.36 pidfd_send_signal F
|
||||
GLIBC_2.4 _IO_fprintf F
|
||||
GLIBC_2.4 _IO_printf F
|
||||
GLIBC_2.4 _IO_sprintf F
|
||||
|
@ -2814,3 +2814,4 @@ GLIBC_2.35 epoll_pwait2 F
|
||||
GLIBC_2.35 posix_spawn_file_actions_addtcsetpgrp_np F
|
||||
GLIBC_2.36 pidfd_getfd F
|
||||
GLIBC_2.36 pidfd_open F
|
||||
GLIBC_2.36 pidfd_send_signal F
|
||||
|
@ -2381,3 +2381,4 @@ GLIBC_2.35 epoll_pwait2 F
|
||||
GLIBC_2.35 posix_spawn_file_actions_addtcsetpgrp_np F
|
||||
GLIBC_2.36 pidfd_getfd F
|
||||
GLIBC_2.36 pidfd_open F
|
||||
GLIBC_2.36 pidfd_send_signal F
|
||||
|
@ -2581,3 +2581,4 @@ GLIBC_2.35 epoll_pwait2 F
|
||||
GLIBC_2.35 posix_spawn_file_actions_addtcsetpgrp_np F
|
||||
GLIBC_2.36 pidfd_getfd F
|
||||
GLIBC_2.36 pidfd_open F
|
||||
GLIBC_2.36 pidfd_send_signal F
|
||||
|
@ -2755,6 +2755,7 @@ GLIBC_2.35 epoll_pwait2 F
|
||||
GLIBC_2.35 posix_spawn_file_actions_addtcsetpgrp_np F
|
||||
GLIBC_2.36 pidfd_getfd F
|
||||
GLIBC_2.36 pidfd_open F
|
||||
GLIBC_2.36 pidfd_send_signal F
|
||||
GLIBC_2.4 _IO_fprintf F
|
||||
GLIBC_2.4 _IO_printf F
|
||||
GLIBC_2.4 _IO_sprintf F
|
||||
|
@ -2549,6 +2549,7 @@ GLIBC_2.35 epoll_pwait2 F
|
||||
GLIBC_2.35 posix_spawn_file_actions_addtcsetpgrp_np F
|
||||
GLIBC_2.36 pidfd_getfd F
|
||||
GLIBC_2.36 pidfd_open F
|
||||
GLIBC_2.36 pidfd_send_signal F
|
||||
GLIBC_2.4 _IO_fprintf F
|
||||
GLIBC_2.4 _IO_printf F
|
||||
GLIBC_2.4 _IO_sprintf F
|
||||
|
@ -2610,6 +2610,7 @@ GLIBC_2.35 epoll_pwait2 F
|
||||
GLIBC_2.35 posix_spawn_file_actions_addtcsetpgrp_np F
|
||||
GLIBC_2.36 pidfd_getfd F
|
||||
GLIBC_2.36 pidfd_open F
|
||||
GLIBC_2.36 pidfd_send_signal F
|
||||
GLIBC_2.4 __confstr_chk F
|
||||
GLIBC_2.4 __fgets_chk F
|
||||
GLIBC_2.4 __fgets_unlocked_chk F
|
||||
|
@ -2607,6 +2607,7 @@ GLIBC_2.35 epoll_pwait2 F
|
||||
GLIBC_2.35 posix_spawn_file_actions_addtcsetpgrp_np F
|
||||
GLIBC_2.36 pidfd_getfd F
|
||||
GLIBC_2.36 pidfd_open F
|
||||
GLIBC_2.36 pidfd_send_signal F
|
||||
GLIBC_2.4 __confstr_chk F
|
||||
GLIBC_2.4 __fgets_chk F
|
||||
GLIBC_2.4 __fgets_unlocked_chk F
|
||||
|
@ -2750,6 +2750,7 @@ GLIBC_2.35 epoll_pwait2 F
|
||||
GLIBC_2.35 posix_spawn_file_actions_addtcsetpgrp_np F
|
||||
GLIBC_2.36 pidfd_getfd F
|
||||
GLIBC_2.36 pidfd_open F
|
||||
GLIBC_2.36 pidfd_send_signal F
|
||||
GLIBC_2.4 _IO_fprintf F
|
||||
GLIBC_2.4 _IO_printf F
|
||||
GLIBC_2.4 _IO_sprintf F
|
||||
|
@ -2576,6 +2576,7 @@ GLIBC_2.35 epoll_pwait2 F
|
||||
GLIBC_2.35 posix_spawn_file_actions_addtcsetpgrp_np F
|
||||
GLIBC_2.36 pidfd_getfd F
|
||||
GLIBC_2.36 pidfd_open F
|
||||
GLIBC_2.36 pidfd_send_signal F
|
||||
GLIBC_2.4 __confstr_chk F
|
||||
GLIBC_2.4 __fgets_chk F
|
||||
GLIBC_2.4 __fgets_unlocked_chk F
|
||||
|
@ -38,4 +38,12 @@ extern int pidfd_open (__pid_t __pid, unsigned int __flags) __THROW;
|
||||
extern int pidfd_getfd (int __pidfd, int __targetfd,
|
||||
unsigned int __flags) __THROW;
|
||||
|
||||
/* Sends the signal SIG to the target process referred by the PIDFD. If
|
||||
INFO points to a siginfo_t buffer, it will be populated.
|
||||
|
||||
The FLAGS argument is reserved for future use, it must be specified
|
||||
as 0. */
|
||||
extern int pidfd_send_signal (int __pidfd, int __sig, siginfo_t *__info,
|
||||
unsigned int __flags) __THROW;
|
||||
|
||||
#endif /* _PIDFD_H */
|
||||
|
@ -42,6 +42,7 @@ pipe2 - pipe2 i:fi __pipe2 pipe2
|
||||
pidfd_open EXTRA pidfd_open i:iU pidfd_open
|
||||
pidfd_getfd EXTRA pidfd_getfd i:iiU pidfd_getfd
|
||||
pivot_root EXTRA pivot_root i:ss pivot_root
|
||||
pidfd_send_signal EXTRA pidfd_send_signal i:iiPU pidfd_send_signal
|
||||
query_module EXTRA query_module i:sipip __compat_query_module query_module@GLIBC_2.0:GLIBC_2.23
|
||||
quotactl EXTRA quotactl i:isip quotactl
|
||||
remap_file_pages - remap_file_pages i:pUiUi __remap_file_pages remap_file_pages
|
||||
|
@ -2527,6 +2527,7 @@ GLIBC_2.35 epoll_pwait2 F
|
||||
GLIBC_2.35 posix_spawn_file_actions_addtcsetpgrp_np F
|
||||
GLIBC_2.36 pidfd_getfd F
|
||||
GLIBC_2.36 pidfd_open F
|
||||
GLIBC_2.36 pidfd_send_signal F
|
||||
GLIBC_2.4 __confstr_chk F
|
||||
GLIBC_2.4 __fgets_chk F
|
||||
GLIBC_2.4 __fgets_unlocked_chk F
|
||||
|
@ -2633,3 +2633,4 @@ GLIBC_2.35 epoll_pwait2 F
|
||||
GLIBC_2.35 posix_spawn_file_actions_addtcsetpgrp_np F
|
||||
GLIBC_2.36 pidfd_getfd F
|
||||
GLIBC_2.36 pidfd_open F
|
||||
GLIBC_2.36 pidfd_send_signal F
|
||||
|
Loading…
Reference in New Issue
Block a user