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-2011, 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
88 #elif defined (__alpha__) && defined (__osf__)
89 /** For Tru64 UNIX, _XOPEN_SOURCE must be defined, otherwise CLOCK_REALTIME
92 #define _XOPEN_SOURCE 500
94 #elif defined (__mips) && defined (__sgi)
95 /** For IRIX 6, _XOPEN5 must be defined and _XOPEN_IOV_MAX must be used as
96 ** IOV_MAX, otherwise IOV_MAX is not defined. IRIX 5 has neither.
100 #define IOV_MAX _XOPEN_IOV_MAX
104 /* Include gsocket.h before any system header so it can redefine FD_SETSIZE */
114 #if defined (__alpha__) && defined (__osf__)
115 /** Tru64 is unable to do vector IO operations with default value of IOV_MAX,
116 ** so its value is redefined to a small one which is known to work properly.
123 /** VMS is unable to do vector IO operations with default value of IOV_MAX,
124 ** so its value is redefined to a small one which is known to work properly.
130 #if ! (defined (__vxworks) || defined (__VMS) || defined (__MINGW32__) || \
131 defined (__nucleus__))
132 # define HAVE_TERMIOS
135 #if defined (__vxworks)
138 ** For VxWorks, always include vxWorks.h (gsocket.h provides it only for
139 ** the case of runtime libraries that support sockets).
142 # include <vxWorks.h>
147 # if defined (TARGET)
148 # error TARGET may not be defined when generating the dummy version
150 # define TARGET "batch runtime compilation (dummy values)"
153 # if !(defined (HAVE_SOCKETS) && defined (HAVE_TERMIOS))
154 # error Features missing on platform
162 # error Please define TARGET
170 # include <termios.h>
178 # include <pthread.h>
187 # define _VAL(x) counter++
192 #define CND(name,comment) \
193 printf ("\n->CND:$%d:" #name ":$%d:" comment, __LINE__, ((int) _VAL (name)));
195 #define CNS(name,comment) \
196 printf ("\n->CNS:$%d:" #name ":" name ":" comment, __LINE__);
198 #define C(sname,type,value,comment)\
199 printf ("\n->C:$%d:" sname ":" #type ":" value ":" comment, __LINE__);
202 printf ("\n->TXT:$%d:" text, __LINE__);
206 #define CND(name, comment) \
207 asm volatile("\n->CND:%0:" #name ":%1:" comment \
208 : : "i" (__LINE__), "i" ((int) name));
209 /* Decimal constant in the range of type "int" */
211 #define CNS(name, comment) \
212 asm volatile("\n->CNS:%0:" #name ":" name ":" comment \
214 /* General expression named number */
216 #define C(sname, type, value, comment) \
217 asm volatile("\n->C:%0:" sname ":" #type ":" value ":" comment \
222 asm volatile("\n->TXT:%0:" text \
228 #define CST(name,comment) C(#name,String,name,comment)
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)
258 ** The type definitions for struct hostent components uses Interfaces.C
261 TXT("with Interfaces.C;")
265 package System.OS_Constants is
271 ** General constants (all platforms)
276 -----------------------------
277 -- Platform identification --
278 -----------------------------
280 type OS_Type is (Windows, VMS, Other_OS);
282 #if defined (__MINGW32__)
283 # define TARGET_OS "Windows"
284 #elif defined (__VMS)
285 # define TARGET_OS "VMS"
287 # define TARGET_OS "Other_OS"
289 C("Target_OS", OS_Type, TARGET_OS, "")
290 #define Target_Name TARGET
301 # define IOV_MAX INT_MAX
303 CND(IOV_MAX, "Maximum writev iovcnt")
307 ---------------------
308 -- File open modes --
309 ---------------------
316 CND(O_RDWR, "Read/write")
321 CND(O_NOCTTY, "Don't change ctrl tty")
326 CND(O_NDELAY, "Nonblocking")
330 ----------------------
331 -- Fcntl operations --
332 ----------------------
339 CND(F_GETFL, "Get flags")
344 CND(F_SETFL, "Set flags")
357 CND(FNDELAY, "Nonblocking")
361 ----------------------
362 -- Ioctl operations --
363 ----------------------
370 CND(FIONBIO, "Set/clear non-blocking io")
375 CND(FIONREAD, "How many bytes to read")
383 -- The following constants are defined from <errno.h>
389 CND(EAGAIN, "Try again")
394 CND(ENOENT, "File not found")
399 CND(ENOMEM, "Out of memory")
404 -- The following constants are defined from <winsock2.h> (WSA*)
409 ** For sockets-related errno values on Windows, gsocket.h redefines
418 CND(EACCES, "Permission denied")
421 # define EADDRINUSE -1
423 CND(EADDRINUSE, "Address already in use")
425 #ifndef EADDRNOTAVAIL
426 # define EADDRNOTAVAIL -1
428 CND(EADDRNOTAVAIL, "Cannot assign address")
431 # define EAFNOSUPPORT -1
433 CND(EAFNOSUPPORT, "Addr family not supported")
438 CND(EALREADY, "Operation in progress")
443 CND(EBADF, "Bad file descriptor")
446 # define ECONNABORTED -1
448 CND(ECONNABORTED, "Connection aborted")
451 # define ECONNREFUSED -1
453 CND(ECONNREFUSED, "Connection refused")
456 # define ECONNRESET -1
458 CND(ECONNRESET, "Connection reset by peer")
461 # define EDESTADDRREQ -1
463 CND(EDESTADDRREQ, "Destination addr required")
468 CND(EFAULT, "Bad address")
471 # define EHOSTDOWN -1
473 CND(EHOSTDOWN, "Host is down")
476 # define EHOSTUNREACH -1
478 CND(EHOSTUNREACH, "No route to host")
481 # define EINPROGRESS -1
483 CND(EINPROGRESS, "Operation now in progress")
488 CND(EINTR, "Interrupted system call")
493 CND(EINVAL, "Invalid argument")
498 CND(EIO, "Input output error")
503 CND(EISCONN, "Socket already connected")
508 CND(ELOOP, "Too many symbolic links")
513 CND(EMFILE, "Too many open files")
518 CND(EMSGSIZE, "Message too long")
521 # define ENAMETOOLONG -1
523 CND(ENAMETOOLONG, "Name too long")
528 CND(ENETDOWN, "Network is down")
531 # define ENETRESET -1
533 CND(ENETRESET, "Disconn. on network reset")
536 # define ENETUNREACH -1
538 CND(ENETUNREACH, "Network is unreachable")
543 CND(ENOBUFS, "No buffer space available")
546 # define ENOPROTOOPT -1
548 CND(ENOPROTOOPT, "Protocol not available")
553 CND(ENOTCONN, "Socket not connected")
558 CND(ENOTSOCK, "Operation on non socket")
561 # define EOPNOTSUPP -1
563 CND(EOPNOTSUPP, "Operation not supported")
568 CND(EPIPE, "Broken pipe")
571 # define EPFNOSUPPORT -1
573 CND(EPFNOSUPPORT, "Unknown protocol family")
575 #ifndef EPROTONOSUPPORT
576 # define EPROTONOSUPPORT -1
578 CND(EPROTONOSUPPORT, "Unknown protocol")
581 # define EPROTOTYPE -1
583 CND(EPROTOTYPE, "Unknown protocol type")
588 CND(ERANGE, "Result too large")
591 # define ESHUTDOWN -1
593 CND(ESHUTDOWN, "Cannot send once shutdown")
595 #ifndef ESOCKTNOSUPPORT
596 # define ESOCKTNOSUPPORT -1
598 CND(ESOCKTNOSUPPORT, "Socket type not supported")
601 # define ETIMEDOUT -1
603 CND(ETIMEDOUT, "Connection timed out")
606 # define ETOOMANYREFS -1
608 CND(ETOOMANYREFS, "Too many references")
611 # define EWOULDBLOCK -1
613 CND(EWOULDBLOCK, "Operation would block")
616 ** Terminal I/O constants
623 ----------------------
624 -- Terminal control --
625 ----------------------
632 CND(TCSANOW, "Immediate")
637 CND(TCIFLUSH, "Flush input")
647 CND(CRTSCTS, "Hardware flow control")
657 CND(CS5, "5 data bits")
662 CND(CS6, "6 data bits")
667 CND(CS7, "7 data bits")
672 CND(CS8, "8 data bits")
677 CND(CSTOPB, "2 stop bits")
682 CND(PARENB, "Parity enable")
687 CND(PARODD, "Parity odd")
737 CND(B1200, "1200 bps")
742 CND(B1800, "1800 bps")
747 CND(B2400, "2400 bps")
752 CND(B4800, "4800 bps")
757 CND(B9600, "9600 bps")
762 CND(B19200, "19200 bps")
767 CND(B38400, "38400 bps")
772 CND(B57600, "57600 bps")
777 CND(B115200, "115200 bps")
782 CND(B230400, "230400 bps")
787 CND(B460800, "460800 bps")
792 CND(B500000, "500000 bps")
797 CND(B576000, "576000 bps")
802 CND(B921600, "921600 bps")
807 CND(B1000000, "1000000 bps")
812 CND(B1152000, "1152000 bps")
817 CND(B1500000, "1500000 bps")
822 CND(B2000000, "2000000 bps")
827 CND(B2500000, "2500000 bps")
832 CND(B3000000, "3000000 bps")
837 CND(B3500000, "3500000 bps")
842 CND(B4000000, "4000000 bps")
846 ---------------------------------
847 -- Terminal control characters --
848 ---------------------------------
855 CND(VINTR, "Interrupt")
880 CND(VTIME, "Read timeout")
885 CND(VMIN, "Read min chars")
895 CND(VSTART, "Flow control start")
900 CND(VSTOP, "Flow control stop")
905 CND(VSUSP, "Suspend")
915 CND(VREPRINT, "Reprint unread")
920 CND(VDISCARD, "Discard pending")
925 CND(VWERASE, "Word erase")
930 CND(VLNEXT, "Literal next")
935 CND(VEOL2, "Alternative EOL")
937 #endif /* HAVE_TERMIOS */
941 -----------------------------
942 -- Pseudo terminal library --
943 -----------------------------
947 #if defined (__FreeBSD__) || defined (linux)
948 # define PTY_Library "-lutil"
950 # define PTY_Library ""
952 CST(PTY_Library, "for g-exptty")
971 CND(AF_INET, "IPv4 address family")
974 ** RTEMS lies and defines AF_INET6 even though there is no IPV6 support.
975 ** Its TCP/IP stack is in transition. It has newer .h files but no IPV6 yet.
977 #if defined(__rtems__)
982 ** Tru64 UNIX V4.0F defines AF_INET6 without IPv6 support, specifically
983 ** without struct sockaddr_in6. We use _SS_MAXSIZE (used for the definition
984 ** of struct sockaddr_storage on Tru64 UNIX V5.1) to detect this.
986 #if defined(__osf__) && !defined(_SS_MAXSIZE)
993 # define HAVE_AF_INET6 1
995 CND(AF_INET6, "IPv6 address family")
1006 # define SOCK_STREAM -1
1008 CND(SOCK_STREAM, "Stream socket")
1011 # define SOCK_DGRAM -1
1013 CND(SOCK_DGRAM, "Datagram socket")
1023 #ifndef HOST_NOT_FOUND
1024 # define HOST_NOT_FOUND -1
1026 CND(HOST_NOT_FOUND, "Unknown host")
1029 # define TRY_AGAIN -1
1031 CND(TRY_AGAIN, "Host name lookup failure")
1036 CND(NO_DATA, "No data record for name")
1039 # define NO_RECOVERY -1
1041 CND(NO_RECOVERY, "Non recoverable errors")
1045 --------------------
1046 -- Shutdown modes --
1047 --------------------
1054 CND(SHUT_RD, "No more recv")
1059 CND(SHUT_WR, "No more send")
1062 # define SHUT_RDWR -1
1064 CND(SHUT_RDWR, "No more recv/send")
1068 ---------------------
1069 -- Protocol levels --
1070 ---------------------
1075 # define SOL_SOCKET -1
1077 CND(SOL_SOCKET, "Options for socket level")
1080 # define IPPROTO_IP -1
1082 CND(IPPROTO_IP, "Dummy protocol for IP")
1085 # define IPPROTO_UDP -1
1087 CND(IPPROTO_UDP, "UDP")
1090 # define IPPROTO_TCP -1
1092 CND(IPPROTO_TCP, "TCP")
1105 CND(MSG_OOB, "Process out-of-band data")
1108 # define MSG_PEEK -1
1110 CND(MSG_PEEK, "Peek at incoming data")
1115 CND(MSG_EOR, "Send end of record")
1119 /* The value of MSG_WAITALL is 8. Nevertheless winsock.h doesn't
1120 define it, but it is still usable as we link to winsock2 API. */
1121 # define MSG_WAITALL (1 << 3)
1123 # define MSG_WAITALL -1
1126 CND(MSG_WAITALL, "Wait for full reception")
1128 #ifndef MSG_NOSIGNAL
1129 # define MSG_NOSIGNAL -1
1131 CND(MSG_NOSIGNAL, "No SIGPIPE on send")
1134 # define MSG_Forced_Flags "MSG_NOSIGNAL"
1136 # define MSG_Forced_Flags "0"
1138 CNS(MSG_Forced_Flags, "")
1140 -- Flags set on all send(2) calls
1145 --------------------
1146 -- Socket options --
1147 --------------------
1152 # define TCP_NODELAY -1
1154 CND(TCP_NODELAY, "Do not coalesce packets")
1156 #ifndef SO_REUSEADDR
1157 # define SO_REUSEADDR -1
1159 CND(SO_REUSEADDR, "Bind reuse local address")
1161 #ifndef SO_REUSEPORT
1162 # define SO_REUSEPORT -1
1164 CND(SO_REUSEPORT, "Bind reuse port number")
1166 #ifndef SO_KEEPALIVE
1167 # define SO_KEEPALIVE -1
1169 CND(SO_KEEPALIVE, "Enable keep-alive msgs")
1172 # define SO_LINGER -1
1174 CND(SO_LINGER, "Defer close to flush data")
1176 #ifndef SO_BROADCAST
1177 # define SO_BROADCAST -1
1179 CND(SO_BROADCAST, "Can send broadcast msgs")
1182 # define SO_SNDBUF -1
1184 CND(SO_SNDBUF, "Set/get send buffer size")
1187 # define SO_RCVBUF -1
1189 CND(SO_RCVBUF, "Set/get recv buffer size")
1192 # define SO_SNDTIMEO -1
1194 CND(SO_SNDTIMEO, "Emission timeout")
1197 # define SO_RCVTIMEO -1
1199 CND(SO_RCVTIMEO, "Reception timeout")
1202 # define SO_ERROR -1
1204 CND(SO_ERROR, "Get/clear error status")
1206 #ifndef IP_MULTICAST_IF
1207 # define IP_MULTICAST_IF -1
1209 CND(IP_MULTICAST_IF, "Set/get mcast interface")
1211 #ifndef IP_MULTICAST_TTL
1212 # define IP_MULTICAST_TTL -1
1214 CND(IP_MULTICAST_TTL, "Set/get multicast TTL")
1216 #ifndef IP_MULTICAST_LOOP
1217 # define IP_MULTICAST_LOOP -1
1219 CND(IP_MULTICAST_LOOP, "Set/get mcast loopback")
1221 #ifndef IP_ADD_MEMBERSHIP
1222 # define IP_ADD_MEMBERSHIP -1
1224 CND(IP_ADD_MEMBERSHIP, "Join a multicast group")
1226 #ifndef IP_DROP_MEMBERSHIP
1227 # define IP_DROP_MEMBERSHIP -1
1229 CND(IP_DROP_MEMBERSHIP, "Leave a multicast group")
1232 # define IP_PKTINFO -1
1234 CND(IP_PKTINFO, "Get datagram info")
1238 ----------------------
1239 -- Type definitions --
1240 ----------------------
1247 -- Sizes (in bytes) of the components of struct timeval
1249 #define SIZEOF_tv_sec (sizeof tv.tv_sec)
1250 CND(SIZEOF_tv_sec, "tv_sec")
1251 #define SIZEOF_tv_usec (sizeof tv.tv_usec)
1252 CND(SIZEOF_tv_usec, "tv_usec")
1255 -- Maximum allowed value for tv_sec
1259 ** On Solaris and IRIX, field tv_sec in struct timeval has an undocumented
1260 ** hard-wired limit of 100 million.
1261 ** On IA64 HP-UX the limit is 2**31 - 1.
1263 #if defined (sun) || (defined (__mips) && defined (__sgi))
1264 # define MAX_tv_sec "100_000_000"
1266 #elif defined (__hpux__)
1267 # define MAX_tv_sec "16#7fffffff#"
1270 # define MAX_tv_sec "2 ** (SIZEOF_tv_sec * 8 - 1) - 1"
1276 -- Sizes of various data types
1279 #define SIZEOF_sockaddr_in (sizeof (struct sockaddr_in))
1280 CND(SIZEOF_sockaddr_in, "struct sockaddr_in")
1281 #ifdef HAVE_AF_INET6
1282 # define SIZEOF_sockaddr_in6 (sizeof (struct sockaddr_in6))
1284 # define SIZEOF_sockaddr_in6 0
1286 CND(SIZEOF_sockaddr_in6, "struct sockaddr_in6")
1288 #define SIZEOF_fd_set (sizeof (fd_set))
1289 CND(SIZEOF_fd_set, "fd_set");
1290 CND(FD_SETSIZE, "Max fd value");
1292 #define SIZEOF_struct_hostent (sizeof (struct hostent))
1293 CND(SIZEOF_struct_hostent, "struct hostent");
1295 #define SIZEOF_struct_servent (sizeof (struct servent))
1296 CND(SIZEOF_struct_servent, "struct servent");
1298 #if defined (__linux__)
1299 #define SIZEOF_sigset (sizeof (sigset_t))
1300 CND(SIZEOF_sigset, "sigset");
1304 -- Fields of struct msghdr
1307 #if defined (__sun__) || defined (__hpux__)
1308 # define msg_iovlen_t "int"
1310 # define msg_iovlen_t "size_t"
1313 TXT(" subtype Msg_Iovlen_T is Interfaces.C." msg_iovlen_t ";")
1317 ----------------------------------------
1318 -- Properties of supported interfaces --
1319 ----------------------------------------
1323 CND(Need_Netdb_Buffer, "Need buffer for Netdb ops")
1324 CND(Need_Netdb_Lock, "Need lock for Netdb ops")
1325 CND(Has_Sockaddr_Len, "Sockaddr has sa_len field")
1328 ** Do not change the format of the line below without also updating the
1331 C("Thread_Blocking_IO", Boolean, "True", "")
1333 -- Set False for contexts where socket i/o are process blocking
1337 #ifdef HAVE_INET_PTON
1338 # define Inet_Pton_Linkname "inet_pton"
1340 # define Inet_Pton_Linkname "__gnat_inet_pton"
1342 CST(Inet_Pton_Linkname, "")
1344 #endif /* HAVE_SOCKETS */
1348 ---------------------
1349 -- Threads support --
1350 ---------------------
1352 -- Clock identifier definitions
1356 /* Note: On HP-UX, CLOCK_REALTIME is an enum, not a macro. */
1358 #if defined(CLOCK_REALTIME) || defined (__hpux__)
1359 # define HAVE_CLOCK_REALTIME
1362 #ifdef HAVE_CLOCK_REALTIME
1363 CND(CLOCK_REALTIME, "System realtime clock")
1366 #ifdef CLOCK_MONOTONIC
1367 CND(CLOCK_MONOTONIC, "System monotonic clock")
1370 #ifdef CLOCK_FASTEST
1371 CND(CLOCK_FASTEST, "Fastest clock")
1375 CND(CLOCK_SGI_FAST, "SGI fast clock")
1376 CND(CLOCK_SGI_CYCLE, "SGI CPU clock")
1379 #ifndef CLOCK_THREAD_CPUTIME_ID
1380 # define CLOCK_THREAD_CPUTIME_ID -1
1382 CND(CLOCK_THREAD_CPUTIME_ID, "Thread CPU clock")
1384 #if defined(__APPLE__)
1385 /* There's no clock_gettime or clock_id's on Darwin, generate a dummy value */
1386 # define CLOCK_RT_Ada "-1"
1388 #elif defined(FreeBSD) || defined(_AIX)
1389 /** On these platforms use system provided monotonic clock instead of
1390 ** the default CLOCK_REALTIME. We then need to set up cond var attributes
1391 ** appropriately (see thread.c).
1393 # define CLOCK_RT_Ada "CLOCK_MONOTONIC"
1394 # define NEED_PTHREAD_CONDATTR_SETCLOCK
1396 #elif defined(HAVE_CLOCK_REALTIME)
1397 /* By default use CLOCK_REALTIME */
1398 # define CLOCK_RT_Ada "CLOCK_REALTIME"
1402 CNS(CLOCK_RT_Ada, "")
1405 #if defined (__APPLE__) || defined (__linux__) || defined (DUMMY)
1408 -- Sizes of pthread data types
1412 #if defined (__APPLE__) || defined (DUMMY)
1414 -- (on Darwin, these are just placeholders)
1417 #define PTHREAD_SIZE __PTHREAD_SIZE__
1418 #define PTHREAD_ATTR_SIZE __PTHREAD_ATTR_SIZE__
1419 #define PTHREAD_MUTEXATTR_SIZE __PTHREAD_MUTEXATTR_SIZE__
1420 #define PTHREAD_MUTEX_SIZE __PTHREAD_MUTEX_SIZE__
1421 #define PTHREAD_CONDATTR_SIZE __PTHREAD_CONDATTR_SIZE__
1422 #define PTHREAD_COND_SIZE __PTHREAD_COND_SIZE__
1423 #define PTHREAD_RWLOCKATTR_SIZE __PTHREAD_RWLOCKATTR_SIZE__
1424 #define PTHREAD_RWLOCK_SIZE __PTHREAD_RWLOCK_SIZE__
1425 #define PTHREAD_ONCE_SIZE __PTHREAD_ONCE_SIZE__
1427 #define PTHREAD_SIZE (sizeof (pthread_t))
1428 #define PTHREAD_ATTR_SIZE (sizeof (pthread_attr_t))
1429 #define PTHREAD_MUTEXATTR_SIZE (sizeof (pthread_mutexattr_t))
1430 #define PTHREAD_MUTEX_SIZE (sizeof (pthread_mutex_t))
1431 #define PTHREAD_CONDATTR_SIZE (sizeof (pthread_condattr_t))
1432 #define PTHREAD_COND_SIZE (sizeof (pthread_cond_t))
1433 #define PTHREAD_RWLOCKATTR_SIZE (sizeof (pthread_rwlockattr_t))
1434 #define PTHREAD_RWLOCK_SIZE (sizeof (pthread_rwlock_t))
1435 #define PTHREAD_ONCE_SIZE (sizeof (pthread_once_t))
1438 CND(PTHREAD_SIZE, "pthread_t")
1439 CND(PTHREAD_ATTR_SIZE, "pthread_attr_t")
1440 CND(PTHREAD_MUTEXATTR_SIZE, "pthread_mutexattr_t")
1441 CND(PTHREAD_MUTEX_SIZE, "pthread_mutex_t")
1442 CND(PTHREAD_CONDATTR_SIZE, "pthread_condattr_t")
1443 CND(PTHREAD_COND_SIZE, "pthread_cond_t")
1444 CND(PTHREAD_RWLOCKATTR_SIZE, "pthread_rwlockattr_t")
1445 CND(PTHREAD_RWLOCK_SIZE, "pthread_rwlock_t")
1446 CND(PTHREAD_ONCE_SIZE, "pthread_once_t")
1448 #endif /* __APPLE__ || __linux__ */
1451 ** System-specific constants follow
1452 ** Each section should be activated if compiling for the corresponding
1453 ** platform *or* generating the dummy version for runtime test compilation.
1456 #if defined (__vxworks) || defined (DUMMY)
1460 --------------------------------
1461 -- VxWorks-specific constants --
1462 --------------------------------
1464 -- These constants may be used only within the VxWorks version of
1465 -- GNAT.Sockets.Thin.
1468 CND(OK, "VxWorks generic success")
1469 CND(ERROR, "VxWorks generic error")
1471 #endif /* __vxworks */
1473 #if defined (__MINGW32__) || defined (DUMMY)
1476 ------------------------------
1477 -- MinGW-specific constants --
1478 ------------------------------
1480 -- These constants may be used only within the MinGW version of
1481 -- GNAT.Sockets.Thin.
1484 CND(WSASYSNOTREADY, "System not ready")
1485 CND(WSAVERNOTSUPPORTED, "Version not supported")
1486 CND(WSANOTINITIALISED, "Winsock not initialized")
1487 CND(WSAEDISCON, "Disconnected")
1489 #endif /* __MINGW32__ */
1492 ** End of constants definitions
1501 end System.OS_Constants;