public inbox for linux-man@vger.kernel.org
 help / color / mirror / Atom feed
* sigprocmask.2: s/kernel_sigset_t/sigset_t/
@ 2021-02-12 15:28 Alejandro Colomar (man-pages)
  2021-02-13 16:05 ` Michael Kerrisk (man-pages)
  0 siblings, 1 reply; 5+ messages in thread
From: Alejandro Colomar (man-pages) @ 2021-02-12 15:28 UTC (permalink / raw)
  To: Michael Kerrisk (man-pages); +Cc: linux-man

Hi Michael,

AFAICT, the syscalls [rt_]sigprocmask use '[old_]sigset_t' (there's the
'__user' modifier too), so 'kernel_' should be removed from the types,
shouldn't it?

Thanks,

Alex

[[
SYNOPSIS
       #include <signal.h>

       /* Prototype for the glibc wrapper function */
       int sigprocmask(int how, const sigset_t *restrict set,
                       sigset_t *restrict oldset);

       /* Prototype for the underlying system call */
       int rt_sigprocmask(int how, const kernel_sigset_t *set,
                       kernel_sigset_t *oldset, size_t sigsetsize);

       /* Prototype for the legacy system call (deprecated) */
       int sigprocmask(int how, const old_kernel_sigset_t *set,
                       old_kernel_sigset_t *oldset);

   Feature  Test  Macro   Requirements   for   glibc   (see   fea‐
   ture_test_macros(7)):

       sigprocmask():
           _POSIX_C_SOURCE

]]

.../linux$ grep_syscall rt_sigprocmask
kernel/signal.c:3050:
SYSCALL_DEFINE4(rt_sigprocmask, int, how, sigset_t __user *, nset,
		sigset_t __user *, oset, size_t, sigsetsize)
kernel/signal.c:3081:
COMPAT_SYSCALL_DEFINE4(rt_sigprocmask, int, how, compat_sigset_t __user
*, nset,
		compat_sigset_t __user *, oset, compat_size_t, sigsetsize)
include/linux/compat.h:698:
asmlinkage long compat_sys_rt_sigprocmask(int how, compat_sigset_t
__user *set,
					  compat_sigset_t __user *oset,
					  compat_size_t sigsetsize);
include/linux/syscalls.h:696:
asmlinkage long sys_rt_sigprocmask(int how, sigset_t __user *set,
				sigset_t __user *oset, size_t sigsetsize);
.../linux$ grep_syscall sigprocmask
kernel/compat.c:40:
COMPAT_SYSCALL_DEFINE3(sigprocmask, int, how,
		       compat_old_sigset_t __user *, nset,
		       compat_old_sigset_t __user *, oset)
kernel/signal.c:4236:
SYSCALL_DEFINE3(sigprocmask, int, how, old_sigset_t __user *, nset,
		old_sigset_t __user *, oset)
include/linux/compat.h:882:
asmlinkage long compat_sys_sigprocmask(int how, compat_old_sigset_t
__user *nset,
				       compat_old_sigset_t __user *oset);
include/linux/syscalls.h:1136:
asmlinkage long sys_sigprocmask(int how, old_sigset_t __user *set,
				old_sigset_t __user *oset);
.../linux$



-- 
Alejandro Colomar
Linux man-pages comaintainer; https://www.kernel.org/doc/man-pages/
http://www.alejandro-colomar.es/

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: sigprocmask.2: s/kernel_sigset_t/sigset_t/
  2021-02-12 15:28 sigprocmask.2: s/kernel_sigset_t/sigset_t/ Alejandro Colomar (man-pages)
@ 2021-02-13 16:05 ` Michael Kerrisk (man-pages)
  2021-02-13 16:41   ` Alejandro Colomar (man-pages)
  2021-02-13 23:30   ` Alejandro Colomar (man-pages)
  0 siblings, 2 replies; 5+ messages in thread
From: Michael Kerrisk (man-pages) @ 2021-02-13 16:05 UTC (permalink / raw)
  To: Alejandro Colomar (man-pages); +Cc: mtk.manpages, linux-man

Hi Alex,

On 2/12/21 4:28 PM, Alejandro Colomar (man-pages) wrote:
> Hi Michael,
> 
> AFAICT, the syscalls [rt_]sigprocmask use '[old_]sigset_t' (there's the
> '__user' modifier too), so 'kernel_' should be removed from the types,
> shouldn't it?

Looks like you're right. Will you send a patch?

Thanks,

Michael

