Merged revisions 143552,143554,143557,143560,143562,143564-143567,143570-143573,14357...
[official-gcc.git] / gcc / ada / s-oscons-tmplt.c
blob8298f7526def12a32a5e092ff1acd1c2e04bcb98
1 /*
2 ------------------------------------------------------------------------------
3 -- --
4 -- GNAT COMPILER COMPONENTS --
5 -- --
6 -- S Y S T E M . O S _ C O N S T A N T S --
7 -- --
8 -- S p e c --
9 -- --
10 -- Copyright (C) 2000-2009, Free Software Foundation, Inc. --
11 -- --
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 2, 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. See the GNU General Public License --
18 -- for more details. You should have received a copy of the GNU General --
19 -- Public License distributed with GNAT; see file COPYING. If not, write --
20 -- to the Free Software Foundation, 51 Franklin Street, Fifth Floor, --
21 -- Boston, MA 02110-1301, USA. --
22 -- --
23 -- As a special exception, if other files instantiate generics from this --
24 -- unit, or you link this unit with other files to produce an executable, --
25 -- this unit does not by itself cause the resulting executable to be --
26 -- covered by the GNU General Public License. This exception does not --
27 -- however invalidate any other reasons why the executable file might be --
28 -- covered by the GNU Public License. --
29 -- --
30 -- GNAT was originally developed by the GNAT team at New York University. --
31 -- Extensive contributions were provided by Ada Core Technologies Inc. --
32 -- --
33 ------------------------------------------------------------------------------
37 /**
38 ** This template file is used while building the GNAT runtime library to
39 ** generate package System.OS_Constants (s-oscons.ads).
41 ** The generation process is:
42 ** 1. the platform-independent extraction tool xoscons is built with the
43 ** base native compiler
44 ** 2. this template is processed by the cross C compiler to produce
45 ** a list of constant values
46 ** 3. the comments in this template and the list of values are processed
47 ** by xoscons to generate s-oscons.ads.
49 ** Any comment occurring in this file whose start and end markers are on
50 ** a line by themselves (see above) is copied verbatim to s-oscons.ads.
51 ** All other comments are ignored. Note that the build process first passes
52 ** this file through the C preprocessor, so comments that occur in a section
53 ** that is conditioned by a #if directive will be copied to the output only
54 ** when it applies.
56 ** Two methods are supported to generate the list of constant values,
57 ** s-oscons-tmpl.s.
59 ** The default one assumes that the template can be compiled by the newly-
60 ** build cross compiler. It uses markup produced in the (pseudo-)assembly
61 ** listing:
63 ** xgcc -DTARGET=\"$target\" -C -E s-oscons-tmplt.c > s-oscons-tmplt.i
64 ** xgcc -S s-oscons-tmplt.i
65 ** xoscons
67 ** Alternatively, if s-oscons-tmplt.c must be compiled with a proprietary
68 ** compiler (e.g. the native DEC CC on OpenVMS), the NATIVE macro should
69 ** be defined, and the resulting program executed:
71 ** $ CC/DEFINE=("TARGET=""OpenVMS""",NATIVE)
72 ** /PREPROCESS_ONLY /COMMENTS=AS_IS s-oscons-tmplt
73 ** $ CC/DEFINE=("TARGET=""OpenVMS""",NATIVE) s-oscons-tmplt
74 ** $ LINK s-oscons-tmplt
75 ** $ DEFINE/USER SYS$OUTPUT s-oscons-tmplt.s
76 ** $ RUN s-oscons-tmplt
77 ** $ RUN xoscons
79 **/
81 #ifndef TARGET
82 # error Please define TARGET
83 #endif
85 #include <stdlib.h>
86 #include <string.h>
87 #include <limits.h>
88 #include <fcntl.h>
90 #if ! (defined (__vxworks) || defined (__VMS) || defined (__MINGW32__) || \
91 defined (__nucleus__))
92 # define HAVE_TERMIOS
93 #endif
95 #include "gsocket.h"
97 #ifndef HAVE_SOCKETS
98 # include <errno.h>
99 #endif
101 #ifdef HAVE_TERMIOS
102 # include <termios.h>
103 #endif
105 #ifdef NATIVE
106 #include <stdio.h>
107 #define CND(name,comment) \
108 printf ("\n->CND:$%d:" #name ":$%d:" comment, __LINE__, ((int) name));
110 #define CNS(name,comment) \
111 printf ("\n->CNS:$%d:" #name ":" name ":" comment, __LINE__);
113 #define TXT(text) \
114 printf ("\n->TXT:$%d:" text, __LINE__);
116 #else
118 #define CND(name, comment) \
119 asm volatile("\n->CND:%0:" #name ":%1:" comment \
120 : : "i" (__LINE__), "i" ((int) name));
121 /* Decimal constant in the range of type "int" */
123 #define CNS(name, comment) \
124 asm volatile("\n->CNS:%0:" #name ":" name ":" comment \
125 : : "i" (__LINE__));
126 /* General expression constant */
128 #define TXT(text) \
129 asm volatile("\n->TXT:%0:" text \
130 : : "i" (__LINE__));
131 /* Freeform text */
133 #endif
135 #ifdef __MINGW32__
136 unsigned int _CRT_fmode = _O_BINARY;
137 #endif
140 main (void) {
143 -- This package provides target dependent definitions of constant for use
144 -- by the GNAT runtime library. This package should not be directly with'd
145 -- by an application program.
147 -- This file is generated automatically, do not modify it by hand! Instead,
148 -- make changes to s-oscons-tmplt.c and rebuild the GNAT runtime library.
152 ** Do not change the format of the line below without also updating the
153 ** MaRTE Makefile.
155 TXT("-- This is the version for " TARGET)
156 TXT("")
158 #ifdef HAVE_SOCKETS
160 ** The type definitions for struct hostent components uses Interfaces.C
163 TXT("with Interfaces.C;")
164 #endif
167 package System.OS_Constants is
169 pragma Pure;
173 ** General constants (all platforms)
178 -------------------
179 -- System limits --
180 -------------------
184 #ifndef IOV_MAX
185 # define IOV_MAX INT_MAX
186 #endif
187 CND(IOV_MAX, "Maximum writev iovcnt")
191 ---------------------
192 -- File open modes --
193 ---------------------
197 #ifndef O_RDWR
198 # define O_RDWR -1
199 #endif
200 CND(O_RDWR, "Read/write")
202 #ifndef O_NOCTTY
203 # define O_NOCTTY -1
204 #endif
205 CND(O_NOCTTY, "Don't change ctrl tty")
207 #ifndef O_NDELAY
208 # define O_NDELAY -1
209 #endif
210 CND(O_NDELAY, "Nonblocking")
214 ----------------------
215 -- Fcntl operations --
216 ----------------------
220 #ifndef F_GETFL
221 # define F_GETFL -1
222 #endif
223 CND(F_GETFL, "Get flags")
225 #ifndef F_SETFL
226 # define F_SETFL -1
227 #endif
228 CND(F_SETFL, "Set flags")
232 -----------------
233 -- Fcntl flags --
234 -----------------
238 #ifndef FNDELAY
239 # define FNDELAY -1
240 #endif
241 CND(FNDELAY, "Nonblocking")
245 ----------------------
246 -- Ioctl operations --
247 ----------------------
251 #ifndef FIONBIO
252 # define FIONBIO -1
253 #endif
254 CND(FIONBIO, "Set/clear non-blocking io")
256 #ifndef FIONREAD
257 # define FIONREAD -1
258 #endif
259 CND(FIONREAD, "How many bytes to read")
263 ------------------
264 -- Errno values --
265 ------------------
267 -- The following constants are defined from <errno.h>
270 #ifndef EAGAIN
271 # define EAGAIN -1
272 #endif
273 CND(EAGAIN, "Try again")
275 #ifndef ENOENT
276 # define ENOENT -1
277 #endif
278 CND(ENOENT, "File not found")
280 #ifndef ENOMEM
281 # define ENOMEM -1
282 #endif
283 CND(ENOMEM, "Out of memory")
285 #ifdef __MINGW32__
288 -- The following constants are defined from <winsock2.h> (WSA*)
293 ** For sockets-related errno values on Windows, gsocket.h redefines
294 ** Exxx as WSAExxx.
297 #endif
299 #ifndef EACCES
300 # define EACCES -1
301 #endif
302 CND(EACCES, "Permission denied")
304 #ifndef EADDRINUSE
305 # define EADDRINUSE -1
306 #endif
307 CND(EADDRINUSE, "Address already in use")
309 #ifndef EADDRNOTAVAIL
310 # define EADDRNOTAVAIL -1
311 #endif
312 CND(EADDRNOTAVAIL, "Cannot assign address")
314 #ifndef EAFNOSUPPORT
315 # define EAFNOSUPPORT -1
316 #endif
317 CND(EAFNOSUPPORT, "Addr family not supported")
319 #ifndef EALREADY
320 # define EALREADY -1
321 #endif
322 CND(EALREADY, "Operation in progress")
324 #ifndef EBADF
325 # define EBADF -1
326 #endif
327 CND(EBADF, "Bad file descriptor")
329 #ifndef ECONNABORTED
330 # define ECONNABORTED -1
331 #endif
332 CND(ECONNABORTED, "Connection aborted")
334 #ifndef ECONNREFUSED
335 # define ECONNREFUSED -1
336 #endif
337 CND(ECONNREFUSED, "Connection refused")
339 #ifndef ECONNRESET
340 # define ECONNRESET -1
341 #endif
342 CND(ECONNRESET, "Connection reset by peer")
344 #ifndef EDESTADDRREQ
345 # define EDESTADDRREQ -1
346 #endif
347 CND(EDESTADDRREQ, "Destination addr required")
349 #ifndef EFAULT
350 # define EFAULT -1
351 #endif
352 CND(EFAULT, "Bad address")
354 #ifndef EHOSTDOWN
355 # define EHOSTDOWN -1
356 #endif
357 CND(EHOSTDOWN, "Host is down")
359 #ifndef EHOSTUNREACH
360 # define EHOSTUNREACH -1
361 #endif
362 CND(EHOSTUNREACH, "No route to host")
364 #ifndef EINPROGRESS
365 # define EINPROGRESS -1
366 #endif
367 CND(EINPROGRESS, "Operation now in progress")
369 #ifndef EINTR
370 # define EINTR -1
371 #endif
372 CND(EINTR, "Interrupted system call")
374 #ifndef EINVAL
375 # define EINVAL -1
376 #endif
377 CND(EINVAL, "Invalid argument")
379 #ifndef EIO
380 # define EIO -1
381 #endif
382 CND(EIO, "Input output error")
384 #ifndef EISCONN
385 # define EISCONN -1
386 #endif
387 CND(EISCONN, "Socket already connected")
389 #ifndef ELOOP
390 # define ELOOP -1
391 #endif
392 CND(ELOOP, "Too many symbolic links")
394 #ifndef EMFILE
395 # define EMFILE -1
396 #endif
397 CND(EMFILE, "Too many open files")
399 #ifndef EMSGSIZE
400 # define EMSGSIZE -1
401 #endif
402 CND(EMSGSIZE, "Message too long")
404 #ifndef ENAMETOOLONG
405 # define ENAMETOOLONG -1
406 #endif
407 CND(ENAMETOOLONG, "Name too long")
409 #ifndef ENETDOWN
410 # define ENETDOWN -1
411 #endif
412 CND(ENETDOWN, "Network is down")
414 #ifndef ENETRESET
415 # define ENETRESET -1
416 #endif
417 CND(ENETRESET, "Disconn. on network reset")
419 #ifndef ENETUNREACH
420 # define ENETUNREACH -1
421 #endif
422 CND(ENETUNREACH, "Network is unreachable")
424 #ifndef ENOBUFS
425 # define ENOBUFS -1
426 #endif
427 CND(ENOBUFS, "No buffer space available")
429 #ifndef ENOPROTOOPT
430 # define ENOPROTOOPT -1
431 #endif
432 CND(ENOPROTOOPT, "Protocol not available")
434 #ifndef ENOTCONN
435 # define ENOTCONN -1
436 #endif
437 CND(ENOTCONN, "Socket not connected")
439 #ifndef ENOTSOCK
440 # define ENOTSOCK -1
441 #endif
442 CND(ENOTSOCK, "Operation on non socket")
444 #ifndef EOPNOTSUPP
445 # define EOPNOTSUPP -1
446 #endif
447 CND(EOPNOTSUPP, "Operation not supported")
449 #ifndef EPFNOSUPPORT
450 # define EPFNOSUPPORT -1
451 #endif
452 CND(EPFNOSUPPORT, "Unknown protocol family")
454 #ifndef EPROTONOSUPPORT
455 # define EPROTONOSUPPORT -1
456 #endif
457 CND(EPROTONOSUPPORT, "Unknown protocol")
459 #ifndef EPROTOTYPE
460 # define EPROTOTYPE -1
461 #endif
462 CND(EPROTOTYPE, "Unknown protocol type")
464 #ifndef ESHUTDOWN
465 # define ESHUTDOWN -1
466 #endif
467 CND(ESHUTDOWN, "Cannot send once shutdown")
469 #ifndef ESOCKTNOSUPPORT
470 # define ESOCKTNOSUPPORT -1
471 #endif
472 CND(ESOCKTNOSUPPORT, "Socket type not supported")
474 #ifndef ETIMEDOUT
475 # define ETIMEDOUT -1
476 #endif
477 CND(ETIMEDOUT, "Connection timed out")
479 #ifndef ETOOMANYREFS
480 # define ETOOMANYREFS -1
481 #endif
482 CND(ETOOMANYREFS, "Too many references")
484 #ifndef EWOULDBLOCK
485 # define EWOULDBLOCK -1
486 #endif
487 CND(EWOULDBLOCK, "Operation would block")
490 ** Terminal I/O constants
493 #ifdef HAVE_TERMIOS
497 ----------------------
498 -- Terminal control --
499 ----------------------
503 #ifndef TCSANOW
504 # define TCSANOW -1
505 #endif
506 CND(TCSANOW, "Immediate")
508 #ifndef TCIFLUSH
509 # define TCIFLUSH -1
510 #endif
511 CND(TCIFLUSH, "Flush input")
513 #ifndef CLOCAL
514 # define CLOCAL -1
515 #endif
516 CND(CLOCAL, "Local")
518 #ifndef CRTSCTS
519 # define CRTSCTS -1
520 #endif
521 CND(CRTSCTS, "Hardware flow control")
523 #ifndef CREAD
524 # define CREAD -1
525 #endif
526 CND(CREAD, "Read")
528 #ifndef CS5
529 # define CS5 -1
530 #endif
531 CND(CS5, "5 data bits")
533 #ifndef CS6
534 # define CS6 -1
535 #endif
536 CND(CS6, "6 data bits")
538 #ifndef CS7
539 # define CS7 -1
540 #endif
541 CND(CS7, "7 data bits")
543 #ifndef CS8
544 # define CS8 -1
545 #endif
546 CND(CS8, "8 data bits")
548 #ifndef CSTOPB
549 # define CSTOPB -1
550 #endif
551 CND(CSTOPB, "2 stop bits")
553 #ifndef PARENB
554 # define PARENB -1
555 #endif
556 CND(PARENB, "Parity enable")
558 #ifndef PARODD
559 # define PARODD -1
560 #endif
561 CND(PARODD, "Parity odd")
563 #ifndef B0
564 # define B0 -1
565 #endif
566 CND(B0, "0 bps")
568 #ifndef B50
569 # define B50 -1
570 #endif
571 CND(B50, "50 bps")
573 #ifndef B75
574 # define B75 -1
575 #endif
576 CND(B75, "75 bps")
578 #ifndef B110
579 # define B110 -1
580 #endif
581 CND(B110, "110 bps")
583 #ifndef B134
584 # define B134 -1
585 #endif
586 CND(B134, "134 bps")
588 #ifndef B150
589 # define B150 -1
590 #endif
591 CND(B150, "150 bps")
593 #ifndef B200
594 # define B200 -1
595 #endif
596 CND(B200, "200 bps")
598 #ifndef B300
599 # define B300 -1
600 #endif
601 CND(B300, "300 bps")
603 #ifndef B600
604 # define B600 -1
605 #endif
606 CND(B600, "600 bps")
608 #ifndef B1200
609 # define B1200 -1
610 #endif
611 CND(B1200, "1200 bps")
613 #ifndef B1800
614 # define B1800 -1
615 #endif
616 CND(B1800, "1800 bps")
618 #ifndef B2400
619 # define B2400 -1
620 #endif
621 CND(B2400, "2400 bps")
623 #ifndef B4800
624 # define B4800 -1
625 #endif
626 CND(B4800, "4800 bps")
628 #ifndef B9600
629 # define B9600 -1
630 #endif
631 CND(B9600, "9600 bps")
633 #ifndef B19200
634 # define B19200 -1
635 #endif
636 CND(B19200, "19200 bps")
638 #ifndef B38400
639 # define B38400 -1
640 #endif
641 CND(B38400, "38400 bps")
643 #ifndef B57600
644 # define B57600 -1
645 #endif
646 CND(B57600, "57600 bps")
648 #ifndef B115200
649 # define B115200 -1
650 #endif
651 CND(B115200, "115200 bps")
653 #ifndef B230400
654 # define B230400 -1
655 #endif
656 CND(B230400, "230400 bps")
658 #ifndef B460800
659 # define B460800 -1
660 #endif
661 CND(B460800, "460800 bps")
663 #ifndef B500000
664 # define B500000 -1
665 #endif
666 CND(B500000, "500000 bps")
668 #ifndef B576000
669 # define B576000 -1
670 #endif
671 CND(B576000, "576000 bps")
673 #ifndef B921600
674 # define B921600 -1
675 #endif
676 CND(B921600, "921600 bps")
678 #ifndef B1000000
679 # define B1000000 -1
680 #endif
681 CND(B1000000, "1000000 bps")
683 #ifndef B1152000
684 # define B1152000 -1
685 #endif
686 CND(B1152000, "1152000 bps")
688 #ifndef B1500000
689 # define B1500000 -1
690 #endif
691 CND(B1500000, "1500000 bps")
693 #ifndef B2000000
694 # define B2000000 -1
695 #endif
696 CND(B2000000, "2000000 bps")
698 #ifndef B2500000
699 # define B2500000 -1
700 #endif
701 CND(B2500000, "2500000 bps")
703 #ifndef B3000000
704 # define B3000000 -1
705 #endif
706 CND(B3000000, "3000000 bps")
708 #ifndef B3500000
709 # define B3500000 -1
710 #endif
711 CND(B3500000, "3500000 bps")
713 #ifndef B4000000
714 # define B4000000 -1
715 #endif
716 CND(B4000000, "4000000 bps")
720 ---------------------------------
721 -- Terminal control characters --
722 ---------------------------------
726 #ifndef VINTR
727 # define VINTR -1
728 #endif
729 CND(VINTR, "Interrupt")
731 #ifndef VQUIT
732 # define VQUIT -1
733 #endif
734 CND(VQUIT, "Quit")
736 #ifndef VERASE
737 # define VERASE -1
738 #endif
739 CND(VERASE, "Erase")
741 #ifndef VKILL
742 # define VKILL -1
743 #endif
744 CND(VKILL, "Kill")
746 #ifndef VEOF
747 # define VEOF -1
748 #endif
749 CND(VEOF, "EOF")
751 #ifndef VTIME
752 # define VTIME -1
753 #endif
754 CND(VTIME, "Read timeout")
756 #ifndef VMIN
757 # define VMIN -1
758 #endif
759 CND(VMIN, "Read min chars")
761 #ifndef VSWTC
762 # define VSWTC -1
763 #endif
764 CND(VSWTC, "Switch")
766 #ifndef VSTART
767 # define VSTART -1
768 #endif
769 CND(VSTART, "Flow control start")
771 #ifndef VSTOP
772 # define VSTOP -1
773 #endif
774 CND(VSTOP, "Flow control stop")
776 #ifndef VSUSP
777 # define VSUSP -1
778 #endif
779 CND(VSUSP, "Suspend")
781 #ifndef VEOL
782 # define VEOL -1
783 #endif
784 CND(VEOL, "EOL")
786 #ifndef VREPRINT
787 # define VREPRINT -1
788 #endif
789 CND(VREPRINT, "Reprint unread")
791 #ifndef VDISCARD
792 # define VDISCARD -1
793 #endif
794 CND(VDISCARD, "Discard pending")
796 #ifndef VWERASE
797 # define VWERASE -1
798 #endif
799 CND(VWERASE, "Word erase")
801 #ifndef VLNEXT
802 # define VLNEXT -1
803 #endif
804 CND(VLNEXT, "Literal next")
806 #ifndef VEOL2
807 # define VEOL2 -1
808 #endif
809 CND(VEOL2, "Alternative EOL")
811 #endif /* HAVE_TERMIOS */
814 ** Sockets constants
817 #ifdef HAVE_SOCKETS
821 --------------
822 -- Families --
823 --------------
827 #ifndef AF_INET
828 # define AF_INET -1
829 #endif
830 CND(AF_INET, "IPv4 address family")
833 ** RTEMS lies and defines AF_INET6 even though there is no IPV6 support.
834 ** Its TCP/IP stack is in transition. It has newer .h files but no IPV6 yet.
836 #if defined(__rtems__)
837 # undef AF_INET6
838 #endif
841 ** Tru64 UNIX V4.0F defines AF_INET6 without IPv6 support, specificially
842 ** without struct sockaddr_in6. We use _SS_MAXSIZE (used for the definition
843 ** of struct sockaddr_storage on Tru64 UNIX V5.1) to detect this.
845 #if defined(__osf__) && !defined(_SS_MAXSIZE)
846 # undef AF_INET6
847 #endif
849 #ifndef AF_INET6
850 # define AF_INET6 -1
851 #else
852 # define HAVE_AF_INET6 1
853 #endif
854 CND(AF_INET6, "IPv6 address family")
858 ------------------
859 -- Socket modes --
860 ------------------
864 #ifndef SOCK_STREAM
865 # define SOCK_STREAM -1
866 #endif
867 CND(SOCK_STREAM, "Stream socket")
869 #ifndef SOCK_DGRAM
870 # define SOCK_DGRAM -1
871 #endif
872 CND(SOCK_DGRAM, "Datagram socket")
876 -----------------
877 -- Host errors --
878 -----------------
882 #ifndef HOST_NOT_FOUND
883 # define HOST_NOT_FOUND -1
884 #endif
885 CND(HOST_NOT_FOUND, "Unknown host")
887 #ifndef TRY_AGAIN
888 # define TRY_AGAIN -1
889 #endif
890 CND(TRY_AGAIN, "Host name lookup failure")
892 #ifndef NO_DATA
893 # define NO_DATA -1
894 #endif
895 CND(NO_DATA, "No data record for name")
897 #ifndef NO_RECOVERY
898 # define NO_RECOVERY -1
899 #endif
900 CND(NO_RECOVERY, "Non recoverable errors")
904 --------------------
905 -- Shutdown modes --
906 --------------------
910 #ifndef SHUT_RD
911 # define SHUT_RD -1
912 #endif
913 CND(SHUT_RD, "No more recv")
915 #ifndef SHUT_WR
916 # define SHUT_WR -1
917 #endif
918 CND(SHUT_WR, "No more send")
920 #ifndef SHUT_RDWR
921 # define SHUT_RDWR -1
922 #endif
923 CND(SHUT_RDWR, "No more recv/send")
927 ---------------------
928 -- Protocol levels --
929 ---------------------
933 #ifndef SOL_SOCKET
934 # define SOL_SOCKET -1
935 #endif
936 CND(SOL_SOCKET, "Options for socket level")
938 #ifndef IPPROTO_IP
939 # define IPPROTO_IP -1
940 #endif
941 CND(IPPROTO_IP, "Dummy protocol for IP")
943 #ifndef IPPROTO_UDP
944 # define IPPROTO_UDP -1
945 #endif
946 CND(IPPROTO_UDP, "UDP")
948 #ifndef IPPROTO_TCP
949 # define IPPROTO_TCP -1
950 #endif
951 CND(IPPROTO_TCP, "TCP")
955 -------------------
956 -- Request flags --
957 -------------------
961 #ifndef MSG_OOB
962 # define MSG_OOB -1
963 #endif
964 CND(MSG_OOB, "Process out-of-band data")
966 #ifndef MSG_PEEK
967 # define MSG_PEEK -1
968 #endif
969 CND(MSG_PEEK, "Peek at incoming data")
971 #ifndef MSG_EOR
972 # define MSG_EOR -1
973 #endif
974 CND(MSG_EOR, "Send end of record")
976 #ifndef MSG_WAITALL
977 # define MSG_WAITALL -1
978 #endif
979 CND(MSG_WAITALL, "Wait for full reception")
981 #ifndef MSG_NOSIGNAL
982 # define MSG_NOSIGNAL -1
983 #endif
984 CND(MSG_NOSIGNAL, "No SIGPIPE on send")
986 #ifdef __linux__
987 # define MSG_Forced_Flags "MSG_NOSIGNAL"
988 #else
989 # define MSG_Forced_Flags "0"
990 #endif
991 CNS(MSG_Forced_Flags, "")
993 -- Flags set on all send(2) calls
998 --------------------
999 -- Socket options --
1000 --------------------
1004 #ifndef TCP_NODELAY
1005 # define TCP_NODELAY -1
1006 #endif
1007 CND(TCP_NODELAY, "Do not coalesce packets")
1009 #ifndef SO_REUSEADDR
1010 # define SO_REUSEADDR -1
1011 #endif
1012 CND(SO_REUSEADDR, "Bind reuse local address")
1014 #ifndef SO_REUSEPORT
1015 # define SO_REUSEPORT -1
1016 #endif
1017 CND(SO_REUSEPORT, "Bind reuse port number")
1019 #ifndef SO_KEEPALIVE
1020 # define SO_KEEPALIVE -1
1021 #endif
1022 CND(SO_KEEPALIVE, "Enable keep-alive msgs")
1024 #ifndef SO_LINGER
1025 # define SO_LINGER -1
1026 #endif
1027 CND(SO_LINGER, "Defer close to flush data")
1029 #ifndef SO_BROADCAST
1030 # define SO_BROADCAST -1
1031 #endif
1032 CND(SO_BROADCAST, "Can send broadcast msgs")
1034 #ifndef SO_SNDBUF
1035 # define SO_SNDBUF -1
1036 #endif
1037 CND(SO_SNDBUF, "Set/get send buffer size")
1039 #ifndef SO_RCVBUF
1040 # define SO_RCVBUF -1
1041 #endif
1042 CND(SO_RCVBUF, "Set/get recv buffer size")
1044 #ifndef SO_SNDTIMEO
1045 # define SO_SNDTIMEO -1
1046 #endif
1047 CND(SO_SNDTIMEO, "Emission timeout")
1049 #ifndef SO_RCVTIMEO
1050 # define SO_RCVTIMEO -1
1051 #endif
1052 CND(SO_RCVTIMEO, "Reception timeout")
1054 #ifndef SO_ERROR
1055 # define SO_ERROR -1
1056 #endif
1057 CND(SO_ERROR, "Get/clear error status")
1059 #ifndef IP_MULTICAST_IF
1060 # define IP_MULTICAST_IF -1
1061 #endif
1062 CND(IP_MULTICAST_IF, "Set/get mcast interface")
1064 #ifndef IP_MULTICAST_TTL
1065 # define IP_MULTICAST_TTL -1
1066 #endif
1067 CND(IP_MULTICAST_TTL, "Set/get multicast TTL")
1069 #ifndef IP_MULTICAST_LOOP
1070 # define IP_MULTICAST_LOOP -1
1071 #endif
1072 CND(IP_MULTICAST_LOOP, "Set/get mcast loopback")
1074 #ifndef IP_ADD_MEMBERSHIP
1075 # define IP_ADD_MEMBERSHIP -1
1076 #endif
1077 CND(IP_ADD_MEMBERSHIP, "Join a multicast group")
1079 #ifndef IP_DROP_MEMBERSHIP
1080 # define IP_DROP_MEMBERSHIP -1
1081 #endif
1082 CND(IP_DROP_MEMBERSHIP, "Leave a multicast group")
1084 #ifndef IP_PKTINFO
1085 # define IP_PKTINFO -1
1086 #endif
1087 CND(IP_PKTINFO, "Get datagram info")
1091 ----------------------
1092 -- Type definitions --
1093 ----------------------
1098 struct timeval tv;
1100 -- Sizes (in bytes) of the components of struct timeval
1102 #define SIZEOF_tv_sec (sizeof tv.tv_sec)
1103 CND(SIZEOF_tv_sec, "tv_sec")
1104 #define SIZEOF_tv_usec (sizeof tv.tv_usec)
1105 CND(SIZEOF_tv_usec, "tv_usec")
1109 -- Sizes of protocol specific address types (for sockaddr.sa_len)
1112 #define SIZEOF_sockaddr_in (sizeof (struct sockaddr_in))
1113 CND(SIZEOF_sockaddr_in, "struct sockaddr_in")
1114 #ifdef HAVE_AF_INET6
1115 # define SIZEOF_sockaddr_in6 (sizeof (struct sockaddr_in6))
1116 #else
1117 # define SIZEOF_sockaddr_in6 0
1118 #endif
1119 CND(SIZEOF_sockaddr_in6, "struct sockaddr_in6")
1123 -- Size of file descriptor sets
1125 #define SIZEOF_fd_set (sizeof (fd_set))
1126 CND(SIZEOF_fd_set, "fd_set");
1129 -- Fields of struct hostent
1132 #ifdef __MINGW32__
1133 # define h_addrtype_t "short"
1134 # define h_length_t "short"
1135 #else
1136 # define h_addrtype_t "int"
1137 # define h_length_t "int"
1138 #endif
1140 TXT(" subtype H_Addrtype_T is Interfaces.C." h_addrtype_t ";")
1141 TXT(" subtype H_Length_T is Interfaces.C." h_length_t ";")
1145 ----------------------------------------
1146 -- Properties of supported interfaces --
1147 ----------------------------------------
1151 CND(Need_Netdb_Buffer, "Need buffer for Netdb ops")
1152 CND(Has_Sockaddr_Len, "Sockaddr has sa_len field")
1155 ** Do not change the format of the line below without also updating the
1156 ** MaRTE Makefile.
1158 TXT(" Thread_Blocking_IO : constant Boolean := True;")
1160 -- Set False for contexts where socket i/o are process blocking
1163 #endif /* HAVE_SOCKETS */
1166 ** System-specific constants follow
1169 #ifdef __vxworks
1173 --------------------------------
1174 -- VxWorks-specific constants --
1175 --------------------------------
1177 -- These constants may be used only within the VxWorks version of
1178 -- GNAT.Sockets.Thin.
1181 CND(OK, "VxWorks generic success")
1182 CND(ERROR, "VxWorks generic error")
1184 #endif
1186 #ifdef __MINGW32__
1189 ------------------------------
1190 -- MinGW-specific constants --
1191 ------------------------------
1193 -- These constants may be used only within the MinGW version of
1194 -- GNAT.Sockets.Thin.
1197 CND(WSASYSNOTREADY, "System not ready")
1198 CND(WSAVERNOTSUPPORTED, "Version not supported")
1199 CND(WSANOTINITIALISED, "Winsock not initialized")
1200 CND(WSAEDISCON, "Disconnected")
1202 #endif
1204 #ifdef NATIVE
1205 putchar ('\n');
1206 #endif
1210 end System.OS_Constants;