# \[PATCH 34/45\] include/uapi/asm-generic/signal.h: hide sigset\_t definition in userspace

- Subsystems: GENERIC INCLUDE/ASM HEADER FILES, THE REST
- Maintainers: Arnd Bergmann, Linus Torvalds
- List: linux-api
- 3 messages, 2 authors
- Page: https://ratatoskr.run/linux-api/2015/02/4432062/t

## \[PATCH 34/45\] include/uapi/asm-generic/signal.h: hide sigset\_t definition in userspace

- From: Mikko Rapeli \<hidden\>
- Date: 2015-02-16 23:07:55 
- Message: https://ratatoskr.run/linux-api/2015/02/4432062.md

```text
It is already defined by libc headers in
/usr/include/i386-linux-gnu/sys/select.h

Signed-off-by: Mikko Rapeli <redacted>
---
 include/uapi/asm-generic/signal.h | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/include/uapi/asm-generic/signal.h b/include/uapi/asm-generic/signal.h
index 8a341a2..af4d83a 100644
--- a/include/uapi/asm-generic/signal.h
+++ b/include/uapi/asm-generic/signal.h
@@ -88,9 +88,12 @@
 #define SIGSTKSZ	8192
 
 #ifndef __ASSEMBLY__
+#ifdef __KERNEL__
+/* already defined in userspace via stdlib.h */
 typedef struct {
 	unsigned long sig[_NSIG_WORDS];
 } sigset_t;
+#endif /* __KERNEL__ */
 
 /* not actually used, but required for linux/syscalls.h */
 typedef unsigned long old_sigset_t;
-- 
2.1.4
```

## Re: \[PATCH 34/45\] include/uapi/asm-generic/signal.h: hide sigset\_t definition in userspace

- From: Arnd Bergmann \<arnd@arndb.de\>
- Date: 2015-02-17 09:16:14 
- Message: https://ratatoskr.run/linux-api/2015/02/4432359.md

```text
On Tuesday 17 February 2015 00:05:37 Mikko Rapeli wrote:
> +#ifdef __KERNEL__
> +/* already defined in userspace via stdlib.h */
>  typedef struct {
>         unsigned long sig[_NSIG_WORDS];
>  } sigset_t;
> +#endif /* __KERNEL__ */

I'm not sure here: Is this structure always identical to the one
we see in user space?

If not, we might want to rename the typedef to __kernel_sigset_t
instead and use that inside of the uapi headers.

	Arnd
```

## Re: \[PATCH 34/45\] include/uapi/asm-generic/signal.h: hide sigset\_t definition in userspace

- From: Mikko Rapeli \<hidden\>
- Date: 2015-03-11 00:05:22 
- Message: https://ratatoskr.run/linux-api/2015/03/4447991.md

```text
On Tue, Feb 17, 2015 at 10:16:09AM +0100, Arnd Bergmann wrote:
> On Tuesday 17 February 2015 00:05:37 Mikko Rapeli wrote:
> > +#ifdef __KERNEL__
> > +/* already defined in userspace via stdlib.h */
> >  typedef struct {
> >         unsigned long sig[_NSIG_WORDS];
> >  } sigset_t;
> > +#endif /* __KERNEL__ */
> 
> I'm not sure here: Is this structure always identical to the one
> we see in user space?
> 
> If not, we might want to rename the typedef to __kernel_sigset_t
> instead and use that inside of the uapi headers.

I was copying this ifdef from the struct sigaction part in the same file:

#ifndef __KERNEL__
struct sigaction {
        __sighandler_t sa_handler;
        unsigned long sa_flags;
#ifdef SA_RESTORER
        __sigrestore_t sa_restorer;
#endif
        sigset_t sa_mask;               /* mask last for extensibility */
};
#endif

I assumed it had the same problems at some point.

-Mikko
```
