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-2014, 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 3,  or (at your option) any later ver- --
14-- sion.  GNAT 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.                                     --
17--                                                                          --
18-- As a special exception under Section 7 of GPL version 3, you are granted --
19-- additional permissions described in the GCC Runtime Library Exception,   --
20-- version 3.1, as published by the Free Software Foundation.               --
21--                                                                          --
22-- You should have received a copy of the GNU General Public License and    --
23-- a copy of the GCC Runtime Library Exception along with this program;     --
24-- see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see    --
25-- <http://www.gnu.org/licenses/>.                                          --
26--                                                                          --
27--                                                                          --
28------------------------------------------------------------------------------
29
30--  This is the hppa version of this package
31
32--  This package encapsulates cpu specific differences between implementations
33--  of GNU/Linux, in order to share s-osinte-linux.ads.
34
35--  PLEASE DO NOT add any with-clauses to this package or remove the pragma
36--  Preelaborate. This package is designed to be a bottom-level (leaf) package.
37
38with Interfaces.C;
39
40package System.Linux is
41   pragma Preelaborate;
42
43   ----------
44   -- Time --
45   ----------
46
47   subtype long        is Interfaces.C.long;
48   subtype suseconds_t is Interfaces.C.long;
49   subtype time_t      is Interfaces.C.long;
50
51   type timespec is record
52      tv_sec  : time_t;
53      tv_nsec : long;
54   end record;
55   pragma Convention (C, timespec);
56
57   type timeval is record
58      tv_sec  : time_t;
59      tv_usec : suseconds_t;
60   end record;
61   pragma Convention (C, timeval);
62
63   -----------
64   -- Errno --
65   -----------
66
67   EAGAIN    : constant := 11;
68   EINTR     : constant := 4;
69   EINVAL    : constant := 22;
70   ENOMEM    : constant := 12;
71   EPERM     : constant := 1;
72   ETIMEDOUT : constant := 238;
73
74   -------------
75   -- Signals --
76   -------------
77
78   SIGHUP     : constant := 1; --  hangup
79   SIGINT     : constant := 2; --  interrupt (rubout)
80   SIGQUIT    : constant := 3; --  quit (ASCD FS)
81   SIGILL     : constant := 4; --  illegal instruction (not reset)
82   SIGTRAP    : constant := 5; --  trace trap (not reset)
83   SIGIOT     : constant := 6; --  IOT instruction
84   SIGABRT    : constant := 6; --  used by abort, replace SIGIOT in the  future
85   SIGEMT     : constant := 7; --  EMT
86   SIGFPE     : constant := 8; --  floating point exception
87   SIGKILL    : constant := 9; --  kill (cannot be caught or ignored)
88   SIGBUS     : constant := 10; --  bus error
89   SIGSEGV    : constant := 11; --  segmentation violation
90   SIGSYS     : constant := 12; --  bad system call
91   SIGPIPE    : constant := 13; --  write on a pipe with no one to read it
92   SIGALRM    : constant := 14; --  alarm clock
93   SIGTERM    : constant := 15; --  software termination signal from kill
94   SIGUSR1    : constant := 16; --  user defined signal 1
95   SIGUSR2    : constant := 17; --  user defined signal 2
96   SIGCLD     : constant := 18; --  alias for SIGCHLD
97   SIGCHLD    : constant := 18; --  child status change
98   SIGPWR     : constant := 19; --  power-fail restart
99   SIGVTALRM  : constant := 20; --  virtual timer expired
100   SIGPROF    : constant := 21; --  profiling timer expired
101   SIGPOLL    : constant := 22; --  pollable event occurred
102   SIGIO      : constant := 22; --  I/O now possible (4.2 BSD)
103   SIGWINCH   : constant := 23; --  window size change
104   SIGSTOP    : constant := 24; --  stop (cannot be caught or ignored)
105   SIGTSTP    : constant := 25; --  user stop requested from tty
106   SIGCONT    : constant := 26; --  stopped process has been continued
107   SIGTTIN    : constant := 27; --  background tty read attempted
108   SIGTTOU    : constant := 28; --  background tty write attempted
109   SIGURG     : constant := 29; --  urgent condition on IO channel
110   SIGLOST    : constant := 30; --  File lock lost
111   SIGUNUSED  : constant := 31; --  unused signal (GNU/Linux)
112   SIGXCPU    : constant := 33; --  CPU time limit exceeded
113   SIGXFSZ    : constant := 34; --  filesize limit exceeded
114   SIGSTKFLT  : constant := 36; --  coprocessor stack fault (Linux)
115   SIGLTHRRES : constant := 37; --  GNU/LinuxThreads restart signal
116   SIGLTHRCAN : constant := 38; --  GNU/LinuxThreads cancel signal
117   SIGLTHRDBG : constant := 39; --  GNU/LinuxThreads debugger signal
118
119   --  struct_sigaction offsets
120
121   sa_handler_pos : constant := 0;
122   sa_flags_pos   : constant := Standard'Address_Size / 8;
123   sa_mask_pos    : constant := sa_flags_pos * 2;
124
125   SA_SIGINFO : constant := 16#10#;
126   SA_ONSTACK : constant := 16#01#;
127
128end System.Linux;
129