# \[PATCH 45/45\] include/uapi/asm-generic/ucontext.h: include signal.h and sigcontext.h

- 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/4432073/t

## \[PATCH 45/45\] include/uapi/asm-generic/ucontext.h: include signal.h and sigcontext.h

- From: Mikko Rapeli \<hidden\>
- Date: 2015-02-16 23:08:29 
- Message: https://ratatoskr.run/linux-api/2015/02/4432073.md

```text
Fixes userspace compiler errors:

error: unknown type name ‘stack_t’
error: field ‘uc_mcontext’ has incomplete type
struct sigcontext uc_mcontext;
error: unknown type name ‘sigset_t’

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

diff --git a/include/uapi/asm-generic/ucontext.h b/include/uapi/asm-generic/ucontext.h
index ad77343..31ece341 100644
--- a/include/uapi/asm-generic/ucontext.h
+++ b/include/uapi/asm-generic/ucontext.h
@@ -1,6 +1,9 @@
 #ifndef __ASM_GENERIC_UCONTEXT_H
 #define __ASM_GENERIC_UCONTEXT_H
 
+#include <asm-generic/signal.h>
+#include <asm/sigcontext.h>
+
 struct ucontext {
 	unsigned long	  uc_flags;
 	struct ucontext  *uc_link;
-- 
2.1.4
```

## Re: \[PATCH 45/45\] include/uapi/asm-generic/ucontext.h: include signal.h and sigcontext.h

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

```text
On Tuesday 17 February 2015 00:05:48 Mikko Rapeli wrote:
>  #ifndef __ASM_GENERIC_UCONTEXT_H
>  #define __ASM_GENERIC_UCONTEXT_H
>  
> +#include <asm-generic/signal.h>
> +#include <asm/sigcontext.h>
> +
>  struct ucontext {
> 

Including another asm-generic header here is a bad idea: it breaks
if an architecture overrides asm/signal.h with its own version
but wants to use the asm-generic/ucontext.h file.

It would be best to just use linux/signal.h here, which includes
the correct architecture specific files.

	Arnd
```

## Re: \[PATCH 45/45\] include/uapi/asm-generic/ucontext.h: include signal.h and sigcontext.h

- From: Mikko Rapeli \<hidden\>
- Date: 2015-03-11 01:59:37 
- Message: https://ratatoskr.run/linux-api/2015/03/4448054.md

```text
On Tue, Feb 17, 2015 at 10:10:42AM +0100, Arnd Bergmann wrote:
> On Tuesday 17 February 2015 00:05:48 Mikko Rapeli wrote:
> >  #ifndef __ASM_GENERIC_UCONTEXT_H
> >  #define __ASM_GENERIC_UCONTEXT_H
> >  
> > +#include <asm-generic/signal.h>
> > +#include <asm/sigcontext.h>
> > +
> >  struct ucontext {
> > 
> 
> Including another asm-generic header here is a bad idea: it breaks
> if an architecture overrides asm/signal.h with its own version
> but wants to use the asm-generic/ucontext.h file.
> 
> It would be best to just use linux/signal.h here, which includes
> the correct architecture specific files.

Thanks, I will use asm/signal.h instead.

-Mikko
```
