Commit 9989a439 by Patrick Bernardi Committed by Pierre-Marie de Rodat

[Ada] Update signal constants for GNU/Linux

Add the signal SIGSYS and mark the glibc reserved real-time signals
(32-34) as reserved rather than not maskable.

2018-11-14  Patrick Bernardi  <bernardi@adacore.com>

gcc/ada/

	* libgnarl/a-intnam__linux.ads: Add SIGSYS.
	* libgnarl/s-linux__alpha.ads, libgnarl/s-linux__android.ads,
	libgnarl/s-linux__hppa.ads, libgnarl/s-linux__mips.ads,
	libgnarl/s-linux__riscv.ads, libgnarl/s-linux__sparc.ads,
	libgnarl/s-linux__x32.ads: Rename SIGLTHRRES, SIGLTHRCAN and
	SIGLTHRDBG to SIG32, SIG33 and SIG34 as their names are
	implementation specific.
	* libgnarl/s-osinte__linux.ads, libgnarl/s-linux.ads: Add
	SIGSYS.  Move SIG32, SIG33 and SIG34 from the unmasked list to
	the reserved list.

gcc/testsuite/

	* gnat.dg/rt_signals.adb: New testcase.

From-SVN: r266136
parent f1e2bf65
2018-11-14 Patrick Bernardi <bernardi@adacore.com>
* libgnarl/a-intnam__linux.ads: Add SIGSYS.
* libgnarl/s-linux__alpha.ads, libgnarl/s-linux__android.ads,
libgnarl/s-linux__hppa.ads, libgnarl/s-linux__mips.ads,
libgnarl/s-linux__riscv.ads, libgnarl/s-linux__sparc.ads,
libgnarl/s-linux__x32.ads: Rename SIGLTHRRES, SIGLTHRCAN and
SIGLTHRDBG to SIG32, SIG33 and SIG34 as their names are
implementation specific.
* libgnarl/s-osinte__linux.ads, libgnarl/s-linux.ads: Add
SIGSYS. Move SIG32, SIG33 and SIG34 from the unmasked list to
the reserved list.
2018-11-14 Eric Botcazou <ebotcazou@adacore.com>
* exp_aggr.adb (Is_Static_Element): New predicate extracted
......
......@@ -160,4 +160,7 @@ package Ada.Interrupts.Names is
SIGPWR : constant Interrupt_ID :=
System.OS_Interface.SIGPWR; -- Power failure
SIGSYS : constant Interrupt_ID :=
System.OS_Interface.SIGSYS; -- bad system call
end Ada.Interrupts.Names;
......@@ -86,34 +86,35 @@ package System.Linux is
SIGFPE : constant := 8; -- floating point exception
SIGKILL : constant := 9; -- kill (cannot be caught or ignored)
SIGBUS : constant := 7; -- bus error
SIGUSR1 : constant := 10; -- user defined signal 1
SIGSEGV : constant := 11; -- segmentation violation
SIGUSR2 : constant := 12; -- user defined signal 2
SIGPIPE : constant := 13; -- write on a pipe with no one to read it
SIGALRM : constant := 14; -- alarm clock
SIGTERM : constant := 15; -- software termination signal from kill
SIGUSR1 : constant := 10; -- user defined signal 1
SIGUSR2 : constant := 12; -- user defined signal 2
SIGSTKFLT : constant := 16; -- coprocessor stack fault (Linux)
SIGCLD : constant := 17; -- alias for SIGCHLD
SIGCHLD : constant := 17; -- child status change
SIGPWR : constant := 30; -- power-fail restart
SIGWINCH : constant := 28; -- window size change
SIGURG : constant := 23; -- urgent condition on IO channel
SIGPOLL : constant := 29; -- pollable event occurred
SIGIO : constant := 29; -- I/O now possible (4.2 BSD)
SIGLOST : constant := 29; -- File lock lost
SIGSTOP : constant := 19; -- stop (cannot be caught or ignored)
SIGTSTP : constant := 20; -- user stop requested from tty
SIGCONT : constant := 18; -- stopped process has been continued
SIGTTIN : constant := 21; -- background tty read attempted
SIGTTOU : constant := 22; -- background tty write attempted
SIGVTALRM : constant := 26; -- virtual timer expired
SIGPROF : constant := 27; -- profiling timer expired
SIGURG : constant := 23; -- urgent condition on IO channel
SIGXCPU : constant := 24; -- CPU time limit exceeded
SIGXFSZ : constant := 25; -- filesize limit exceeded
SIGUNUSED : constant := 31; -- unused signal (GNU/Linux)
SIGSTKFLT : constant := 16; -- coprocessor stack fault (Linux)
SIGLTHRRES : constant := 32; -- GNU/LinuxThreads restart signal
SIGLTHRCAN : constant := 33; -- GNU/LinuxThreads cancel signal
SIGLTHRDBG : constant := 34; -- GNU/LinuxThreads debugger signal
SIGVTALRM : constant := 26; -- virtual timer expired
SIGPROF : constant := 27; -- profiling timer expired
SIGWINCH : constant := 28; -- window size change
SIGPOLL : constant := 29; -- pollable event occurred
SIGIO : constant := 29; -- I/O now possible (4.2 BSD)
SIGLOST : constant := 29; -- File lock lost
SIGPWR : constant := 30; -- power-fail restart
SIGSYS : constant := 31; -- bad system call
SIGUNUSED : constant := 31; -- unused signal (mapped to SIGSYS)
SIG32 : constant := 32; -- glibc internal signal
SIG33 : constant := 33; -- glibc internal signal
SIG34 : constant := 34; -- glibc internal signal
-- struct_sigaction offsets
......
......@@ -109,9 +109,9 @@ package System.Linux is
SIGUSR1 : constant := 30; -- user defined signal 1
SIGUSR2 : constant := 31; -- user defined signal 2
SIGLTHRRES : constant := 32; -- GNU/LinuxThreads restart signal
SIGLTHRCAN : constant := 33; -- GNU/LinuxThreads cancel signal
SIGLTHRDBG : constant := 34; -- GNU/LinuxThreads debugger signal
SIG32 : constant := 32; -- glibc internal signal
SIG33 : constant := 33; -- glibc internal signal
SIG34 : constant := 34; -- glibc internal signal
SIGADAABORT : constant := SIGABRT;
-- Change this if you want to use another signal for task abort.
......
......@@ -111,9 +111,9 @@ package System.Linux is
SIGXFSZ : constant := 25; -- filesize limit exceeded
SIGUNUSED : constant := 31; -- unused signal (GNU/Linux)
SIGSTKFLT : constant := 16; -- coprocessor stack fault (Linux)
SIGLTHRRES : constant := 32; -- GNU/LinuxThreads restart signal
SIGLTHRCAN : constant := 33; -- GNU/LinuxThreads cancel signal
SIGLTHRDBG : constant := 34; -- GNU/LinuxThreads debugger signal
SIG32 : constant := 32; -- glibc internal signal
SIG33 : constant := 33; -- glibc internal signal
SIG34 : constant := 34; -- glibc internal signal
-- struct_sigaction offsets
......
......@@ -113,9 +113,9 @@ package System.Linux is
SIGXCPU : constant := 33; -- CPU time limit exceeded
SIGXFSZ : constant := 34; -- filesize limit exceeded
SIGSTKFLT : constant := 36; -- coprocessor stack fault (Linux)
SIGLTHRRES : constant := 37; -- GNU/LinuxThreads restart signal
SIGLTHRCAN : constant := 38; -- GNU/LinuxThreads cancel signal
SIGLTHRDBG : constant := 39; -- GNU/LinuxThreads debugger signal
SIG32 : constant := 37; -- glibc internal signal
SIG33 : constant := 38; -- glibc internal signal
SIG34 : constant := 39; -- glibc internal signal
-- struct_sigaction offsets
......
......@@ -111,9 +111,9 @@ package System.Linux is
SIGXCPU : constant := 30; -- CPU time limit exceeded
SIGXFSZ : constant := 31; -- filesize limit exceeded
SIGLTHRRES : constant := 32; -- GNU/LinuxThreads restart signal
SIGLTHRCAN : constant := 33; -- GNU/LinuxThreads cancel signal
SIGLTHRDBG : constant := 34; -- GNU/LinuxThreads debugger signal
SIG32 : constant := 32; -- glibc internal signal
SIG33 : constant := 33; -- glibc internal signal
SIG34 : constant := 34; -- glibc internal signal
-- These don't exist for Linux/MIPS. The constants are present
-- so that we can continue to use a-intnam-linux.ads.
......
......@@ -110,10 +110,9 @@ package System.Linux is
SIGIO : constant := 29; -- I/O now possible (4.2 BSD)
SIGPWR : constant := 30; -- power-fail restart
SIGSYS : constant := 31; -- bad system call
SIGLTHRRES : constant := 0; -- GNU/LinuxThreads restart signal
SIGLTHRCAN : constant := 0; -- GNU/LinuxThreads cancel signal
SIGLTHRDBG : constant := 0; -- GNU/LinuxThreads debugger signal
SIG32 : constant := 32; -- glibc internal signal
SIG33 : constant := 33; -- glibc internal signal
SIG34 : constant := 34; -- glibc internal signal
-- These don't exist for Linux/RISC-V. The constants are present
-- so that we can continue to use a-intnam-linux.ads.
......
......@@ -112,9 +112,9 @@ package System.Linux is
SIGUSR1 : constant := 30; -- user defined signal 1
SIGUSR2 : constant := 31; -- user defined signal 2
SIGLTHRRES : constant := 32; -- GNU/LinuxThreads restart signal
SIGLTHRCAN : constant := 33; -- GNU/LinuxThreads cancel signal
SIGLTHRDBG : constant := 34; -- GNU/LinuxThreads debugger signal
SIG32 : constant := 32; -- glibc internal signal
SIG33 : constant := 33; -- glibc internal signal
SIG34 : constant := 34; -- glibc internal signal
SIGUNUSED : constant := 0;
SIGSTKFLT : constant := 0;
......
......@@ -111,9 +111,9 @@ package System.Linux is
SIGXFSZ : constant := 25; -- filesize limit exceeded
SIGUNUSED : constant := 31; -- unused signal (GNU/Linux)
SIGSTKFLT : constant := 16; -- coprocessor stack fault (Linux)
SIGLTHRRES : constant := 32; -- GNU/LinuxThreads restart signal
SIGLTHRCAN : constant := 33; -- GNU/LinuxThreads cancel signal
SIGLTHRDBG : constant := 34; -- GNU/LinuxThreads debugger signal
SIG32 : constant := 32; -- glibc internal signal
SIG33 : constant := 33; -- glibc internal signal
SIG34 : constant := 34; -- glibc internal signal
-- struct_sigaction offsets
......
......@@ -30,7 +30,7 @@
-- --
------------------------------------------------------------------------------
-- This is a GNU/Linux (GNU/LinuxThreads) version of this package
-- This is a GNU/Linux version of this package
-- This package encapsulates all direct interfaces to OS services
-- that are needed by the tasking run-time (libgnarl).
......@@ -90,37 +90,38 @@ package System.OS_Interface is
SIGTRAP : constant := System.Linux.SIGTRAP;
SIGIOT : constant := System.Linux.SIGIOT;
SIGABRT : constant := System.Linux.SIGABRT;
SIGBUS : constant := System.Linux.SIGBUS;
SIGFPE : constant := System.Linux.SIGFPE;
SIGKILL : constant := System.Linux.SIGKILL;
SIGBUS : constant := System.Linux.SIGBUS;
SIGUSR1 : constant := System.Linux.SIGUSR1;
SIGSEGV : constant := System.Linux.SIGSEGV;
SIGUSR2 : constant := System.Linux.SIGUSR2;
SIGPIPE : constant := System.Linux.SIGPIPE;
SIGALRM : constant := System.Linux.SIGALRM;
SIGTERM : constant := System.Linux.SIGTERM;
SIGUSR1 : constant := System.Linux.SIGUSR1;
SIGUSR2 : constant := System.Linux.SIGUSR2;
SIGSTKFLT : constant := System.Linux.SIGSTKFLT;
SIGCLD : constant := System.Linux.SIGCLD;
SIGCHLD : constant := System.Linux.SIGCHLD;
SIGPWR : constant := System.Linux.SIGPWR;
SIGWINCH : constant := System.Linux.SIGWINCH;
SIGURG : constant := System.Linux.SIGURG;
SIGPOLL : constant := System.Linux.SIGPOLL;
SIGIO : constant := System.Linux.SIGIO;
SIGLOST : constant := System.Linux.SIGLOST;
SIGCONT : constant := System.Linux.SIGCONT;
SIGSTOP : constant := System.Linux.SIGSTOP;
SIGTSTP : constant := System.Linux.SIGTSTP;
SIGCONT : constant := System.Linux.SIGCONT;
SIGTTIN : constant := System.Linux.SIGTTIN;
SIGTTOU : constant := System.Linux.SIGTTOU;
SIGVTALRM : constant := System.Linux.SIGVTALRM;
SIGPROF : constant := System.Linux.SIGPROF;
SIGURG : constant := System.Linux.SIGURG;
SIGXCPU : constant := System.Linux.SIGXCPU;
SIGXFSZ : constant := System.Linux.SIGXFSZ;
SIGVTALRM : constant := System.Linux.SIGVTALRM;
SIGPROF : constant := System.Linux.SIGPROF;
SIGWINCH : constant := System.Linux.SIGWINCH;
SIGPOLL : constant := System.Linux.SIGPOLL;
SIGIO : constant := System.Linux.SIGIO;
SIGLOST : constant := System.Linux.SIGLOST;
SIGPWR : constant := System.Linux.SIGPWR;
SIGSYS : constant := System.Linux.SIGSYS;
SIGUNUSED : constant := System.Linux.SIGUNUSED;
SIGSTKFLT : constant := System.Linux.SIGSTKFLT;
SIGLTHRRES : constant := System.Linux.SIGLTHRRES;
SIGLTHRCAN : constant := System.Linux.SIGLTHRCAN;
SIGLTHRDBG : constant := System.Linux.SIGLTHRDBG;
SIG32 : constant := System.Linux.SIG32;
SIG33 : constant := System.Linux.SIG33;
SIG34 : constant := System.Linux.SIG34;
SIGADAABORT : constant := SIGABRT;
-- Change this to use another signal for task abort. SIGTERM might be a
......@@ -142,16 +143,19 @@ package System.OS_Interface is
SIGPROF,
-- To avoid confusing the profiler
SIGKILL, SIGSTOP,
SIGKILL, SIGSTOP
-- These two signals actually can't be masked (POSIX won't allow it)
SIGLTHRRES, SIGLTHRCAN, SIGLTHRDBG);
-- These three signals are used by GNU/LinuxThreads starting from glibc
-- 2.1 (future 2.2).
Reserved : constant Signal_Set := (SIGVTALRM, SIGUNUSED);
-- Not clear why these two signals are reserved. Perhaps they are not
-- supported by this version of GNU/Linux ???
);
Reserved : constant Signal_Set := (
SIG32, SIG33, SIG34
-- glibc POSIX threads implementation uses two (NPTL) or three
-- (LinuxThreads) real-time signals for its own use (see SIGNAL(7)).
-- These signals are considered reserved and not unmasked as glibc does
-- not permit these signals to be used by the public signal.h API.
-- While LinuxThreads is mostly likely unused now, SIG34 is still
-- reserved as this behavior is consistent with past GNAT releases.
);
type sigset_t is private;
......
2018-11-14 Patrick Bernardi <bernardi@adacore.com>
* gnat.dg/rt_signals.adb: New testcase.
2018-11-14 Hristian Kirtchev <kirtchev@adacore.com>
* gnat.dg/ghost1.adb, gnat.dg/ghost1.ads: New testcase.
......
-- { dg-do run }
-- This program used to fail with a runtime built with assertions
procedure RT_Signals is
task Task_A;
task body Task_A is
begin
null;
end Task_A;
begin
null;
end RT_Signals;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment