* ChangeLog: Repair from previous update.
[platform/upstream/gcc.git] / gcc / ada / 5tosinte.ads
1 ------------------------------------------------------------------------------
2 --                                                                          --
3 --                GNU ADA RUN-TIME LIBRARY (GNARL) COMPONENTS               --
4 --                                                                          --
5 --                   S Y S T E M . O S _ I N T E R F A C E                  --
6 --                                                                          --
7 --                                  S p e c                                 --
8 --                                                                          --
9 --                             $Revision: 1.26 $
10 --                                                                          --
11 --          Copyright (C) 1997-2001, Free Software Foundation, Inc.         --
12 --                                                                          --
13 -- GNARL is free software; you can  redistribute it  and/or modify it under --
14 -- terms of the  GNU General Public License as published  by the Free Soft- --
15 -- ware  Foundation;  either version 2,  or (at your option) any later ver- --
16 -- sion. GNARL is distributed in the hope that it will be useful, but WITH- --
17 -- OUT ANY WARRANTY;  without even the  implied warranty of MERCHANTABILITY --
18 -- or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License --
19 -- for  more details.  You should have  received  a copy of the GNU General --
20 -- Public License  distributed with GNARL; see file COPYING.  If not, write --
21 -- to  the Free Software Foundation,  59 Temple Place - Suite 330,  Boston, --
22 -- MA 02111-1307, USA.                                                      --
23 --                                                                          --
24 -- As a special exception,  if other files  instantiate  generics from this --
25 -- unit, or you link  this unit with other files  to produce an executable, --
26 -- this  unit  does not  by itself cause  the resulting  executable  to  be --
27 -- covered  by the  GNU  General  Public  License.  This exception does not --
28 -- however invalidate  any other reasons why  the executable file  might be --
29 -- covered by the  GNU Public License.                                      --
30 --                                                                          --
31 -- GNARL was developed by the GNARL team at Florida State University. It is --
32 -- now maintained by Ada Core Technologies Inc. in cooperation with Florida --
33 -- State University (http://www.gnat.com).                                  --
34 --                                                                          --
35 ------------------------------------------------------------------------------
36
37 --  This is a Solaris (FSU THREADS) version of this package.
38
39 --  This package includes all direct interfaces to OS services
40 --  that are needed by children of System.
41
42 --  PLEASE DO NOT add any with-clauses to this package
43 --  or remove the pragma Elaborate_Body.
44 --  It is designed to be a bottom-level (leaf) package.
45
46 with Interfaces.C;
47 package System.OS_Interface is
48    pragma Preelaborate;
49
50    pragma Linker_Options ("-lgthreads");
51    pragma Linker_Options ("-lmalloc");
52
53    subtype int            is Interfaces.C.int;
54    subtype short          is Interfaces.C.short;
55    subtype long           is Interfaces.C.long;
56    subtype unsigned       is Interfaces.C.unsigned;
57    subtype unsigned_short is Interfaces.C.unsigned_short;
58    subtype unsigned_long  is Interfaces.C.unsigned_long;
59    subtype unsigned_char  is Interfaces.C.unsigned_char;
60    subtype plain_char     is Interfaces.C.plain_char;
61    subtype size_t         is Interfaces.C.size_t;
62
63    -----------
64    -- Errno --
65    -----------
66
67    function errno return int;
68    pragma Import (C, errno, "__get_errno");
69
70    EAGAIN    : constant := 11;
71    EINTR     : constant := 4;
72    EINVAL    : constant := 22;
73    ENOMEM    : constant := 12;
74    ETIMEDOUT : constant := 145;
75
76    -------------
77    -- Signals --
78    -------------
79
80    Max_Interrupt : constant := 45;
81    type Signal is new int range 0 .. Max_Interrupt;
82    for Signal'Size use int'Size;
83
84    SIGHUP     : constant := 1; --  hangup
85    SIGINT     : constant := 2; --  interrupt (rubout)
86    SIGQUIT    : constant := 3; --  quit (ASCD FS)
87    SIGILL     : constant := 4; --  illegal instruction (not reset)
88    SIGTRAP    : constant := 5; --  trace trap (not reset)
89    SIGIOT     : constant := 6; --  IOT instruction
90    SIGABRT    : constant := 6; --  used by abort, replace SIGIOT in the  future
91    SIGEMT     : constant := 7; --  EMT instruction
92    SIGFPE     : constant := 8; --  floating point exception
93    SIGKILL    : constant := 9; --  kill (cannot be caught or ignored)
94    SIGBUS     : constant := 10; --  bus error
95    SIGSEGV    : constant := 11; --  segmentation violation
96    SIGSYS     : constant := 12; --  bad argument to system call
97    SIGPIPE    : constant := 13; --  write on a pipe with no one to read it
98    SIGALRM    : constant := 14; --  alarm clock
99    SIGTERM    : constant := 15; --  software termination signal from kill
100    SIGUSR1    : constant := 16; --  user defined signal 1
101    SIGUSR2    : constant := 17; --  user defined signal 2
102    SIGCLD     : constant := 18; --  alias for SIGCHLD
103    SIGCHLD    : constant := 18; --  child status change
104    SIGPWR     : constant := 19; --  power-fail restart
105    SIGWINCH   : constant := 20; --  window size change
106    SIGURG     : constant := 21; --  urgent condition on IO channel
107    SIGPOLL    : constant := 22; --  pollable event occurred
108    SIGIO      : constant := 22; --  I/O possible (Solaris SIGPOLL alias)
109    SIGSTOP    : constant := 23; --  stop (cannot be caught or ignored)
110    SIGTSTP    : constant := 24; --  user stop requested from tty
111    SIGCONT    : constant := 25; --  stopped process has been continued
112    SIGTTIN    : constant := 26; --  background tty read attempted
113    SIGTTOU    : constant := 27; --  background tty write attempted
114    SIGVTALRM  : constant := 28; --  virtual timer expired
115    SIGPROF    : constant := 29; --  profiling timer expired
116    SIGXCPU    : constant := 30; --  CPU time limit exceeded
117    SIGXFSZ    : constant := 31; --  filesize limit exceeded
118    SIGWAITING : constant := 32; --  process's lwps blocked (Solaris)
119    SIGLWP     : constant := 33; --  used by thread library (Solaris)
120    SIGFREEZE  : constant := 34; --  used by CPR (Solaris)
121    SIGTHAW    : constant := 35; --  used by CPR (Solaris)
122    SIGCANCEL  : constant := 36; --  used for thread cancel (Solaris)
123
124    type Signal_Set is array (Natural range <>) of Signal;
125
126    Unmasked    : constant Signal_Set :=
127      (SIGTRAP, SIGLWP, SIGTTIN, SIGTTOU, SIGTSTP, SIGPROF);
128
129    Reserved    : constant Signal_Set :=
130      (SIGKILL, SIGSTOP, SIGALRM, SIGVTALRM, SIGWAITING);
131
132    type sigset_t is private;
133
134    function sigaddset (set : access sigset_t; sig : Signal) return int;
135    pragma Import (C, sigaddset, "sigaddset");
136
137    function sigdelset (set : access sigset_t; sig : Signal) return int;
138    pragma Import (C, sigdelset, "sigdelset");
139
140    function sigfillset (set : access sigset_t) return int;
141    pragma Import (C, sigfillset, "sigfillset");
142
143    function sigismember (set : access sigset_t; sig : Signal) return int;
144    pragma Import (C, sigismember, "sigismember");
145
146    function sigemptyset (set : access sigset_t) return int;
147    pragma Import (C, sigemptyset, "sigemptyset");
148
149    type union_type_3 is new String (1 .. 116);
150    type siginfo_t is record
151       si_signo     : int;
152       si_code      : int;
153       si_errno     : int;
154       X_data       : union_type_3;
155    end record;
156    pragma Convention (C, siginfo_t);
157
158    --  The types mcontext_t and gregset_t are part of the ucontext_t
159    --  information, which is specific to Solaris2.4 for SPARC
160    --  The ucontext_t info seems to be used by the handler
161    --  for SIGSEGV to decide whether it is a Storage_Error (stack overflow) or
162    --  a Constraint_Error (bad pointer).  The original code that did this
163    --  is suspect, so it is not clear whether we really need this part of
164    --  the signal context information, or perhaps something else.
165    --  More analysis is needed, after which these declarations may need to
166    --  be changed.
167
168    EMT_TAGOVF  : constant := 1; --  tag overflow
169    FPE_INTDIV  : constant := 1; --  integer divide by zero
170    FPE_INTOVF  : constant := 2; --  integer overflow
171    FPE_FLTDIV  : constant := 3; --  floating point divide by zero
172    FPE_FLTOVF  : constant := 4; --  floating point overflow
173    FPE_FLTUND  : constant := 5; --  floating point underflow
174    FPE_FLTRES  : constant := 6; --  floating point inexact result
175    FPE_FLTINV  : constant := 7; --  invalid floating point operation
176    FPE_FLTSUB  : constant := 8; --  subscript out of range
177
178    SEGV_MAPERR : constant := 1; --  address not mapped to object
179    SEGV_ACCERR : constant := 2; --  invalid permissions
180
181    BUS_ADRALN  : constant := 1; --  invalid address alignment
182    BUS_ADRERR  : constant := 2; --  non-existent physical address
183    BUS_OBJERR  : constant := 3; --  object specific hardware error
184
185    ILL_ILLOPC  : constant := 1; --  illegal opcode
186    ILL_ILLOPN  : constant := 2; --  illegal operand
187    ILL_ILLADR  : constant := 3; --  illegal addressing mode
188    ILL_ILLTRP  : constant := 4; --  illegal trap
189    ILL_PRVOPC  : constant := 5; --  privileged opcode
190    ILL_PRVREG  : constant := 6; --  privileged register
191    ILL_COPROC  : constant := 7; --  co-processor
192    ILL_BADSTK  : constant := 8; --  bad stack
193
194    type greg_t is new int;
195
196    type gregset_t is array (Integer range 0 .. 18) of greg_t;
197
198    REG_O0 : constant := 11;
199    --  index of saved register O0 in ucontext.uc_mcontext.gregs array
200
201    type union_type_2 is new String (1 .. 128);
202    type record_type_1 is record
203       fpu_fr       : union_type_2;
204       fpu_q        : System.Address;
205       fpu_fsr      : unsigned;
206       fpu_qcnt     : unsigned_char;
207       fpu_q_entrysize  : unsigned_char;
208       fpu_en       : unsigned_char;
209    end record;
210    pragma Convention (C, record_type_1);
211    type array_type_7 is array (Integer range 0 .. 20) of long;
212    type mcontext_t is record
213       gregs        : gregset_t;
214       gwins        : System.Address;
215       fpregs       : record_type_1;
216       filler       : array_type_7;
217    end record;
218    pragma Convention (C, mcontext_t);
219
220    type record_type_2 is record
221       ss_sp        : System.Address;
222       ss_size      : int;
223       ss_flags     : int;
224    end record;
225    pragma Convention (C, record_type_2);
226    type array_type_8 is array (Integer range 0 .. 22) of long;
227    type ucontext_t is record
228       uc_flags     : unsigned_long;
229       uc_link      : System.Address;
230       uc_sigmask   : sigset_t;
231       uc_stack     : record_type_2;
232       uc_mcontext  : mcontext_t;
233       uc_filler    : array_type_8;
234    end record;
235    pragma Convention (C, ucontext_t);
236
237    type Signal_Handler is access procedure
238       (signo   : Signal;
239        info    : access siginfo_t;
240        context : access ucontext_t);
241
242    type union_type_1 is new plain_char;
243    type array_type_2 is array (Integer range 0 .. 1) of int;
244    type struct_sigaction is record
245       sa_flags     : int;
246       sa_handler   : System.Address;
247       sa_mask      : sigset_t;
248       sa_resv      : array_type_2;
249    end record;
250    pragma Convention (C, struct_sigaction);
251    type struct_sigaction_ptr is access all struct_sigaction;
252
253    SIG_BLOCK   : constant := 1;
254    SIG_UNBLOCK : constant := 2;
255    SIG_SETMASK : constant := 3;
256
257    SIG_DFL : constant := 0;
258    SIG_IGN : constant := 1;
259
260    function sigaction
261      (sig  : Signal;
262       act  : struct_sigaction_ptr;
263       oact : struct_sigaction_ptr) return int;
264    pragma Import (C, sigaction, "sigaction");
265
266    ----------
267    -- Time --
268    ----------
269
270    Time_Slice_Supported : constant Boolean := False;
271    --  Indicates wether time slicing is supported (i.e FSU threads have been
272    --  compiled with DEF_RR)
273
274    type timespec is private;
275
276    type clockid_t is private;
277
278    CLOCK_REALTIME : constant clockid_t;
279
280    function clock_gettime
281      (clock_id : clockid_t;
282       tp       : access timespec) return int;
283    pragma Import (C, clock_gettime, "clock_gettime");
284
285    function To_Duration (TS : timespec) return Duration;
286    pragma Inline (To_Duration);
287
288    function To_Timespec (D : Duration) return timespec;
289    pragma Inline (To_Timespec);
290
291    type struct_timeval is private;
292
293    function To_Duration (TV : struct_timeval) return Duration;
294    pragma Inline (To_Duration);
295
296    function To_Timeval (D : Duration) return struct_timeval;
297    pragma Inline (To_Timeval);
298
299    -------------------------
300    -- Priority Scheduling --
301    -------------------------
302
303    SCHED_FIFO  : constant := 0;
304    SCHED_RR    : constant := 1;
305    SCHED_OTHER : constant := 2;
306
307    -------------
308    -- Process --
309    -------------
310
311    type pid_t is private;
312
313    function kill (pid : pid_t; sig : Signal) return int;
314    pragma Import (C, kill, "kill");
315
316    function getpid return pid_t;
317    pragma Import (C, getpid, "getpid");
318
319    ---------
320    -- LWP --
321    ---------
322
323    function lwp_self return System.Address;
324    --  lwp_self does not exist on this thread library, revert to pthread_self
325    --  which is the closest approximation (with getpid). This function is
326    --  needed to share 7staprop.adb across POSIX-like targets.
327    pragma Import (C, lwp_self, "pthread_self");
328
329    -------------
330    -- Threads --
331    -------------
332
333    type Thread_Body is access
334      function (arg : System.Address) return System.Address;
335    type pthread_t           is private;
336    subtype Thread_Id        is pthread_t;
337
338    type pthread_mutex_t     is limited private;
339    type pthread_cond_t      is limited private;
340    type pthread_attr_t      is limited private;
341    type pthread_mutexattr_t is limited private;
342    type pthread_condattr_t  is limited private;
343    type pthread_key_t       is private;
344
345    PTHREAD_CREATE_DETACHED : constant := 1;
346
347    -----------
348    -- Stack --
349    -----------
350
351    Stack_Base_Available : constant Boolean := False;
352    --  Indicates wether the stack base is available on this target.
353    --  This allows us to share s-osinte.adb between all the FSU run time.
354    --  Note that this value can only be true if pthread_t has a complete
355    --  definition that corresponds exactly to the C header files.
356
357    function Get_Stack_Base (thread : pthread_t) return Address;
358    pragma Inline (Get_Stack_Base);
359    --  returns the stack base of the specified thread.
360    --  Only call this function when Stack_Base_Available is True.
361
362    function Get_Page_Size return size_t;
363    function Get_Page_Size return Address;
364    pragma Import (C, Get_Page_Size, "getpagesize");
365    --  returns the size of a page, or 0 if this is not relevant on this
366    --  target
367
368    PROT_NONE  : constant := 0;
369    PROT_READ  : constant := 1;
370    PROT_WRITE : constant := 2;
371    PROT_EXEC  : constant := 4;
372    PROT_ALL   : constant := PROT_READ + PROT_WRITE + PROT_EXEC;
373
374    PROT_ON    : constant := PROT_NONE;
375    PROT_OFF   : constant := PROT_ALL;
376
377    function mprotect (addr : Address; len : size_t; prot : int) return int;
378    pragma Import (C, mprotect);
379
380    ---------------------------------------
381    -- Nonstandard Thread Initialization --
382    ---------------------------------------
383
384    procedure pthread_init;
385    --  FSU_THREADS requires pthread_init, which is nonstandard
386    --  and this should be invoked during the elaboration of s-taprop.adb
387    pragma Import (C, pthread_init, "pthread_init");
388
389    -------------------------
390    -- POSIX.1c  Section 3 --
391    -------------------------
392
393    function sigwait (set : access sigset_t; sig : access Signal) return int;
394    --  FSU_THREADS has a nonstandard sigwait
395
396    function pthread_kill (thread : pthread_t; sig : Signal) return int;
397    pragma Import (C, pthread_kill, "pthread_kill");
398
399    type sigset_t_ptr is access all sigset_t;
400
401    function pthread_sigmask
402      (how  : int;
403       set  : sigset_t_ptr;
404       oset : sigset_t_ptr) return int;
405    pragma Import (C, pthread_sigmask, "sigprocmask");
406
407    --------------------------
408    -- POSIX.1c  Section 11 --
409    --------------------------
410
411    function pthread_mutexattr_init
412      (attr : access pthread_mutexattr_t) return int;
413    pragma Import (C, pthread_mutexattr_init, "pthread_mutexattr_init");
414
415    function pthread_mutexattr_destroy
416      (attr : access pthread_mutexattr_t) return int;
417    pragma Import (C, pthread_mutexattr_destroy, "pthread_mutexattr_destroy");
418
419    function pthread_mutex_init
420      (mutex : access pthread_mutex_t;
421       attr  : access pthread_mutexattr_t) return int;
422    pragma Import (C, pthread_mutex_init, "pthread_mutex_init");
423
424    function pthread_mutex_destroy (mutex : access pthread_mutex_t) return int;
425    pragma Import (C, pthread_mutex_destroy, "pthread_mutex_destroy");
426
427    function pthread_mutex_lock (mutex : access pthread_mutex_t) return int;
428    --  FSU_THREADS has nonstandard pthread_mutex_lock
429
430    function pthread_mutex_unlock (mutex : access pthread_mutex_t) return int;
431    --  FSU_THREADS has nonstandard pthread_mutex_lock
432
433    function pthread_condattr_init
434      (attr : access pthread_condattr_t) return int;
435    pragma Import (C, pthread_condattr_init, "pthread_condattr_init");
436
437    function pthread_condattr_destroy
438      (attr : access pthread_condattr_t) return int;
439    pragma Import (C, pthread_condattr_destroy, "pthread_condattr_destroy");
440
441    function pthread_cond_init
442      (cond : access pthread_cond_t;
443       attr : access pthread_condattr_t) return int;
444    pragma Import (C, pthread_cond_init, "pthread_cond_init");
445
446    function pthread_cond_destroy (cond : access pthread_cond_t) return int;
447    pragma Import (C, pthread_cond_destroy, "pthread_cond_destroy");
448
449    function pthread_cond_signal (cond : access pthread_cond_t) return int;
450    pragma Import (C, pthread_cond_signal, "pthread_cond_signal");
451
452    function pthread_cond_wait
453      (cond  : access pthread_cond_t;
454       mutex : access pthread_mutex_t) return int;
455    --  FSU_THREADS has a nonstandard pthread_cond_wait
456
457    function pthread_cond_timedwait
458      (cond    : access pthread_cond_t;
459       mutex   : access pthread_mutex_t;
460       abstime : access timespec) return int;
461    --  FSU_THREADS has a nonstandard pthread_cond_timedwait
462
463    Relative_Timed_Wait : constant Boolean := False;
464    --  pthread_cond_timedwait requires an absolute delay time
465
466    --------------------------
467    -- POSIX.1c  Section 13 --
468    --------------------------
469
470    PTHREAD_PRIO_NONE    : constant := 0;
471    PTHREAD_PRIO_PROTECT : constant := 2;
472    PTHREAD_PRIO_INHERIT : constant := 1;
473
474    function pthread_mutexattr_setprotocol
475      (attr     : access pthread_mutexattr_t;
476       protocol : int) return int;
477    pragma Import (C, pthread_mutexattr_setprotocol);
478
479    function pthread_mutexattr_setprioceiling
480      (attr     : access pthread_mutexattr_t;
481       prioceiling : int) return int;
482    pragma Import
483      (C, pthread_mutexattr_setprioceiling,
484       "pthread_mutexattr_setprio_ceiling");
485
486    type struct_sched_param is record
487       sched_priority : int;  --  scheduling priority
488    end record;
489
490    function pthread_setschedparam
491      (thread : pthread_t;
492       policy : int;
493       param  : access struct_sched_param) return int;
494    --  FSU_THREADS does not have pthread_setschedparam
495
496    function pthread_attr_setscope
497      (attr            : access pthread_attr_t;
498       contentionscope : int) return int;
499    pragma Import (C, pthread_attr_setscope, "pthread_attr_setscope");
500
501    function pthread_attr_setinheritsched
502      (attr            : access pthread_attr_t;
503       inheritsched : int) return int;
504    pragma Import (C, pthread_attr_setinheritsched);
505
506    function pthread_attr_setschedpolicy
507      (attr   : access pthread_attr_t;
508       policy : int) return int;
509    pragma Import (C, pthread_attr_setschedpolicy, "pthread_attr_setsched");
510
511    function sched_yield return int;
512    --  FSU_THREADS does not have sched_yield;
513
514    ---------------------------
515    -- P1003.1c - Section 16 --
516    ---------------------------
517
518    function pthread_attr_init (attributes : access pthread_attr_t) return int;
519    pragma Import (C, pthread_attr_init, "pthread_attr_init");
520
521    function pthread_attr_destroy
522      (attributes : access pthread_attr_t) return int;
523    pragma Import (C, pthread_attr_destroy, "pthread_attr_destroy");
524
525    function pthread_attr_setdetachstate
526      (attr        : access pthread_attr_t;
527       detachstate : int) return int;
528    --  FSU_THREADS has a nonstandard pthread_attr_setdetachstate
529
530    function pthread_attr_setstacksize
531      (attr      : access pthread_attr_t;
532       stacksize : size_t) return int;
533    pragma Import (C, pthread_attr_setstacksize);
534
535    function pthread_create
536      (thread        : access pthread_t;
537       attributes    : access pthread_attr_t;
538       start_routine : Thread_Body;
539       arg           : System.Address) return int;
540    pragma Import (C, pthread_create, "pthread_create");
541
542    procedure pthread_exit (status : System.Address);
543    pragma Import (C, pthread_exit, "pthread_exit");
544
545    function pthread_self return pthread_t;
546    pragma Import (C, pthread_self, "pthread_self");
547
548    --------------------------
549    -- POSIX.1c  Section 17 --
550    --------------------------
551
552    function pthread_setspecific
553      (key   : pthread_key_t;
554       value : System.Address) return int;
555    pragma Import (C, pthread_setspecific, "pthread_setspecific");
556
557    function pthread_getspecific (key : pthread_key_t) return System.Address;
558    --  FSU_THREADS has a nonstandard pthread_getspecific
559
560    type destructor_pointer is access procedure (arg : System.Address);
561
562    function pthread_key_create
563      (key        : access pthread_key_t;
564       destructor : destructor_pointer) return int;
565    pragma Import (C, pthread_key_create, "pthread_key_create");
566
567 private
568
569    type array_type_1 is array (Integer range 0 .. 3) of unsigned_long;
570    type sigset_t is record
571       X_X_sigbits  : array_type_1;
572    end record;
573    pragma Convention (C, sigset_t);
574
575    type pid_t is new long;
576
577    type time_t is new long;
578
579    type timespec is record
580       tv_sec  : time_t;
581       tv_nsec : long;
582    end record;
583    pragma Convention (C, timespec);
584
585    type clockid_t is new int;
586    CLOCK_REALTIME : constant clockid_t := 0;
587
588    type struct_timeval is record
589       tv_sec  : long;
590       tv_usec : long;
591    end record;
592    pragma Convention (C, struct_timeval);
593
594    type pthread_attr_t is record
595       flags           : int;
596       stacksize       : int;
597       contentionscope : int;
598       inheritsched    : int;
599       detachstate     : int;
600       sched           : int;
601       prio            : int;
602       starttime       : timespec;
603       deadline        : timespec;
604       period          : timespec;
605    end record;
606    pragma Convention (C, pthread_attr_t);
607
608    type pthread_condattr_t is record
609       flags : int;
610    end record;
611    pragma Convention (C, pthread_condattr_t);
612
613    type pthread_mutexattr_t is record
614       flags        : int;
615       prio_ceiling : int;
616       protocol     : int;
617    end record;
618    pragma Convention (C, pthread_mutexattr_t);
619
620    type sigjmp_buf is array (Integer range 0 .. 18) of int;
621
622    type pthread_t_struct is record
623       context    : sigjmp_buf;
624       pbody      : sigjmp_buf;
625       errno      : int;
626       ret        : int;
627       stack_base : System.Address;
628    end record;
629    pragma Convention (C, pthread_t_struct);
630
631    type pthread_t is access all pthread_t_struct;
632
633    type queue_t is record
634       head : System.Address;
635       tail : System.Address;
636    end record;
637    pragma Convention (C, queue_t);
638
639    type pthread_mutex_t is record
640       queue                 : queue_t;
641       lock                  : plain_char;
642       owner                 : System.Address;
643       flags                 : int;
644       prio_ceiling          : int;
645       protocol              : int;
646       prev_max_ceiling_prio : int;
647    end record;
648    pragma Convention (C, pthread_mutex_t);
649
650    type pthread_cond_t is record
651       queue        : queue_t;
652       flags        : int;
653       waiters      : int;
654       mutex        : System.Address;
655    end record;
656    pragma Convention (C, pthread_cond_t);
657
658    type pthread_key_t is new int;
659
660 end System.OS_Interface;