]>
Commit | Line | Data |
---|---|---|
fb0fdcac | 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 | -- -- | |
1d8be7c0 | 9 | -- Copyright (C) 2009-2017, Free Software Foundation, Inc. -- |
fb0fdcac | 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 | ||
1d8be7c0 | 29 | -- This is the MIPS version of this package |
fb0fdcac | 30 | |
31 | -- This package encapsulates cpu specific differences between implementations | |
32 | -- of GNU/Linux, in order to share s-osinte-linux.ads. | |
33 | ||
34 | -- PLEASE DO NOT add any with-clauses to this package or remove the pragma | |
35 | -- Preelaborate. This package is designed to be a bottom-level (leaf) package | |
36 | ||
b1dc44f0 | 37 | with Interfaces.C; |
38 | ||
fb0fdcac | 39 | package System.Linux is |
40 | pragma Preelaborate; | |
41 | ||
b1dc44f0 | 42 | ---------- |
43 | -- Time -- | |
44 | ---------- | |
45 | ||
1d8be7c0 | 46 | subtype int is Interfaces.C.int; |
b1dc44f0 | 47 | subtype long is Interfaces.C.long; |
48 | subtype suseconds_t is Interfaces.C.long; | |
49 | subtype time_t is Interfaces.C.long; | |
5f02e527 | 50 | subtype clockid_t is Interfaces.C.int; |
b1dc44f0 | 51 | |
52 | type timespec is record | |
53 | tv_sec : time_t; | |
54 | tv_nsec : long; | |
55 | end record; | |
56 | pragma Convention (C, timespec); | |
e3a1f6b5 | 57 | |
b1dc44f0 | 58 | type timeval is record |
59 | tv_sec : time_t; | |
60 | tv_usec : suseconds_t; | |
61 | end record; | |
62 | pragma Convention (C, timeval); | |
e3a1f6b5 | 63 | |
fb0fdcac | 64 | ----------- |
65 | -- Errno -- | |
66 | ----------- | |
67 | ||
68 | EAGAIN : constant := 11; | |
69 | EINTR : constant := 4; | |
70 | EINVAL : constant := 22; | |
71 | ENOMEM : constant := 12; | |
72 | EPERM : constant := 1; | |
1d8be7c0 | 73 | ETIMEDOUT : constant := 145; |
fb0fdcac | 74 | |
75 | ------------- | |
76 | -- Signals -- | |
77 | ------------- | |
78 | ||
79 | SIGHUP : constant := 1; -- hangup | |
80 | SIGINT : constant := 2; -- interrupt (rubout) | |
81 | SIGQUIT : constant := 3; -- quit (ASCD FS) | |
82 | SIGILL : constant := 4; -- illegal instruction (not reset) | |
83 | SIGTRAP : constant := 5; -- trace trap (not reset) | |
84 | SIGIOT : constant := 6; -- IOT instruction | |
85 | SIGABRT : constant := 6; -- used by abort, replace SIGIOT in the future | |
1d8be7c0 | 86 | SIGEMT : constant := 7; -- EMT |
fb0fdcac | 87 | SIGFPE : constant := 8; -- floating point exception |
88 | SIGKILL : constant := 9; -- kill (cannot be caught or ignored) | |
1d8be7c0 | 89 | SIGBUS : constant := 10; -- bus error |
fb0fdcac | 90 | SIGSEGV : constant := 11; -- segmentation violation |
1d8be7c0 | 91 | SIGSYS : constant := 12; -- bad system call |
fb0fdcac | 92 | SIGPIPE : constant := 13; -- write on a pipe with no one to read it |
93 | SIGALRM : constant := 14; -- alarm clock | |
94 | SIGTERM : constant := 15; -- software termination signal from kill | |
1d8be7c0 | 95 | SIGUSR1 : constant := 16; -- user defined signal 1 |
96 | SIGUSR2 : constant := 17; -- user defined signal 2 | |
97 | SIGCLD : constant := 18; -- alias for SIGCHLD | |
98 | SIGCHLD : constant := 18; -- child status change | |
99 | SIGPWR : constant := 19; -- power-fail restart | |
100 | SIGWINCH : constant := 20; -- window size change | |
101 | SIGURG : constant := 21; -- urgent condition on IO channel | |
102 | SIGPOLL : constant := 22; -- pollable event occurred | |
103 | SIGIO : constant := 22; -- I/O now possible (4.2 BSD) | |
104 | SIGSTOP : constant := 23; -- stop (cannot be caught or ignored) | |
105 | SIGTSTP : constant := 24; -- user stop requested from tty | |
106 | SIGCONT : constant := 25; -- stopped process has been continued | |
107 | SIGTTIN : constant := 26; -- background tty read attempted | |
108 | SIGTTOU : constant := 27; -- background tty write attempted | |
109 | SIGVTALRM : constant := 28; -- virtual timer expired | |
110 | SIGPROF : constant := 29; -- profiling timer expired | |
111 | SIGXCPU : constant := 30; -- CPU time limit exceeded | |
112 | SIGXFSZ : constant := 31; -- filesize limit exceeded | |
113 | ||
fb0fdcac | 114 | SIGLTHRRES : constant := 32; -- GNU/LinuxThreads restart signal |
115 | SIGLTHRCAN : constant := 33; -- GNU/LinuxThreads cancel signal | |
116 | SIGLTHRDBG : constant := 34; -- GNU/LinuxThreads debugger signal | |
117 | ||
1d8be7c0 | 118 | -- These don't exist for Linux/MIPS. The constants are present |
119 | -- so that we can continue to use a-intnam-linux.ads. | |
120 | SIGLOST : constant := 0; -- File lock lost | |
121 | SIGSTKFLT : constant := 0; -- coprocessor stack fault (Linux) | |
122 | SIGUNUSED : constant := 0; -- unused signal (GNU/Linux) | |
123 | ||
fb0fdcac | 124 | -- struct_sigaction offsets |
125 | ||
1d8be7c0 | 126 | sa_handler_pos : constant := int'Size / 8; |
127 | sa_mask_pos : constant := int'Size / 8 + | |
128 | Standard'Address_Size / 8; | |
fb0fdcac | 129 | sa_flags_pos : constant := 0; |
130 | ||
1d8be7c0 | 131 | SA_SIGINFO : constant := 16#08#; |
fb0fdcac | 132 | SA_ONSTACK : constant := 16#08000000#; |
133 | ||
fb0fdcac | 134 | end System.Linux; |