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 (__mips) && defined (__sgi)
89 /** For IRIX 6, _XOPEN5 must be defined and _XOPEN_IOV_MAX must be used as
90 ** IOV_MAX, otherwise IOV_MAX is not defined. IRIX 5 has neither.
94 #define IOV_MAX _XOPEN_IOV_MAX
98 /* Include gsocket.h before any system header so it can redefine FD_SETSIZE */
108 #if defined (__alpha__) && defined (__osf__)
109 /** Tru64 is unable to do vector IO operations with default value of IOV_MAX,
110 ** so its value is redefined to a small one which is known to work properly.
117 /** VMS is unable to do vector IO operations with default value of IOV_MAX,
118 ** so its value is redefined to a small one which is known to work properly.
124 #if ! (defined (__vxworks) || defined (__VMS) || defined (__MINGW32__) || \
125 defined (__nucleus__))
126 # define HAVE_TERMIOS
129 #if defined (__vxworks)
132 ** For VxWorks, always include vxWorks.h (gsocket.h provides it only for
133 ** the case of runtime libraries that support sockets).
136 # include <vxWorks.h>
141 # if defined (TARGET)
142 # error TARGET may not be defined when generating the dummy version
144 # define TARGET "batch runtime compilation (dummy values)"
147 # if !(defined (HAVE_SOCKETS) && defined (HAVE_TERMIOS))
148 # error Features missing on platform
156 # error Please define TARGET
164 # include <termios.h>
172 # include <pthread.h>
181 # define _VAL(x) counter++
186 #define CND(name,comment) \
187 printf ("\n->CND:$%d:" #name ":$%d:" comment, __LINE__, ((int) _VAL (name)));
189 #define CNS(name,comment) \
190 printf ("\n->CNS:$%d:" #name ":" name ":" comment, __LINE__);
192 #define C(sname,type,value,comment)\
193 printf ("\n->C:$%d:" sname ":" #type ":" value ":" comment, __LINE__);
196 printf ("\n->TXT:$%d:" text, __LINE__);
200 #define CND(name, comment) \
201 asm volatile("\n->CND:%0:" #name ":%1:" comment \
202 : : "i" (__LINE__), "i" ((int) name));
203 /* Decimal constant in the range of type "int" */
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->TXT:%0:" text \
222 #define CST(name,comment) C(#name,String,name,comment)
224 #define STR(x) STR1(x)
228 unsigned int _CRT_fmode = _O_BINARY;
235 -- This package provides target dependent definitions of constant for use
236 -- by the GNAT runtime library. This package should not be directly with'd
237 -- by an application program.
239 -- This file is generated automatically, do not modify it by hand! Instead,
240 -- make changes to s-oscons-tmplt.c and rebuild the GNAT runtime library.
244 ** Do not change the format of the line below without also updating the
247 TXT("-- This is the version for " TARGET)
252 ** The type definitions for struct hostent components uses Interfaces.C
255 TXT("with Interfaces.C;")
259 package System.OS_Constants is
265 ** General constants (all platforms)
270 -----------------------------
271 -- Platform identification --
272 -----------------------------
274 type OS_Type is (Windows, VMS, Other_OS);
276 #if defined (__MINGW32__)
277 # define TARGET_OS "Windows"
278 #elif defined (__VMS)
279 # define TARGET_OS "VMS"
281 # define TARGET_OS "Other_OS"
283 C("Target_OS", OS_Type, TARGET_OS, "")
284 #define Target_Name TARGET
295 # define IOV_MAX INT_MAX
297 CND(IOV_MAX, "Maximum writev iovcnt")
301 ---------------------
302 -- File open modes --
303 ---------------------
310 CND(O_RDWR, "Read/write")
315 CND(O_NOCTTY, "Don't change ctrl tty")
320 CND(O_NDELAY, "Nonblocking")
324 ----------------------
325 -- Fcntl operations --
326 ----------------------
333 CND(F_GETFL, "Get flags")
338 CND(F_SETFL, "Set flags")
351 CND(FNDELAY, "Nonblocking")
355 ----------------------
356 -- Ioctl operations --
357 ----------------------
364 CND(FIONBIO, "Set/clear non-blocking io")
369 CND(FIONREAD, "How many bytes to read")
377 -- The following constants are defined from <errno.h>
383 CND(EAGAIN, "Try again")
388 CND(ENOENT, "File not found")
393 CND(ENOMEM, "Out of memory")
398 -- The following constants are defined from <winsock2.h> (WSA*)
403 ** For sockets-related errno values on Windows, gsocket.h redefines
412 CND(EACCES, "Permission denied")
415 # define EADDRINUSE -1
417 CND(EADDRINUSE, "Address already in use")
419 #ifndef EADDRNOTAVAIL
420 # define EADDRNOTAVAIL -1
422 CND(EADDRNOTAVAIL, "Cannot assign address")
425 # define EAFNOSUPPORT -1
427 CND(EAFNOSUPPORT, "Addr family not supported")
432 CND(EALREADY, "Operation in progress")
437 CND(EBADF, "Bad file descriptor")
440 # define ECONNABORTED -1
442 CND(ECONNABORTED, "Connection aborted")
445 # define ECONNREFUSED -1
447 CND(ECONNREFUSED, "Connection refused")
450 # define ECONNRESET -1
452 CND(ECONNRESET, "Connection reset by peer")
455 # define EDESTADDRREQ -1
457 CND(EDESTADDRREQ, "Destination addr required")
462 CND(EFAULT, "Bad address")
465 # define EHOSTDOWN -1
467 CND(EHOSTDOWN, "Host is down")
470 # define EHOSTUNREACH -1
472 CND(EHOSTUNREACH, "No route to host")
475 # define EINPROGRESS -1
477 CND(EINPROGRESS, "Operation now in progress")
482 CND(EINTR, "Interrupted system call")
487 CND(EINVAL, "Invalid argument")
492 CND(EIO, "Input output error")
497 CND(EISCONN, "Socket already connected")
502 CND(ELOOP, "Too many symbolic links")
507 CND(EMFILE, "Too many open files")
512 CND(EMSGSIZE, "Message too long")
515 # define ENAMETOOLONG -1
517 CND(ENAMETOOLONG, "Name too long")
522 CND(ENETDOWN, "Network is down")
525 # define ENETRESET -1
527 CND(ENETRESET, "Disconn. on network reset")
530 # define ENETUNREACH -1
532 CND(ENETUNREACH, "Network is unreachable")
537 CND(ENOBUFS, "No buffer space available")
540 # define ENOPROTOOPT -1
542 CND(ENOPROTOOPT, "Protocol not available")
547 CND(ENOTCONN, "Socket not connected")
552 CND(ENOTSOCK, "Operation on non socket")
555 # define EOPNOTSUPP -1
557 CND(EOPNOTSUPP, "Operation not supported")
562 CND(EPIPE, "Broken pipe")
565 # define EPFNOSUPPORT -1
567 CND(EPFNOSUPPORT, "Unknown protocol family")
569 #ifndef EPROTONOSUPPORT
570 # define EPROTONOSUPPORT -1
572 CND(EPROTONOSUPPORT, "Unknown protocol")
575 # define EPROTOTYPE -1
577 CND(EPROTOTYPE, "Unknown protocol type")
582 CND(ERANGE, "Result too large")
585 # define ESHUTDOWN -1
587 CND(ESHUTDOWN, "Cannot send once shutdown")
589 #ifndef ESOCKTNOSUPPORT
590 # define ESOCKTNOSUPPORT -1
592 CND(ESOCKTNOSUPPORT, "Socket type not supported")
595 # define ETIMEDOUT -1
597 CND(ETIMEDOUT, "Connection timed out")
600 # define ETOOMANYREFS -1
602 CND(ETOOMANYREFS, "Too many references")
605 # define EWOULDBLOCK -1
607 CND(EWOULDBLOCK, "Operation would block")
610 ** Terminal I/O constants
617 ----------------------
618 -- Terminal control --
619 ----------------------
626 CND(TCSANOW, "Immediate")
631 CND(TCIFLUSH, "Flush input")
641 CND(CRTSCTS, "Hardware flow control")
651 CND(CS5, "5 data bits")
656 CND(CS6, "6 data bits")
661 CND(CS7, "7 data bits")
666 CND(CS8, "8 data bits")
671 CND(CSTOPB, "2 stop bits")
676 CND(PARENB, "Parity enable")
681 CND(PARODD, "Parity odd")
731 CND(B1200, "1200 bps")
736 CND(B1800, "1800 bps")
741 CND(B2400, "2400 bps")
746 CND(B4800, "4800 bps")
751 CND(B9600, "9600 bps")
756 CND(B19200, "19200 bps")
761 CND(B38400, "38400 bps")
766 CND(B57600, "57600 bps")
771 CND(B115200, "115200 bps")
776 CND(B230400, "230400 bps")
781 CND(B460800, "460800 bps")
786 CND(B500000, "500000 bps")
791 CND(B576000, "576000 bps")
796 CND(B921600, "921600 bps")
801 CND(B1000000, "1000000 bps")
806 CND(B1152000, "1152000 bps")
811 CND(B1500000, "1500000 bps")
816 CND(B2000000, "2000000 bps")
821 CND(B2500000, "2500000 bps")
826 CND(B3000000, "3000000 bps")
831 CND(B3500000, "3500000 bps")
836 CND(B4000000, "4000000 bps")
840 ---------------------------------
841 -- Terminal control characters --
842 ---------------------------------
849 CND(VINTR, "Interrupt")
874 CND(VTIME, "Read timeout")
879 CND(VMIN, "Read min chars")
889 CND(VSTART, "Flow control start")
894 CND(VSTOP, "Flow control stop")
899 CND(VSUSP, "Suspend")
909 CND(VREPRINT, "Reprint unread")
914 CND(VDISCARD, "Discard pending")
919 CND(VWERASE, "Word erase")
924 CND(VLNEXT, "Literal next")
929 CND(VEOL2, "Alternative EOL")
931 #endif /* HAVE_TERMIOS */
935 -----------------------------
936 -- Pseudo terminal library --
937 -----------------------------
941 #if defined (__FreeBSD__) || defined (linux)
942 # define PTY_Library "-lutil"
944 # define PTY_Library ""
946 CST(PTY_Library, "for g-exptty")
965 CND(AF_INET, "IPv4 address family")
968 ** RTEMS lies and defines AF_INET6 even though there is no IPV6 support.
969 ** Its TCP/IP stack is in transition. It has newer .h files but no IPV6 yet.
971 #if defined(__rtems__)
976 ** Tru64 UNIX V4.0F defines AF_INET6 without IPv6 support, specifically
977 ** without struct sockaddr_in6. We use _SS_MAXSIZE (used for the definition
978 ** of struct sockaddr_storage on Tru64 UNIX V5.1) to detect this.
980 #if defined(__osf__) && !defined(_SS_MAXSIZE)
987 # define HAVE_AF_INET6 1
989 CND(AF_INET6, "IPv6 address family")
1000 # define SOCK_STREAM -1
1002 CND(SOCK_STREAM, "Stream socket")
1005 # define SOCK_DGRAM -1
1007 CND(SOCK_DGRAM, "Datagram socket")
1017 #ifndef HOST_NOT_FOUND
1018 # define HOST_NOT_FOUND -1
1020 CND(HOST_NOT_FOUND, "Unknown host")
1023 # define TRY_AGAIN -1
1025 CND(TRY_AGAIN, "Host name lookup failure")
1030 CND(NO_DATA, "No data record for name")
1033 # define NO_RECOVERY -1
1035 CND(NO_RECOVERY, "Non recoverable errors")
1039 --------------------
1040 -- Shutdown modes --
1041 --------------------
1048 CND(SHUT_RD, "No more recv")
1053 CND(SHUT_WR, "No more send")
1056 # define SHUT_RDWR -1
1058 CND(SHUT_RDWR, "No more recv/send")
1062 ---------------------
1063 -- Protocol levels --
1064 ---------------------
1069 # define SOL_SOCKET -1
1071 CND(SOL_SOCKET, "Options for socket level")
1074 # define IPPROTO_IP -1
1076 CND(IPPROTO_IP, "Dummy protocol for IP")
1079 # define IPPROTO_UDP -1
1081 CND(IPPROTO_UDP, "UDP")
1084 # define IPPROTO_TCP -1
1086 CND(IPPROTO_TCP, "TCP")
1099 CND(MSG_OOB, "Process out-of-band data")
1102 # define MSG_PEEK -1
1104 CND(MSG_PEEK, "Peek at incoming data")
1109 CND(MSG_EOR, "Send end of record")
1113 /* The value of MSG_WAITALL is 8. Nevertheless winsock.h doesn't
1114 define it, but it is still usable as we link to winsock2 API. */
1115 # define MSG_WAITALL (1 << 3)
1117 # define MSG_WAITALL -1
1120 CND(MSG_WAITALL, "Wait for full reception")
1122 #ifndef MSG_NOSIGNAL
1123 # define MSG_NOSIGNAL -1
1125 CND(MSG_NOSIGNAL, "No SIGPIPE on send")
1128 # define MSG_Forced_Flags "MSG_NOSIGNAL"
1130 # define MSG_Forced_Flags "0"
1132 CNS(MSG_Forced_Flags, "")
1134 -- Flags set on all send(2) calls
1139 --------------------
1140 -- Socket options --
1141 --------------------
1146 # define TCP_NODELAY -1
1148 CND(TCP_NODELAY, "Do not coalesce packets")
1150 #ifndef SO_REUSEADDR
1151 # define SO_REUSEADDR -1
1153 CND(SO_REUSEADDR, "Bind reuse local address")
1155 #ifndef SO_REUSEPORT
1156 # define SO_REUSEPORT -1
1158 CND(SO_REUSEPORT, "Bind reuse port number")
1160 #ifndef SO_KEEPALIVE
1161 # define SO_KEEPALIVE -1
1163 CND(SO_KEEPALIVE, "Enable keep-alive msgs")
1166 # define SO_LINGER -1
1168 CND(SO_LINGER, "Defer close to flush data")
1170 #ifndef SO_BROADCAST
1171 # define SO_BROADCAST -1
1173 CND(SO_BROADCAST, "Can send broadcast msgs")
1176 # define SO_SNDBUF -1
1178 CND(SO_SNDBUF, "Set/get send buffer size")
1181 # define SO_RCVBUF -1
1183 CND(SO_RCVBUF, "Set/get recv buffer size")
1186 # define SO_SNDTIMEO -1
1188 CND(SO_SNDTIMEO, "Emission timeout")
1191 # define SO_RCVTIMEO -1
1193 CND(SO_RCVTIMEO, "Reception timeout")
1196 # define SO_ERROR -1
1198 CND(SO_ERROR, "Get/clear error status")
1200 #ifndef IP_MULTICAST_IF
1201 # define IP_MULTICAST_IF -1
1203 CND(IP_MULTICAST_IF, "Set/get mcast interface")
1205 #ifndef IP_MULTICAST_TTL
1206 # define IP_MULTICAST_TTL -1
1208 CND(IP_MULTICAST_TTL, "Set/get multicast TTL")
1210 #ifndef IP_MULTICAST_LOOP
1211 # define IP_MULTICAST_LOOP -1
1213 CND(IP_MULTICAST_LOOP, "Set/get mcast loopback")
1215 #ifndef IP_ADD_MEMBERSHIP
1216 # define IP_ADD_MEMBERSHIP -1
1218 CND(IP_ADD_MEMBERSHIP, "Join a multicast group")
1220 #ifndef IP_DROP_MEMBERSHIP
1221 # define IP_DROP_MEMBERSHIP -1
1223 CND(IP_DROP_MEMBERSHIP, "Leave a multicast group")
1226 # define IP_PKTINFO -1
1228 CND(IP_PKTINFO, "Get datagram info")
1232 ----------------------
1233 -- Type definitions --
1234 ----------------------
1241 -- Sizes (in bytes) of the components of struct timeval
1243 #define SIZEOF_tv_sec (sizeof tv.tv_sec)
1244 CND(SIZEOF_tv_sec, "tv_sec")
1245 #define SIZEOF_tv_usec (sizeof tv.tv_usec)
1246 CND(SIZEOF_tv_usec, "tv_usec")
1249 -- Maximum allowed value for tv_sec
1253 ** On Solaris and IRIX, field tv_sec in struct timeval has an undocumented
1254 ** hard-wired limit of 100 million.
1255 ** On IA64 HP-UX the limit is 2**31 - 1.
1257 #if defined (sun) || (defined (__mips) && defined (__sgi))
1258 # define MAX_tv_sec "100_000_000"
1260 #elif defined (__hpux__)
1261 # define MAX_tv_sec "16#7fffffff#"
1264 # define MAX_tv_sec "2 ** (SIZEOF_tv_sec * 8 - 1) - 1"
1270 -- Sizes of various data types
1273 #define SIZEOF_sockaddr_in (sizeof (struct sockaddr_in))
1274 CND(SIZEOF_sockaddr_in, "struct sockaddr_in")
1275 #ifdef HAVE_AF_INET6
1276 # define SIZEOF_sockaddr_in6 (sizeof (struct sockaddr_in6))
1278 # define SIZEOF_sockaddr_in6 0
1280 CND(SIZEOF_sockaddr_in6, "struct sockaddr_in6")
1282 #define SIZEOF_fd_set (sizeof (fd_set))
1283 CND(SIZEOF_fd_set, "fd_set");
1284 CND(FD_SETSIZE, "Max fd value");
1286 #define SIZEOF_struct_hostent (sizeof (struct hostent))
1287 CND(SIZEOF_struct_hostent, "struct hostent");
1289 #define SIZEOF_struct_servent (sizeof (struct servent))
1290 CND(SIZEOF_struct_servent, "struct servent");
1292 #if defined (__linux__)
1293 #define SIZEOF_sigset (sizeof (sigset_t))
1294 CND(SIZEOF_sigset, "sigset");
1298 -- Fields of struct msghdr
1301 #if defined (__sun__) || defined (__hpux__)
1302 # define msg_iovlen_t "int"
1304 # define msg_iovlen_t "size_t"
1307 TXT(" subtype Msg_Iovlen_T is Interfaces.C." msg_iovlen_t ";")
1311 ----------------------------------------
1312 -- Properties of supported interfaces --
1313 ----------------------------------------
1317 CND(Need_Netdb_Buffer, "Need buffer for Netdb ops")
1318 CND(Need_Netdb_Lock, "Need lock for Netdb ops")
1319 CND(Has_Sockaddr_Len, "Sockaddr has sa_len field")
1322 ** Do not change the format of the line below without also updating the
1325 C("Thread_Blocking_IO", Boolean, "True", "")
1327 -- Set False for contexts where socket i/o are process blocking
1331 #ifdef HAVE_INET_PTON
1332 # define Inet_Pton_Linkname "inet_pton"
1334 # define Inet_Pton_Linkname "__gnat_inet_pton"
1336 CST(Inet_Pton_Linkname, "")
1338 #endif /* HAVE_SOCKETS */
1342 ---------------------
1343 -- Threads support --
1344 ---------------------
1346 -- Clock identifier definitions
1350 /* Note: On HP-UX, CLOCK_REALTIME is an enum, not a macro. */
1352 #if defined(CLOCK_REALTIME) || defined (__hpux__)
1353 # define HAVE_CLOCK_REALTIME
1356 #ifdef HAVE_CLOCK_REALTIME
1357 CND(CLOCK_REALTIME, "System realtime clock")
1360 #ifdef CLOCK_MONOTONIC
1361 CND(CLOCK_MONOTONIC, "System monotonic clock")
1364 #ifdef CLOCK_FASTEST
1365 CND(CLOCK_FASTEST, "Fastest clock")
1369 CND(CLOCK_SGI_FAST, "SGI fast clock")
1370 CND(CLOCK_SGI_CYCLE, "SGI CPU clock")
1373 #ifndef CLOCK_THREAD_CPUTIME_ID
1374 # define CLOCK_THREAD_CPUTIME_ID -1
1376 CND(CLOCK_THREAD_CPUTIME_ID, "Thread CPU clock")
1378 #if defined(__APPLE__)
1379 /* There's no clock_gettime or clock_id's on Darwin, generate a dummy value */
1380 # define CLOCK_RT_Ada "-1"
1382 #elif defined(FreeBSD) || defined(_AIX)
1383 /** On these platforms use system provided monotonic clock instead of
1384 ** the default CLOCK_REALTIME. We then need to set up cond var attributes
1385 ** appropriately (see thread.c).
1387 # define CLOCK_RT_Ada "CLOCK_MONOTONIC"
1388 # define NEED_PTHREAD_CONDATTR_SETCLOCK
1390 #elif defined(HAVE_CLOCK_REALTIME)
1391 /* By default use CLOCK_REALTIME */
1392 # define CLOCK_RT_Ada "CLOCK_REALTIME"
1396 CNS(CLOCK_RT_Ada, "")
1399 #if defined (__APPLE__) || defined (__linux__) || defined (DUMMY)
1402 -- Sizes of pthread data types
1406 #if defined (__APPLE__) || defined (DUMMY)
1408 -- (on Darwin, these are just placeholders)
1411 #define PTHREAD_SIZE __PTHREAD_SIZE__
1412 #define PTHREAD_ATTR_SIZE __PTHREAD_ATTR_SIZE__
1413 #define PTHREAD_MUTEXATTR_SIZE __PTHREAD_MUTEXATTR_SIZE__
1414 #define PTHREAD_MUTEX_SIZE __PTHREAD_MUTEX_SIZE__
1415 #define PTHREAD_CONDATTR_SIZE __PTHREAD_CONDATTR_SIZE__
1416 #define PTHREAD_COND_SIZE __PTHREAD_COND_SIZE__
1417 #define PTHREAD_RWLOCKATTR_SIZE __PTHREAD_RWLOCKATTR_SIZE__
1418 #define PTHREAD_RWLOCK_SIZE __PTHREAD_RWLOCK_SIZE__
1419 #define PTHREAD_ONCE_SIZE __PTHREAD_ONCE_SIZE__
1421 #define PTHREAD_SIZE (sizeof (pthread_t))
1422 #define PTHREAD_ATTR_SIZE (sizeof (pthread_attr_t))
1423 #define PTHREAD_MUTEXATTR_SIZE (sizeof (pthread_mutexattr_t))
1424 #define PTHREAD_MUTEX_SIZE (sizeof (pthread_mutex_t))
1425 #define PTHREAD_CONDATTR_SIZE (sizeof (pthread_condattr_t))
1426 #define PTHREAD_COND_SIZE (sizeof (pthread_cond_t))
1427 #define PTHREAD_RWLOCKATTR_SIZE (sizeof (pthread_rwlockattr_t))
1428 #define PTHREAD_RWLOCK_SIZE (sizeof (pthread_rwlock_t))
1429 #define PTHREAD_ONCE_SIZE (sizeof (pthread_once_t))
1432 CND(PTHREAD_SIZE, "pthread_t")
1433 CND(PTHREAD_ATTR_SIZE, "pthread_attr_t")
1434 CND(PTHREAD_MUTEXATTR_SIZE, "pthread_mutexattr_t")
1435 CND(PTHREAD_MUTEX_SIZE, "pthread_mutex_t")
1436 CND(PTHREAD_CONDATTR_SIZE, "pthread_condattr_t")
1437 CND(PTHREAD_COND_SIZE, "pthread_cond_t")
1438 CND(PTHREAD_RWLOCKATTR_SIZE, "pthread_rwlockattr_t")
1439 CND(PTHREAD_RWLOCK_SIZE, "pthread_rwlock_t")
1440 CND(PTHREAD_ONCE_SIZE, "pthread_once_t")
1442 #endif /* __APPLE__ || __linux__ */
1445 ** System-specific constants follow
1446 ** Each section should be activated if compiling for the corresponding
1447 ** platform *or* generating the dummy version for runtime test compilation.
1450 #if defined (__vxworks) || defined (DUMMY)
1454 --------------------------------
1455 -- VxWorks-specific constants --
1456 --------------------------------
1458 -- These constants may be used only within the VxWorks version of
1459 -- GNAT.Sockets.Thin.
1462 CND(OK, "VxWorks generic success")
1463 CND(ERROR, "VxWorks generic error")
1465 #endif /* __vxworks */
1467 #if defined (__MINGW32__) || defined (DUMMY)
1470 ------------------------------
1471 -- MinGW-specific constants --
1472 ------------------------------
1474 -- These constants may be used only within the MinGW version of
1475 -- GNAT.Sockets.Thin.
1478 CND(WSASYSNOTREADY, "System not ready")
1479 CND(WSAVERNOTSUPPORTED, "Version not supported")
1480 CND(WSANOTINITIALISED, "Winsock not initialized")
1481 CND(WSAEDISCON, "Disconnected")
1483 #endif /* __MINGW32__ */
1486 ** End of constants definitions
1495 end System.OS_Constants;