Debian Codegraph @

gcc/ada/libgnarl/s-osinte__android.ads

raw
1 ------------------------------------------------------------------------------
2 -- --
3 -- GNAT 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 -- Copyright (C) 1995-2025, Free Software Foundation, Inc. --
10 -- --
11 -- GNAT 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 -- GNARL was developed by the GNARL team at Florida State University. --
28 -- Extensive contributions were provided by Ada Core Technologies, Inc. --
29 -- --
30 ------------------------------------------------------------------------------
31
32 -- This is an Android version of this package which is based on the
33 -- GNU/Linux version
34
35 -- This package encapsulates all direct interfaces to OS services
36 -- that are needed by the tasking run-time (libgnarl).
37
38 -- PLEASE DO NOT add any with-clauses to this package or remove the pragma
39 -- Preelaborate. This package is designed to be a bottom-level (leaf) package.
40
41 with Ada.Unchecked_Conversion;
42
43 with Interfaces.C;
44
45 with System.Linux;
46 with System.OS_Constants;
47 with System.OS_Locks;
48 with System.Parameters;
49
50 package System.OS_Interface is
51 pragma Preelaborate;
52
53 subtype int is Interfaces.C.int;
54 subtype char is Interfaces.C.char;
55 subtype short is Interfaces.C.short;
56 subtype long is Interfaces.C.long;
57 subtype unsigned is Interfaces.C.unsigned;
58 subtype unsigned_short is Interfaces.C.unsigned_short;
59 subtype unsigned_long is Interfaces.C.unsigned_long;
60 subtype unsigned_char is Interfaces.C.unsigned_char;
61 subtype plain_char is Interfaces.C.plain_char;
62 subtype size_t is Interfaces.C.size_t;
63
64 -----------
65 -- Errno --
66 -----------
67
68 function errno return int;
69 pragma Import (C, errno, "__get_errno");
70
71 EAGAIN : constant := System.Linux.EAGAIN;
72 EINTR : constant := System.Linux.EINTR;
73 EINVAL : constant := System.Linux.EINVAL;
74 ENOMEM : constant := System.Linux.ENOMEM;
75 EPERM : constant := System.Linux.EPERM;
76 ETIMEDOUT : constant := System.Linux.ETIMEDOUT;
77
78 -------------
79 -- Signals --
80 -------------
81
82 Max_Interrupt : constant := 31;
83 type Signal is new int range 0 .. Max_Interrupt;
84 for Signal'Size use int'Size;
85
86 SIGHUP : constant := System.Linux.SIGHUP;
87 SIGINT : constant := System.Linux.SIGINT;
88 SIGQUIT : constant := System.Linux.SIGQUIT;
89 SIGILL : constant := System.Linux.SIGILL;
90 SIGTRAP : constant := System.Linux.SIGTRAP;
91 SIGIOT : constant := System.Linux.SIGIOT;
92 SIGABRT : constant := System.Linux.SIGABRT;
93 SIGFPE : constant := System.Linux.SIGFPE;
94 SIGKILL : constant := System.Linux.SIGKILL;
95 SIGBUS : constant := System.Linux.SIGBUS;
96 SIGSEGV : constant := System.Linux.SIGSEGV;
97 SIGPIPE : constant := System.Linux.SIGPIPE;
98 SIGALRM : constant := System.Linux.SIGALRM;
99 SIGTERM : constant := System.Linux.SIGTERM;
100 SIGUSR1 : constant := System.Linux.SIGUSR1;
101 SIGUSR2 : constant := System.Linux.SIGUSR2;
102 SIGCLD : constant := System.Linux.SIGCLD;
103 SIGCHLD : constant := System.Linux.SIGCHLD;
104 SIGPWR : constant := System.Linux.SIGPWR;
105 SIGWINCH : constant := System.Linux.SIGWINCH;
106 SIGURG : constant := System.Linux.SIGURG;
107 SIGPOLL : constant := System.Linux.SIGPOLL;
108 SIGIO : constant := System.Linux.SIGIO;
109 SIGLOST : constant := System.Linux.SIGLOST;
110 SIGSTOP : constant := System.Linux.SIGSTOP;
111 SIGTSTP : constant := System.Linux.SIGTSTP;
112 SIGCONT : constant := System.Linux.SIGCONT;
113 SIGTTIN : constant := System.Linux.SIGTTIN;
114 SIGTTOU : constant := System.Linux.SIGTTOU;
115 SIGVTALRM : constant := System.Linux.SIGVTALRM;
116 SIGPROF : constant := System.Linux.SIGPROF;
117 SIGXCPU : constant := System.Linux.SIGXCPU;
118 SIGXFSZ : constant := System.Linux.SIGXFSZ;
119 SIGSYS : constant := System.Linux.SIGSYS;
120 SIGUNUSED : constant := System.Linux.SIGUNUSED;
121 SIGSTKFLT : constant := System.Linux.SIGSTKFLT;
122
123 SIGADAABORT : constant := SIGABRT;
124 -- Change this to use another signal for task abort. SIGTERM might be a
125 -- good one.
126
127 type Signal_Set is array (Natural range <>) of Signal;
128
129 Unmasked : constant Signal_Set := (
130 SIGTRAP,
131 -- To enable debugging on multithreaded applications, mark SIGTRAP to
132 -- be kept unmasked.
133
134 SIGBUS,
135
136 SIGTTIN, SIGTTOU, SIGTSTP,
137 -- Keep these three signals unmasked so that background processes and IO
138 -- behaves as normal "C" applications
139
140 SIGPROF,
141 -- To avoid confusing the profiler
142
143 SIGKILL, SIGSTOP);
144 -- These two signals actually can't be masked (POSIX won't allow it)
145
146 Reserved : constant Signal_Set := (SIGVTALRM, SIGUNUSED);
147 -- Not clear why these two signals are reserved. Perhaps they are not
148 -- supported by this version of GNU/Linux ???
149
150 type sigset_t is private;
151
152 function sigaddset (set : access sigset_t; sig : Signal) return int;
153 pragma Import (C, sigaddset, "_sigaddset");
154
155 function sigdelset (set : access sigset_t; sig : Signal) return int;
156 pragma Import (C, sigdelset, "_sigdelset");
157
158 function sigfillset (set : access sigset_t) return int;
159 pragma Import (C, sigfillset, "_sigfillset");
160
161 function sigismember (set : access sigset_t; sig : Signal) return int;
162 pragma Import (C, sigismember, "_sigismember");
163
164 function sigemptyset (set : access sigset_t) return int;
165 pragma Import (C, sigemptyset, "_sigemptyset");
166
167 type union_type_3 is new String (1 .. 116);
168 type siginfo_t is record
169 si_signo : int;
170 si_code : int;
171 si_errno : int;
172 X_data : union_type_3;
173 end record;
174 pragma Convention (C, siginfo_t);
175
176 type struct_sigaction is record
177 sa_handler : System.Address;
178 sa_mask : sigset_t;
179 sa_flags : Interfaces.C.int;
180 sa_restorer : System.Address;
181 end record;
182 pragma Convention (C, struct_sigaction);
183
184 type struct_sigaction_ptr is access all struct_sigaction;
185
186 SA_SIGINFO : constant := System.Linux.SA_SIGINFO;
187 SA_ONSTACK : constant := System.Linux.SA_ONSTACK;
188 SA_NODEFER : constant := System.Linux.SA_NODEFER;
189 SA_RESTART : constant := System.Linux.SA_RESTART;
190
191 SIG_BLOCK : constant := 0;
192 SIG_UNBLOCK : constant := 1;
193 SIG_SETMASK : constant := 2;
194
195 SIG_DFL : constant := 0;
196 SIG_IGN : constant := 1;
197
198 function sigaction
199 (sig : Signal;
200 act : struct_sigaction_ptr;
201 oact : struct_sigaction_ptr) return int;
202 pragma Import (C, sigaction, "sigaction");
203
204 ----------
205 -- Time --
206 ----------
207
208 Time_Slice_Supported : constant Boolean := True;
209 -- Indicates whether time slicing is supported
210
211 type timespec is private;
212
213 type clockid_t is new int;
214
215 function clock_gettime
216 (clock_id : clockid_t; tp : access timespec) return int;
217 pragma Import (C, clock_gettime, "clock_gettime");
218
219 function clock_getres
220 (clock_id : clockid_t;
221 res : access timespec) return int;
222 pragma Import (C, clock_getres, "clock_getres");
223
224 function To_Duration (TS : timespec) return Duration;
225 pragma Inline (To_Duration);
226
227 function To_Timespec (D : Duration) return timespec;
228 pragma Inline (To_Timespec);
229
230 function sysconf (name : int) return long;
231 pragma Import (C, sysconf);
232
233 SC_CLK_TCK : constant := 2;
234 SC_NPROCESSORS_ONLN : constant := 84;
235
236 -------------------------
237 -- Priority Scheduling --
238 -------------------------
239
240 SCHED_OTHER : constant := 0;
241 SCHED_FIFO : constant := 1;
242 SCHED_RR : constant := 2;
243
244 function To_Target_Priority
245 (Prio : System.Any_Priority)
246 return Interfaces.C.int is (Interfaces.C.int (Prio));
247 -- Maps System.Any_Priority to a POSIX priority
248
249 -------------
250 -- Process --
251 -------------
252
253 type pid_t is private;
254
255 function kill (pid : pid_t; sig : Signal) return int;
256 pragma Import (C, kill, "kill");
257
258 function getpid return pid_t;
259 pragma Import (C, getpid, "getpid");
260
261 -------------
262 -- Threads --
263 -------------
264
265 type Thread_Body is access
266 function (arg : System.Address) return System.Address;
267 pragma Convention (C, Thread_Body);
268
269 function Thread_Body_Access is new
270 Ada.Unchecked_Conversion (System.Address, Thread_Body);
271
272 type pthread_t is new unsigned_long;
273 subtype Thread_Id is pthread_t;
274
275 function To_pthread_t is
276 new Ada.Unchecked_Conversion (unsigned_long, pthread_t);
277
278 subtype pthread_mutex_t is System.OS_Locks.pthread_mutex_t;
279 type pthread_cond_t is limited private;
280 type pthread_attr_t is limited private;
281 type pthread_mutexattr_t is limited private;
282 type pthread_condattr_t is limited private;
283 type pthread_key_t is private;
284
285 PTHREAD_CREATE_DETACHED : constant := 1;
286
287 PTHREAD_SCOPE_PROCESS : constant := 1;
288 PTHREAD_SCOPE_SYSTEM : constant := 0;
289
290 -- Read/Write lock not supported on Android.
291
292 subtype pthread_rwlock_t is pthread_mutex_t;
293 subtype pthread_rwlockattr_t is pthread_mutexattr_t;
294
295 -----------
296 -- Stack --
297 -----------
298
299 type stack_t is record
300 ss_sp : System.Address;
301 ss_flags : int;
302 ss_size : size_t;
303 end record;
304 pragma Convention (C, stack_t);
305
306 function sigaltstack
307 (ss : not null access stack_t;
308 oss : access stack_t) return int;
309 pragma Import (C, sigaltstack, "sigaltstack");
310
311 Alternate_Stack : aliased System.Address;
312 pragma Import (C, Alternate_Stack, "__gnat_alternate_stack");
313 -- The alternate signal stack for stack overflows
314
315 Alternate_Stack_Size : constant := 16 * 1024;
316 -- This must be in keeping with init.c:__gnat_alternate_stack
317
318 Stack_Base_Available : constant Boolean := False;
319 -- Indicates whether the stack base is available on this target
320
321 function Get_Stack_Base (ignored_thread : pthread_t)
322 return Address is (Null_Address);
323 -- This is a dummy procedure to share some GNULLI files
324
325 function Get_Page_Size return int;
326 pragma Import (C, Get_Page_Size, "_getpagesize");
327 -- Returns the size of a page
328
329 PROT_NONE : constant := 0;
330 PROT_READ : constant := 1;
331 PROT_WRITE : constant := 2;
332 PROT_EXEC : constant := 4;
333 PROT_ALL : constant := PROT_READ + PROT_WRITE + PROT_EXEC;
334 PROT_ON : constant := PROT_READ;
335 PROT_OFF : constant := PROT_ALL;
336
337 function mprotect (addr : Address; len : size_t; prot : int) return int;
338 pragma Import (C, mprotect);
339
340 ---------------------------------------
341 -- Nonstandard Thread Initialization --
342 ---------------------------------------
343
344 procedure pthread_init is null;
345 -- This is a dummy procedure to share some GNULLI files
346
347 -------------------------
348 -- POSIX.1c Section 3 --
349 -------------------------
350
351 function sigwait (set : access sigset_t; sig : access Signal) return int;
352 pragma Import (C, sigwait, "sigwait");
353
354 function pthread_kill (thread : pthread_t; sig : Signal) return int;
355 pragma Import (C, pthread_kill, "pthread_kill");
356
357 function pthread_sigmask
358 (how : int;
359 set : access sigset_t;
360 oset : access sigset_t) return int;
361 pragma Import (C, pthread_sigmask, "sigprocmask");
362 -- pthread_sigmask maybe be broken due to mismatch between sigset_t and
363 -- kernel_sigset_t, substitute sigprocmask temporarily. ???
364 -- pragma Import (C, pthread_sigmask, "pthread_sigmask");
365
366 --------------------------
367 -- POSIX.1c Section 11 --
368 --------------------------
369
370 function pthread_mutexattr_init
371 (attr : access pthread_mutexattr_t) return int;
372 pragma Import (C, pthread_mutexattr_init, "pthread_mutexattr_init");
373
374 function pthread_mutexattr_destroy
375 (attr : access pthread_mutexattr_t) return int;
376 pragma Import (C, pthread_mutexattr_destroy, "pthread_mutexattr_destroy");
377
378 function pthread_mutex_init
379 (mutex : access pthread_mutex_t;
380 attr : access pthread_mutexattr_t) return int;
381 pragma Import (C, pthread_mutex_init, "pthread_mutex_init");
382
383 function pthread_mutex_destroy (mutex : access pthread_mutex_t) return int;
384 pragma Import (C, pthread_mutex_destroy, "pthread_mutex_destroy");
385
386 function pthread_mutex_lock (mutex : access pthread_mutex_t) return int;
387 pragma Import (C, pthread_mutex_lock, "pthread_mutex_lock");
388
389 function pthread_mutex_unlock (mutex : access pthread_mutex_t) return int;
390 pragma Import (C, pthread_mutex_unlock, "pthread_mutex_unlock");
391
392 function pthread_condattr_init
393 (attr : access pthread_condattr_t) return int;
394 pragma Import (C, pthread_condattr_init, "pthread_condattr_init");
395
396 function pthread_condattr_destroy
397 (attr : access pthread_condattr_t) return int;
398 pragma Import (C, pthread_condattr_destroy, "pthread_condattr_destroy");
399
400 function pthread_cond_init
401 (cond : access pthread_cond_t;
402 attr : access pthread_condattr_t) return int;
403 pragma Import (C, pthread_cond_init, "pthread_cond_init");
404
405 function pthread_cond_destroy (cond : access pthread_cond_t) return int;
406 pragma Import (C, pthread_cond_destroy, "pthread_cond_destroy");
407
408 function pthread_cond_signal (cond : access pthread_cond_t) return int;
409 pragma Import (C, pthread_cond_signal, "pthread_cond_signal");
410
411 function pthread_cond_wait
412 (cond : access pthread_cond_t;
413 mutex : access pthread_mutex_t) return int;
414 pragma Import (C, pthread_cond_wait, "pthread_cond_wait");
415
416 function pthread_cond_timedwait
417 (cond : access pthread_cond_t;
418 mutex : access pthread_mutex_t;
419 abstime : access timespec) return int;
420 pragma Import (C, pthread_cond_timedwait, "pthread_cond_timedwait");
421
422 --------------------------
423 -- POSIX.1c Section 13 --
424 --------------------------
425
426 PTHREAD_PRIO_PROTECT : constant := 0;
427 PTHREAD_PRIO_INHERIT : constant := 1;
428
429 function pthread_mutexattr_setprotocol
430 (ignored_attr : access pthread_mutexattr_t;
431 ignored_protocol : int) return int is (0);
432
433 function pthread_mutexattr_setprioceiling
434 (ignored_attr : access pthread_mutexattr_t;
435 ignored_prioceiling : int) return int is (0);
436
437 type struct_sched_param is record
438 sched_priority : int; -- scheduling priority
439 end record;
440 pragma Convention (C, struct_sched_param);
441
442 function pthread_setschedparam
443 (thread : pthread_t;
444 policy : int;
445 param : access struct_sched_param) return int;
446 pragma Import (C, pthread_setschedparam, "pthread_setschedparam");
447
448 function pthread_attr_setscope
449 (attr : access pthread_attr_t;
450 scope : int) return int;
451 pragma Import (C, pthread_attr_setscope, "pthread_attr_setscope");
452
453 function pthread_attr_setschedpolicy
454 (attr : access pthread_attr_t;
455 policy : int) return int;
456 pragma Import
457 (C, pthread_attr_setschedpolicy, "pthread_attr_setschedpolicy");
458
459 function sched_yield return int;
460 pragma Import (C, sched_yield, "sched_yield");
461
462 ---------------------------
463 -- P1003.1c - Section 16 --
464 ---------------------------
465
466 function pthread_attr_init
467 (attributes : access pthread_attr_t) return int;
468 pragma Import (C, pthread_attr_init, "pthread_attr_init");
469
470 function pthread_attr_destroy
471 (attributes : access pthread_attr_t) return int;
472 pragma Import (C, pthread_attr_destroy, "pthread_attr_destroy");
473
474 function pthread_attr_setdetachstate
475 (attr : access pthread_attr_t;
476 detachstate : int) return int;
477 pragma Import
478 (C, pthread_attr_setdetachstate, "pthread_attr_setdetachstate");
479
480 function pthread_attr_setstacksize
481 (attr : access pthread_attr_t;
482 stacksize : size_t) return int;
483 pragma Import (C, pthread_attr_setstacksize, "pthread_attr_setstacksize");
484
485 function pthread_create
486 (thread : access pthread_t;
487 attributes : access pthread_attr_t;
488 start_routine : Thread_Body;
489 arg : System.Address) return int;
490 pragma Import (C, pthread_create, "pthread_create");
491
492 procedure pthread_exit (status : System.Address);
493 pragma Import (C, pthread_exit, "pthread_exit");
494
495 function pthread_self return pthread_t;
496 pragma Import (C, pthread_self, "pthread_self");
497
498 function lwp_self return System.Address;
499 pragma Import (C, lwp_self, "__gnat_lwp_self");
500
501 --------------------------
502 -- POSIX.1c Section 17 --
503 --------------------------
504
505 function pthread_setspecific
506 (key : pthread_key_t;
507 value : System.Address) return int;
508 pragma Import (C, pthread_setspecific, "pthread_setspecific");
509
510 function pthread_getspecific (key : pthread_key_t) return System.Address;
511 pragma Import (C, pthread_getspecific, "pthread_getspecific");
512
513 type destructor_pointer is access procedure (arg : System.Address);
514 pragma Convention (C, destructor_pointer);
515
516 function pthread_key_create
517 (key : access pthread_key_t;
518 destructor : destructor_pointer) return int;
519 pragma Import (C, pthread_key_create, "pthread_key_create");
520
521 CPU_SETSIZE : constant := 1_024;
522 -- Size of the cpu_set_t mask on most linux systems (SUSE 11 uses 4_096).
523 -- This is kept for backward compatibility (System.Task_Info uses it), but
524 -- the run-time library does no longer rely on static masks, using
525 -- dynamically allocated masks instead.
526
527 type bit_field is array (1 .. CPU_SETSIZE) of Boolean;
528 for bit_field'Size use CPU_SETSIZE;
529 pragma Pack (bit_field);
530 pragma Convention (C, bit_field);
531
532 type cpu_set_t is record
533 bits : bit_field;
534 end record;
535 pragma Convention (C, cpu_set_t);
536
537 type cpu_set_t_ptr is access all cpu_set_t;
538 -- In the run-time library we use this pointer because the size of type
539 -- cpu_set_t varies depending on the glibc version. Hence, objects of type
540 -- cpu_set_t are allocated dynamically using the number of processors
541 -- available in the target machine (value obtained at execution time).
542
543 function CPU_ALLOC (count : size_t) return cpu_set_t_ptr;
544 pragma Import (C, CPU_ALLOC, "__gnat_cpu_alloc");
545 -- Wrapper around the CPU_ALLOC C macro
546
547 function CPU_ALLOC_SIZE (count : size_t) return size_t;
548 pragma Import (C, CPU_ALLOC_SIZE, "__gnat_cpu_alloc_size");
549 -- Wrapper around the CPU_ALLOC_SIZE C macro
550
551 procedure CPU_FREE (cpuset : cpu_set_t_ptr);
552 pragma Import (C, CPU_FREE, "__gnat_cpu_free");
553 -- Wrapper around the CPU_FREE C macro
554
555 procedure CPU_ZERO (count : size_t; cpuset : cpu_set_t_ptr);
556 pragma Import (C, CPU_ZERO, "__gnat_cpu_zero");
557 -- Wrapper around the CPU_ZERO_S C macro
558
559 procedure CPU_SET (cpu : int; count : size_t; cpuset : cpu_set_t_ptr);
560 pragma Import (C, CPU_SET, "__gnat_cpu_set");
561 -- Wrapper around the CPU_SET_S C macro
562
563 function pthread_setaffinity_np
564 (thread : pthread_t;
565 cpusetsize : size_t;
566 cpuset : cpu_set_t_ptr) return int;
567 pragma Import (C, pthread_setaffinity_np, "pthread_setaffinity_np");
568 pragma Weak_External (pthread_setaffinity_np);
569 -- Use a weak symbol because this function may be available or not,
570 -- depending on the version of the system.
571
572 function pthread_attr_setaffinity_np
573 (attr : access pthread_attr_t;
574 cpusetsize : size_t;
575 cpuset : cpu_set_t_ptr) return int;
576 pragma Import (C, pthread_attr_setaffinity_np,
577 "pthread_attr_setaffinity_np");
578 pragma Weak_External (pthread_attr_setaffinity_np);
579 -- Use a weak symbol because this function may be available or not,
580 -- depending on the version of the system.
581
582 private
583
584 type sigset_t is
585 array (0 .. OS_Constants.SIZEOF_sigset - 1) of unsigned_char;
586 pragma Convention (C, sigset_t);
587 for sigset_t'Alignment use Interfaces.C.unsigned_long'Alignment;
588
589 pragma Warnings (Off);
590 for struct_sigaction use record
591 sa_handler at Linux.sa_handler_pos range 0 .. Standard'Address_Size - 1;
592 sa_mask at Linux.sa_mask_pos
593 range 0 .. OS_Constants.SIZEOF_sigset * 8 - 1;
594 sa_flags at Linux.sa_flags_pos
595 range 0 .. Interfaces.C.int'Size - 1;
596 end record;
597 -- We intentionally leave sa_restorer unspecified and let the compiler
598 -- append it after the last field, so disable corresponding warning.
599 pragma Warnings (On);
600
601 type pid_t is new int;
602
603 type time_t is range -2 ** (System.Parameters.time_t_bits - 1)
604 .. 2 ** (System.Parameters.time_t_bits - 1) - 1;
605
606 type timespec is record
607 tv_sec : time_t;
608 tv_nsec : long;
609 end record;
610 pragma Convention (C, timespec);
611
612 type unsigned_long_long_t is mod 2 ** 64;
613 -- Local type only used to get the alignment of this type below
614
615 subtype char_array is Interfaces.C.char_array;
616
617 type pthread_attr_t is record
618 Data : char_array (1 .. OS_Constants.PTHREAD_ATTR_SIZE);
619 end record;
620 pragma Convention (C, pthread_attr_t);
621 for pthread_attr_t'Alignment use Interfaces.C.unsigned_long'Alignment;
622
623 type pthread_condattr_t is record
624 Data : char_array (1 .. OS_Constants.PTHREAD_CONDATTR_SIZE);
625 end record;
626 pragma Convention (C, pthread_condattr_t);
627 for pthread_condattr_t'Alignment use Interfaces.C.int'Alignment;
628
629 type pthread_mutexattr_t is record
630 Data : char_array (1 .. OS_Constants.PTHREAD_MUTEXATTR_SIZE);
631 end record;
632 pragma Convention (C, pthread_mutexattr_t);
633 for pthread_mutexattr_t'Alignment use Interfaces.C.int'Alignment;
634
635 type pthread_cond_t is record
636 Data : char_array (1 .. OS_Constants.PTHREAD_COND_SIZE);
637 end record;
638 pragma Convention (C, pthread_cond_t);
639 for pthread_cond_t'Alignment use unsigned_long_long_t'Alignment;
640
641 type pthread_key_t is new unsigned;
642
643 end System.OS_Interface;