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->TXT:$%d:" text, __LINE__);
190 #define CND(name, comment) \
191 asm volatile("\n->CND:%0:" #name ":%1:" comment \
192 : : "i" (__LINE__), "i" ((int) name));
193 /* Decimal constant in the range of type "int" */
195 #define CNU(name, comment) \
196 asm volatile("\n->CNU:%0:" #name ":%1:" comment \
197 : : "i" (__LINE__), "i" ((int) name));
198 /* Decimal constant in the range of type "unsigned int" (note, assembler
199 * always wants a signed int, we convert back in xoscons).
202 #define CNS(name, comment) \
203 asm volatile("\n->CNS:%0:" #name ":" name ":" comment \
205 /* General expression named number */
207 #define C(sname, type, value, comment) \
208 asm volatile("\n->C:%0:" sname ":" #type ":" value ":" comment \
213 asm volatile("\n->TXT:%0:" text \
219 #define CST(name,comment) C(#name,String,name,comment)
221 #define STR(x) STR1(x)
225 unsigned int _CRT_fmode
= _O_BINARY
;
232 -- This package provides target dependent definitions of constant for use
233 -- by the GNAT runtime library. This package should not be directly with'd
234 -- by an application program.
236 -- This file is generated automatically, do not modify it by hand! Instead,
237 -- make changes to s-oscons-tmplt.c and rebuild the GNAT runtime library.
241 ** Do not change the format of the line below without also updating the
244 TXT("-- This is the version for " TARGET
)
249 ** The type definitions for struct hostent components uses Interfaces.C
252 TXT("with Interfaces.C;")
256 package System.OS_Constants is
262 ** General constants (all platforms)
267 ---------------------------------
268 -- General platform parameters --
269 ---------------------------------
271 type OS_Type is (Windows, VMS, Other_OS);
273 #if defined (__MINGW32__)
274 # define TARGET_OS "Windows"
275 #elif defined (__VMS)
276 # define TARGET_OS "VMS"
278 # define TARGET_OS "Other_OS"
280 C("Target_OS", OS_Type
, TARGET_OS
, "")
282 pragma Warnings (Off, Target_OS);
283 -- Suppress warnings on Target_OS since it is in general tested for
284 -- equality with a constant value to implement conditional compilation,
285 -- which normally generates a constant condition warning.
288 #define Target_Name TARGET
292 ** Note: the name of the following constant is recognized specially by
293 ** xoscons (case sensitive).
295 #define SIZEOF_unsigned_int sizeof (unsigned int)
296 CND(SIZEOF_unsigned_int
, "Size of unsigned int")
307 # define IOV_MAX INT_MAX
309 CND(IOV_MAX
, "Maximum writev iovcnt")
313 ---------------------
314 -- File open modes --
315 ---------------------
322 CND(O_RDWR
, "Read/write")
327 CND(O_NOCTTY
, "Don't change ctrl tty")
332 CND(O_NDELAY
, "Nonblocking")
336 ----------------------
337 -- Fcntl operations --
338 ----------------------
345 CND(F_GETFL
, "Get flags")
350 CND(F_SETFL
, "Set flags")
363 CND(FNDELAY
, "Nonblocking")
367 ----------------------
368 -- Ioctl operations --
369 ----------------------
376 CND(FIONBIO
, "Set/clear non-blocking io")
381 CND(FIONREAD
, "How many bytes to read")
389 -- The following constants are defined from <errno.h>
395 CND(EAGAIN
, "Try again")
400 CND(ENOENT
, "File not found")
405 CND(ENOMEM
, "Out of memory")
410 -- The following constants are defined from <winsock2.h> (WSA*)
415 ** For sockets-related errno values on Windows, gsocket.h redefines
424 CND(EACCES
, "Permission denied")
427 # define EADDRINUSE -1
429 CND(EADDRINUSE
, "Address already in use")
431 #ifndef EADDRNOTAVAIL
432 # define EADDRNOTAVAIL -1
434 CND(EADDRNOTAVAIL
, "Cannot assign address")
437 # define EAFNOSUPPORT -1
439 CND(EAFNOSUPPORT
, "Addr family not supported")
444 CND(EALREADY
, "Operation in progress")
449 CND(EBADF
, "Bad file descriptor")
452 # define ECONNABORTED -1
454 CND(ECONNABORTED
, "Connection aborted")
457 # define ECONNREFUSED -1
459 CND(ECONNREFUSED
, "Connection refused")
462 # define ECONNRESET -1
464 CND(ECONNRESET
, "Connection reset by peer")
467 # define EDESTADDRREQ -1
469 CND(EDESTADDRREQ
, "Destination addr required")
474 CND(EFAULT
, "Bad address")
477 # define EHOSTDOWN -1
479 CND(EHOSTDOWN
, "Host is down")
482 # define EHOSTUNREACH -1
484 CND(EHOSTUNREACH
, "No route to host")
487 # define EINPROGRESS -1
489 CND(EINPROGRESS
, "Operation now in progress")
494 CND(EINTR
, "Interrupted system call")
499 CND(EINVAL
, "Invalid argument")
504 CND(EIO
, "Input output error")
509 CND(EISCONN
, "Socket already connected")
514 CND(ELOOP
, "Too many symbolic links")
519 CND(EMFILE
, "Too many open files")
524 CND(EMSGSIZE
, "Message too long")
527 # define ENAMETOOLONG -1
529 CND(ENAMETOOLONG
, "Name too long")
534 CND(ENETDOWN
, "Network is down")
537 # define ENETRESET -1
539 CND(ENETRESET
, "Disconn. on network reset")
542 # define ENETUNREACH -1
544 CND(ENETUNREACH
, "Network is unreachable")
549 CND(ENOBUFS
, "No buffer space available")
552 # define ENOPROTOOPT -1
554 CND(ENOPROTOOPT
, "Protocol not available")
559 CND(ENOTCONN
, "Socket not connected")
564 CND(ENOTSOCK
, "Operation on non socket")
567 # define EOPNOTSUPP -1
569 CND(EOPNOTSUPP
, "Operation not supported")
574 CND(EPIPE
, "Broken pipe")
577 # define EPFNOSUPPORT -1
579 CND(EPFNOSUPPORT
, "Unknown protocol family")
581 #ifndef EPROTONOSUPPORT
582 # define EPROTONOSUPPORT -1
584 CND(EPROTONOSUPPORT
, "Unknown protocol")
587 # define EPROTOTYPE -1
589 CND(EPROTOTYPE
, "Unknown protocol type")
594 CND(ERANGE
, "Result too large")
597 # define ESHUTDOWN -1
599 CND(ESHUTDOWN
, "Cannot send once shutdown")
601 #ifndef ESOCKTNOSUPPORT
602 # define ESOCKTNOSUPPORT -1
604 CND(ESOCKTNOSUPPORT
, "Socket type not supported")
607 # define ETIMEDOUT -1
609 CND(ETIMEDOUT
, "Connection timed out")
612 # define ETOOMANYREFS -1
614 CND(ETOOMANYREFS
, "Too many references")
617 # define EWOULDBLOCK -1
619 CND(EWOULDBLOCK
, "Operation would block")
624 CND(E2BIG
, "Argument list too long")
629 CND(EILSEQ
, "Illegal byte sequence")
632 ** Terminal/serial I/O constants
635 #if defined(HAVE_TERMIOS) || defined(__MINGW32__)
638 ----------------------
639 -- Terminal control --
640 ----------------------
650 CND(TCSANOW
, "Immediate")
655 CND(TCIFLUSH
, "Flush input")
660 CNU(IXON
, "Output sw flow control")
670 CNU(CRTSCTS
, "Output hw flow control")
680 CNU(CS5
, "5 data bits")
685 CNU(CS6
, "6 data bits")
690 CNU(CS7
, "7 data bits")
695 CNU(CS8
, "8 data bits")
700 CNU(CSTOPB
, "2 stop bits")
705 CNU(PARENB
, "Parity enable")
710 CNU(PARODD
, "Parity odd")
760 CNU(B1200
, "1200 bps")
765 CNU(B1800
, "1800 bps")
770 CNU(B2400
, "2400 bps")
775 CNU(B4800
, "4800 bps")
780 CNU(B9600
, "9600 bps")
785 CNU(B19200
, "19200 bps")
790 CNU(B38400
, "38400 bps")
795 CNU(B57600
, "57600 bps")
800 CNU(B115200
, "115200 bps")
805 CNU(B230400
, "230400 bps")
810 CNU(B460800
, "460800 bps")
815 CNU(B500000
, "500000 bps")
820 CNU(B576000
, "576000 bps")
825 CNU(B921600
, "921600 bps")
830 CNU(B1000000
, "1000000 bps")
835 CNU(B1152000
, "1152000 bps")
840 CNU(B1500000
, "1500000 bps")
845 CNU(B2000000
, "2000000 bps")
850 CNU(B2500000
, "2500000 bps")
855 CNU(B3000000
, "3000000 bps")
860 CNU(B3500000
, "3500000 bps")
865 CNU(B4000000
, "4000000 bps")
869 ---------------------------------
870 -- Terminal control characters --
871 ---------------------------------
878 CND(VINTR
, "Interrupt")
903 CND(VTIME
, "Read timeout")
908 CND(VMIN
, "Read min chars")
918 CND(VSTART
, "Flow control start")
923 CND(VSTOP
, "Flow control stop")
928 CND(VSUSP
, "Suspend")
938 CND(VREPRINT
, "Reprint unread")
943 CND(VDISCARD
, "Discard pending")
948 CND(VWERASE
, "Word erase")
953 CND(VLNEXT
, "Literal next")
958 CND(VEOL2
, "Alternative EOL")
960 #endif /* HAVE_TERMIOS */
963 CNU(DTR_CONTROL_ENABLE
, "Enable DTR flow ctrl")
964 CNU(RTS_CONTROL_ENABLE
, "Enable RTS flow ctrl")
969 -----------------------------
970 -- Pseudo terminal library --
971 -----------------------------
975 #if defined (__FreeBSD__) || defined (linux)
976 # define PTY_Library "-lutil"
978 # define PTY_Library ""
980 CST(PTY_Library
, "for g-exptty")
999 CND(AF_INET
, "IPv4 address family")
1002 ** RTEMS lies and defines AF_INET6 even though there is no IPV6 support.
1003 ** Its TCP/IP stack is in transition. It has newer .h files but no IPV6 yet.
1005 #if defined(__rtems__)
1010 # define AF_INET6 -1
1012 # define HAVE_AF_INET6 1
1014 CND(AF_INET6
, "IPv6 address family")
1025 # define SOCK_STREAM -1
1027 CND(SOCK_STREAM
, "Stream socket")
1030 # define SOCK_DGRAM -1
1032 CND(SOCK_DGRAM
, "Datagram socket")
1042 #ifndef HOST_NOT_FOUND
1043 # define HOST_NOT_FOUND -1
1045 CND(HOST_NOT_FOUND
, "Unknown host")
1048 # define TRY_AGAIN -1
1050 CND(TRY_AGAIN
, "Host name lookup failure")
1055 CND(NO_DATA
, "No data record for name")
1058 # define NO_RECOVERY -1
1060 CND(NO_RECOVERY
, "Non recoverable errors")
1064 --------------------
1065 -- Shutdown modes --
1066 --------------------
1073 CND(SHUT_RD
, "No more recv")
1078 CND(SHUT_WR
, "No more send")
1081 # define SHUT_RDWR -1
1083 CND(SHUT_RDWR
, "No more recv/send")
1087 ---------------------
1088 -- Protocol levels --
1089 ---------------------
1094 # define SOL_SOCKET -1
1096 CND(SOL_SOCKET
, "Options for socket level")
1099 # define IPPROTO_IP -1
1101 CND(IPPROTO_IP
, "Dummy protocol for IP")
1104 # define IPPROTO_UDP -1
1106 CND(IPPROTO_UDP
, "UDP")
1109 # define IPPROTO_TCP -1
1111 CND(IPPROTO_TCP
, "TCP")
1124 CND(MSG_OOB
, "Process out-of-band data")
1127 # define MSG_PEEK -1
1129 CND(MSG_PEEK
, "Peek at incoming data")
1134 CND(MSG_EOR
, "Send end of record")
1138 /* The value of MSG_WAITALL is 8. Nevertheless winsock.h doesn't
1139 define it, but it is still usable as we link to winsock2 API. */
1140 # define MSG_WAITALL (1 << 3)
1142 # define MSG_WAITALL -1
1145 CND(MSG_WAITALL
, "Wait for full reception")
1147 #ifndef MSG_NOSIGNAL
1148 # define MSG_NOSIGNAL -1
1150 CND(MSG_NOSIGNAL
, "No SIGPIPE on send")
1153 # define MSG_Forced_Flags "MSG_NOSIGNAL"
1155 # define MSG_Forced_Flags "0"
1157 CNS(MSG_Forced_Flags
, "")
1159 -- Flags set on all send(2) calls
1164 --------------------
1165 -- Socket options --
1166 --------------------
1171 # define TCP_NODELAY -1
1173 CND(TCP_NODELAY
, "Do not coalesce packets")
1175 #ifndef SO_REUSEADDR
1176 # define SO_REUSEADDR -1
1178 CND(SO_REUSEADDR
, "Bind reuse local address")
1180 #ifndef SO_REUSEPORT
1181 # define SO_REUSEPORT -1
1183 CND(SO_REUSEPORT
, "Bind reuse port number")
1185 #ifndef SO_KEEPALIVE
1186 # define SO_KEEPALIVE -1
1188 CND(SO_KEEPALIVE
, "Enable keep-alive msgs")
1191 # define SO_LINGER -1
1193 CND(SO_LINGER
, "Defer close to flush data")
1195 #ifndef SO_BROADCAST
1196 # define SO_BROADCAST -1
1198 CND(SO_BROADCAST
, "Can send broadcast msgs")
1201 # define SO_SNDBUF -1
1203 CND(SO_SNDBUF
, "Set/get send buffer size")
1206 # define SO_RCVBUF -1
1208 CND(SO_RCVBUF
, "Set/get recv buffer size")
1211 # define SO_SNDTIMEO -1
1213 CND(SO_SNDTIMEO
, "Emission timeout")
1216 # define SO_RCVTIMEO -1
1218 CND(SO_RCVTIMEO
, "Reception timeout")
1221 # define SO_ERROR -1
1223 CND(SO_ERROR
, "Get/clear error status")
1225 #ifndef IP_MULTICAST_IF
1226 # define IP_MULTICAST_IF -1
1228 CND(IP_MULTICAST_IF
, "Set/get mcast interface")
1230 #ifndef IP_MULTICAST_TTL
1231 # define IP_MULTICAST_TTL -1
1233 CND(IP_MULTICAST_TTL
, "Set/get multicast TTL")
1235 #ifndef IP_MULTICAST_LOOP
1236 # define IP_MULTICAST_LOOP -1
1238 CND(IP_MULTICAST_LOOP
, "Set/get mcast loopback")
1240 #ifndef IP_ADD_MEMBERSHIP
1241 # define IP_ADD_MEMBERSHIP -1
1243 CND(IP_ADD_MEMBERSHIP
, "Join a multicast group")
1245 #ifndef IP_DROP_MEMBERSHIP
1246 # define IP_DROP_MEMBERSHIP -1
1248 CND(IP_DROP_MEMBERSHIP
, "Leave a multicast group")
1251 # define IP_PKTINFO -1
1253 CND(IP_PKTINFO
, "Get datagram info")
1257 ----------------------
1258 -- Type definitions --
1259 ----------------------
1266 -- Sizes (in bytes) of the components of struct timeval
1268 #define SIZEOF_tv_sec (sizeof tv.tv_sec)
1269 CND(SIZEOF_tv_sec
, "tv_sec")
1270 #define SIZEOF_tv_usec (sizeof tv.tv_usec)
1271 CND(SIZEOF_tv_usec
, "tv_usec")
1274 -- Maximum allowed value for tv_sec
1278 ** On Solaris, field tv_sec in struct timeval has an undocumented
1279 ** hard-wired limit of 100 million.
1280 ** On IA64 HP-UX the limit is 2**31 - 1.
1283 # define MAX_tv_sec "100_000_000"
1285 #elif defined (__hpux__)
1286 # define MAX_tv_sec "16#7fffffff#"
1289 # define MAX_tv_sec "2 ** (SIZEOF_tv_sec * 8 - 1) - 1"
1295 -- Sizes of various data types
1298 #define SIZEOF_sockaddr_in (sizeof (struct sockaddr_in))
1299 CND(SIZEOF_sockaddr_in
, "struct sockaddr_in")
1300 #ifdef HAVE_AF_INET6
1301 # define SIZEOF_sockaddr_in6 (sizeof (struct sockaddr_in6))
1303 # define SIZEOF_sockaddr_in6 0
1305 CND(SIZEOF_sockaddr_in6
, "struct sockaddr_in6")
1307 #define SIZEOF_fd_set (sizeof (fd_set))
1308 CND(SIZEOF_fd_set
, "fd_set");
1309 CND(FD_SETSIZE
, "Max fd value");
1311 #define SIZEOF_struct_hostent (sizeof (struct hostent))
1312 CND(SIZEOF_struct_hostent
, "struct hostent");
1314 #define SIZEOF_struct_servent (sizeof (struct servent))
1315 CND(SIZEOF_struct_servent
, "struct servent");
1317 #if defined (__linux__)
1318 #define SIZEOF_sigset (sizeof (sigset_t))
1319 CND(SIZEOF_sigset
, "sigset");
1323 -- Fields of struct msghdr
1326 #if defined (__sun__) || defined (__hpux__)
1327 # define msg_iovlen_t "int"
1329 # define msg_iovlen_t "size_t"
1332 TXT(" subtype Msg_Iovlen_T is Interfaces.C." msg_iovlen_t
";")
1336 ----------------------------------------
1337 -- Properties of supported interfaces --
1338 ----------------------------------------
1342 CND(Need_Netdb_Buffer
, "Need buffer for Netdb ops")
1343 CND(Need_Netdb_Lock
, "Need lock for Netdb ops")
1344 CND(Has_Sockaddr_Len
, "Sockaddr has sa_len field")
1347 ** Do not change the format of the line below without also updating the
1350 C("Thread_Blocking_IO", Boolean
, "True", "")
1352 -- Set False for contexts where socket i/o are process blocking
1356 #ifdef HAVE_INET_PTON
1357 # define Inet_Pton_Linkname "inet_pton"
1359 # define Inet_Pton_Linkname "__gnat_inet_pton"
1361 CST(Inet_Pton_Linkname
, "")
1363 #endif /* HAVE_SOCKETS */
1367 ---------------------
1368 -- Threads support --
1369 ---------------------
1371 -- Clock identifier definitions
1375 /* Note: On HP-UX, CLOCK_REALTIME is an enum, not a macro. */
1377 #if defined(CLOCK_REALTIME) || defined (__hpux__)
1378 # define HAVE_CLOCK_REALTIME
1381 #ifdef HAVE_CLOCK_REALTIME
1382 CND(CLOCK_REALTIME
, "System realtime clock")
1385 #ifdef CLOCK_MONOTONIC
1386 CND(CLOCK_MONOTONIC
, "System monotonic clock")
1389 #ifdef CLOCK_FASTEST
1390 CND(CLOCK_FASTEST
, "Fastest clock")
1393 #ifndef CLOCK_THREAD_CPUTIME_ID
1394 # define CLOCK_THREAD_CPUTIME_ID -1
1396 CND(CLOCK_THREAD_CPUTIME_ID
, "Thread CPU clock")
1398 #if defined(__APPLE__)
1399 /* There's no clock_gettime or clock_id's on Darwin, generate a dummy value */
1400 # define CLOCK_RT_Ada "-1"
1402 #elif defined(FreeBSD) || defined(_AIX)
1403 /** On these platforms use system provided monotonic clock instead of
1404 ** the default CLOCK_REALTIME. We then need to set up cond var attributes
1405 ** appropriately (see thread.c).
1407 # define CLOCK_RT_Ada "CLOCK_MONOTONIC"
1408 # define NEED_PTHREAD_CONDATTR_SETCLOCK
1410 #elif defined(HAVE_CLOCK_REALTIME)
1411 /* By default use CLOCK_REALTIME */
1412 # define CLOCK_RT_Ada "CLOCK_REALTIME"
1416 CNS(CLOCK_RT_Ada
, "")
1419 #if defined (__APPLE__) || defined (__linux__) || defined (DUMMY)
1422 -- Sizes of pthread data types
1426 #if defined (__APPLE__) || defined (DUMMY)
1428 -- (on Darwin, these are just placeholders)
1431 #define PTHREAD_SIZE __PTHREAD_SIZE__
1432 #define PTHREAD_ATTR_SIZE __PTHREAD_ATTR_SIZE__
1433 #define PTHREAD_MUTEXATTR_SIZE __PTHREAD_MUTEXATTR_SIZE__
1434 #define PTHREAD_MUTEX_SIZE __PTHREAD_MUTEX_SIZE__
1435 #define PTHREAD_CONDATTR_SIZE __PTHREAD_CONDATTR_SIZE__
1436 #define PTHREAD_COND_SIZE __PTHREAD_COND_SIZE__
1437 #define PTHREAD_RWLOCKATTR_SIZE __PTHREAD_RWLOCKATTR_SIZE__
1438 #define PTHREAD_RWLOCK_SIZE __PTHREAD_RWLOCK_SIZE__
1439 #define PTHREAD_ONCE_SIZE __PTHREAD_ONCE_SIZE__
1441 #define PTHREAD_SIZE (sizeof (pthread_t))
1442 #define PTHREAD_ATTR_SIZE (sizeof (pthread_attr_t))
1443 #define PTHREAD_MUTEXATTR_SIZE (sizeof (pthread_mutexattr_t))
1444 #define PTHREAD_MUTEX_SIZE (sizeof (pthread_mutex_t))
1445 #define PTHREAD_CONDATTR_SIZE (sizeof (pthread_condattr_t))
1446 #define PTHREAD_COND_SIZE (sizeof (pthread_cond_t))
1447 #define PTHREAD_RWLOCKATTR_SIZE (sizeof (pthread_rwlockattr_t))
1448 #define PTHREAD_RWLOCK_SIZE (sizeof (pthread_rwlock_t))
1449 #define PTHREAD_ONCE_SIZE (sizeof (pthread_once_t))
1452 CND(PTHREAD_SIZE
, "pthread_t")
1453 CND(PTHREAD_ATTR_SIZE
, "pthread_attr_t")
1454 CND(PTHREAD_MUTEXATTR_SIZE
, "pthread_mutexattr_t")
1455 CND(PTHREAD_MUTEX_SIZE
, "pthread_mutex_t")
1456 CND(PTHREAD_CONDATTR_SIZE
, "pthread_condattr_t")
1457 CND(PTHREAD_COND_SIZE
, "pthread_cond_t")
1458 CND(PTHREAD_RWLOCKATTR_SIZE
, "pthread_rwlockattr_t")
1459 CND(PTHREAD_RWLOCK_SIZE
, "pthread_rwlock_t")
1460 CND(PTHREAD_ONCE_SIZE
, "pthread_once_t")
1462 #endif /* __APPLE__ || __linux__ */
1465 ** System-specific constants follow
1466 ** Each section should be activated if compiling for the corresponding
1467 ** platform *or* generating the dummy version for runtime test compilation.
1470 #if defined (__vxworks) || defined (DUMMY)
1474 --------------------------------
1475 -- VxWorks-specific constants --
1476 --------------------------------
1478 -- These constants may be used only within the VxWorks version of
1479 -- GNAT.Sockets.Thin.
1482 CND(OK
, "VxWorks generic success")
1483 CND(ERROR
, "VxWorks generic error")
1485 #endif /* __vxworks */
1487 #if defined (__MINGW32__) || defined (DUMMY)
1490 ------------------------------
1491 -- MinGW-specific constants --
1492 ------------------------------
1494 -- These constants may be used only within the MinGW version of
1495 -- GNAT.Sockets.Thin.
1498 CND(WSASYSNOTREADY
, "System not ready")
1499 CND(WSAVERNOTSUPPORTED
, "Version not supported")
1500 CND(WSANOTINITIALISED
, "Winsock not initialized")
1501 CND(WSAEDISCON
, "Disconnected")
1503 #endif /* __MINGW32__ */
1506 ** End of constants definitions
1515 end System.OS_Constants;