use of struct sigcontext does not conform to POSIX namespace
requirements. */
-#ifndef _SYS_UCONTEXT_H
-#define _SYS_UCONTEXT_H 1
+#ifndef _BITS_UCONTEXT_H
+#define _BITS_UCONTEXT_H 1
#include <features.h>
#undef __ctx
-#endif /* sys/ucontext.h */
+#endif /* bits/ucontext.h */
--- /dev/null
+#include <stdlib/sys/ucontext.h>
# tgmath.h -> complex.h, math.h
# threads.h -> time.h
"inttypes.h": [ "stdint.h" ],
- "signal.h": [ "sys/ucontext.h" ],
- "stdlib.h": [ "alloca.h", "sys/types.h" ],
"tgmath.h": [ "complex.h", "math.h" ],
"threads.h": [ "time.h" ],
+ # necessary for backward compatibility with old GNU extensions
+ "stdlib.h": [ "alloca.h", "sys/types.h" ],
# POSIX top-level headers
# mandated: pthread.h -> sched.h, time.h
+ "pthread.h": [ "sched.h", "time.h" ],
# allowed: ftw.h -> sys/stat.h
# mqueue.h -> fcntl.h
# sched.h -> time.h
# spawn.h -> sched.h
"ftw.h": [ "sys/stat.h" ],
- "langinfo.h": [ "nl_types.h" ],
"mqueue.h": [ "fcntl.h" ],
- "pthread.h": [ "sched.h", "time.h" ],
- "regex.h": [ "limits.h", "sys/types.h" ],
"sched.h": [ "time.h" ],
"spawn.h": [ "sched.h" ],
+ # not yet analyzed
+ "langinfo.h": [ "nl_types.h" ],
+ "regex.h": [ "limits.h", "sys/types.h" ],
"termios.h": [ "sys/ttydefaults.h" ],
"utmpx.h": [ "paths.h" ],
"shadow.h": [ "paths.h" ],
"stdio_ext.h": [ "stdio.h" ],
"thread_db.h": [ "pthread.h", "stdint.h", "sys/procfs.h" ],
- "ucontext.h": [ "sys/ucontext.h" ],
"utmp.h": [ "paths.h" ],
"values.h": [ "float.h", "limits.h" ],
"sys/mount.h": [ "sys/ioctl.h" ],
"sys/mtio.h": [ "sys/ioctl.h" ],
"sys/param.h": [ "endian.h", "limits.h", "sys/types.h" ],
- "sys/procfs.h": [ "sys/ucontext.h", "sys/user.h" ],
- "sys/ptrace.h": [ "sys/ucontext.h" ],
+ "sys/procfs.h": [ "sys/user.h" ],
"sys/raw.h": [ "sys/ioctl.h" ],
"sys/timerfd.h": [ "time.h" ],
"sys/ttychars.h": [ "sys/ttydefaults.h" ],
- "sys/ucontext.h": [ "sys/procfs.h" ],
"sys/vfs.h": [ "sys/statfs.h" ],
# Nonstandardized headers that do nothing but include some other
"sys/socketvar.h": [ "sys/socket.h" ],
"sys/syslog.h": [ "syslog.h" ],
"sys/termios.h": [ "termios.h" ],
+ "sys/ucontext.h": [ "ucontext.h" ],
"sys/unistd.h": [ "unistd.h" ],
"syscall.h": [ "sys/syscall.h" ],
"termio.h": [ "sys/ioctl.h", "termios.h" ],
"features.h": [ "gnu/stubs.h", "stdc-predef.h",
"sys/cdefs.h" ],
- "bits/procfs.h": [ "signal.h", "sys/ucontext.h" ],
-
"bits/types/__va_list.h": [ "stdarg.h" ],
"bits/types/ptrdiff_t.h": [ "stddef.h" ],
"bits/types/size_t.h": [ "stddef.h" ],
"bits/ioctls.h": [ "asm/ioctls.h", "linux/sockios.h" ],
"bits/local_lim.h": [ "linux/limits.h" ],
"bits/param.h": [ "linux/limits.h", "linux/param.h" ],
- "bits/procfs.h": [ "asm/elf.h", "asm/ptrace.h" ],
- "bits/procfs-prregset.h": [ "sys/ucontext.h" ],
+ "bits/procfs.h": [ "asm/elf.h", "asm/ptrace.h",
+ "sys/user.h" ],
"bits/sigcontext.h": [ "asm/sigcontext.h" ],
"bits/socket.h": [ "asm/socket.h" ],
},
"sys/fpregdef.h": [ "sgidefs.h" ],
"sys/regdef.h": [ "sgidefs.h" ],
"sys/tas.h": [ "sgidefs.h" ],
- "sys/ucontext.h": [ "sgidefs.h" ],
"sys/user.h": [ "sgidefs.h" ],
"bits/fcntl.h": [ "sgidefs.h" ],
"bits/setjmp.h": [ "sgidefs.h" ],
"bits/sigcontext.h": [ "sgidefs.h" ],
"bits/stat.h": [ "sgidefs.h" ],
+ "bits/ucontext.h": [ "sgidefs.h" ],
"bits/wordsize.h": [ "sgidefs.h" ],
},
}
# include <bits/types/stack_t.h>
# if defined __USE_XOPEN || defined __USE_XOPEN2K8
/* This will define `ucontext_t' and `mcontext_t'. */
-# include <sys/ucontext.h>
+# include <bits/ucontext.h>
# endif
#endif /* Use POSIX.1-2008 or X/Open Unix. */
monetary.h bits/monetary-ldbl.h \
inttypes.h stdint.h bits/wordsize.h bits/timesize.h \
errno.h sys/errno.h bits/errno.h bits/types/error_t.h \
- ucontext.h sys/ucontext.h bits/indirect-return.h \
+ ucontext.h sys/ucontext.h bits/ucontext.h bits/indirect-return.h \
alloca.h fmtmsg.h \
bits/stdlib-bsearch.h sys/random.h bits/stdint-intn.h \
bits/stdint-uintn.h bits/time64.h bits/NULL.h \
--- /dev/null
+#include <ucontext.h>
#include <bits/indirect-return.h>
/* Get machine dependent definition of data structures. */
-#include <sys/ucontext.h>
+#include <bits/ucontext.h>
__BEGIN_DECLS
/* System V/ARM ABI compliant context switching support. */
-#ifndef _SYS_UCONTEXT_H
-#define _SYS_UCONTEXT_H 1
+#ifndef _BITS_UCONTEXT_H
+#define _BITS_UCONTEXT_H 1
#include <features.h>
#undef __ctx
-#endif /* sys/ucontext.h */
+#endif /* bits/ucontext.h */
/* System V/i386 ABI compliant context switching support. */
-#ifndef _SYS_UCONTEXT_H
-#define _SYS_UCONTEXT_H 1
+#ifndef _BITS_UCONTEXT_H
+#define _BITS_UCONTEXT_H 1
#include <features.h>
#undef __ctx
#undef __ctxt
-#endif /* sys/ucontext.h */
+#endif /* bits/ucontext.h */
/* System V/m68k ABI compliant context switching support. */
-#ifndef _SYS_UCONTEXT_H
-#define _SYS_UCONTEXT_H 1
+#ifndef _BITS_UCONTEXT_H
+#define _BITS_UCONTEXT_H 1
#include <features.h>
#undef __ctx
-#endif /* sys/ucontext.h */
+#endif /* bits/ucontext.h */
/* System V/mips ABI compliant context switching support. */
-#ifndef _SYS_UCONTEXT_H
-#define _SYS_UCONTEXT_H 1
+#ifndef _BITS_UCONTEXT_H
+#define _BITS_UCONTEXT_H 1
#include <features.h>
#undef __ctx
-#endif /* sys/ucontext.h */
+#endif /* bits/ucontext.h */
#ifndef _BITS_PROCFS_H
#define _BITS_PROCFS_H 1
-#ifndef _SYS_PROCFS_H
+#if !defined _SYS_PROCFS_H && !defined _BITS_UCONTEXT_H
# error "Never include <bits/procfs.h> directly; use <sys/procfs.h> instead."
#endif
#include <bits/types.h>
+#include <sys/user.h>
/* Type for a general-purpose register. */
typedef __uint64_t elf_greg_t;
/* System V/AArch64 ABI compliant context switching support. */
-#ifndef _SYS_UCONTEXT_H
-#define _SYS_UCONTEXT_H 1
+#ifndef _BITS_UCONTEXT_H
+#define _BITS_UCONTEXT_H 1
#include <features.h>
#endif
#ifdef __USE_MISC
-# include <sys/procfs.h>
+# include <bits/procfs.h>
typedef elf_greg_t greg_t;
#undef __ctx
-#endif /* sys/ucontext.h */
+#endif /* bits/ucontext.h */
#define _SIGCONTEXTINFO_H
#include <stdint.h>
-#include <sys/ucontext.h>
+#include <signal.h>
static inline uintptr_t
sigcontext_get_pc (const ucontext_t *ctx)
-#include <inttypes.h>
-#include <signal.h>
#include <stddef.h>
-#include <sys/ucontext.h>
-#include <asm/sigcontext.h>
+#include <signal.h>
#include "kernel_rt_sigframe.h"
#endif
/* For gregset_t and fpregset_t. FIXME: sys/procfs.h should not
- expose all of sys/ucontext.h. */
-#include <sys/ucontext.h>
+ expose all of bits/ucontext.h. */
+#include <bits/ucontext.h>
typedef gregset_t __prgregset_t;
typedef fpregset_t __prfpregset_t;
License along with the GNU C Library. If not, see
<https://www.gnu.org/licenses/>. */
-#ifndef _SYS_UCONTEXT_H
-#define _SYS_UCONTEXT_H 1
+#ifndef _BITS_UCONTEXT_H
+#define _BITS_UCONTEXT_H 1
#include <features.h>
#undef __ctx
-#endif /* sys/ucontext.h */
+#endif /* bits/ucontext.h */
#include <stddef.h>
-#include <sys/ucontext.h>
+#include <signal.h>
--
UC_LINK offsetof (ucontext_t, uc_link)
/* System V/ARM ABI compliant context switching support. */
-#ifndef _SYS_UCONTEXT_H
-#define _SYS_UCONTEXT_H 1
+#ifndef _BITS_UCONTEXT_H
+#define _BITS_UCONTEXT_H 1
#include <features.h>
#undef __ctx
-#endif /* sys/ucontext.h */
+#endif /* bits/ucontext.h */
#include <sys/uio.h>
#include <_itoa.h>
-#include <sys/ucontext.h>
+#include <ucontext.h>
/* We will print the register dump in this format:
-#include <inttypes.h>
-#include <signal.h>
#include <stddef.h>
-#include <sys/ucontext.h>
+#include <signal.h>
SIG_BLOCK
SIG_SETMASK
-#include <inttypes.h>
-#include <signal.h>
#include <stddef.h>
-#include <sys/ucontext.h>
+#include <signal.h>
SIG_BLOCK
SIG_SETMASK
License along with the GNU C Library. If not, see
<https://www.gnu.org/licenses/>. */
-#ifndef _SYS_UCONTEXT_H
-#define _SYS_UCONTEXT_H 1
+#ifndef _BITS_UCONTEXT_H
+#define _BITS_UCONTEXT_H 1
#include <features.h>
#undef __ctx
-#endif /* sys/ucontext.h */
+#endif /* bits/ucontext.h */
#include <sys/uio.h>
#include <_itoa.h>
#include <bits/sigcontext.h>
-#include <sys/ucontext.h>
+#include <ucontext.h>
/* abiv1 register dump in this format:
/* Don't rely on this, the interface is currently messed up and may need to
be broken to be fixed. */
-#ifndef _SYS_UCONTEXT_H
-#define _SYS_UCONTEXT_H 1
+#ifndef _BITS_UCONTEXT_H
+#define _BITS_UCONTEXT_H 1
#include <features.h>
#undef __ctx
-#endif /* sys/ucontext.h */
+#endif /* bits/ucontext.h */
#include <stddef.h>
#include <signal.h>
-#include <sys/ucontext.h>
--
#include <stddef.h>
#include <signal.h>
-#include <sys/ucontext.h>
--
-ifeq ($(subdir),misc)
-sysdep_headers += sys/rse.h
+ifeq ($(subdir),signal)
+sysdep_headers += bits/types/__ia64_fpreg.h
endif
ifeq ($(subdir),stdlib)
endif
ifeq ($(subdir),misc)
-sysdep_headers += sys/io.h
+sysdep_headers += sys/io.h sys/rse.h
sysdep_routines += ioperm clone2
gen-as-const-headers += sigaltstack-offsets.sym
endif
# error "Never include <bits/procfs.h> directly; use <sys/procfs.h> instead."
#endif
-/* For struct __ia64_fpreg. FIXME: sys/procfs.h should not expose all
- of sys/ucontext.h. */
-#include <sys/ucontext.h>
-#include <bits/sigcontext.h>
+#include <bits/types/__ia64_fpreg.h>
/* We really need just 72 but let's leave some headroom... */
#define ELF_NGREG 128
#include <bits/types/size_t.h>
#include <bits/types/struct_sigstack.h>
#include <bits/types/stack_t.h>
+#include <bits/types/__ia64_fpreg.h>
#include <bits/sigstack.h>
#include <bits/ss_flags.h>
-struct __ia64_fpreg
- {
- union
- {
- unsigned long bits[2];
- } u;
- } __attribute__ ((__aligned__ (16)));
-
struct sigcontext
{
unsigned long int sc_flags; /* see manifest constants below */
--- /dev/null
+#ifndef ____ia64_fpreg_defined
+#define ____ia64_fpreg_defined
+
+#include <features.h>
+
+#ifdef __USE_MISC
+# define __ctx(fld) fld
+#else
+# define __ctx(fld) __ ## fld
+#endif
+
+struct __ia64_fpreg
+ {
+ union
+ {
+ unsigned long __ctx(bits)[2];
+ } __ctx(u);
+ } __attribute__ ((__aligned__ (16)));
+
+#undef __ctx
+
+#endif /* __ia64_fpreg */
License along with the GNU C Library; if not, see
<https://www.gnu.org/licenses/>. */
-#ifndef _SYS_UCONTEXT_H
-#define _SYS_UCONTEXT_H 1
+#ifndef _BITS_UCONTEXT_H
+#define _BITS_UCONTEXT_H 1
#include <features.h>
#include <bits/types/sigset_t.h>
#include <bits/types/stack_t.h>
-
+#include <bits/types/__ia64_fpreg.h>
#ifdef __USE_MISC
# define __ctx(fld) fld
* "ucontext_t" as all the necessary info is inside the former.
*/
-struct __ia64_fpreg_mcontext
- {
- union
- {
- unsigned long __ctx(bits)[2];
- } __ctx(u);
- } __attribute__ ((__aligned__ (16)));
-
typedef struct
{
unsigned long int __ctx(sc_flags);
unsigned long int __ctx(sc_pr);
unsigned long int __ctx(sc_br)[8];
unsigned long int __ctx(sc_gr)[32];
- struct __ia64_fpreg_mcontext __ctx(sc_fr)[128];
+ struct __ia64_fpreg __ctx(sc_fr)[128];
unsigned long int __ctx(sc_rbs_base);
unsigned long int __ctx(sc_loadrs);
unsigned long int __ctx(sc_ar25);
#define uc_stack _u._mc.__ctx(sc_stack)
#define uc_link _u._uc._link
-#endif /* sys/ucontext.h */
+#endif /* bits/ucontext.h */
#include <stddef.h>
-#include <sys/ucontext.h>
+#include <signal.h>
--
SC_NAT offsetof (mcontext_t, sc_nat)
#define _SYS_PTRACE_H 1
#include <features.h>
-#include <sys/ucontext.h>
-#include <bits/sigcontext.h>
#include <bits/types.h>
+#include <bits/ucontext.h>
__BEGIN_DECLS
/* System V/m68k ABI compliant context switching support. */
-#ifndef _SYS_UCONTEXT_H
-#define _SYS_UCONTEXT_H 1
+#ifndef _BITS_UCONTEXT_H
+#define _BITS_UCONTEXT_H 1
#include <features.h>
#undef __ctx
-#endif /* sys/ucontext.h */
+#endif /* bits/ucontext.h */
#include <stddef.h>
#include <signal.h>
-#include <sys/ucontext.h>
--
License along with the GNU C Library; if not, see
<https://www.gnu.org/licenses/>. */
-#ifndef _SYS_UCONTEXT_H
-#define _SYS_UCONTEXT_H 1
+#ifndef _BITS_UCONTEXT_H
+#define _BITS_UCONTEXT_H 1
#include <features.h>
#undef __ctx
-#endif /* sys/ucontext.h */
+#endif /* bits/ucontext.h */
/* Don't rely on this, the interface is currently messed up and may need to
be broken to be fixed. */
-#ifndef _SYS_UCONTEXT_H
-#define _SYS_UCONTEXT_H 1
+#ifndef _BITS_UCONTEXT_H
+#define _BITS_UCONTEXT_H 1
#include <features.h>
#undef __ctx
-#endif /* sys/ucontext.h */
+#endif /* bits/ucontext.h */
-#include <inttypes.h>
#include <signal.h>
#include <stddef.h>
-#include <sys/ucontext.h>
#include <kernel_rt_sigframe.h>
/* System V/Nios II ABI compliant context switching support. */
-#ifndef _SYS_UCONTEXT_H
-#define _SYS_UCONTEXT_H 1
+#ifndef _BITS_UCONTEXT_H
+#define _BITS_UCONTEXT_H 1
#include <features.h>
#undef __ctx
-#endif /* sys/ucontext.h */
+#endif /* bits/ucontext.h */
-#include <inttypes.h>
#include <signal.h>
#include <stddef.h>
-#include <sys/ucontext.h>
#include "kernel_rt_sigframe.h"
License along with the GNU C Library; if not, see
<https://www.gnu.org/licenses/>. */
-#ifndef _SYS_UCONTEXT_H
-#define _SYS_UCONTEXT_H 1
+#ifndef _BITS_UCONTEXT_H
+#define _BITS_UCONTEXT_H 1
#include <features.h>
#undef __ctx
-#endif /* sys/ucontext.h */
+#endif /* bits/ucontext.h */
#include <stddef.h>
#include <signal.h>
-#include <sys/ucontext.h>
--
#include <stddef.h>
#include <signal.h>
-#include <sys/ucontext.h>
--
# error "Never include <bits/procfs.h> directly; use <sys/procfs.h> instead."
#endif
-/* FIXME: sys/ucontext.h does not define NGREG or NFPREG unless
+/* FIXME: bits/ucontext.h does not define NGREG or NFPREG unless
__USE_MISC is active, and sys/procfs.h should not expose all of
- sys/ucontext.h. */
-#include <sys/ucontext.h>
+ bits/ucontext.h. */
+#include <bits/ucontext.h>
/* ELF register definitions */
#define ELF_NGREG NGREG
/* Don't rely on this, the interface is currently messed up and may need to
be broken to be fixed. */
-#ifndef _SYS_UCONTEXT_H
-#define _SYS_UCONTEXT_H 1
+#ifndef _BITS_UCONTEXT_H
+#define _BITS_UCONTEXT_H 1
#include <features.h>
mcontext_t uc_mcontext;
} ucontext_t;
-#endif /* sys/ucontext.h */
+#endif /* bits/ucontext.h */
#include <sysdep.h>
#include <sys/asm.h>
-#include <sys/ucontext.h>
+#include <ucontext.h>
#include <stdarg.h>
#include <assert.h>
void
-__makecontext (ucontext_t *ucp, void (*func) (void), int argc,
- long int a0, long int a1, long int a2, long int a3, long int a4,
- ...)
+__makecontext (ucontext_t *ucp, void (*func) (void), int argc, ...)
{
extern void __start_context (void) attribute_hidden;
long int i, sp;
ucp->uc_mcontext.__gregs[REG_PC] = (long int) &__start_context;
/* Put args in a0-a7, then put any remaining args on the stack. */
- ucp->uc_mcontext.__gregs[REG_A0 + 0] = a0;
- ucp->uc_mcontext.__gregs[REG_A0 + 1] = a1;
- ucp->uc_mcontext.__gregs[REG_A0 + 2] = a2;
- ucp->uc_mcontext.__gregs[REG_A0 + 3] = a3;
- ucp->uc_mcontext.__gregs[REG_A0 + 4] = a4;
-
- if (__glibc_unlikely (argc > 5))
+ if (argc > 0)
{
va_list vl;
- va_start (vl, a4);
+ va_start (vl, argc);
long reg_args = argc < REG_NARGS ? argc : REG_NARGS;
- for (i = 5; i < reg_args; i++)
+ for (i = 0; i < reg_args; i++)
ucp->uc_mcontext.__gregs[REG_A0 + i] = va_arg (vl, long);
long int stack_args = argc - reg_args;
#ifndef _SIGCONTEXTINFO_H
#define _SIGCONTEXTINFO_H
-#include <sys/ucontext.h>
+#include <signal.h>
static inline uintptr_t
sigcontext_get_pc (const ucontext_t *ctx)
-#include <inttypes.h>
-#include <signal.h>
#include <stddef.h>
-#include <sys/ucontext.h>
+#include <signal.h>
-- Constants used by the rt_sigprocmask call.
# error "Never include <bits/procfs.h> directly; use <sys/procfs.h> instead."
#endif
-/* FIXME: sys/ucontext.h does not define NGREG unless __USE_MISC is
- active, and sys/procfs.h should not expose all of sys/ucontext.h. */
-#include <sys/ucontext.h>
+/* FIXME: bits/ucontext.h does not define NGREG unless __USE_MISC is
+ active, and sys/procfs.h should not expose all of bits/ucontext.h. */
+#include <bits/ucontext.h>
typedef greg_t elf_greg_t;
#define ELF_NGREG NGREG
License along with the GNU C Library; if not, see
<https://www.gnu.org/licenses/>. */
-#ifndef _SYS_UCONTEXT_H
-#define _SYS_UCONTEXT_H 1
+#ifndef _BITS_UCONTEXT_H
+#define _BITS_UCONTEXT_H 1
#include <features.h>
#undef __ctx
-#endif /* sys/ucontext.h */
+#endif /* bits/ucontext.h */
License along with the GNU C Library; if not, see
<https://www.gnu.org/licenses/>. */
+#include <elf.h>
+#include <errno.h>
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
-#include <sys/wait.h>
#include <sys/types.h>
#include <sys/uio.h>
-#include <elf.h>
-#include <support/xunistd.h>
+#include <sys/wait.h>
+
#include <support/check.h>
-#include <string.h>
-#include <errno.h>
+#include <support/xunistd.h>
/* Ensure that we use the PTRACE_SINGLEBLOCK definition from glibc ptrace.h
in tracer_func. We need the kernel ptrace.h for structs ptrace_area
#include <stddef.h>
#include <signal.h>
-#include <sys/ucontext.h>
--
/* Where is System V/SH ABI? */
-#ifndef _SYS_UCONTEXT_H
-#define _SYS_UCONTEXT_H 1
+#ifndef _BITS_UCONTEXT_H
+#define _BITS_UCONTEXT_H 1
#include <features.h>
#undef __ctx
-#endif /* sys/ucontext.h */
+#endif /* bits/ucontext.h */
#include <stddef.h>
#include <signal.h>
-#include <sys/ucontext.h>
--
#include <stddef.h>
#include <signal.h>
-#include <sys/ucontext.h>
--
License along with the GNU C Library; if not, see
<https://www.gnu.org/licenses/>. */
-#ifndef _SYS_UCONTEXT_H
-#define _SYS_UCONTEXT_H 1
+#ifndef _BITS_UCONTEXT_H
+#define _BITS_UCONTEXT_H 1
#include <features.h>
} ucontext_t;
#endif /* __WORDSIZE == 32 */
-#endif /* sys/ucontext.h */
+#endif /* bits/ucontext.h */
#include <stddef.h>
#include <signal.h>
-#include <sys/ucontext.h>
--
License along with the GNU C Library; if not, see
<https://www.gnu.org/licenses/>. */
-#ifndef _SYS_UCONTEXT_H
-#define _SYS_UCONTEXT_H 1
+#ifndef _BITS_UCONTEXT_H
+#define _BITS_UCONTEXT_H 1
#include <features.h>
#undef __ctx
-#endif /* sys/ucontext.h */
+#endif /* bits/ucontext.h */
#include <stddef.h>
#include <signal.h>
-#include <sys/ucontext.h>
--