> [[
> SYNOPSIS
>        #include <signal.h>
> 
>        /* Prototype for the glibc wrapper function */
>        int sigprocmask(int how, const sigset_t *restrict set,
>                        sigset_t *restrict oldset);
> 
>        /* Prototype for the underlying system call */
>        int rt_sigprocmask(int how, const kernel_sigset_t *set,
>                        kernel_sigset_t *oldset, size_t sigsetsize);
> 
>        /* Prototype for the legacy system call (deprecated) */
>        int sigprocmask(int how, const old_kernel_sigset_t *set,
>                        old_kernel_sigset_t *oldset);
> 
>    Feature  Test  Macro   Requirements   for   glibc   (see   fea‐
>    ture_test_macros(7)):
> 
>        sigprocmask():
>            _POSIX_C_SOURCE
> 
> ]]
> 
> .../linux$ grep_syscall rt_sigprocmask
> kernel/signal.c:3050:
> SYSCALL_DEFINE4(rt_sigprocmask, int, how, sigset_t __user *, nset,
> 		sigset_t __user *, oset, size_t, sigsetsize)
> kernel/signal.c:3081:
> COMPAT_SYSCALL_DEFINE4(rt_sigprocmask, int, how, compat_sigset_t __user
> *, nset,
> 		compat_sigset_t __user *, oset, compat_size_t, sigsetsize)
> include/linux/compat.h:698:
> asmlinkage long compat_sys_rt_sigprocmask(int how, compat_sigset_t
> __user *set,
> 					  compat_sigset_t __user *oset,
> 					  compat_size_t sigsetsize);
> include/linux/syscalls.h:696:
> asmlinkage long sys_rt_sigprocmask(int how, sigset_t __user *set,
> 				sigset_t __user *oset, size_t sigsetsize);
> .../linux$ grep_syscall sigprocmask
> kernel/compat.c:40:
> COMPAT_SYSCALL_DEFINE3(sigprocmask, int, how,
> 		       compat_old_sigset_t __user *, nset,
> 		       compat_old_sigset_t __user *, oset)
> kernel/signal.c:4236:
> SYSCALL_DEFINE3(sigprocmask, int, how, old_sigset_t __user *, nset,
> 		old_sigset_t __user *, oset)
> include/linux/compat.h:882:
> asmlinkage long compat_sys_sigprocmask(int how, compat_old_sigset_t
> __user *nset,
> 				       compat_old_sigset_t __user *oset);
> include/linux/syscalls.h:1136:
> asmlinkage long sys_sigprocmask(int how, old_sigset_t __user *set,
> 				old_sigset_t __user *oset);
> .../linux$
> 
> 
> 


-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: sigprocmask.2: s/kernel_sigset_t/sigset_t/
  2021-02-13 16:05 ` Michael Kerrisk (man-pages)
@ 2021-02-13 16:41   ` Alejandro Colomar (man-pages)
  2021-02-13 23:30   ` Alejandro Colomar (man-pages)
  1 sibling, 0 replies; 5+ messages in thread
From: Alejandro Colomar (man-pages) @ 2021-02-13 16:41 UTC (permalink / raw)
  To: Michael Kerrisk (man-pages); +Cc: linux-man

On 2/13/21 5:05 PM, Michael Kerrisk (man-pages) wrote:
> Hi Alex,
> 
> On 2/12/21 4:28 PM, Alejandro Colomar (man-pages) wrote:
>> Hi Michael,
>>
>> AFAICT, the syscalls [rt_]sigprocmask use '[old_]sigset_t' (there's the
>> '__user' modifier too), so 'kernel_' should be removed from the types,
>> shouldn't it?
> 
> Looks like you're right. Will you send a patch?

Yup!

Cheers,

Alex


-- 
Alejandro Colomar
Linux man-pages comaintainer; https://www.kernel.org/doc/man-pages/
http://www.alejandro-colomar.es/

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: sigprocmask.2: s/kernel_sigset_t/sigset_t/
  2021-02-13 16:05 ` Michael Kerrisk (man-pages)
  2021-02-13 16:41   ` Alejandro Colomar (man-pages)
@ 2021-02-13 23:30   ` Alejandro Colomar (man-pages)
  2021-02-14  8:42     ` Michael Kerrisk (man-pages)
  1 sibling, 1 reply; 5+ messages in thread
From: Alejandro Colomar (man-pages) @ 2021-02-13 23:30 UTC (permalink / raw)
  To: Michael Kerrisk (man-pages); +Cc: linux-man

On 2/13/21 5:05 PM, Michael Kerrisk (man-pages) wrote:
> Hi Alex,
> 
> On 2/12/21 4:28 PM, Alejandro Colomar (man-pages) wrote:
>> Hi Michael,
>>
>> AFAICT, the syscalls [rt_]sigprocmask use '[old_]sigset_t' (there's the
>> '__user' modifier too), so 'kernel_' should be removed from the types,
>> shouldn't it?
> 
> Looks like you're right. Will you send a patch?
> 
> Thanks,
> 
> Michael

Hi Michael,

I was wrong!

Thanks,

Alex

[[
   C library/kernel differences
       The kernel's definition of sigset_t differs  in  size  from
       that  used by the C library.  In this manual page, the for‐
       mer is referred to as kernel_sigset_t (it  is  nevertheless
       named sigset_t in the kernel sources).

       The  glibc  wrapper function for sigprocmask() silently ig‐
       nores attempts to block the two real-time signals that  are
       used  internally by the NPTL threading implementation.  See
       nptl(7) for details.

       The original Linux system  call  was  named  sigprocmask().
       However,  with  the  addition of real-time signals in Linux
       2.2,  the  fixed-size,  32-bit  sigset_t  (referred  to  as
       old_kernel_sigset_t  in this manual page) type supported by
       that system call was no longer  fit  for  purpose.   Conse‐
       quently,  a new system call, rt_sigprocmask(), was added to
       support an enlarged sigset_t  type  (referred  to  as  ker‐
       nel_sigset_t  in  this  manual  page).  The new system call
       takes a fourth argument, size_t sigsetsize, which specifies
       the  size  in  bytes  of the signal sets in set and oldset.
       This argument is currently required to have a fixed  archi‐
       tecture specific value (equal to sizeof(kernel_sigset_t)).

       The  glibc  sigprocmask()  wrapper function hides these de‐
       tails from us, transparently calling rt_sigprocmask()  when
       the kernel provides it.
]]



-- 
Alejandro Colomar
Linux man-pages comaintainer; https://www.kernel.org/doc/man-pages/
http://www.alejandro-colomar.es/

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: sigprocmask.2: s/kernel_sigset_t/sigset_t/
  2021-02-13 23:30   ` Alejandro Colomar (man-pages)
@ 2021-02-14  8:42     ` Michael Kerrisk (man-pages)
  0 siblings, 0 replies; 5+ messages in thread
From: Michael Kerrisk (man-pages) @ 2021-02-14  8:42 UTC (permalink / raw)
  To: Alejandro Colomar (man-pages); +Cc: mtk.manpages, linux-man

On 2/14/21 12:30 AM, Alejandro Colomar (man-pages) wrote:
> On 2/13/21 5:05 PM, Michael Kerrisk (man-pages) wrote:
>> Hi Alex,
>>
>> On 2/12/21 4:28 PM, Alejandro Colomar (man-pages) wrote:
>>> Hi Michael,
>>>
>>> AFAICT, the syscalls [rt_]sigprocmask use '[old_]sigset_t' (there's the
>>> '__user' modifier too), so 'kernel_' should be removed from the types,
>>> shouldn't it?
>>
>> Looks like you're right. Will you send a patch?
>>
>> Thanks,
>>
>> Michael
> 
> Hi Michael,
> 
> I was wrong!

D'oh! I should read the manual page!

Cheers,

Michael

> [[
>    C library/kernel differences
>        The kernel's definition of sigset_t differs  in  size  from
>        that  used by the C library.  In this manual page, the for‐
>        mer is referred to as kernel_sigset_t (it  is  nevertheless
>        named sigset_t in the kernel sources).
> 
>        The  glibc  wrapper function for sigprocmask() silently ig‐
>        nores attempts to block the two real-time signals that  are
>        used  internally by the NPTL threading implementation.  See
>        nptl(7) for details.
> 
>        The original Linux system  call  was  named  sigprocmask().
>        However,  with  the  addition of real-time signals in Linux
>        2.2,  the  fixed-size,  32-bit  sigset_t  (referred  to  as
>        old_kernel_sigset_t  in this manual page) type supported by
>        that system call was no longer  fit  for  purpose.   Conse‐
>        quently,  a new system call, rt_sigprocmask(), was added to
>        support an enlarged sigset_t  type  (referred  to  as  ker‐
>        nel_sigset_t  in  this  manual  page).  The new system call
>        takes a fourth argument, size_t sigsetsize, which specifies
>        the  size  in  bytes  of the signal sets in set and oldset.
>        This argument is currently required to have a fixed  archi‐
>        tecture specific value (equal to sizeof(kernel_sigset_t)).
> 
>        The  glibc  sigprocmask()  wrapper function hides these de‐
>        tails from us, transparently calling rt_sigprocmask()  when
>        the kernel provides it.
> ]]
> 
> 
> 


-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-02-14  8:43 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-02-12 15:28 sigprocmask.2: s/kernel_sigset_t/sigset_t/ Alejandro Colomar (man-pages)
2021-02-13 16:05 ` Michael Kerrisk (man-pages)
2021-02-13 16:41   ` Alejandro Colomar (man-pages)
2021-02-13 23:30   ` Alejandro Colomar (man-pages)
2021-02-14  8:42     ` Michael Kerrisk (man-pages)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox