2 ------------------------------------------------------------------------------
4 -- GNAT COMPILER COMPONENTS --
6 -- S Y S T E M . O S _ C O N S T A N T S --
10 -- Copyright (C) 2000-2012, Free Software Foundation, Inc. --
12 -- GNAT is free software; you can redistribute it and/or modify it under --
13 -- terms of the GNU General Public License as published by the Free Soft- --
14 -- ware Foundation; either version 3, or (at your option) any later ver- --
15 -- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
16 -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
17 -- or FITNESS FOR A PARTICULAR PURPOSE. --
19 -- As a special exception under Section 7 of GPL version 3, you are granted --
20 -- additional permissions described in the GCC Runtime Library Exception, --
21 -- version 3.1, as published by the Free Software Foundation. --
23 -- You should have received a copy of the GNU General Public License and --
24 -- a copy of the GCC Runtime Library Exception along with this program; --
25 -- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
26 -- <http://www.gnu.org/licenses/>. --
28 -- GNAT was originally developed by the GNAT team at New York University. --
29 -- Extensive contributions were provided by Ada Core Technologies Inc. --
31 ------------------------------------------------------------------------------
33 pragma Style_Checks ("M32766");
39 ** This template file is used while building the GNAT runtime library to
40 ** generate package System.OS_Constants (s-oscons.ads).
42 ** The generation process is:
43 ** 1. the platform-independent extraction tool xoscons is built with the
44 ** base native compiler
45 ** 2. this template is processed by the cross C compiler to produce
46 ** a list of constant values
47 ** 3. the comments in this template and the list of values are processed
48 ** by xoscons to generate s-oscons.ads.
50 ** Any comment occurring in this file whose start and end markers are on
51 ** a line by themselves (see above) is copied verbatim to s-oscons.ads.
52 ** All other comments are ignored. Note that the build process first passes
53 ** this file through the C preprocessor, so comments that occur in a section
54 ** that is conditioned by a #if directive will be copied to the output only
57 ** Two methods are supported to generate the list of constant values,
60 ** The default one assumes that the template can be compiled by the newly-
61 ** built cross compiler. It uses markup produced in the (pseudo-)assembly
64 ** xgcc -DTARGET=\"$target\" -C -E s-oscons-tmplt.c > s-oscons-tmplt.i
65 ** xgcc -S s-oscons-tmplt.i
68 ** Alternatively, if s-oscons-tmplt.c must be compiled with a proprietary
69 ** compiler (e.g. the native DEC CC on OpenVMS), the NATIVE macro should
70 ** be defined, and the resulting program executed:
72 ** $ CC/DEFINE=("TARGET=""OpenVMS""",NATIVE)
73 ** /PREPROCESS_ONLY /COMMENTS=AS_IS s-oscons-tmplt
74 ** $ CC/DEFINE=("TARGET=""OpenVMS""",NATIVE) s-oscons-tmplt
75 ** $ LINK s-oscons-tmplt
76 ** $ DEFINE/USER SYS$OUTPUT s-oscons-tmplt.s
77 ** $ RUN s-oscons-tmplt
81 /* Feature macro definitions */
83 #if defined (__linux__) && !defined (_XOPEN_SOURCE)
84 /** For Linux _XOPEN_SOURCE must be defined, otherwise IOV_MAX is not defined
86 #define _XOPEN_SOURCE 500
89 /* Include gsocket.h before any system header so it can redefine FD_SETSIZE */
100 /** VMS is unable to do vector IO operations with default value of IOV_MAX,
101 ** so its value is redefined to a small one which is known to work properly.
107 #if ! (defined (__vxworks) || defined (__VMS) || defined (__MINGW32__) || \
108 defined (__nucleus__))
109 # define HAVE_TERMIOS
112 #if defined (__vxworks)
115 ** For VxWorks, always include vxWorks.h (gsocket.h provides it only for
116 ** the case of runtime libraries that support sockets).
119 # include <vxWorks.h>
124 # if defined (TARGET)
125 # error TARGET may not be defined when generating the dummy version
127 # define TARGET "batch runtime compilation (dummy values)"
130 # if !(defined (HAVE_SOCKETS) && defined (HAVE_TERMIOS))
131 # error Features missing on platform
139 # error Please define TARGET
147 # include <termios.h>
155 # include <pthread.h>
160 # include <winbase.h>
168 # define _VAL(x) counter++
173 #define CND(name,comment) \
174 printf ("\n->CND:$%d:" #name ":$%d:" comment, __LINE__, ((int) _VAL (name)));
176 #define CNU(name,comment) \
177 printf ("\n->CNU:$%d:" #name ":$%u:" comment, __LINE__, ((unsigned int) _VAL (name)));
179 #define CNS(name,comment) \
180 printf ("\n->CNS:$%d:" #name ":" name ":" comment, __LINE__);
182 #define C(sname,type,value,comment)\
183 printf ("\n->C:$%d:" sname ":" #type ":" value ":" comment, __LINE__);
186 printf ("\n->SUB:$%d:" #sname ":" sname, __LINE__);
189 printf ("\n->TXT:$%d:" text, __LINE__);
193 #define CND(name, comment) \
194 asm volatile("\n->CND:%0:" #name ":%1:" comment \
195 : : "i" (__LINE__), "i" ((int) name));
196 /* Decimal constant in the range of type "int" */
198 #define CNU(name, comment) \
199 asm volatile("\n->CNU:%0:" #name ":%1:" comment \
200 : : "i" (__LINE__), "i" ((int) name));
201 /* Decimal constant in the range of type "unsigned int" (note, assembler
202 * always wants a signed int, we convert back in xoscons).
205 #define CNS(name, comment) \
206 asm volatile("\n->CNS:%0:" #name ":" name ":" comment \
208 /* General expression named number */
210 #define C(sname, type, value, comment) \
211 asm volatile("\n->C:%0:" sname ":" #type ":" value ":" comment \
216 asm volatile("\n->SUB:%0:" #sname ":" sname \
221 asm volatile("\n->TXT:%0:" text \
227 #define CST(name,comment) C(#name,String,name,comment)
228 /* String constant */
230 #define STR(x) STR1(x)
234 unsigned int _CRT_fmode = _O_BINARY;
241 -- This package provides target dependent definitions of constant for use
242 -- by the GNAT runtime library. This package should not be directly with'd
243 -- by an application program.
245 -- This file is generated automatically, do not modify it by hand! Instead,
246 -- make changes to s-oscons-tmplt.c and rebuild the GNAT runtime library.
250 ** Do not change the format of the line below without also updating the
253 TXT("-- This is the version for " TARGET)
255 TXT("with Interfaces.C;")
258 package System.OS_Constants is
264 ** General constants (all platforms)
269 ---------------------------------
270 -- General platform parameters --
271 ---------------------------------
273 type OS_Type is (Windows, VMS, Other_OS);
275 #if defined (__MINGW32__)
276 # define TARGET_OS "Windows"
277 #elif defined (__VMS)
278 # define TARGET_OS "VMS"
280 # define TARGET_OS "Other_OS"
282 C("Target_OS", OS_Type, TARGET_OS, "")
284 pragma Warnings (Off, Target_OS);
285 -- Suppress warnings on Target_OS since it is in general tested for
286 -- equality with a constant value to implement conditional compilation,
287 -- which normally generates a constant condition warning.
290 #define Target_Name TARGET
294 ** Note: the name of the following constant is recognized specially by
295 ** xoscons (case sensitive).
297 #define SIZEOF_unsigned_int sizeof (unsigned int)
298 CND(SIZEOF_unsigned_int, "Size of unsigned int")
309 # define IOV_MAX INT_MAX
311 CND(IOV_MAX, "Maximum writev iovcnt")
315 ---------------------
316 -- File open modes --
317 ---------------------
324 CND(O_RDWR, "Read/write")
329 CND(O_NOCTTY, "Don't change ctrl tty")
334 CND(O_NDELAY, "Nonblocking")
338 ----------------------
339 -- Fcntl operations --
340 ----------------------
347 CND(F_GETFL, "Get flags")
352 CND(F_SETFL, "Set flags")
365 CND(FNDELAY, "Nonblocking")
369 ----------------------
370 -- Ioctl operations --
371 ----------------------
375 /* ioctl(2) requests are "int" in UNIX, but "unsigned long" on FreeBSD */
379 # define IOCTL_Req_T "unsigned"
382 # define IOCTL_Req_T "int"
390 CNI(FIONBIO, "Set/clear non-blocking io")
395 CNI(FIONREAD, "How many bytes to read")
403 -- The following constants are defined from <errno.h>
409 CND(EAGAIN, "Try again")
414 CND(ENOENT, "File not found")
419 CND(ENOMEM, "Out of memory")
424 -- The following constants are defined from <winsock2.h> (WSA*)
429 ** For sockets-related errno values on Windows, gsocket.h redefines
438 CND(EACCES, "Permission denied")
441 # define EADDRINUSE -1
443 CND(EADDRINUSE, "Address already in use")
445 #ifndef EADDRNOTAVAIL
446 # define EADDRNOTAVAIL -1
448 CND(EADDRNOTAVAIL, "Cannot assign address")
451 # define EAFNOSUPPORT -1
453 CND(EAFNOSUPPORT, "Addr family not supported")
458 CND(EALREADY, "Operation in progress")
463 CND(EBADF, "Bad file descriptor")
466 # define ECONNABORTED -1
468 CND(ECONNABORTED, "Connection aborted")
471 # define ECONNREFUSED -1
473 CND(ECONNREFUSED, "Connection refused")
476 # define ECONNRESET -1
478 CND(ECONNRESET, "Connection reset by peer")
481 # define EDESTADDRREQ -1
483 CND(EDESTADDRREQ, "Destination addr required")
488 CND(EFAULT, "Bad address")
491 # define EHOSTDOWN -1
493 CND(EHOSTDOWN, "Host is down")
496 # define EHOSTUNREACH -1
498 CND(EHOSTUNREACH, "No route to host")
501 # define EINPROGRESS -1
503 CND(EINPROGRESS, "Operation now in progress")
508 CND(EINTR, "Interrupted system call")
513 CND(EINVAL, "Invalid argument")
518 CND(EIO, "Input output error")
523 CND(EISCONN, "Socket already connected")
528 CND(ELOOP, "Too many symbolic links")
533 CND(EMFILE, "Too many open files")
538 CND(EMSGSIZE, "Message too long")
541 # define ENAMETOOLONG -1
543 CND(ENAMETOOLONG, "Name too long")
548 CND(ENETDOWN, "Network is down")
551 # define ENETRESET -1
553 CND(ENETRESET, "Disconn. on network reset")
556 # define ENETUNREACH -1
558 CND(ENETUNREACH, "Network is unreachable")
563 CND(ENOBUFS, "No buffer space available")
566 # define ENOPROTOOPT -1
568 CND(ENOPROTOOPT, "Protocol not available")
573 CND(ENOTCONN, "Socket not connected")
578 CND(ENOTSOCK, "Operation on non socket")
581 # define EOPNOTSUPP -1
583 CND(EOPNOTSUPP, "Operation not supported")
588 CND(EPIPE, "Broken pipe")
591 # define EPFNOSUPPORT -1
593 CND(EPFNOSUPPORT, "Unknown protocol family")
595 #ifndef EPROTONOSUPPORT
596 # define EPROTONOSUPPORT -1
598 CND(EPROTONOSUPPORT, "Unknown protocol")
601 # define EPROTOTYPE -1
603 CND(EPROTOTYPE, "Unknown protocol type")
608 CND(ERANGE, "Result too large")
611 # define ESHUTDOWN -1
613 CND(ESHUTDOWN, "Cannot send once shutdown")
615 #ifndef ESOCKTNOSUPPORT
616 # define ESOCKTNOSUPPORT -1
618 CND(ESOCKTNOSUPPORT, "Socket type not supported")
621 # define ETIMEDOUT -1
623 CND(ETIMEDOUT, "Connection timed out")
626 # define ETOOMANYREFS -1
628 CND(ETOOMANYREFS, "Too many references")
631 # define EWOULDBLOCK -1
633 CND(EWOULDBLOCK, "Operation would block")
638 CND(E2BIG, "Argument list too long")
643 CND(EILSEQ, "Illegal byte sequence")
646 ** Terminal/serial I/O constants
649 #if defined(HAVE_TERMIOS) || defined(__MINGW32__)
652 ----------------------
653 -- Terminal control --
654 ----------------------
664 CND(TCSANOW, "Immediate")
669 CND(TCIFLUSH, "Flush input")
674 CNU(IXON, "Output sw flow control")
684 CNU(CRTSCTS, "Output hw flow control")
694 CNU(CS5, "5 data bits")
699 CNU(CS6, "6 data bits")
704 CNU(CS7, "7 data bits")
709 CNU(CS8, "8 data bits")
714 CNU(CSTOPB, "2 stop bits")
719 CNU(PARENB, "Parity enable")
724 CNU(PARODD, "Parity odd")
774 CNU(B1200, "1200 bps")
779 CNU(B1800, "1800 bps")
784 CNU(B2400, "2400 bps")
789 CNU(B4800, "4800 bps")
794 CNU(B9600, "9600 bps")
799 CNU(B19200, "19200 bps")
804 CNU(B38400, "38400 bps")
809 CNU(B57600, "57600 bps")
814 CNU(B115200, "115200 bps")
819 CNU(B230400, "230400 bps")
824 CNU(B460800, "460800 bps")
829 CNU(B500000, "500000 bps")
834 CNU(B576000, "576000 bps")
839 CNU(B921600, "921600 bps")
844 CNU(B1000000, "1000000 bps")
849 CNU(B1152000, "1152000 bps")
854 CNU(B1500000, "1500000 bps")
859 CNU(B2000000, "2000000 bps")
864 CNU(B2500000, "2500000 bps")
869 CNU(B3000000, "3000000 bps")
874 CNU(B3500000, "3500000 bps")
879 CNU(B4000000, "4000000 bps")
883 ---------------------------------
884 -- Terminal control characters --
885 ---------------------------------
892 CND(VINTR, "Interrupt")
917 CND(VTIME, "Read timeout")
922 CND(VMIN, "Read min chars")
932 CND(VSTART, "Flow control start")
937 CND(VSTOP, "Flow control stop")
942 CND(VSUSP, "Suspend")
952 CND(VREPRINT, "Reprint unread")
957 CND(VDISCARD, "Discard pending")
962 CND(VWERASE, "Word erase")
967 CND(VLNEXT, "Literal next")
972 CND(VEOL2, "Alternative EOL")
974 #endif /* HAVE_TERMIOS */
977 CNU(DTR_CONTROL_ENABLE, "Enable DTR flow ctrl")
978 CNU(RTS_CONTROL_ENABLE, "Enable RTS flow ctrl")
983 -----------------------------
984 -- Pseudo terminal library --
985 -----------------------------
989 #if defined (__FreeBSD__) || defined (linux)
990 # define PTY_Library "-lutil"
992 # define PTY_Library ""
994 CST(PTY_Library, "for g-exptty")
1013 CND(AF_INET, "IPv4 address family")
1016 ** RTEMS lies and defines AF_INET6 even though there is no IPV6 support.
1017 ** Its TCP/IP stack is in transition. It has newer .h files but no IPV6 yet.
1019 #if defined(__rtems__)
1024 # define AF_INET6 -1
1026 # define HAVE_AF_INET6 1
1028 CND(AF_INET6, "IPv6 address family")
1039 # define SOCK_STREAM -1
1041 CND(SOCK_STREAM, "Stream socket")
1044 # define SOCK_DGRAM -1
1046 CND(SOCK_DGRAM, "Datagram socket")
1056 #ifndef HOST_NOT_FOUND
1057 # define HOST_NOT_FOUND -1
1059 CND(HOST_NOT_FOUND, "Unknown host")
1062 # define TRY_AGAIN -1
1064 CND(TRY_AGAIN, "Host name lookup failure")
1069 CND(NO_DATA, "No data record for name")
1072 # define NO_RECOVERY -1
1074 CND(NO_RECOVERY, "Non recoverable errors")
1078 --------------------
1079 -- Shutdown modes --
1080 --------------------
1087 CND(SHUT_RD, "No more recv")
1092 CND(SHUT_WR, "No more send")
1095 # define SHUT_RDWR -1
1097 CND(SHUT_RDWR, "No more recv/send")
1101 ---------------------
1102 -- Protocol levels --
1103 ---------------------
1108 # define SOL_SOCKET -1
1110 CND(SOL_SOCKET, "Options for socket level")
1113 # define IPPROTO_IP -1
1115 CND(IPPROTO_IP, "Dummy protocol for IP")
1118 # define IPPROTO_UDP -1
1120 CND(IPPROTO_UDP, "UDP")
1123 # define IPPROTO_TCP -1
1125 CND(IPPROTO_TCP, "TCP")
1138 CND(MSG_OOB, "Process out-of-band data")
1141 # define MSG_PEEK -1
1143 CND(MSG_PEEK, "Peek at incoming data")
1148 CND(MSG_EOR, "Send end of record")
1152 /* The value of MSG_WAITALL is 8. Nevertheless winsock.h doesn't
1153 define it, but it is still usable as we link to winsock2 API. */
1154 # define MSG_WAITALL (1 << 3)
1156 # define MSG_WAITALL -1
1159 CND(MSG_WAITALL, "Wait for full reception")
1161 #ifndef MSG_NOSIGNAL
1162 # define MSG_NOSIGNAL -1
1164 CND(MSG_NOSIGNAL, "No SIGPIPE on send")
1167 # define MSG_Forced_Flags "MSG_NOSIGNAL"
1169 # define MSG_Forced_Flags "0"
1171 CNS(MSG_Forced_Flags, "")
1173 -- Flags set on all send(2) calls
1178 --------------------
1179 -- Socket options --
1180 --------------------
1185 # define TCP_NODELAY -1
1187 CND(TCP_NODELAY, "Do not coalesce packets")
1189 #ifndef SO_REUSEADDR
1190 # define SO_REUSEADDR -1
1192 CND(SO_REUSEADDR, "Bind reuse local address")
1194 #ifndef SO_REUSEPORT
1195 # define SO_REUSEPORT -1
1197 CND(SO_REUSEPORT, "Bind reuse port number")
1199 #ifndef SO_KEEPALIVE
1200 # define SO_KEEPALIVE -1
1202 CND(SO_KEEPALIVE, "Enable keep-alive msgs")
1205 # define SO_LINGER -1
1207 CND(SO_LINGER, "Defer close to flush data")
1209 #ifndef SO_BROADCAST
1210 # define SO_BROADCAST -1
1212 CND(SO_BROADCAST, "Can send broadcast msgs")
1215 # define SO_SNDBUF -1
1217 CND(SO_SNDBUF, "Set/get send buffer size")
1220 # define SO_RCVBUF -1
1222 CND(SO_RCVBUF, "Set/get recv buffer size")
1225 # define SO_SNDTIMEO -1
1227 CND(SO_SNDTIMEO, "Emission timeout")
1230 # define SO_RCVTIMEO -1
1232 CND(SO_RCVTIMEO, "Reception timeout")
1235 # define SO_ERROR -1
1237 CND(SO_ERROR, "Get/clear error status")
1239 #ifndef IP_MULTICAST_IF
1240 # define IP_MULTICAST_IF -1
1242 CND(IP_MULTICAST_IF, "Set/get mcast interface")
1244 #ifndef IP_MULTICAST_TTL
1245 # define IP_MULTICAST_TTL -1
1247 CND(IP_MULTICAST_TTL, "Set/get multicast TTL")
1249 #ifndef IP_MULTICAST_LOOP
1250 # define IP_MULTICAST_LOOP -1
1252 CND(IP_MULTICAST_LOOP, "Set/get mcast loopback")
1254 #ifndef IP_ADD_MEMBERSHIP
1255 # define IP_ADD_MEMBERSHIP -1
1257 CND(IP_ADD_MEMBERSHIP, "Join a multicast group")
1259 #ifndef IP_DROP_MEMBERSHIP
1260 # define IP_DROP_MEMBERSHIP -1
1262 CND(IP_DROP_MEMBERSHIP, "Leave a multicast group")
1265 # define IP_PKTINFO -1
1267 CND(IP_PKTINFO, "Get datagram info")
1271 ----------------------
1272 -- Type definitions --
1273 ----------------------
1280 -- Sizes (in bytes) of the components of struct timeval
1282 #define SIZEOF_tv_sec (sizeof tv.tv_sec)
1283 CND(SIZEOF_tv_sec, "tv_sec")
1284 #define SIZEOF_tv_usec (sizeof tv.tv_usec)
1285 CND(SIZEOF_tv_usec, "tv_usec")
1288 -- Maximum allowed value for tv_sec
1292 ** On Solaris, field tv_sec in struct timeval has an undocumented
1293 ** hard-wired limit of 100 million.
1294 ** On IA64 HP-UX the limit is 2**31 - 1.
1297 # define MAX_tv_sec "100_000_000"
1299 #elif defined (__hpux__)
1300 # define MAX_tv_sec "16#7fffffff#"
1303 # define MAX_tv_sec "2 ** (SIZEOF_tv_sec * 8 - 1) - 1"
1309 -- Sizes of various data types
1312 #define SIZEOF_sockaddr_in (sizeof (struct sockaddr_in))
1313 CND(SIZEOF_sockaddr_in, "struct sockaddr_in")
1314 #ifdef HAVE_AF_INET6
1315 # define SIZEOF_sockaddr_in6 (sizeof (struct sockaddr_in6))
1317 # define SIZEOF_sockaddr_in6 0
1319 CND(SIZEOF_sockaddr_in6, "struct sockaddr_in6")
1321 #define SIZEOF_fd_set (sizeof (fd_set))
1322 CND(SIZEOF_fd_set, "fd_set");
1323 CND(FD_SETSIZE, "Max fd value");
1325 #define SIZEOF_struct_hostent (sizeof (struct hostent))
1326 CND(SIZEOF_struct_hostent, "struct hostent");
1328 #define SIZEOF_struct_servent (sizeof (struct servent))
1329 CND(SIZEOF_struct_servent, "struct servent");
1331 #if defined (__linux__)
1332 #define SIZEOF_sigset (sizeof (sigset_t))
1333 CND(SIZEOF_sigset, "sigset");
1338 -- Fields of struct msghdr
1341 #if defined (__sun__) || defined (__hpux__)
1342 # define Msg_Iovlen_T "int"
1344 # define Msg_Iovlen_T "size_t"
1351 ----------------------------------------
1352 -- Properties of supported interfaces --
1353 ----------------------------------------
1357 CND(Need_Netdb_Buffer, "Need buffer for Netdb ops")
1358 CND(Need_Netdb_Lock, "Need lock for Netdb ops")
1359 CND(Has_Sockaddr_Len, "Sockaddr has sa_len field")
1362 ** Do not change the format of the line below without also updating the
1365 C("Thread_Blocking_IO", Boolean, "True", "")
1367 -- Set False for contexts where socket i/o are process blocking
1371 #ifdef HAVE_INET_PTON
1372 # define Inet_Pton_Linkname "inet_pton"
1374 # define Inet_Pton_Linkname "__gnat_inet_pton"
1376 CST(Inet_Pton_Linkname, "")
1378 #endif /* HAVE_SOCKETS */
1382 ---------------------
1383 -- Threads support --
1384 ---------------------
1386 -- Clock identifier definitions
1390 /* Note: On HP-UX, CLOCK_REALTIME is an enum, not a macro. */
1392 #if defined(CLOCK_REALTIME) || defined (__hpux__)
1393 # define HAVE_CLOCK_REALTIME
1396 #ifdef HAVE_CLOCK_REALTIME
1397 CND(CLOCK_REALTIME, "System realtime clock")
1400 #ifdef CLOCK_MONOTONIC
1401 CND(CLOCK_MONOTONIC, "System monotonic clock")
1404 #ifdef CLOCK_FASTEST
1405 CND(CLOCK_FASTEST, "Fastest clock")
1408 #ifndef CLOCK_THREAD_CPUTIME_ID
1409 # define CLOCK_THREAD_CPUTIME_ID -1
1411 CND(CLOCK_THREAD_CPUTIME_ID, "Thread CPU clock")
1413 #if defined(__APPLE__)
1414 /* There's no clock_gettime or clock_id's on Darwin, generate a dummy value */
1415 # define CLOCK_RT_Ada "-1"
1417 #elif defined(__FreeBSD__) || defined(_AIX)
1418 /** On these platforms use system provided monotonic clock instead of
1419 ** the default CLOCK_REALTIME. We then need to set up cond var attributes
1420 ** appropriately (see thread.c).
1422 # define CLOCK_RT_Ada "CLOCK_MONOTONIC"
1423 # define NEED_PTHREAD_CONDATTR_SETCLOCK
1425 #elif defined(HAVE_CLOCK_REALTIME)
1426 /* By default use CLOCK_REALTIME */
1427 # define CLOCK_RT_Ada "CLOCK_REALTIME"
1431 CNS(CLOCK_RT_Ada, "")
1434 #if defined (__APPLE__) || defined (__linux__) || defined (DUMMY)
1437 -- Sizes of pthread data types
1441 #if defined (__APPLE__) || defined (DUMMY)
1443 -- (on Darwin, these are just placeholders)
1446 #define PTHREAD_SIZE __PTHREAD_SIZE__
1447 #define PTHREAD_ATTR_SIZE __PTHREAD_ATTR_SIZE__
1448 #define PTHREAD_MUTEXATTR_SIZE __PTHREAD_MUTEXATTR_SIZE__
1449 #define PTHREAD_MUTEX_SIZE __PTHREAD_MUTEX_SIZE__
1450 #define PTHREAD_CONDATTR_SIZE __PTHREAD_CONDATTR_SIZE__
1451 #define PTHREAD_COND_SIZE __PTHREAD_COND_SIZE__
1452 #define PTHREAD_RWLOCKATTR_SIZE __PTHREAD_RWLOCKATTR_SIZE__
1453 #define PTHREAD_RWLOCK_SIZE __PTHREAD_RWLOCK_SIZE__
1454 #define PTHREAD_ONCE_SIZE __PTHREAD_ONCE_SIZE__
1456 #define PTHREAD_SIZE (sizeof (pthread_t))
1457 #define PTHREAD_ATTR_SIZE (sizeof (pthread_attr_t))
1458 #define PTHREAD_MUTEXATTR_SIZE (sizeof (pthread_mutexattr_t))
1459 #define PTHREAD_MUTEX_SIZE (sizeof (pthread_mutex_t))
1460 #define PTHREAD_CONDATTR_SIZE (sizeof (pthread_condattr_t))
1461 #define PTHREAD_COND_SIZE (sizeof (pthread_cond_t))
1462 #define PTHREAD_RWLOCKATTR_SIZE (sizeof (pthread_rwlockattr_t))
1463 #define PTHREAD_RWLOCK_SIZE (sizeof (pthread_rwlock_t))
1464 #define PTHREAD_ONCE_SIZE (sizeof (pthread_once_t))
1467 CND(PTHREAD_SIZE, "pthread_t")
1468 CND(PTHREAD_ATTR_SIZE, "pthread_attr_t")
1469 CND(PTHREAD_MUTEXATTR_SIZE, "pthread_mutexattr_t")
1470 CND(PTHREAD_MUTEX_SIZE, "pthread_mutex_t")
1471 CND(PTHREAD_CONDATTR_SIZE, "pthread_condattr_t")
1472 CND(PTHREAD_COND_SIZE, "pthread_cond_t")
1473 CND(PTHREAD_RWLOCKATTR_SIZE, "pthread_rwlockattr_t")
1474 CND(PTHREAD_RWLOCK_SIZE, "pthread_rwlock_t")
1475 CND(PTHREAD_ONCE_SIZE, "pthread_once_t")
1477 #endif /* __APPLE__ || __linux__ */
1480 ** System-specific constants follow
1481 ** Each section should be activated if compiling for the corresponding
1482 ** platform *or* generating the dummy version for runtime test compilation.
1485 #if defined (__vxworks) || defined (DUMMY)
1489 --------------------------------
1490 -- VxWorks-specific constants --
1491 --------------------------------
1493 -- These constants may be used only within the VxWorks version of
1494 -- GNAT.Sockets.Thin.
1497 CND(OK, "VxWorks generic success")
1498 CND(ERROR, "VxWorks generic error")
1500 #endif /* __vxworks */
1502 #if defined (__MINGW32__) || defined (DUMMY)
1505 ------------------------------
1506 -- MinGW-specific constants --
1507 ------------------------------
1509 -- These constants may be used only within the MinGW version of
1510 -- GNAT.Sockets.Thin.
1513 CND(WSASYSNOTREADY, "System not ready")
1514 CND(WSAVERNOTSUPPORTED, "Version not supported")
1515 CND(WSANOTINITIALISED, "Winsock not initialized")
1516 CND(WSAEDISCON, "Disconnected")
1518 #endif /* __MINGW32__ */
1521 ** End of constants definitions
1530 end System.OS_Constants;