2008-05-30 Vladimir Makarov <vmakarov@redhat.com>
[official-gcc.git] / gcc / ada / s-linux.ads
blobcb9ad42b018484e5eeefa7ab805a85cdeb400f81
1 ------------------------------------------------------------------------------
2 -- --
3 -- GNU ADA RUN-TIME LIBRARY (GNARL) COMPONENTS --
4 -- --
5 -- S Y S T E M . L I N U X --
6 -- --
7 -- S p e c --
8 -- --
9 -- Copyright (C) 2008, Free Software Foundation, Inc. --
10 -- --
11 -- GNARL is free software; you can redistribute it and/or modify it under --
12 -- terms of the GNU General Public License as published by the Free Soft- --
13 -- ware Foundation; either version 2, or (at your option) any later ver- --
14 -- sion. GNARL is distributed in the hope that it will be useful, but WITH- --
15 -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
16 -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
17 -- for more details. You should have received a copy of the GNU General --
18 -- Public License distributed with GNARL; see file COPYING. If not, write --
19 -- to the Free Software Foundation, 51 Franklin Street, Fifth Floor, --
20 -- Boston, MA 02110-1301, USA. --
21 -- --
22 -- As a special exception, if other files instantiate generics from this --
23 -- unit, or you link this unit with other files to produce an executable, --
24 -- this unit does not by itself cause the resulting executable to be --
25 -- covered by the GNU General Public License. This exception does not --
26 -- however invalidate any other reasons why the executable file might be --
27 -- covered by the GNU Public License. --
28 -- --
29 ------------------------------------------------------------------------------
31 -- This is the default version of this package
33 -- This package encapsulates cpu specific differences between implementations
34 -- of GNU/Linux, in order to share s-osinte-linux.ads.
36 -- PLEASE DO NOT add any with-clauses to this package or remove the pragma
37 -- Preelaborate. This package is designed to be a bottom-level (leaf) package
39 package System.Linux is
40 pragma Preelaborate;
42 -----------
43 -- Errno --
44 -----------
46 EAGAIN : constant := 11;
47 EINTR : constant := 4;
48 EINVAL : constant := 22;
49 ENOMEM : constant := 12;
50 EPERM : constant := 1;
51 ETIMEDOUT : constant := 110;
53 -------------
54 -- Signals --
55 -------------
57 SIGHUP : constant := 1; -- hangup
58 SIGINT : constant := 2; -- interrupt (rubout)
59 SIGQUIT : constant := 3; -- quit (ASCD FS)
60 SIGILL : constant := 4; -- illegal instruction (not reset)
61 SIGTRAP : constant := 5; -- trace trap (not reset)
62 SIGIOT : constant := 6; -- IOT instruction
63 SIGABRT : constant := 6; -- used by abort, replace SIGIOT in the future
64 SIGFPE : constant := 8; -- floating point exception
65 SIGKILL : constant := 9; -- kill (cannot be caught or ignored)
66 SIGBUS : constant := 7; -- bus error
67 SIGSEGV : constant := 11; -- segmentation violation
68 SIGPIPE : constant := 13; -- write on a pipe with no one to read it
69 SIGALRM : constant := 14; -- alarm clock
70 SIGTERM : constant := 15; -- software termination signal from kill
71 SIGUSR1 : constant := 10; -- user defined signal 1
72 SIGUSR2 : constant := 12; -- user defined signal 2
73 SIGCLD : constant := 17; -- alias for SIGCHLD
74 SIGCHLD : constant := 17; -- child status change
75 SIGPWR : constant := 30; -- power-fail restart
76 SIGWINCH : constant := 28; -- window size change
77 SIGURG : constant := 23; -- urgent condition on IO channel
78 SIGPOLL : constant := 29; -- pollable event occurred
79 SIGIO : constant := 29; -- I/O now possible (4.2 BSD)
80 SIGLOST : constant := 29; -- File lock lost
81 SIGSTOP : constant := 19; -- stop (cannot be caught or ignored)
82 SIGTSTP : constant := 20; -- user stop requested from tty
83 SIGCONT : constant := 18; -- stopped process has been continued
84 SIGTTIN : constant := 21; -- background tty read attempted
85 SIGTTOU : constant := 22; -- background tty write attempted
86 SIGVTALRM : constant := 26; -- virtual timer expired
87 SIGPROF : constant := 27; -- profiling timer expired
88 SIGXCPU : constant := 24; -- CPU time limit exceeded
89 SIGXFSZ : constant := 25; -- filesize limit exceeded
90 SIGUNUSED : constant := 31; -- unused signal (GNU/Linux)
91 SIGSTKFLT : constant := 16; -- coprocessor stack fault (Linux)
92 SIGLTHRRES : constant := 32; -- GNU/LinuxThreads restart signal
93 SIGLTHRCAN : constant := 33; -- GNU/LinuxThreads cancel signal
94 SIGLTHRDBG : constant := 34; -- GNU/LinuxThreads debugger signal
96 -- struct_sigaction offsets
98 sa_mask_pos : constant := Standard'Address_Size / 8;
99 sa_flags_pos : constant := 128 + sa_mask_pos;
101 SA_SIGINFO : constant := 16#04#;
102 SA_ONSTACK : constant := 16#08000000#;
104 type struct_pthread_fast_lock is record
105 status : Long_Integer;
106 spinlock : Integer;
107 end record;
108 pragma Convention (C, struct_pthread_fast_lock);
110 type pthread_mutex_t is record
111 m_reserved : Integer;
112 m_count : Integer;
113 m_owner : System.Address;
114 m_kind : Integer;
115 m_lock : struct_pthread_fast_lock;
116 end record;
117 pragma Convention (C, pthread_mutex_t);
119 end System.Linux;