Commit Graph

9 Commits

Author SHA1 Message Date
Zack Weinberg c66b29f9cc Installed-header hygiene (BZ#20366): stack_t.
sys/ucontext.h unconditionally uses stack_t, and it does not make
sense to change that.  But signal.h only declares stack_t under
__USE_XOPEN_EXTENDED || __USE_XOPEN2K8.  The actual definition is
already in a bits header, bits/sigstack.h, but that header insists on
only being included by signal.h, so we have to change that as well as
all of the sys/ucontext.h variants.  (Some but not all variants of
bits/sigcontext.h, which sys/ucontext.h may also need, had already
received this adjustment; for consistency, I made them all the same,
even if that's not strictly necessary in some configurations.)
bits/sigcontext.h and bits/sigstack.h also all need to receive
multiple inclusion guards.

	* sysdeps/generic/sys/ucontext.h
	* sysdeps/arm/sys/ucontext.h
	* sysdeps/i386/sys/ucontext.h
	* sysdeps/m68k/sys/ucontext.h
	* sysdeps/mips/sys/ucontext.h
	* sysdeps/unix/sysv/linux/aarch64/sys/ucontext.h
	* sysdeps/unix/sysv/linux/alpha/sys/ucontext.h
	* sysdeps/unix/sysv/linux/arm/sys/ucontext.h
	* sysdeps/unix/sysv/linux/hppa/sys/ucontext.h
	* sysdeps/unix/sysv/linux/ia64/sys/ucontext.h
	* sysdeps/unix/sysv/linux/m68k/sys/ucontext.h
	* sysdeps/unix/sysv/linux/mips/sys/ucontext.h
	* sysdeps/unix/sysv/linux/nios2/sys/ucontext.h
	* sysdeps/unix/sysv/linux/powerpc/sys/ucontext.h
	* sysdeps/unix/sysv/linux/s390/sys/ucontext.h
	* sysdeps/unix/sysv/linux/sh/sys/ucontext.h
	* sysdeps/unix/sysv/linux/sparc/sys/ucontext.h
	* sysdeps/unix/sysv/linux/tile/sys/ucontext.h
	* sysdeps/unix/sysv/linux/x86/sys/ucontext.h:
	Include both bits/sigcontext.h and bits/sigstack.h.
	Fix grammar error in comment, if present.

	* bits/sigstack.h
	* sysdeps/unix/sysv/linux/aarch64/bits/sigstack.h
	* sysdeps/unix/sysv/linux/alpha/bits/sigstack.h
	* sysdeps/unix/sysv/linux/bits/sigstack.h
	* sysdeps/unix/sysv/linux/ia64/bits/sigstack.h
	* sysdeps/unix/sysv/linux/mips/bits/sigstack.h
	* sysdeps/unix/sysv/linux/powerpc/bits/sigstack.h
	* sysdeps/unix/sysv/linux/sparc/bits/sigstack.h
	* bits/sigcontext.h
	* sysdeps/mach/hurd/i386/bits/sigcontext.h
	* sysdeps/unix/sysv/linux/bits/sigcontext.h
	* sysdeps/unix/sysv/linux/ia64/bits/sigcontext.h
	* sysdeps/unix/sysv/linux/sparc/bits/sigcontext.h:
	Add multiple inclusion guard.  Permit inclusion by sys/ucontext.h
	as well as signal.h, if this was not already allowed.  Request
	definition of size_t if necessary.  Minimize semantically-null
	differences across files.
2016-09-23 08:43:56 -04:00
Joseph Myers fb53a27c57 Add new header definitions from Linux 4.4 (plus older ptrace definitions).
This patch adds some new header definitions from Linux 4.4:

* MCL_ONFAULT is added to bits/mman.h / bits/mman-linux.h (this was
  already done for hppa).

* PTRACE_SECCOMP_GET_FILTER is added to sys/ptrace.h.  Along with it,
  the older PTRACE_GETSIGMASK and PTRACE_SETSIGMASK, added in Linux
  3.11 but missed at the time, are also added.

Tested for x86_64 and x86 (testsuite, and that installed stripped
shared libraries are unchanged by the patch).

	* bits/mman-linux.h [!MCL_CURRENT] (MCL_ONFAULT): New macro.
	* sysdeps/unix/sysv/linux/alpha/bits/mman.h (MCL_ONFAULT):
	Likewise.
	* sysdeps/unix/sysv/linux/powerpc/bits/mman.h (MCL_ONFAULT):
	Likewise.
	* sysdeps/unix/sysv/linux/sparc/bits/mman.h (MCL_ONFAULT):
	Likewise.
	* sysdeps/unix/sysv/linux/sys/ptrace.h (PTRACE_GETSIGMASK): New
	enum constant and macro.
	(PTRACE_SETSIGMASK): Likewise.
	(PTRACE_SECCOMP_GET_FILTER): Likewise.
	* sysdeps/unix/sysv/linux/aarch64/sys/ptrace.h
	(PTRACE_GETSIGMASK): Likewise.
	(PTRACE_SETSIGMASK): Likewise.
	(PTRACE_SECCOMP_GET_FILTER): Likewise.
	* sysdeps/unix/sysv/linux/ia64/sys/ptrace.h (PTRACE_GETSIGMASK):
	Likewise.
	(PTRACE_SETSIGMASK): Likewise.
	(PTRACE_SECCOMP_GET_FILTER): Likewise.
	* sysdeps/unix/sysv/linux/powerpc/sys/ptrace.h
	(PTRACE_GETSIGMASK): Likewise.
	(PTRACE_SETSIGMASK): Likewise.
	(PTRACE_SECCOMP_GET_FILTER): Likewise.
	* sysdeps/unix/sysv/linux/s390/sys/ptrace.h (PTRACE_GETSIGMASK):
	Likewise.
	(PTRACE_SETSIGMASK): Likewise.
	(PTRACE_SECCOMP_GET_FILTER): Likewise.
	* sysdeps/unix/sysv/linux/sparc/sys/ptrace.h (PTRACE_GETSIGMASK):
	Likewise.
	(PTRACE_SETSIGMASK): Likewise.
	(PTRACE_SECCOMP_GET_FILTER): Likewise.
	* sysdeps/unix/sysv/linux/tile/sys/ptrace.h (PTRACE_GETSIGMASK):
	Likewise.
	(PTRACE_SETSIGMASK): Likewise.
	(PTRACE_SECCOMP_GET_FILTER): Likewise.
2016-01-12 12:42:55 +00:00
Joseph Myers f7a9f785e5 Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
Joseph Myers a61a1a2576 Update <sys/ptrace.h> for Linux 4.3.
This patch updates <sys/ptrace.h> for Linux 4.3, adding
PTRACE_O_SUSPEND_SECCOMP and updating the value of PTRACE_O_MASK.
Some architectures were missing the older PTRACE_O_EXITKILL, so that
was added to the files missing it as well.

Tested for x86_64 (testsuite, and that installed shared libraries are
unchanged by the patch).

	* sysdeps/unix/sysv/linux/aarch64/sys/ptrace.h
	(PTRACE_O_EXITKILL): New value in enum __ptrace_setoptions.
	(PTRACE_O_SUSPEND_SECCOMP): Likewise.
	(PTRACE_O_MASK): Update value.
	* sysdeps/unix/sysv/linux/ia64/sys/ptrace.h (PTRACE_O_EXITKILL):
	New value in enum __ptrace_setoptions.
	(PTRACE_O_SUSPEND_SECCOMP): Likewise.
	(PTRACE_O_MASK): Update value.
	* sysdeps/unix/sysv/linux/powerpc/sys/ptrace.h
	(PTRACE_O_SUSPEND_SECCOMP): New value in enum __ptrace_setoptions.
	(PTRACE_O_MASK): Update value.
	* sysdeps/unix/sysv/linux/s390/sys/ptrace.h
	(PTRACE_O_SUSPEND_SECCOMP): New value in enum __ptrace_setoptions.
	(PTRACE_O_MASK): Update value.
	* sysdeps/unix/sysv/linux/sparc/sys/ptrace.h
	(PTRACE_O_SUSPEND_SECCOMP): New value in enum __ptrace_setoptions.
	(PTRACE_O_MASK): Update value.
	* sysdeps/unix/sysv/linux/sys/ptrace.h (PTRACE_O_SUSPEND_SECCOMP):
	New value in enum __ptrace_setoptions.
	(PTRACE_O_MASK): Update value.
	* sysdeps/unix/sysv/linux/tile/sys/ptrace.h (PTRACE_O_EXITKILL):
	New value in enum __ptrace_setoptions.
	(PTRACE_O_SUSPEND_SECCOMP): Likewise.
	(PTRACE_O_MASK): Update value.
2015-11-23 17:53:08 +00:00
Szabolcs Nagy b8528e771c [AArch64][BZ 18648] change greg_t definition in ucontext.h
This is an ABI breaking change, but

	typedef int greg_t;

is not a useful definition on aarch64.

greg_t is usually used for defining gregset_t which is used
in mcontext_t.  The general registers in mcontext_t can only
be accessed by target specific code and on aarch64 greg_t
is not needed for that so this change is not supposed to break
existing code, just fix the definition.

	[BZ #18648]
	* sysdeps/unix/sysv/linux/aarch64/sys/ucontext.h (greg_t): Change the
	definition to elf_greg_t.

(Added another BZ entry that was missed in the previous commit).
2015-07-09 09:53:30 +01:00
Szabolcs Nagy 14d623bcd1 [AArch64][BZ 18400] fix elf_prpsinfo in procfs.h
Kernel uses int pr_uid, pr_gid, but glibc used unsigned short.

This is an ABI breaking change, but the size and alignment of
the struct and the layout of other members is not changed and
there is no known usage of pr_uid and pr_gid so it is expected
to be safe.

	[BZ #18400]
	* sysdeps/unix/sysv/linux/aarch64/sys/procfs.h (struct elf_prpsinfo):
	Fix pr_uid and pr_gid members.
2015-07-09 09:39:51 +01:00
Joseph Myers b168057aaa Update copyright dates with scripts/update-copyrights. 2015-01-02 16:29:47 +00:00
Yvan Roux 7d05a8168b AArch64: Remove asm/ptrace.h inclusion in sys/user.h and sys/procfs.h
This patch fixes an issue observed by the Xen project, where including
signal.h exposes various PSR_MODE #defines.  This is due to the usage
in sys/user.h and sys/procfs.h of the struct user_pt_regs and
user_fpsimd_state included via asm/ptrace.h.  The namespace pollution
this inclusion introduce is already partially fixed with some #undef
of the PTRACE_* symbols, but other symbols like the PSR_MODE ones are
still present, and undefining them is not safe since a user can
include ptrace.h before user.h.

My proposition is to define the 2 structures we need in user.h and get
rid of the asm/ptrace.h inclusion.

Build and make check are clean on AArch64.

2014-05-20  Will Newton  <will.newton@linaro.org>
	    Yvan Roux  <yvan.roux@linaro.org>

	* sysdeps/unix/sysv/linux/aarch64/sys/user.h: Remove unused
	#include of asm/ptrace.h.
	(PTRACE_GET_THREAD_AREA): Remove #undef.
	(PTRACE_GETHBPREGS): Likewise.
	(PTRACE_SETHBPREGS): Likewise.
	(struct user_regs_struct): New structure.
	(struct user_fpsimd_struct): New structure.
	* sysdeps/unix/sysv/linux/aarch64/sys/procfs.h: Remove unused
	#include of asm/ptrace.h and second #include of sys/user.h.
	(PTRACE_GET_THREAD_AREA): Remove #undef.
	(PTRACE_GETHBPREGS): Likewise.
	(PTRACE_SETHBPREGS): Likewise.
	(ELF_NGREG): Use new struct user_regs_struct.
	(elf_fpregset_t): Use new struct user_fpsimd_struct.
2014-05-20 13:45:22 +01:00
Marcus Shawcroft 75eff3fe90 Relocate AArch64 from ports to libc.
This patch moves the AArch64 port to the main sysdeps hierarchy.  The
move is essentially:

  git mv ports/sysdeps/aarch64 sysdeps/aarch64
  git mv ports/sysdeps/unix/sysv/linux/aarch64 sysdeps/unix/sysv/linux/aarch64

The README is updated and I've updated ChangeLog.aarch64 along the
lines of the ARM move.  The AArch64 build has been tested to confirm
that there were no changes in objdump -dr output or the shared
objects.
2014-02-11 11:36:00 +00:00