| 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-2025, 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 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. -- |
| 18 |
-- -- |
| 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. -- |
| 22 |
-- -- |
| 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/>. -- |
| 27 |
-- -- |
| 28 |
-- GNAT was originally developed by the GNAT team at New York University. -- |
| 29 |
-- Extensive contributions were provided by Ada Core Technologies Inc. -- |
| 30 |
-- -- |
| 31 |
------------------------------------------------------------------------------ |
| 32 |
|
| 33 |
pragma Style_Checks ("N"); |
| 34 |
-- Disable style checks |
| 35 |
|
| 36 |
*/ |
| 37 |
|
| 38 |
/** |
| 39 |
** This template file is used while building the GNAT runtime library to |
| 40 |
** generate package System.OS_Constants (s-oscons.ads). |
| 41 |
** |
| 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. |
| 49 |
** |
| 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 |
| 55 |
** when it applies. |
| 56 |
** |
| 57 |
** Two methods are supported to generate the list of constant values, |
| 58 |
** s-oscons-tmpl.s. |
| 59 |
** |
| 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 |
| 62 |
** listing: |
| 63 |
** |
| 64 |
** xgcc -DTARGET=\"$target\" -C -E s-oscons-tmplt.c > s-oscons-tmplt.i |
| 65 |
** xgcc -S s-oscons-tmplt.i |
| 66 |
** xoscons |
| 67 |
** |
| 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: |
| 71 |
** |
| 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 |
| 78 |
** $ RUN xoscons |
| 79 |
**/ |
| 80 |
|
| 81 |
/* Feature macro definitions */ |
| 82 |
|
| 83 |
/** |
| 84 |
** Note: we deliberately do not define _POSIX_SOURCE / _POSIX_C_SOURCE |
| 85 |
** unconditionally, as on many platforms these macros actually disable |
| 86 |
** a number of non-POSIX but useful/required features. |
| 87 |
**/ |
| 88 |
|
| 89 |
#if defined (__linux__) || defined (__ANDROID__) || defined (__GNU__) |
| 90 |
|
| 91 |
/* Define _XOPEN_SOURCE to get IOV_MAX */ |
| 92 |
# if !defined (_XOPEN_SOURCE) |
| 93 |
# define _XOPEN_SOURCE 500 |
| 94 |
# endif |
| 95 |
|
| 96 |
/* Define _BSD_SOURCE to get CRTSCTS */ |
| 97 |
# define _BSD_SOURCE |
| 98 |
|
| 99 |
#endif /* defined (__linux__) || defined (__ANDROID__) || defined (__GNU__) */ |
| 100 |
|
| 101 |
/* Include gsocket.h before any system header so it can redefine FD_SETSIZE */ |
| 102 |
|
| 103 |
#include "gsocket.h" |
| 104 |
|
| 105 |
#include <stdlib.h> |
| 106 |
#include <string.h> |
| 107 |
#include <limits.h> |
| 108 |
#include <fcntl.h> |
| 109 |
#include <time.h> |
| 110 |
|
| 111 |
#if ! (defined (__vxworks) || defined (__MINGW32__)) |
| 112 |
# define HAVE_TERMIOS |
| 113 |
#endif |
| 114 |
|
| 115 |
#if defined (__vxworks) |
| 116 |
|
| 117 |
/** |
| 118 |
** For VxWorks, always include vxWorks.h (gsocket.h provides it only for |
| 119 |
** the case of runtime libraries that support sockets). Note: this must |
| 120 |
** be done before including adaint.h. |
| 121 |
**/ |
| 122 |
|
| 123 |
# include <vxWorks.h> |
| 124 |
#elif !defined(__MINGW32__) |
| 125 |
#include <poll.h> |
| 126 |
#endif |
| 127 |
|
| 128 |
#include "adaint.h" |
| 129 |
|
| 130 |
#ifdef DUMMY |
| 131 |
|
| 132 |
# if defined (TARGET) |
| 133 |
# error TARGET may not be defined when generating the dummy version |
| 134 |
# else |
| 135 |
# define TARGET "batch runtime compilation (dummy values)" |
| 136 |
# endif |
| 137 |
|
| 138 |
# if !(defined (HAVE_SOCKETS) && defined (HAVE_TERMIOS)) |
| 139 |
# error Features missing on platform |
| 140 |
# endif |
| 141 |
|
| 142 |
# define NATIVE |
| 143 |
|
| 144 |
#endif /* DUMMY */ |
| 145 |
|
| 146 |
#ifndef TARGET |
| 147 |
# error Please define TARGET |
| 148 |
#endif |
| 149 |
|
| 150 |
#ifndef HAVE_SOCKETS |
| 151 |
# include <errno.h> |
| 152 |
#endif |
| 153 |
|
| 154 |
#ifdef HAVE_TERMIOS |
| 155 |
# include <termios.h> |
| 156 |
#endif |
| 157 |
|
| 158 |
#ifdef __APPLE__ |
| 159 |
# include <_types.h> |
| 160 |
#endif |
| 161 |
|
| 162 |
#if defined (__linux__) || defined (__ANDROID__) || defined (__QNX__) \ |
| 163 |
|| defined (__rtems__) || defined (__GNU__) |
| 164 |
# include <pthread.h> |
| 165 |
# include <signal.h> |
| 166 |
#endif |
| 167 |
|
| 168 |
#if defined(__MINGW32__) || defined(__CYGWIN__) |
| 169 |
# include <windef.h> |
| 170 |
# include <winbase.h> |
| 171 |
#endif |
| 172 |
|
| 173 |
#ifdef NATIVE |
| 174 |
#include <stdio.h> |
| 175 |
|
| 176 |
#ifdef DUMMY |
| 177 |
int counter = 0; |
| 178 |
# define _VAL(x) counter++ |
| 179 |
#else |
| 180 |
# define _VAL(x) x |
| 181 |
#endif |
| 182 |
|
| 183 |
#define CND(name,comment) \ |
| 184 |
printf ("\n->CND:$%d:" #name ":$%d:" comment, __LINE__, ((int) _VAL (name))); |
| 185 |
|
| 186 |
#define CNU(name,comment) \ |
| 187 |
printf ("\n->CNU:$%d:" #name ":$%u:" comment, __LINE__, ((unsigned int) _VAL (name))); |
| 188 |
|
| 189 |
#define CNS(name,comment) \ |
| 190 |
printf ("\n->CNS:$%d:" #name ":" name ":" comment, __LINE__); |
| 191 |
|
| 192 |
#define C(sname,type,value,comment)\ |
| 193 |
printf ("\n->C:$%d:" sname ":" #type ":" value ":" comment, __LINE__); |
| 194 |
|
| 195 |
#define SUB(sname)\ |
| 196 |
printf ("\n->SUB:$%d:" #sname ":" sname, __LINE__); |
| 197 |
|
| 198 |
#define TXT(text) \ |
| 199 |
printf ("\n->TXT:$%d:" text, __LINE__); |
| 200 |
|
| 201 |
#else |
| 202 |
|
| 203 |
#define CND(name, comment) \ |
| 204 |
asm volatile("\n->CND:%0:" #name ":%1:" comment \ |
| 205 |
: : "i" (__LINE__), "i" ((int) name)); |
| 206 |
/* Decimal constant in the range of type "int" */ |
| 207 |
|
| 208 |
#define CNU(name, comment) \ |
| 209 |
asm volatile("\n->CNU:%0:" #name ":%1:" comment \ |
| 210 |
: : "i" (__LINE__), "i" ((int) name)); |
| 211 |
/* Decimal constant in the range of type "unsigned int" (note, assembler |
| 212 |
* always wants a signed int, we convert back in xoscons). |
| 213 |
*/ |
| 214 |
|
| 215 |
#define CNS(name, comment) \ |
| 216 |
asm volatile("\n->CNS:%0:" #name ":" name ":" comment \ |
| 217 |
: : "i" (__LINE__)); |
| 218 |
/* General expression named number */ |
| 219 |
|
| 220 |
#define C(sname, type, value, comment) \ |
| 221 |
asm volatile("\n->C:%0:" sname ":" #type ":" value ":" comment \ |
| 222 |
: : "i" (__LINE__)); |
| 223 |
/* Typed constant */ |
| 224 |
|
| 225 |
#define SUB(sname) \ |
| 226 |
asm volatile("\n->SUB:%0:" #sname ":" sname \ |
| 227 |
: : "i" (__LINE__)); |
| 228 |
/* Subtype */ |
| 229 |
|
| 230 |
#define TXT(text) \ |
| 231 |
asm volatile("\n->TXT:%0:" text \ |
| 232 |
: : "i" (__LINE__)); |
| 233 |
/* Freeform text */ |
| 234 |
|
| 235 |
#endif /* NATIVE */ |
| 236 |
|
| 237 |
#define CST(name,comment) C(#name,String,name,comment) |
| 238 |
/* String constant */ |
| 239 |
|
| 240 |
#ifdef __MINGW32__ |
| 241 |
unsigned int _CRT_fmode = _O_BINARY; |
| 242 |
#endif |
| 243 |
|
| 244 |
int |
| 245 |
main (void) { |
| 246 |
|
| 247 |
/* |
| 248 |
-- This package provides target dependent definitions of constant for use |
| 249 |
-- by the GNAT runtime library. This package should not be directly with'd |
| 250 |
-- by an application program. |
| 251 |
|
| 252 |
-- This file is generated automatically, do not modify it by hand! Instead, |
| 253 |
-- make changes to s-oscons-tmplt.c and rebuild the GNAT runtime library. |
| 254 |
*/ |
| 255 |
|
| 256 |
/** |
| 257 |
** Do not change the format of the line below without also updating the |
| 258 |
** MaRTE Makefile. |
| 259 |
**/ |
| 260 |
TXT("-- This is the version for " TARGET) |
| 261 |
TXT("") |
| 262 |
TXT("with Interfaces.C;") |
| 263 |
#if defined (__MINGW32__) || defined (__CYGWIN__) |
| 264 |
# define TARGET_OS "Windows" |
| 265 |
# define Serial_Port_Descriptor "System.Win32.HANDLE" |
| 266 |
TXT("with System.Win32;") |
| 267 |
#else |
| 268 |
# define TARGET_OS "Other_OS" |
| 269 |
# define Serial_Port_Descriptor "Interfaces.C.int" |
| 270 |
#endif |
| 271 |
|
| 272 |
/* |
| 273 |
package System.OS_Constants is |
| 274 |
|
| 275 |
pragma Pure; |
| 276 |
*/ |
| 277 |
|
| 278 |
/** |
| 279 |
** General constants (all platforms) |
| 280 |
**/ |
| 281 |
|
| 282 |
/* |
| 283 |
|
| 284 |
--------------------------------- |
| 285 |
-- General platform parameters -- |
| 286 |
--------------------------------- |
| 287 |
|
| 288 |
type OS_Type is (Windows, Other_OS); |
| 289 |
*/ |
| 290 |
C("Target_OS", OS_Type, TARGET_OS, "") |
| 291 |
/* |
| 292 |
pragma Warnings (Off, Target_OS); |
| 293 |
-- Suppress warnings on Target_OS since it is in general tested for |
| 294 |
-- equality with a constant value to implement conditional compilation, |
| 295 |
-- which normally generates a constant condition warning. |
| 296 |
|
| 297 |
*/ |
| 298 |
#define Target_Name TARGET |
| 299 |
CST(Target_Name, "") |
| 300 |
|
| 301 |
/** |
| 302 |
** Note: the name of the following constant is recognized specially by |
| 303 |
** xoscons (case sensitive). |
| 304 |
**/ |
| 305 |
#define SIZEOF_unsigned_int sizeof (unsigned int) |
| 306 |
CND(SIZEOF_unsigned_int, "Size of unsigned int") |
| 307 |
|
| 308 |
SUB(Serial_Port_Descriptor) |
| 309 |
|
| 310 |
/* |
| 311 |
|
| 312 |
------------------- |
| 313 |
-- System limits -- |
| 314 |
------------------- |
| 315 |
|
| 316 |
*/ |
| 317 |
|
| 318 |
#ifndef IOV_MAX |
| 319 |
# define IOV_MAX INT_MAX |
| 320 |
#endif |
| 321 |
CND(IOV_MAX, "Maximum writev iovcnt") |
| 322 |
|
| 323 |
/* NAME_MAX is used to compute the allocation size for a struct dirent |
| 324 |
* passed to readdir() / readdir_r(). However on some systems it is not |
| 325 |
* defined, as it is technically a filesystem dependent property that |
| 326 |
* we should retrieve through pathconf(). In any case, we do not need a |
| 327 |
* precise value but only an upper limit. |
| 328 |
*/ |
| 329 |
#ifndef NAME_MAX |
| 330 |
# ifdef MAXNAMELEN |
| 331 |
/* Solaris has no NAME_MAX but defines MAXNAMELEN */ |
| 332 |
# define NAME_MAX MAXNAMELEN |
| 333 |
# elif defined(PATH_MAX) |
| 334 |
/* PATH_MAX (maximum length of a full path name) is a safe fall back */ |
| 335 |
# define NAME_MAX PATH_MAX |
| 336 |
# elif defined(FILENAME_MAX) |
| 337 |
/* Similarly FILENAME_MAX can provide a safe fall back */ |
| 338 |
# define NAME_MAX FILENAME_MAX |
| 339 |
# else |
| 340 |
/* Hardcode a reasonably large value as a last chance fallback */ |
| 341 |
# define NAME_MAX 1024 |
| 342 |
# endif |
| 343 |
#endif |
| 344 |
CND(NAME_MAX, "Maximum file name length") |
| 345 |
|
| 346 |
/* |
| 347 |
|
| 348 |
--------------------- |
| 349 |
-- File open modes -- |
| 350 |
--------------------- |
| 351 |
|
| 352 |
*/ |
| 353 |
|
| 354 |
#ifndef O_RDWR |
| 355 |
# define O_RDWR -1 |
| 356 |
#endif |
| 357 |
CND(O_RDWR, "Read/write") |
| 358 |
|
| 359 |
#ifndef O_NOCTTY |
| 360 |
# define O_NOCTTY -1 |
| 361 |
#endif |
| 362 |
CND(O_NOCTTY, "Don't change ctrl tty") |
| 363 |
|
| 364 |
#ifndef O_NDELAY |
| 365 |
# define O_NDELAY -1 |
| 366 |
#endif |
| 367 |
CND(O_NDELAY, "Nonblocking") |
| 368 |
|
| 369 |
/* |
| 370 |
|
| 371 |
---------------------- |
| 372 |
-- Fcntl operations -- |
| 373 |
---------------------- |
| 374 |
|
| 375 |
*/ |
| 376 |
|
| 377 |
#ifndef F_GETFL |
| 378 |
# define F_GETFL -1 |
| 379 |
#endif |
| 380 |
CND(F_GETFL, "Get flags") |
| 381 |
|
| 382 |
#ifndef F_SETFL |
| 383 |
# define F_SETFL -1 |
| 384 |
#endif |
| 385 |
CND(F_SETFL, "Set flags") |
| 386 |
|
| 387 |
/* |
| 388 |
|
| 389 |
----------------- |
| 390 |
-- Fcntl flags -- |
| 391 |
----------------- |
| 392 |
|
| 393 |
*/ |
| 394 |
|
| 395 |
#ifndef FNDELAY |
| 396 |
# define FNDELAY -1 |
| 397 |
#endif |
| 398 |
CND(FNDELAY, "Nonblocking") |
| 399 |
|
| 400 |
/* |
| 401 |
|
| 402 |
---------------------- |
| 403 |
-- Ioctl operations -- |
| 404 |
---------------------- |
| 405 |
|
| 406 |
*/ |
| 407 |
|
| 408 |
/* ioctl(2) requests are "int" in UNIX, but "unsigned long" on FreeBSD */ |
| 409 |
|
| 410 |
#if defined (__FreeBSD__) || defined (__DragonFly__) |
| 411 |
# define CNI CNU |
| 412 |
# define IOCTL_Req_T "Interfaces.C.unsigned" |
| 413 |
#else |
| 414 |
# define CNI CND |
| 415 |
# define IOCTL_Req_T "Interfaces.C.int" |
| 416 |
#endif |
| 417 |
|
| 418 |
SUB(IOCTL_Req_T) |
| 419 |
|
| 420 |
#ifndef FIONBIO |
| 421 |
# define FIONBIO -1 |
| 422 |
#endif |
| 423 |
CNI(FIONBIO, "Set/clear non-blocking io") |
| 424 |
|
| 425 |
#ifndef FIONREAD |
| 426 |
# define FIONREAD -1 |
| 427 |
#endif |
| 428 |
CNI(FIONREAD, "How many bytes to read") |
| 429 |
|
| 430 |
/* |
| 431 |
|
| 432 |
------------------ |
| 433 |
-- Errno values -- |
| 434 |
------------------ |
| 435 |
|
| 436 |
-- The following constants are defined from <errno.h> |
| 437 |
|
| 438 |
*/ |
| 439 |
#ifndef EAGAIN |
| 440 |
# define EAGAIN -1 |
| 441 |
#endif |
| 442 |
CND(EAGAIN, "Try again") |
| 443 |
|
| 444 |
#ifndef ENOENT |
| 445 |
# define ENOENT -1 |
| 446 |
#endif |
| 447 |
CND(ENOENT, "File not found") |
| 448 |
|
| 449 |
#ifndef ENOMEM |
| 450 |
# define ENOMEM -1 |
| 451 |
#endif |
| 452 |
CND(ENOMEM, "Out of memory") |
| 453 |
|
| 454 |
#ifdef __MINGW32__ |
| 455 |
/* |
| 456 |
|
| 457 |
-- The following constants are defined from <winsock2.h> (WSA*) |
| 458 |
|
| 459 |
*/ |
| 460 |
|
| 461 |
/** |
| 462 |
** For sockets-related errno values on Windows, gsocket.h redefines |
| 463 |
** Exxx as WSAExxx. |
| 464 |
**/ |
| 465 |
|
| 466 |
#endif |
| 467 |
|
| 468 |
#ifndef EACCES |
| 469 |
# define EACCES -1 |
| 470 |
#endif |
| 471 |
CND(EACCES, "Permission denied") |
| 472 |
|
| 473 |
#ifndef EADDRINUSE |
| 474 |
# define EADDRINUSE -1 |
| 475 |
#endif |
| 476 |
CND(EADDRINUSE, "Address already in use") |
| 477 |
|
| 478 |
#ifndef EADDRNOTAVAIL |
| 479 |
# define EADDRNOTAVAIL -1 |
| 480 |
#endif |
| 481 |
CND(EADDRNOTAVAIL, "Cannot assign address") |
| 482 |
|
| 483 |
#ifndef EAFNOSUPPORT |
| 484 |
# define EAFNOSUPPORT -1 |
| 485 |
#endif |
| 486 |
CND(EAFNOSUPPORT, "Addr family not supported") |
| 487 |
|
| 488 |
#ifndef EALREADY |
| 489 |
# define EALREADY -1 |
| 490 |
#endif |
| 491 |
CND(EALREADY, "Operation in progress") |
| 492 |
|
| 493 |
#ifndef EBADF |
| 494 |
# define EBADF -1 |
| 495 |
#endif |
| 496 |
CND(EBADF, "Bad file descriptor") |
| 497 |
|
| 498 |
#ifndef ECONNABORTED |
| 499 |
# define ECONNABORTED -1 |
| 500 |
#endif |
| 501 |
CND(ECONNABORTED, "Connection aborted") |
| 502 |
|
| 503 |
#ifndef ECONNREFUSED |
| 504 |
# define ECONNREFUSED -1 |
| 505 |
#endif |
| 506 |
CND(ECONNREFUSED, "Connection refused") |
| 507 |
|
| 508 |
#ifndef ECONNRESET |
| 509 |
# define ECONNRESET -1 |
| 510 |
#endif |
| 511 |
CND(ECONNRESET, "Connection reset by peer") |
| 512 |
|
| 513 |
#ifndef EDESTADDRREQ |
| 514 |
# define EDESTADDRREQ -1 |
| 515 |
#endif |
| 516 |
CND(EDESTADDRREQ, "Destination addr required") |
| 517 |
|
| 518 |
#ifndef EFAULT |
| 519 |
# define EFAULT -1 |
| 520 |
#endif |
| 521 |
CND(EFAULT, "Bad address") |
| 522 |
|
| 523 |
#ifndef EHOSTDOWN |
| 524 |
# define EHOSTDOWN -1 |
| 525 |
#endif |
| 526 |
CND(EHOSTDOWN, "Host is down") |
| 527 |
|
| 528 |
#ifndef EHOSTUNREACH |
| 529 |
# define EHOSTUNREACH -1 |
| 530 |
#endif |
| 531 |
CND(EHOSTUNREACH, "No route to host") |
| 532 |
|
| 533 |
#ifndef EINPROGRESS |
| 534 |
# define EINPROGRESS -1 |
| 535 |
#endif |
| 536 |
CND(EINPROGRESS, "Operation now in progress") |
| 537 |
|
| 538 |
#ifndef EINTR |
| 539 |
# define EINTR -1 |
| 540 |
#endif |
| 541 |
CND(EINTR, "Interrupted system call") |
| 542 |
|
| 543 |
#ifndef EINVAL |
| 544 |
# define EINVAL -1 |
| 545 |
#endif |
| 546 |
CND(EINVAL, "Invalid argument") |
| 547 |
|
| 548 |
#ifndef EIO |
| 549 |
# define EIO -1 |
| 550 |
#endif |
| 551 |
CND(EIO, "Input output error") |
| 552 |
|
| 553 |
#ifndef EISCONN |
| 554 |
# define EISCONN -1 |
| 555 |
#endif |
| 556 |
CND(EISCONN, "Socket already connected") |
| 557 |
|
| 558 |
#ifndef ELOOP |
| 559 |
# define ELOOP -1 |
| 560 |
#endif |
| 561 |
CND(ELOOP, "Too many symbolic links") |
| 562 |
|
| 563 |
#ifndef EMFILE |
| 564 |
# define EMFILE -1 |
| 565 |
#endif |
| 566 |
CND(EMFILE, "Too many open files") |
| 567 |
|
| 568 |
#ifndef EMSGSIZE |
| 569 |
# define EMSGSIZE -1 |
| 570 |
#endif |
| 571 |
CND(EMSGSIZE, "Message too long") |
| 572 |
|
| 573 |
#ifndef ENAMETOOLONG |
| 574 |
# define ENAMETOOLONG -1 |
| 575 |
#endif |
| 576 |
CND(ENAMETOOLONG, "Name too long") |
| 577 |
|
| 578 |
#ifndef ENETDOWN |
| 579 |
# define ENETDOWN -1 |
| 580 |
#endif |
| 581 |
CND(ENETDOWN, "Network is down") |
| 582 |
|
| 583 |
#ifndef ENETRESET |
| 584 |
# define ENETRESET -1 |
| 585 |
#endif |
| 586 |
CND(ENETRESET, "Disconn. on network reset") |
| 587 |
|
| 588 |
#ifndef ENETUNREACH |
| 589 |
# define ENETUNREACH -1 |
| 590 |
#endif |
| 591 |
CND(ENETUNREACH, "Network is unreachable") |
| 592 |
|
| 593 |
#ifndef ENOBUFS |
| 594 |
# define ENOBUFS -1 |
| 595 |
#endif |
| 596 |
CND(ENOBUFS, "No buffer space available") |
| 597 |
|
| 598 |
#ifndef ENOPROTOOPT |
| 599 |
# define ENOPROTOOPT -1 |
| 600 |
#endif |
| 601 |
CND(ENOPROTOOPT, "Protocol not available") |
| 602 |
|
| 603 |
#ifndef ENOTCONN |
| 604 |
# define ENOTCONN -1 |
| 605 |
#endif |
| 606 |
CND(ENOTCONN, "Socket not connected") |
| 607 |
|
| 608 |
#ifndef ENOTSOCK |
| 609 |
# define ENOTSOCK -1 |
| 610 |
#endif |
| 611 |
CND(ENOTSOCK, "Operation on non socket") |
| 612 |
|
| 613 |
#ifndef EOPNOTSUPP |
| 614 |
# define EOPNOTSUPP -1 |
| 615 |
#endif |
| 616 |
CND(EOPNOTSUPP, "Operation not supported") |
| 617 |
|
| 618 |
#ifndef EPIPE |
| 619 |
# define EPIPE -1 |
| 620 |
#endif |
| 621 |
CND(EPIPE, "Broken pipe") |
| 622 |
|
| 623 |
#ifndef EPFNOSUPPORT |
| 624 |
# define EPFNOSUPPORT -1 |
| 625 |
#endif |
| 626 |
CND(EPFNOSUPPORT, "Unknown protocol family") |
| 627 |
|
| 628 |
#ifndef EPROTONOSUPPORT |
| 629 |
# define EPROTONOSUPPORT -1 |
| 630 |
#endif |
| 631 |
CND(EPROTONOSUPPORT, "Unknown protocol") |
| 632 |
|
| 633 |
#ifndef EPROTOTYPE |
| 634 |
# define EPROTOTYPE -1 |
| 635 |
#endif |
| 636 |
CND(EPROTOTYPE, "Unknown protocol type") |
| 637 |
|
| 638 |
#ifndef ERANGE |
| 639 |
# define ERANGE -1 |
| 640 |
#endif |
| 641 |
CND(ERANGE, "Result too large") |
| 642 |
|
| 643 |
#ifndef ESHUTDOWN |
| 644 |
# define ESHUTDOWN -1 |
| 645 |
#endif |
| 646 |
CND(ESHUTDOWN, "Cannot send once shutdown") |
| 647 |
|
| 648 |
#ifndef ESOCKTNOSUPPORT |
| 649 |
# define ESOCKTNOSUPPORT -1 |
| 650 |
#endif |
| 651 |
CND(ESOCKTNOSUPPORT, "Socket type not supported") |
| 652 |
|
| 653 |
#ifndef ETIMEDOUT |
| 654 |
# define ETIMEDOUT -1 |
| 655 |
#endif |
| 656 |
CND(ETIMEDOUT, "Connection timed out") |
| 657 |
|
| 658 |
#ifndef ETOOMANYREFS |
| 659 |
# define ETOOMANYREFS -1 |
| 660 |
#endif |
| 661 |
CND(ETOOMANYREFS, "Too many references") |
| 662 |
|
| 663 |
#ifndef EWOULDBLOCK |
| 664 |
# define EWOULDBLOCK -1 |
| 665 |
#endif |
| 666 |
CND(EWOULDBLOCK, "Operation would block") |
| 667 |
|
| 668 |
#ifndef E2BIG |
| 669 |
# define E2BIG -1 |
| 670 |
#endif |
| 671 |
CND(E2BIG, "Argument list too long") |
| 672 |
|
| 673 |
#ifndef EILSEQ |
| 674 |
# define EILSEQ -1 |
| 675 |
#endif |
| 676 |
CND(EILSEQ, "Illegal byte sequence") |
| 677 |
|
| 678 |
/** |
| 679 |
** Terminal/serial I/O constants |
| 680 |
**/ |
| 681 |
|
| 682 |
#if defined(HAVE_TERMIOS) || defined(__MINGW32__) |
| 683 |
/* |
| 684 |
|
| 685 |
---------------------- |
| 686 |
-- Terminal control -- |
| 687 |
---------------------- |
| 688 |
|
| 689 |
*/ |
| 690 |
#endif |
| 691 |
|
| 692 |
#ifdef HAVE_TERMIOS |
| 693 |
|
| 694 |
#ifndef TCSANOW |
| 695 |
# define TCSANOW -1 |
| 696 |
#endif |
| 697 |
CND(TCSANOW, "Immediate") |
| 698 |
|
| 699 |
#ifndef TCIFLUSH |
| 700 |
# define TCIFLUSH -1 |
| 701 |
#endif |
| 702 |
CND(TCIFLUSH, "Flush input") |
| 703 |
|
| 704 |
#ifndef IXON |
| 705 |
# define IXON -1 |
| 706 |
#endif |
| 707 |
CNU(IXON, "Output sw flow control") |
| 708 |
|
| 709 |
#ifndef CLOCAL |
| 710 |
# define CLOCAL -1 |
| 711 |
#endif |
| 712 |
CNU(CLOCAL, "Local") |
| 713 |
|
| 714 |
#ifndef CRTSCTS |
| 715 |
# define CRTSCTS -1 |
| 716 |
#endif |
| 717 |
CNU(CRTSCTS, "Output hw flow control") |
| 718 |
|
| 719 |
#ifndef CREAD |
| 720 |
# define CREAD -1 |
| 721 |
#endif |
| 722 |
CNU(CREAD, "Read") |
| 723 |
|
| 724 |
#ifndef ICANON |
| 725 |
# define ICANON -1 |
| 726 |
#endif |
| 727 |
CNU(ICANON, "canonical mode") |
| 728 |
|
| 729 |
#ifndef CBAUD |
| 730 |
# define CBAUD -1 |
| 731 |
#endif |
| 732 |
CNU(CBAUD, "baud speed mask") |
| 733 |
|
| 734 |
#ifndef ECHO |
| 735 |
# define ECHO -1 |
| 736 |
#endif |
| 737 |
CNU(ECHO, "echo input characters") |
| 738 |
|
| 739 |
#ifndef ECHOE |
| 740 |
# define ECHOE -1 |
| 741 |
#endif |
| 742 |
CNU(ECHOE, "erase preceding characters") |
| 743 |
|
| 744 |
#ifndef ECHOK |
| 745 |
# define ECHOK -1 |
| 746 |
#endif |
| 747 |
CNU(ECHOK, "kill character, erases current line") |
| 748 |
|
| 749 |
#ifndef ECHOCTL |
| 750 |
# define ECHOCTL -1 |
| 751 |
#endif |
| 752 |
CNU(ECHOCTL, "echo special characters") |
| 753 |
|
| 754 |
#ifndef ECHONL |
| 755 |
# define ECHONL -1 |
| 756 |
#endif |
| 757 |
CNU(ECHONL, "force echo NL character") |
| 758 |
|
| 759 |
#ifndef CS5 |
| 760 |
# define CS5 -1 |
| 761 |
#endif |
| 762 |
CNU(CS5, "5 data bits") |
| 763 |
|
| 764 |
#ifndef CS6 |
| 765 |
# define CS6 -1 |
| 766 |
#endif |
| 767 |
CNU(CS6, "6 data bits") |
| 768 |
|
| 769 |
#ifndef CS7 |
| 770 |
# define CS7 -1 |
| 771 |
#endif |
| 772 |
CNU(CS7, "7 data bits") |
| 773 |
|
| 774 |
#ifndef CS8 |
| 775 |
# define CS8 -1 |
| 776 |
#endif |
| 777 |
CNU(CS8, "8 data bits") |
| 778 |
|
| 779 |
#ifndef CSTOPB |
| 780 |
# define CSTOPB -1 |
| 781 |
#endif |
| 782 |
CNU(CSTOPB, "2 stop bits") |
| 783 |
|
| 784 |
#ifndef PARENB |
| 785 |
# define PARENB -1 |
| 786 |
#endif |
| 787 |
CNU(PARENB, "Parity enable") |
| 788 |
|
| 789 |
#ifndef PARODD |
| 790 |
# define PARODD -1 |
| 791 |
#endif |
| 792 |
CNU(PARODD, "Parity odd") |
| 793 |
|
| 794 |
#ifndef B0 |
| 795 |
# define B0 -1 |
| 796 |
#endif |
| 797 |
CNU(B0, "0 bps") |
| 798 |
|
| 799 |
#ifndef B50 |
| 800 |
# define B50 -1 |
| 801 |
#endif |
| 802 |
CNU(B50, "50 bps") |
| 803 |
|
| 804 |
#ifndef B75 |
| 805 |
# define B75 -1 |
| 806 |
#endif |
| 807 |
CNU(B75, "75 bps") |
| 808 |
|
| 809 |
#ifndef B110 |
| 810 |
# define B110 -1 |
| 811 |
#endif |
| 812 |
CNU(B110, "110 bps") |
| 813 |
|
| 814 |
#ifndef B134 |
| 815 |
# define B134 -1 |
| 816 |
#endif |
| 817 |
CNU(B134, "134 bps") |
| 818 |
|
| 819 |
#ifndef B150 |
| 820 |
# define B150 -1 |
| 821 |
#endif |
| 822 |
CNU(B150, "150 bps") |
| 823 |
|
| 824 |
#ifndef B200 |
| 825 |
# define B200 -1 |
| 826 |
#endif |
| 827 |
CNU(B200, "200 bps") |
| 828 |
|
| 829 |
#ifndef B300 |
| 830 |
# define B300 -1 |
| 831 |
#endif |
| 832 |
CNU(B300, "300 bps") |
| 833 |
|
| 834 |
#ifndef B600 |
| 835 |
# define B600 -1 |
| 836 |
#endif |
| 837 |
CNU(B600, "600 bps") |
| 838 |
|
| 839 |
#ifndef B1200 |
| 840 |
# define B1200 -1 |
| 841 |
#endif |
| 842 |
CNU(B1200, "1200 bps") |
| 843 |
|
| 844 |
#ifndef B1800 |
| 845 |
# define B1800 -1 |
| 846 |
#endif |
| 847 |
CNU(B1800, "1800 bps") |
| 848 |
|
| 849 |
#ifndef B2400 |
| 850 |
# define B2400 -1 |
| 851 |
#endif |
| 852 |
CNU(B2400, "2400 bps") |
| 853 |
|
| 854 |
#ifndef B4800 |
| 855 |
# define B4800 -1 |
| 856 |
#endif |
| 857 |
CNU(B4800, "4800 bps") |
| 858 |
|
| 859 |
#ifndef B9600 |
| 860 |
# define B9600 -1 |
| 861 |
#endif |
| 862 |
CNU(B9600, "9600 bps") |
| 863 |
|
| 864 |
#ifndef B19200 |
| 865 |
# define B19200 -1 |
| 866 |
#endif |
| 867 |
CNU(B19200, "19200 bps") |
| 868 |
|
| 869 |
#ifndef B38400 |
| 870 |
# define B38400 -1 |
| 871 |
#endif |
| 872 |
CNU(B38400, "38400 bps") |
| 873 |
|
| 874 |
#ifndef B57600 |
| 875 |
# define B57600 -1 |
| 876 |
#endif |
| 877 |
CNU(B57600, "57600 bps") |
| 878 |
|
| 879 |
#ifndef B115200 |
| 880 |
# define B115200 -1 |
| 881 |
#endif |
| 882 |
CNU(B115200, "115200 bps") |
| 883 |
|
| 884 |
#ifndef B230400 |
| 885 |
# define B230400 -1 |
| 886 |
#endif |
| 887 |
CNU(B230400, "230400 bps") |
| 888 |
|
| 889 |
#ifndef B460800 |
| 890 |
# define B460800 -1 |
| 891 |
#endif |
| 892 |
CNU(B460800, "460800 bps") |
| 893 |
|
| 894 |
#ifndef B500000 |
| 895 |
# define B500000 -1 |
| 896 |
#endif |
| 897 |
CNU(B500000, "500000 bps") |
| 898 |
|
| 899 |
#ifndef B576000 |
| 900 |
# define B576000 -1 |
| 901 |
#endif |
| 902 |
CNU(B576000, "576000 bps") |
| 903 |
|
| 904 |
#ifndef B921600 |
| 905 |
# define B921600 -1 |
| 906 |
#endif |
| 907 |
CNU(B921600, "921600 bps") |
| 908 |
|
| 909 |
#ifndef B1000000 |
| 910 |
# define B1000000 -1 |
| 911 |
#endif |
| 912 |
CNU(B1000000, "1000000 bps") |
| 913 |
|
| 914 |
#ifndef B1152000 |
| 915 |
# define B1152000 -1 |
| 916 |
#endif |
| 917 |
CNU(B1152000, "1152000 bps") |
| 918 |
|
| 919 |
#ifndef B1500000 |
| 920 |
# define B1500000 -1 |
| 921 |
#endif |
| 922 |
CNU(B1500000, "1500000 bps") |
| 923 |
|
| 924 |
#ifndef B2000000 |
| 925 |
# define B2000000 -1 |
| 926 |
#endif |
| 927 |
CNU(B2000000, "2000000 bps") |
| 928 |
|
| 929 |
#ifndef B2500000 |
| 930 |
# define B2500000 -1 |
| 931 |
#endif |
| 932 |
CNU(B2500000, "2500000 bps") |
| 933 |
|
| 934 |
#ifndef B3000000 |
| 935 |
# define B3000000 -1 |
| 936 |
#endif |
| 937 |
CNU(B3000000, "3000000 bps") |
| 938 |
|
| 939 |
#ifndef B3500000 |
| 940 |
# define B3500000 -1 |
| 941 |
#endif |
| 942 |
CNU(B3500000, "3500000 bps") |
| 943 |
|
| 944 |
#ifndef B4000000 |
| 945 |
# define B4000000 -1 |
| 946 |
#endif |
| 947 |
CNU(B4000000, "4000000 bps") |
| 948 |
|
| 949 |
/* |
| 950 |
|
| 951 |
--------------------------------- |
| 952 |
-- Terminal control characters -- |
| 953 |
--------------------------------- |
| 954 |
|
| 955 |
*/ |
| 956 |
|
| 957 |
#ifndef VINTR |
| 958 |
# define VINTR -1 |
| 959 |
#endif |
| 960 |
CND(VINTR, "Interrupt") |
| 961 |
|
| 962 |
#ifndef VQUIT |
| 963 |
# define VQUIT -1 |
| 964 |
#endif |
| 965 |
CND(VQUIT, "Quit") |
| 966 |
|
| 967 |
#ifndef VERASE |
| 968 |
# define VERASE -1 |
| 969 |
#endif |
| 970 |
CND(VERASE, "Erase") |
| 971 |
|
| 972 |
#ifndef VKILL |
| 973 |
# define VKILL -1 |
| 974 |
#endif |
| 975 |
CND(VKILL, "Kill") |
| 976 |
|
| 977 |
#ifndef VEOF |
| 978 |
# define VEOF -1 |
| 979 |
#endif |
| 980 |
CND(VEOF, "EOF") |
| 981 |
|
| 982 |
#ifndef VTIME |
| 983 |
# define VTIME -1 |
| 984 |
#endif |
| 985 |
CND(VTIME, "Read timeout") |
| 986 |
|
| 987 |
#ifndef VMIN |
| 988 |
# define VMIN -1 |
| 989 |
#endif |
| 990 |
CND(VMIN, "Read min chars") |
| 991 |
|
| 992 |
#ifndef VSWTC |
| 993 |
# define VSWTC -1 |
| 994 |
#endif |
| 995 |
CND(VSWTC, "Switch") |
| 996 |
|
| 997 |
#ifndef VSTART |
| 998 |
# define VSTART -1 |
| 999 |
#endif |
| 1000 |
CND(VSTART, "Flow control start") |
| 1001 |
|
| 1002 |
#ifndef VSTOP |
| 1003 |
# define VSTOP -1 |
| 1004 |
#endif |
| 1005 |
CND(VSTOP, "Flow control stop") |
| 1006 |
|
| 1007 |
#ifndef VSUSP |
| 1008 |
# define VSUSP -1 |
| 1009 |
#endif |
| 1010 |
CND(VSUSP, "Suspend") |
| 1011 |
|
| 1012 |
#ifndef VEOL |
| 1013 |
# define VEOL -1 |
| 1014 |
#endif |
| 1015 |
CND(VEOL, "EOL") |
| 1016 |
|
| 1017 |
#ifndef VREPRINT |
| 1018 |
# define VREPRINT -1 |
| 1019 |
#endif |
| 1020 |
CND(VREPRINT, "Reprint unread") |
| 1021 |
|
| 1022 |
#ifndef VDISCARD |
| 1023 |
# define VDISCARD -1 |
| 1024 |
#endif |
| 1025 |
CND(VDISCARD, "Discard pending") |
| 1026 |
|
| 1027 |
#ifndef VWERASE |
| 1028 |
# define VWERASE -1 |
| 1029 |
#endif |
| 1030 |
CND(VWERASE, "Word erase") |
| 1031 |
|
| 1032 |
#ifndef VLNEXT |
| 1033 |
# define VLNEXT -1 |
| 1034 |
#endif |
| 1035 |
CND(VLNEXT, "Literal next") |
| 1036 |
|
| 1037 |
#ifndef VEOL2 |
| 1038 |
# define VEOL2 -1 |
| 1039 |
#endif |
| 1040 |
CND(VEOL2, "Alternative EOL") |
| 1041 |
|
| 1042 |
#endif /* HAVE_TERMIOS */ |
| 1043 |
|
| 1044 |
#if defined(__MINGW32__) || defined(__CYGWIN__) |
| 1045 |
CNU(DTR_CONTROL_ENABLE, "Enable DTR flow ctrl") |
| 1046 |
CNU(RTS_CONTROL_ENABLE, "Enable RTS flow ctrl") |
| 1047 |
#endif |
| 1048 |
|
| 1049 |
/* |
| 1050 |
|
| 1051 |
----------------------------- |
| 1052 |
-- Pseudo terminal library -- |
| 1053 |
----------------------------- |
| 1054 |
|
| 1055 |
*/ |
| 1056 |
|
| 1057 |
#if defined (__FreeBSD__) || defined (__linux__) || defined (__DragonFly__) |
| 1058 |
# define PTY_Library "-lutil" |
| 1059 |
#else |
| 1060 |
# define PTY_Library "" |
| 1061 |
#endif |
| 1062 |
CST(PTY_Library, "for g-exptty") |
| 1063 |
|
| 1064 |
/** |
| 1065 |
** Sockets constants |
| 1066 |
**/ |
| 1067 |
|
| 1068 |
#ifdef HAVE_SOCKETS |
| 1069 |
|
| 1070 |
/* |
| 1071 |
|
| 1072 |
-------------- |
| 1073 |
-- Families -- |
| 1074 |
-------------- |
| 1075 |
|
| 1076 |
*/ |
| 1077 |
|
| 1078 |
#ifndef AF_INET |
| 1079 |
# define AF_INET -1 |
| 1080 |
#endif |
| 1081 |
CND(AF_INET, "IPv4 address family") |
| 1082 |
|
| 1083 |
#ifndef AF_INET6 |
| 1084 |
# define AF_INET6 -1 |
| 1085 |
#else |
| 1086 |
# define HAVE_AF_INET6 1 |
| 1087 |
#endif |
| 1088 |
CND(AF_INET6, "IPv6 address family") |
| 1089 |
|
| 1090 |
#ifndef AF_UNIX |
| 1091 |
# define AF_UNIX -1 |
| 1092 |
#endif |
| 1093 |
CND(AF_UNIX, "Local unix family") |
| 1094 |
|
| 1095 |
#ifndef AF_UNSPEC |
| 1096 |
# define AF_UNSPEC -1 |
| 1097 |
#else |
| 1098 |
# define HAVE_AF_UNSPEC 1 |
| 1099 |
#endif |
| 1100 |
CND(AF_UNSPEC, "Unspecified address family") |
| 1101 |
|
| 1102 |
/* |
| 1103 |
|
| 1104 |
----------------------------- |
| 1105 |
-- addrinfo fields offsets -- |
| 1106 |
----------------------------- |
| 1107 |
|
| 1108 |
*/ |
| 1109 |
|
| 1110 |
#ifdef AI_CANONNAME |
| 1111 |
const struct addrinfo ai; |
| 1112 |
|
| 1113 |
#define AI_FLAGS_OFFSET ((void *)&ai.ai_flags - (void *)&ai) |
| 1114 |
#define AI_FAMILY_OFFSET ((void *)&ai.ai_family - (void *)&ai) |
| 1115 |
#define AI_SOCKTYPE_OFFSET ((void *)&ai.ai_socktype - (void *)&ai) |
| 1116 |
#define AI_PROTOCOL_OFFSET ((void *)&ai.ai_protocol - (void *)&ai) |
| 1117 |
#define AI_ADDRLEN_OFFSET ((void *)&ai.ai_addrlen - (void *)&ai) |
| 1118 |
#define AI_ADDR_OFFSET ((void *)&ai.ai_addr - (void *)&ai) |
| 1119 |
#define AI_CANONNAME_OFFSET ((void *)&ai.ai_canonname - (void *)&ai) |
| 1120 |
#define AI_NEXT_OFFSET ((void *)&ai.ai_next - (void *)&ai) |
| 1121 |
|
| 1122 |
#else |
| 1123 |
|
| 1124 |
#define AI_FLAGS_OFFSET 0 |
| 1125 |
#define AI_FAMILY_OFFSET 4 |
| 1126 |
#define AI_SOCKTYPE_OFFSET 8 |
| 1127 |
#define AI_PROTOCOL_OFFSET 12 |
| 1128 |
#define AI_ADDRLEN_OFFSET 16 |
| 1129 |
#define AI_CANONNAME_OFFSET 24 |
| 1130 |
#define AI_ADDR_OFFSET 32 |
| 1131 |
#define AI_NEXT_OFFSET 40 |
| 1132 |
|
| 1133 |
#endif |
| 1134 |
|
| 1135 |
CND(AI_FLAGS_OFFSET, "Offset of ai_flags in addrinfo"); |
| 1136 |
CND(AI_FAMILY_OFFSET, "Offset of ai_family in addrinfo"); |
| 1137 |
CND(AI_SOCKTYPE_OFFSET, "Offset of ai_socktype in addrinfo"); |
| 1138 |
CND(AI_PROTOCOL_OFFSET, "Offset of ai_protocol in addrinfo"); |
| 1139 |
CND(AI_ADDRLEN_OFFSET, "Offset of ai_addrlen in addrinfo"); |
| 1140 |
CND(AI_ADDR_OFFSET, "Offset of ai_addr in addrinfo"); |
| 1141 |
CND(AI_CANONNAME_OFFSET, "Offset of ai_canonname in addrinfo"); |
| 1142 |
CND(AI_NEXT_OFFSET, "Offset of ai_next in addrinfo"); |
| 1143 |
|
| 1144 |
/* |
| 1145 |
|
| 1146 |
--------------------------------------- |
| 1147 |
-- getaddrinfo getnameinfo constants -- |
| 1148 |
--------------------------------------- |
| 1149 |
|
| 1150 |
*/ |
| 1151 |
|
| 1152 |
#ifndef AI_PASSIVE |
| 1153 |
# define AI_PASSIVE -1 |
| 1154 |
#endif |
| 1155 |
CND(AI_PASSIVE, "NULL nodename for accepting") |
| 1156 |
|
| 1157 |
#ifndef AI_CANONNAME |
| 1158 |
# define AI_CANONNAME -1 |
| 1159 |
#endif |
| 1160 |
CND(AI_CANONNAME, "Get the host official name") |
| 1161 |
|
| 1162 |
#ifndef AI_NUMERICSERV |
| 1163 |
# define AI_NUMERICSERV -1 |
| 1164 |
#endif |
| 1165 |
CND(AI_NUMERICSERV, "Service is a numeric string") |
| 1166 |
|
| 1167 |
#ifndef AI_NUMERICHOST |
| 1168 |
# define AI_NUMERICHOST -1 |
| 1169 |
#endif |
| 1170 |
CND(AI_NUMERICHOST, "Node is a numeric IP address") |
| 1171 |
|
| 1172 |
#ifndef AI_ADDRCONFIG |
| 1173 |
# define AI_ADDRCONFIG -1 |
| 1174 |
#endif |
| 1175 |
CND(AI_ADDRCONFIG, "Returns addresses for only locally configured families") |
| 1176 |
|
| 1177 |
#ifndef AI_V4MAPPED |
| 1178 |
# define AI_V4MAPPED -1 |
| 1179 |
#endif |
| 1180 |
CND(AI_V4MAPPED, "Returns IPv4 mapped to IPv6") |
| 1181 |
|
| 1182 |
#ifndef AI_ALL |
| 1183 |
# define AI_ALL -1 |
| 1184 |
#endif |
| 1185 |
CND(AI_ALL, "Change AI_V4MAPPED behavior for unavailavle IPv6 addresses") |
| 1186 |
|
| 1187 |
#ifndef NI_NAMEREQD |
| 1188 |
# define NI_NAMEREQD -1 |
| 1189 |
#endif |
| 1190 |
CND(NI_NAMEREQD, "Error if the hostname cannot be determined") |
| 1191 |
|
| 1192 |
#ifndef NI_DGRAM |
| 1193 |
# define NI_DGRAM -1 |
| 1194 |
#endif |
| 1195 |
CND(NI_DGRAM, "Service is datagram") |
| 1196 |
|
| 1197 |
#ifndef NI_NOFQDN |
| 1198 |
# define NI_NOFQDN -1 |
| 1199 |
#endif |
| 1200 |
CND(NI_NOFQDN, "Return only the hostname part for local hosts") |
| 1201 |
|
| 1202 |
#ifndef NI_NUMERICSERV |
| 1203 |
# define NI_NUMERICSERV -1 |
| 1204 |
#endif |
| 1205 |
CND(NI_NUMERICSERV, "Numeric form of the service") |
| 1206 |
|
| 1207 |
#ifndef NI_NUMERICHOST |
| 1208 |
# define NI_NUMERICHOST -1 |
| 1209 |
#endif |
| 1210 |
CND(NI_NUMERICHOST, "Numeric form of the hostname") |
| 1211 |
|
| 1212 |
#ifndef NI_MAXHOST |
| 1213 |
# define NI_MAXHOST -1 |
| 1214 |
#endif |
| 1215 |
CND(NI_MAXHOST, "Maximum size of hostname") |
| 1216 |
|
| 1217 |
#ifndef NI_MAXSERV |
| 1218 |
# define NI_MAXSERV -1 |
| 1219 |
#endif |
| 1220 |
CND(NI_MAXSERV, "Maximum size of service name") |
| 1221 |
|
| 1222 |
#ifndef EAI_SYSTEM |
| 1223 |
# define EAI_SYSTEM -1 |
| 1224 |
#endif |
| 1225 |
CND(EAI_SYSTEM, "Check errno for details") |
| 1226 |
|
| 1227 |
/* |
| 1228 |
|
| 1229 |
------------------ |
| 1230 |
-- Socket modes -- |
| 1231 |
------------------ |
| 1232 |
|
| 1233 |
*/ |
| 1234 |
|
| 1235 |
#ifndef SOCK_STREAM |
| 1236 |
# define SOCK_STREAM -1 |
| 1237 |
#endif |
| 1238 |
CND(SOCK_STREAM, "Stream socket") |
| 1239 |
|
| 1240 |
#ifndef SOCK_DGRAM |
| 1241 |
# define SOCK_DGRAM -1 |
| 1242 |
#endif |
| 1243 |
CND(SOCK_DGRAM, "Datagram socket") |
| 1244 |
|
| 1245 |
#ifndef SOCK_RAW |
| 1246 |
# define SOCK_RAW -1 |
| 1247 |
#endif |
| 1248 |
CND(SOCK_RAW, "Raw socket") |
| 1249 |
|
| 1250 |
/* |
| 1251 |
|
| 1252 |
----------------- |
| 1253 |
-- Host errors -- |
| 1254 |
----------------- |
| 1255 |
|
| 1256 |
*/ |
| 1257 |
|
| 1258 |
#ifndef HOST_NOT_FOUND |
| 1259 |
# define HOST_NOT_FOUND -1 |
| 1260 |
#endif |
| 1261 |
CND(HOST_NOT_FOUND, "Unknown host") |
| 1262 |
|
| 1263 |
#ifndef TRY_AGAIN |
| 1264 |
# define TRY_AGAIN -1 |
| 1265 |
#endif |
| 1266 |
CND(TRY_AGAIN, "Host name lookup failure") |
| 1267 |
|
| 1268 |
#ifndef NO_DATA |
| 1269 |
# define NO_DATA -1 |
| 1270 |
#endif |
| 1271 |
CND(NO_DATA, "No data record for name") |
| 1272 |
|
| 1273 |
#ifndef NO_RECOVERY |
| 1274 |
# define NO_RECOVERY -1 |
| 1275 |
#endif |
| 1276 |
CND(NO_RECOVERY, "Non recoverable errors") |
| 1277 |
|
| 1278 |
/* |
| 1279 |
|
| 1280 |
-------------------- |
| 1281 |
-- Shutdown modes -- |
| 1282 |
-------------------- |
| 1283 |
|
| 1284 |
*/ |
| 1285 |
|
| 1286 |
#ifndef SHUT_RD |
| 1287 |
# define SHUT_RD -1 |
| 1288 |
#endif |
| 1289 |
CND(SHUT_RD, "No more recv") |
| 1290 |
|
| 1291 |
#ifndef SHUT_WR |
| 1292 |
# define SHUT_WR -1 |
| 1293 |
#endif |
| 1294 |
CND(SHUT_WR, "No more send") |
| 1295 |
|
| 1296 |
#ifndef SHUT_RDWR |
| 1297 |
# define SHUT_RDWR -1 |
| 1298 |
#endif |
| 1299 |
CND(SHUT_RDWR, "No more recv/send") |
| 1300 |
|
| 1301 |
/* |
| 1302 |
|
| 1303 |
--------------------- |
| 1304 |
-- Protocol levels -- |
| 1305 |
--------------------- |
| 1306 |
|
| 1307 |
*/ |
| 1308 |
|
| 1309 |
#ifndef SOL_SOCKET |
| 1310 |
# define SOL_SOCKET -1 |
| 1311 |
#endif |
| 1312 |
CND(SOL_SOCKET, "Options for socket level") |
| 1313 |
|
| 1314 |
#ifndef IPPROTO_IP |
| 1315 |
# define IPPROTO_IP -1 |
| 1316 |
#endif |
| 1317 |
CND(IPPROTO_IP, "Dummy protocol for IP") |
| 1318 |
|
| 1319 |
#ifndef IPPROTO_IPV6 |
| 1320 |
# define IPPROTO_IPV6 -1 |
| 1321 |
#endif |
| 1322 |
CND(IPPROTO_IPV6, "IPv6 socket option level") |
| 1323 |
|
| 1324 |
#ifndef IPPROTO_UDP |
| 1325 |
# define IPPROTO_UDP -1 |
| 1326 |
#endif |
| 1327 |
CND(IPPROTO_UDP, "UDP") |
| 1328 |
|
| 1329 |
#ifndef IPPROTO_TCP |
| 1330 |
# define IPPROTO_TCP -1 |
| 1331 |
#endif |
| 1332 |
CND(IPPROTO_TCP, "TCP") |
| 1333 |
|
| 1334 |
#ifndef IPPROTO_ICMP |
| 1335 |
# define IPPROTO_ICMP -1 |
| 1336 |
#endif |
| 1337 |
CND(IPPROTO_ICMP, "Internet Control Message Protocol") |
| 1338 |
|
| 1339 |
#ifndef IPPROTO_IGMP |
| 1340 |
# define IPPROTO_IGMP -1 |
| 1341 |
#endif |
| 1342 |
CND(IPPROTO_IGMP, "Internet Group Management Protocol") |
| 1343 |
|
| 1344 |
#ifndef IPPROTO_IPIP |
| 1345 |
# define IPPROTO_IPIP -1 |
| 1346 |
#endif |
| 1347 |
CND(IPPROTO_IPIP, "IPIP tunnels (older KA9Q tunnels use 94)") |
| 1348 |
|
| 1349 |
#ifndef IPPROTO_EGP |
| 1350 |
# define IPPROTO_EGP -1 |
| 1351 |
#endif |
| 1352 |
CND(IPPROTO_EGP, "Exterior Gateway Protocol") |
| 1353 |
|
| 1354 |
#ifndef IPPROTO_PUP |
| 1355 |
# define IPPROTO_PUP -1 |
| 1356 |
#endif |
| 1357 |
CND(IPPROTO_PUP, "PUP protocol") |
| 1358 |
|
| 1359 |
#ifndef IPPROTO_IDP |
| 1360 |
# define IPPROTO_IDP -1 |
| 1361 |
#endif |
| 1362 |
CND(IPPROTO_IDP, "XNS IDP protocol") |
| 1363 |
|
| 1364 |
#ifndef IPPROTO_TP |
| 1365 |
# define IPPROTO_TP -1 |
| 1366 |
#endif |
| 1367 |
CND(IPPROTO_TP, "SO Transport Protocol Class 4") |
| 1368 |
|
| 1369 |
#ifndef IPPROTO_DCCP |
| 1370 |
# define IPPROTO_DCCP -1 |
| 1371 |
#endif |
| 1372 |
CND(IPPROTO_DCCP, "Datagram Congestion Control Protocol") |
| 1373 |
|
| 1374 |
#ifndef IPPROTO_RSVP |
| 1375 |
# define IPPROTO_RSVP -1 |
| 1376 |
#endif |
| 1377 |
CND(IPPROTO_RSVP, "Reservation Protocol") |
| 1378 |
|
| 1379 |
#ifndef IPPROTO_GRE |
| 1380 |
# define IPPROTO_GRE -1 |
| 1381 |
#endif |
| 1382 |
CND(IPPROTO_GRE, "General Routing Encapsulation") |
| 1383 |
|
| 1384 |
#ifndef IPPROTO_ESP |
| 1385 |
# define IPPROTO_ESP -1 |
| 1386 |
#endif |
| 1387 |
CND(IPPROTO_ESP, "encapsulating security payload") |
| 1388 |
|
| 1389 |
#ifndef IPPROTO_AH |
| 1390 |
# define IPPROTO_AH -1 |
| 1391 |
#endif |
| 1392 |
CND(IPPROTO_AH, "authentication header") |
| 1393 |
|
| 1394 |
#ifndef IPPROTO_MTP |
| 1395 |
# define IPPROTO_MTP -1 |
| 1396 |
#endif |
| 1397 |
CND(IPPROTO_MTP, "Multicast Transport Protocol") |
| 1398 |
|
| 1399 |
#ifndef IPPROTO_BEETPH |
| 1400 |
# define IPPROTO_BEETPH -1 |
| 1401 |
#endif |
| 1402 |
CND(IPPROTO_BEETPH, "IP option pseudo header for BEET") |
| 1403 |
|
| 1404 |
#ifndef IPPROTO_ENCAP |
| 1405 |
# define IPPROTO_ENCAP -1 |
| 1406 |
#endif |
| 1407 |
CND(IPPROTO_ENCAP, "Encapsulation Header") |
| 1408 |
|
| 1409 |
#ifndef IPPROTO_PIM |
| 1410 |
# define IPPROTO_PIM -1 |
| 1411 |
#endif |
| 1412 |
CND(IPPROTO_PIM, "Protocol Independent Multicast") |
| 1413 |
|
| 1414 |
#ifndef IPPROTO_COMP |
| 1415 |
# define IPPROTO_COMP -1 |
| 1416 |
#endif |
| 1417 |
CND(IPPROTO_COMP, "Compression Header Protocol") |
| 1418 |
|
| 1419 |
#ifndef IPPROTO_SCTP |
| 1420 |
# define IPPROTO_SCTP -1 |
| 1421 |
#endif |
| 1422 |
CND(IPPROTO_SCTP, "Stream Control Transmission Protocol") |
| 1423 |
|
| 1424 |
#ifndef IPPROTO_UDPLITE |
| 1425 |
# define IPPROTO_UDPLITE -1 |
| 1426 |
#endif |
| 1427 |
CND(IPPROTO_UDPLITE, "UDP-Lite protocol") |
| 1428 |
|
| 1429 |
#ifndef IPPROTO_MPLS |
| 1430 |
# define IPPROTO_MPLS -1 |
| 1431 |
#endif |
| 1432 |
CND(IPPROTO_MPLS, "MPLS in IP") |
| 1433 |
|
| 1434 |
#ifndef IPPROTO_RAW |
| 1435 |
# define IPPROTO_RAW -1 |
| 1436 |
#endif |
| 1437 |
CND(IPPROTO_RAW, "Raw IP packets") |
| 1438 |
|
| 1439 |
/* |
| 1440 |
|
| 1441 |
------------------- |
| 1442 |
-- Request flags -- |
| 1443 |
------------------- |
| 1444 |
|
| 1445 |
*/ |
| 1446 |
|
| 1447 |
#ifndef MSG_OOB |
| 1448 |
# define MSG_OOB -1 |
| 1449 |
#endif |
| 1450 |
CND(MSG_OOB, "Process out-of-band data") |
| 1451 |
|
| 1452 |
#ifndef MSG_PEEK |
| 1453 |
# define MSG_PEEK -1 |
| 1454 |
#endif |
| 1455 |
CND(MSG_PEEK, "Peek at incoming data") |
| 1456 |
|
| 1457 |
#ifndef MSG_EOR |
| 1458 |
# define MSG_EOR -1 |
| 1459 |
#endif |
| 1460 |
CND(MSG_EOR, "Send end of record") |
| 1461 |
|
| 1462 |
#ifndef MSG_WAITALL |
| 1463 |
# define MSG_WAITALL -1 |
| 1464 |
#endif |
| 1465 |
CND(MSG_WAITALL, "Wait for full reception") |
| 1466 |
|
| 1467 |
#ifndef MSG_NOSIGNAL |
| 1468 |
# define MSG_NOSIGNAL -1 |
| 1469 |
#endif |
| 1470 |
CND(MSG_NOSIGNAL, "No SIGPIPE on send") |
| 1471 |
|
| 1472 |
#if defined (__linux__) || defined (__ANDROID__) || defined (__QNX__) || defined (__GNU__) |
| 1473 |
# define MSG_Forced_Flags "MSG_NOSIGNAL" |
| 1474 |
#else |
| 1475 |
# define MSG_Forced_Flags "0" |
| 1476 |
#endif |
| 1477 |
CNS(MSG_Forced_Flags, "") |
| 1478 |
/* |
| 1479 |
-- Flags set on all send(2) calls |
| 1480 |
*/ |
| 1481 |
|
| 1482 |
/* |
| 1483 |
|
| 1484 |
-------------------- |
| 1485 |
-- Socket options -- |
| 1486 |
-------------------- |
| 1487 |
|
| 1488 |
*/ |
| 1489 |
|
| 1490 |
#ifndef TCP_NODELAY |
| 1491 |
# define TCP_NODELAY -1 |
| 1492 |
#endif |
| 1493 |
CND(TCP_NODELAY, "Do not coalesce packets") |
| 1494 |
|
| 1495 |
#ifndef TCP_KEEPCNT |
| 1496 |
#ifdef __MINGW32__ |
| 1497 |
/* Windows headers can be too old to have all available constants. |
| 1498 |
* We know this one. */ |
| 1499 |
# define TCP_KEEPCNT 16 |
| 1500 |
#else |
| 1501 |
# define TCP_KEEPCNT -1 |
| 1502 |
#endif |
| 1503 |
#endif |
| 1504 |
CND(TCP_KEEPCNT, "Maximum number of keepalive probes") |
| 1505 |
|
| 1506 |
#ifndef TCP_KEEPIDLE |
| 1507 |
#ifdef __MINGW32__ |
| 1508 |
/* Windows headers can be too old to have all available constants. |
| 1509 |
* We know this one. */ |
| 1510 |
# define TCP_KEEPIDLE 3 |
| 1511 |
#else |
| 1512 |
# define TCP_KEEPIDLE -1 |
| 1513 |
#endif |
| 1514 |
#endif |
| 1515 |
CND(TCP_KEEPIDLE, "Idle time before TCP starts sending keepalive probes") |
| 1516 |
|
| 1517 |
#ifndef TCP_KEEPINTVL |
| 1518 |
#ifdef __MINGW32__ |
| 1519 |
/* Windows headers can be too old to have all available constants. |
| 1520 |
* We know this one. */ |
| 1521 |
# define TCP_KEEPINTVL 17 |
| 1522 |
#else |
| 1523 |
# define TCP_KEEPINTVL -1 |
| 1524 |
#endif |
| 1525 |
#endif |
| 1526 |
CND(TCP_KEEPINTVL, "Time between individual keepalive probes") |
| 1527 |
|
| 1528 |
#ifndef SO_REUSEADDR |
| 1529 |
# define SO_REUSEADDR -1 |
| 1530 |
#endif |
| 1531 |
CND(SO_REUSEADDR, "Bind reuse local address") |
| 1532 |
|
| 1533 |
#ifndef SO_REUSEPORT |
| 1534 |
# define SO_REUSEPORT -1 |
| 1535 |
#endif |
| 1536 |
CND(SO_REUSEPORT, "Bind reuse port number") |
| 1537 |
|
| 1538 |
#ifndef SO_KEEPALIVE |
| 1539 |
# define SO_KEEPALIVE -1 |
| 1540 |
#endif |
| 1541 |
CND(SO_KEEPALIVE, "Enable keep-alive msgs") |
| 1542 |
|
| 1543 |
#ifndef SO_LINGER |
| 1544 |
# define SO_LINGER -1 |
| 1545 |
#endif |
| 1546 |
CND(SO_LINGER, "Defer close to flush data") |
| 1547 |
|
| 1548 |
#ifndef SO_BINDTODEVICE |
| 1549 |
# define SO_BINDTODEVICE -1 |
| 1550 |
#endif |
| 1551 |
CND(SO_BINDTODEVICE, "Bind to a NIC - Network Interface Controller") |
| 1552 |
|
| 1553 |
#ifndef SO_BROADCAST |
| 1554 |
# define SO_BROADCAST -1 |
| 1555 |
#endif |
| 1556 |
CND(SO_BROADCAST, "Can send broadcast msgs") |
| 1557 |
|
| 1558 |
#ifndef SO_SNDBUF |
| 1559 |
# define SO_SNDBUF -1 |
| 1560 |
#endif |
| 1561 |
CND(SO_SNDBUF, "Set/get send buffer size") |
| 1562 |
|
| 1563 |
#ifndef SO_RCVBUF |
| 1564 |
# define SO_RCVBUF -1 |
| 1565 |
#endif |
| 1566 |
CND(SO_RCVBUF, "Set/get recv buffer size") |
| 1567 |
|
| 1568 |
#ifndef SO_SNDTIMEO |
| 1569 |
# define SO_SNDTIMEO -1 |
| 1570 |
#endif |
| 1571 |
CND(SO_SNDTIMEO, "Emission timeout") |
| 1572 |
|
| 1573 |
#ifndef SO_RCVTIMEO |
| 1574 |
# define SO_RCVTIMEO -1 |
| 1575 |
#endif |
| 1576 |
CND(SO_RCVTIMEO, "Reception timeout") |
| 1577 |
|
| 1578 |
#ifndef SO_ERROR |
| 1579 |
# define SO_ERROR -1 |
| 1580 |
#endif |
| 1581 |
CND(SO_ERROR, "Get/clear error status") |
| 1582 |
|
| 1583 |
#ifndef SO_BUSY_POLL |
| 1584 |
# define SO_BUSY_POLL -1 |
| 1585 |
#endif |
| 1586 |
CND(SO_BUSY_POLL, "Busy polling") |
| 1587 |
|
| 1588 |
#ifndef IP_MULTICAST_IF |
| 1589 |
# define IP_MULTICAST_IF -1 |
| 1590 |
#endif |
| 1591 |
CND(IP_MULTICAST_IF, "Set/get mcast interface") |
| 1592 |
|
| 1593 |
#ifndef IP_MULTICAST_TTL |
| 1594 |
# define IP_MULTICAST_TTL -1 |
| 1595 |
#endif |
| 1596 |
CND(IP_MULTICAST_TTL, "Set/get multicast TTL") |
| 1597 |
|
| 1598 |
#ifndef IP_MULTICAST_LOOP |
| 1599 |
# define IP_MULTICAST_LOOP -1 |
| 1600 |
#endif |
| 1601 |
CND(IP_MULTICAST_LOOP, "Set/get mcast loopback") |
| 1602 |
|
| 1603 |
#ifndef IP_ADD_MEMBERSHIP |
| 1604 |
# define IP_ADD_MEMBERSHIP -1 |
| 1605 |
#endif |
| 1606 |
CND(IP_ADD_MEMBERSHIP, "Join a multicast group") |
| 1607 |
|
| 1608 |
#ifndef IP_DROP_MEMBERSHIP |
| 1609 |
# define IP_DROP_MEMBERSHIP -1 |
| 1610 |
#endif |
| 1611 |
CND(IP_DROP_MEMBERSHIP, "Leave a multicast group") |
| 1612 |
|
| 1613 |
#ifndef IP_PKTINFO |
| 1614 |
# define IP_PKTINFO -1 |
| 1615 |
#endif |
| 1616 |
CND(IP_PKTINFO, "Get datagram info") |
| 1617 |
|
| 1618 |
#ifndef IP_RECVERR |
| 1619 |
# define IP_RECVERR -1 |
| 1620 |
#endif |
| 1621 |
CND(IP_RECVERR, "Extended reliable error message passing") |
| 1622 |
|
| 1623 |
#ifndef IPV6_ADDRFORM |
| 1624 |
# define IPV6_ADDRFORM -1 |
| 1625 |
#endif |
| 1626 |
CND(IPV6_ADDRFORM, "Turn IPv6 socket into different address family") |
| 1627 |
|
| 1628 |
#ifndef IPV6_ADD_MEMBERSHIP |
| 1629 |
# define IPV6_ADD_MEMBERSHIP -1 |
| 1630 |
#endif |
| 1631 |
CND(IPV6_ADD_MEMBERSHIP, "Join IPv6 multicast group") |
| 1632 |
|
| 1633 |
#ifndef IPV6_DROP_MEMBERSHIP |
| 1634 |
# define IPV6_DROP_MEMBERSHIP -1 |
| 1635 |
#endif |
| 1636 |
CND(IPV6_DROP_MEMBERSHIP, "Leave IPv6 multicast group") |
| 1637 |
|
| 1638 |
#ifndef IPV6_MTU |
| 1639 |
# define IPV6_MTU -1 |
| 1640 |
#endif |
| 1641 |
CND(IPV6_MTU, "Set/get MTU used for the socket") |
| 1642 |
|
| 1643 |
#ifndef IPV6_MTU_DISCOVER |
| 1644 |
# define IPV6_MTU_DISCOVER -1 |
| 1645 |
#endif |
| 1646 |
CND(IPV6_MTU_DISCOVER, "Control path-MTU discovery on the socket") |
| 1647 |
|
| 1648 |
#ifndef IPV6_MULTICAST_HOPS |
| 1649 |
# define IPV6_MULTICAST_HOPS -1 |
| 1650 |
#endif |
| 1651 |
CND(IPV6_MULTICAST_HOPS, "Set the multicast hop limit for the socket") |
| 1652 |
|
| 1653 |
#ifndef IPV6_MULTICAST_IF |
| 1654 |
# define IPV6_MULTICAST_IF -1 |
| 1655 |
#endif |
| 1656 |
CND(IPV6_MULTICAST_IF, "Set/get IPv6 mcast interface") |
| 1657 |
|
| 1658 |
#ifndef IPV6_MULTICAST_LOOP |
| 1659 |
# define IPV6_MULTICAST_LOOP -1 |
| 1660 |
#endif |
| 1661 |
CND(IPV6_MULTICAST_LOOP, "Set/get mcast loopback") |
| 1662 |
|
| 1663 |
#ifndef IPV6_RECVPKTINFO |
| 1664 |
# define IPV6_RECVPKTINFO -1 |
| 1665 |
#endif |
| 1666 |
CND(IPV6_RECVPKTINFO, "Set delivery of the IPV6_PKTINFO") |
| 1667 |
|
| 1668 |
#ifndef IPV6_PKTINFO |
| 1669 |
# define IPV6_PKTINFO -1 |
| 1670 |
#endif |
| 1671 |
CND(IPV6_PKTINFO, "Get IPv6datagram info") |
| 1672 |
|
| 1673 |
#ifndef IPV6_RTHDR |
| 1674 |
# define IPV6_RTHDR -1 |
| 1675 |
#endif |
| 1676 |
CND(IPV6_RTHDR, "Set the routing header delivery") |
| 1677 |
|
| 1678 |
#ifndef IPV6_AUTHHDR |
| 1679 |
# define IPV6_AUTHHDR -1 |
| 1680 |
#endif |
| 1681 |
CND(IPV6_AUTHHDR, "Set the authentication header delivery") |
| 1682 |
|
| 1683 |
#ifndef IPV6_DSTOPTS |
| 1684 |
# define IPV6_DSTOPTS -1 |
| 1685 |
#endif |
| 1686 |
CND(IPV6_DSTOPTS, "Set the destination options delivery") |
| 1687 |
|
| 1688 |
#ifndef IPV6_HOPOPTS |
| 1689 |
# define IPV6_HOPOPTS -1 |
| 1690 |
#endif |
| 1691 |
CND(IPV6_HOPOPTS, "Set the hop options delivery") |
| 1692 |
|
| 1693 |
#ifndef IPV6_FLOWINFO |
| 1694 |
#ifdef __linux__ |
| 1695 |
/* The IPV6_FLOWINFO is defined in linux/in6.h, but we can't include it because |
| 1696 |
* of conflicts with other headers. */ |
| 1697 |
# define IPV6_FLOWINFO 11 |
| 1698 |
#else |
| 1699 |
# define IPV6_FLOWINFO -1 |
| 1700 |
#endif |
| 1701 |
#endif |
| 1702 |
CND(IPV6_FLOWINFO, "Set the flow ID delivery") |
| 1703 |
|
| 1704 |
#ifndef IPV6_HOPLIMIT |
| 1705 |
# define IPV6_HOPLIMIT -1 |
| 1706 |
#endif |
| 1707 |
CND(IPV6_HOPLIMIT, "Set the hop count of the packet delivery") |
| 1708 |
|
| 1709 |
#ifndef IPV6_RECVERR |
| 1710 |
# define IPV6_RECVERR -1 |
| 1711 |
#endif |
| 1712 |
CND(IPV6_RECVERR, "Extended reliable error message passing") |
| 1713 |
|
| 1714 |
#ifndef IPV6_ROUTER_ALERT |
| 1715 |
# define IPV6_ROUTER_ALERT -1 |
| 1716 |
#endif |
| 1717 |
CND(IPV6_ROUTER_ALERT, "Pass forwarded router alert hop-by-hop option") |
| 1718 |
|
| 1719 |
#ifndef IPV6_UNICAST_HOPS |
| 1720 |
# define IPV6_UNICAST_HOPS -1 |
| 1721 |
#endif |
| 1722 |
CND(IPV6_UNICAST_HOPS, "Set the unicast hop limit") |
| 1723 |
|
| 1724 |
#ifndef IPV6_V6ONLY |
| 1725 |
# define IPV6_V6ONLY -1 |
| 1726 |
#endif |
| 1727 |
CND(IPV6_V6ONLY, "Restricted to IPv6 communications only") |
| 1728 |
|
| 1729 |
/* |
| 1730 |
|
| 1731 |
---------------------- |
| 1732 |
-- Type definitions -- |
| 1733 |
---------------------- |
| 1734 |
|
| 1735 |
*/ |
| 1736 |
|
| 1737 |
{ |
| 1738 |
struct timeval tv; |
| 1739 |
/* |
| 1740 |
-- Sizes (in bytes) of the components of struct timeval |
| 1741 |
*/ |
| 1742 |
#define SIZEOF_tv_sec (sizeof tv.tv_sec) |
| 1743 |
CND(SIZEOF_tv_sec, "tv_sec") |
| 1744 |
#define SIZEOF_tv_usec (sizeof tv.tv_usec) |
| 1745 |
CND(SIZEOF_tv_usec, "tv_usec") |
| 1746 |
/* |
| 1747 |
|
| 1748 |
-- Maximum allowed value for tv_sec |
| 1749 |
*/ |
| 1750 |
|
| 1751 |
/** |
| 1752 |
** On Solaris, field tv_sec in struct timeval has an undocumented |
| 1753 |
** hard-wired limit of 100 million. |
| 1754 |
** On IA64 HP-UX the limit is 2**31 - 1. |
| 1755 |
**/ |
| 1756 |
#if defined (__sun__) |
| 1757 |
# define MAX_tv_sec "100_000_000" |
| 1758 |
|
| 1759 |
#elif defined (__hpux__) |
| 1760 |
# define MAX_tv_sec "16#7fffffff#" |
| 1761 |
|
| 1762 |
#else |
| 1763 |
# define MAX_tv_sec "2 ** (SIZEOF_tv_sec * 8 - 1) - 1" |
| 1764 |
#endif |
| 1765 |
CNS(MAX_tv_sec, "") |
| 1766 |
} |
| 1767 |
/* |
| 1768 |
|
| 1769 |
-- Sizes of various data types |
| 1770 |
*/ |
| 1771 |
|
| 1772 |
#define SIZEOF_sockaddr_in (sizeof (struct sockaddr_in)) |
| 1773 |
CND(SIZEOF_sockaddr_in, "struct sockaddr_in") |
| 1774 |
#ifdef HAVE_AF_INET6 |
| 1775 |
# define SIZEOF_sockaddr_in6 (sizeof (struct sockaddr_in6)) |
| 1776 |
#else |
| 1777 |
# define SIZEOF_sockaddr_in6 0 |
| 1778 |
#endif |
| 1779 |
CND(SIZEOF_sockaddr_in6, "struct sockaddr_in6") |
| 1780 |
|
| 1781 |
/** |
| 1782 |
** The sockaddr_un structure is not defined in MINGW C headers |
| 1783 |
** but Windows supports it from build 17063. |
| 1784 |
**/ |
| 1785 |
#if defined(__MINGW32__) |
| 1786 |
struct sockaddr_un { |
| 1787 |
ADDRESS_FAMILY sun_family; /* AF_UNIX */ |
| 1788 |
char sun_path[108]; /* Pathname */ |
| 1789 |
}; |
| 1790 |
#endif |
| 1791 |
#define SIZEOF_sockaddr_un (sizeof (struct sockaddr_un)) |
| 1792 |
CND(SIZEOF_sockaddr_un, "struct sockaddr_un") |
| 1793 |
|
| 1794 |
#define SIZEOF_fd_set (sizeof (fd_set)) |
| 1795 |
CND(SIZEOF_fd_set, "fd_set") |
| 1796 |
CND(FD_SETSIZE, "Max fd value") |
| 1797 |
|
| 1798 |
#define SIZEOF_struct_hostent (sizeof (struct hostent)) |
| 1799 |
CND(SIZEOF_struct_hostent, "struct hostent") |
| 1800 |
|
| 1801 |
#define SIZEOF_struct_servent (sizeof (struct servent)) |
| 1802 |
CND(SIZEOF_struct_servent, "struct servent") |
| 1803 |
|
| 1804 |
#if defined(_WIN32) || defined(__vxworks) |
| 1805 |
#define SIZEOF_nfds_t sizeof (int) * 8 |
| 1806 |
#define SIZEOF_socklen_t sizeof (size_t) |
| 1807 |
#elif defined(__Lynx__) |
| 1808 |
#define SIZEOF_nfds_t sizeof (unsigned long int) * 8 |
| 1809 |
#define SIZEOF_socklen_t sizeof (socklen_t) |
| 1810 |
#else |
| 1811 |
#define SIZEOF_nfds_t sizeof (nfds_t) * 8 |
| 1812 |
#define SIZEOF_socklen_t sizeof (socklen_t) |
| 1813 |
#endif |
| 1814 |
CND(SIZEOF_nfds_t, "Size of nfds_t"); |
| 1815 |
CND(SIZEOF_socklen_t, "Size of socklen_t"); |
| 1816 |
|
| 1817 |
{ |
| 1818 |
#if defined(__vxworks) |
| 1819 |
#define SIZEOF_fd_type sizeof (int) * 8 |
| 1820 |
#define SIZEOF_pollfd_events sizeof (short) * 8 |
| 1821 |
#else |
| 1822 |
const struct pollfd v_pollfd; |
| 1823 |
#define SIZEOF_fd_type sizeof (v_pollfd.fd) * 8 |
| 1824 |
#define SIZEOF_pollfd_events sizeof (v_pollfd.events) * 8 |
| 1825 |
#endif |
| 1826 |
CND(SIZEOF_fd_type, "Size of socket fd"); |
| 1827 |
CND(SIZEOF_pollfd_events, "Size of pollfd.events"); |
| 1828 |
} |
| 1829 |
|
| 1830 |
#ifndef IF_NAMESIZE |
| 1831 |
#ifdef IF_MAX_STRING_SIZE |
| 1832 |
#define IF_NAMESIZE IF_MAX_STRING_SIZE |
| 1833 |
#else |
| 1834 |
#define IF_NAMESIZE -1 |
| 1835 |
#endif |
| 1836 |
#endif |
| 1837 |
CND(IF_NAMESIZE, "Max size of interface name with 0 terminator"); |
| 1838 |
|
| 1839 |
/* |
| 1840 |
|
| 1841 |
-- Poll values |
| 1842 |
|
| 1843 |
*/ |
| 1844 |
|
| 1845 |
#if defined(__vxworks) |
| 1846 |
#ifndef POLLIN |
| 1847 |
#define POLLIN 1 |
| 1848 |
#endif |
| 1849 |
|
| 1850 |
#ifndef POLLPRI |
| 1851 |
#define POLLPRI 2 |
| 1852 |
#endif |
| 1853 |
|
| 1854 |
#ifndef POLLOUT |
| 1855 |
#define POLLOUT 4 |
| 1856 |
#endif |
| 1857 |
|
| 1858 |
#ifndef POLLERR |
| 1859 |
#define POLLERR 8 |
| 1860 |
#endif |
| 1861 |
|
| 1862 |
#ifndef POLLHUP |
| 1863 |
#define POLLHUP 16 |
| 1864 |
#endif |
| 1865 |
|
| 1866 |
#ifndef POLLNVAL |
| 1867 |
#define POLLNVAL 32 |
| 1868 |
#endif |
| 1869 |
|
| 1870 |
#elif defined(_WIN32) |
| 1871 |
#define POLLPRI 0 |
| 1872 |
/* If the POLLPRI flag is set on a socket for the Microsoft Winsock provider, |
| 1873 |
* the WSAPoll function will fail. */ |
| 1874 |
#endif |
| 1875 |
|
| 1876 |
CND(POLLIN, "There is data to read"); |
| 1877 |
CND(POLLPRI, "Urgent data to read"); |
| 1878 |
CND(POLLOUT, "Writing will not block"); |
| 1879 |
CND(POLLERR, "Error (output only)"); |
| 1880 |
CND(POLLHUP, "Hang up (output only)"); |
| 1881 |
CND(POLLNVAL, "Invalid request"); |
| 1882 |
|
| 1883 |
/* |
| 1884 |
|
| 1885 |
-- Fields of struct msghdr |
| 1886 |
*/ |
| 1887 |
|
| 1888 |
#if defined (__sun__) || defined (__hpux__) |
| 1889 |
# define Msg_Iovlen_T "Interfaces.C.int" |
| 1890 |
#else |
| 1891 |
# define Msg_Iovlen_T "Interfaces.C.size_t" |
| 1892 |
#endif |
| 1893 |
|
| 1894 |
SUB(Msg_Iovlen_T) |
| 1895 |
|
| 1896 |
/* |
| 1897 |
|
| 1898 |
---------------------------------------- |
| 1899 |
-- Properties of supported interfaces -- |
| 1900 |
---------------------------------------- |
| 1901 |
|
| 1902 |
*/ |
| 1903 |
|
| 1904 |
CND(Need_Netdb_Buffer, "Need buffer for Netdb ops") |
| 1905 |
CND(Need_Netdb_Lock, "Need lock for Netdb ops") |
| 1906 |
CND(Has_Sockaddr_Len, "Sockaddr has sa_len field") |
| 1907 |
|
| 1908 |
/** |
| 1909 |
** Do not change the format of the line below without also updating the |
| 1910 |
** MaRTE Makefile. |
| 1911 |
**/ |
| 1912 |
C("Thread_Blocking_IO", Boolean, "True", "") |
| 1913 |
/* |
| 1914 |
-- Set False for contexts where socket i/o are process blocking |
| 1915 |
|
| 1916 |
*/ |
| 1917 |
|
| 1918 |
#ifdef HAVE_INET_PTON |
| 1919 |
# define Inet_Pton_Linkname "inet_pton" |
| 1920 |
#else |
| 1921 |
# define Inet_Pton_Linkname "__gnat_inet_pton" |
| 1922 |
#endif |
| 1923 |
CST(Inet_Pton_Linkname, "") |
| 1924 |
|
| 1925 |
#ifdef HAVE_INET_NTOP |
| 1926 |
# define Inet_Ntop_Linkname "inet_ntop" |
| 1927 |
#else |
| 1928 |
# define Inet_Ntop_Linkname "__gnat_inet_ntop" |
| 1929 |
#endif |
| 1930 |
CST(Inet_Ntop_Linkname, "") |
| 1931 |
|
| 1932 |
#if defined(_WIN32) |
| 1933 |
# define Poll_Linkname "WSAPoll" |
| 1934 |
#else |
| 1935 |
# define Poll_Linkname "poll" |
| 1936 |
#endif |
| 1937 |
CST(Poll_Linkname, "") |
| 1938 |
|
| 1939 |
#endif /* HAVE_SOCKETS */ |
| 1940 |
|
| 1941 |
#if defined (__linux__) || defined (__ANDROID__) || defined (__QNX__) || defined (__GNU__) |
| 1942 |
#define SIZEOF_sigset (sizeof (sigset_t)) |
| 1943 |
CND(SIZEOF_sigset, "sigset") |
| 1944 |
#endif |
| 1945 |
|
| 1946 |
/* |
| 1947 |
|
| 1948 |
--------------------- |
| 1949 |
-- Threads support -- |
| 1950 |
--------------------- |
| 1951 |
|
| 1952 |
-- Clock identifier definitions |
| 1953 |
|
| 1954 |
*/ |
| 1955 |
|
| 1956 |
/* Note: On HP-UX, CLOCK_REALTIME is an enum, not a macro. */ |
| 1957 |
|
| 1958 |
#if !(defined(CLOCK_REALTIME) || defined (__hpux__)) |
| 1959 |
# define CLOCK_REALTIME (-1) |
| 1960 |
#endif |
| 1961 |
CND(CLOCK_REALTIME, "System realtime clock") |
| 1962 |
|
| 1963 |
#ifdef CLOCK_MONOTONIC |
| 1964 |
CND(CLOCK_MONOTONIC, "System monotonic clock") |
| 1965 |
#endif |
| 1966 |
|
| 1967 |
#ifdef CLOCK_FASTEST |
| 1968 |
CND(CLOCK_FASTEST, "Fastest clock") |
| 1969 |
#endif |
| 1970 |
|
| 1971 |
#ifndef CLOCK_THREAD_CPUTIME_ID |
| 1972 |
# define CLOCK_THREAD_CPUTIME_ID -1 |
| 1973 |
#endif |
| 1974 |
CND(CLOCK_THREAD_CPUTIME_ID, "Thread CPU clock") |
| 1975 |
|
| 1976 |
#if defined(__linux__) || defined(__FreeBSD__) \ |
| 1977 |
|| (defined(_AIX) && defined(_AIXVERSION_530)) \ |
| 1978 |
|| defined(__DragonFly__) || defined(__QNX__) \ |
| 1979 |
|| defined (__vxworks) |
| 1980 |
/** On these platforms use system provided monotonic clock instead of |
| 1981 |
** the default CLOCK_REALTIME. We then need to set up cond var attributes |
| 1982 |
** appropriately (see thread.c). |
| 1983 |
** |
| 1984 |
** Note that AIX 5.2 does not support CLOCK_MONOTONIC timestamps for |
| 1985 |
** pthread_cond_timedwait (and does not have pthread_condattr_setclock), |
| 1986 |
** hence the conditionalization on AIX version above). _AIXVERSION_530 |
| 1987 |
** is defined in AIX 5.3 and more recent versions. |
| 1988 |
**/ |
| 1989 |
# define CLOCK_RT_Ada "CLOCK_MONOTONIC" |
| 1990 |
|
| 1991 |
#else |
| 1992 |
/* By default use CLOCK_REALTIME */ |
| 1993 |
# define CLOCK_RT_Ada "CLOCK_REALTIME" |
| 1994 |
#endif |
| 1995 |
|
| 1996 |
#ifdef CLOCK_RT_Ada |
| 1997 |
CNS(CLOCK_RT_Ada, "") |
| 1998 |
#endif |
| 1999 |
|
| 2000 |
#if defined (__APPLE__) || defined (__ANDROID__) || defined (DUMMY) \ |
| 2001 |
|| defined (__FreeBSD__) || defined (__linux__) \ |
| 2002 |
|| defined (__QNX__) || defined (__rtems__) || defined (__GNU__) |
| 2003 |
|
| 2004 |
/* |
| 2005 |
|
| 2006 |
-- Sizes of pthread data types |
| 2007 |
*/ |
| 2008 |
|
| 2009 |
#if defined (__APPLE__) || defined (DUMMY) |
| 2010 |
/* |
| 2011 |
-- (on Darwin, these are just placeholders) |
| 2012 |
*/ |
| 2013 |
#define PTHREAD_SIZE __PTHREAD_SIZE__ |
| 2014 |
#define PTHREAD_ATTR_SIZE __PTHREAD_ATTR_SIZE__ |
| 2015 |
#define PTHREAD_MUTEXATTR_SIZE __PTHREAD_MUTEXATTR_SIZE__ |
| 2016 |
#define PTHREAD_MUTEX_SIZE __PTHREAD_MUTEX_SIZE__ |
| 2017 |
#define PTHREAD_CONDATTR_SIZE __PTHREAD_CONDATTR_SIZE__ |
| 2018 |
#define PTHREAD_COND_SIZE __PTHREAD_COND_SIZE__ |
| 2019 |
#define PTHREAD_RWLOCKATTR_SIZE __PTHREAD_RWLOCKATTR_SIZE__ |
| 2020 |
#define PTHREAD_RWLOCK_SIZE __PTHREAD_RWLOCK_SIZE__ |
| 2021 |
#define PTHREAD_ONCE_SIZE __PTHREAD_ONCE_SIZE__ |
| 2022 |
#else |
| 2023 |
#define PTHREAD_SIZE (sizeof (pthread_t)) |
| 2024 |
#define PTHREAD_ATTR_SIZE (sizeof (pthread_attr_t)) |
| 2025 |
#define PTHREAD_MUTEXATTR_SIZE (sizeof (pthread_mutexattr_t)) |
| 2026 |
#define PTHREAD_MUTEX_SIZE (sizeof (pthread_mutex_t)) |
| 2027 |
#define PTHREAD_CONDATTR_SIZE (sizeof (pthread_condattr_t)) |
| 2028 |
#define PTHREAD_COND_SIZE (sizeof (pthread_cond_t)) |
| 2029 |
#define PTHREAD_RWLOCKATTR_SIZE (sizeof (pthread_rwlockattr_t)) |
| 2030 |
#define PTHREAD_RWLOCK_SIZE (sizeof (pthread_rwlock_t)) |
| 2031 |
#define PTHREAD_ONCE_SIZE (sizeof (pthread_once_t)) |
| 2032 |
#endif |
| 2033 |
/* |
| 2034 |
|
| 2035 |
*/ |
| 2036 |
CND(PTHREAD_SIZE, "pthread_t") |
| 2037 |
CND(PTHREAD_ATTR_SIZE, "pthread_attr_t") |
| 2038 |
CND(PTHREAD_MUTEXATTR_SIZE, "pthread_mutexattr_t") |
| 2039 |
CND(PTHREAD_MUTEX_SIZE, "pthread_mutex_t") |
| 2040 |
CND(PTHREAD_CONDATTR_SIZE, "pthread_condattr_t") |
| 2041 |
CND(PTHREAD_COND_SIZE, "pthread_cond_t") |
| 2042 |
CND(PTHREAD_RWLOCKATTR_SIZE, "pthread_rwlockattr_t") |
| 2043 |
CND(PTHREAD_RWLOCK_SIZE, "pthread_rwlock_t") |
| 2044 |
CND(PTHREAD_ONCE_SIZE, "pthread_once_t") |
| 2045 |
|
| 2046 |
#endif /* __APPLE__ || __ANDROID__ || __FreeBSD ||__linux__ |
| 2047 |
|| __QNX__|| __rtems__ || __GNU__ */ |
| 2048 |
|
| 2049 |
/* |
| 2050 |
|
| 2051 |
-------------------------------- |
| 2052 |
-- File and directory support -- |
| 2053 |
-------------------------------- |
| 2054 |
|
| 2055 |
*/ |
| 2056 |
|
| 2057 |
/** |
| 2058 |
** Note: this constant can be used in the GNAT runtime library. In compiler |
| 2059 |
** units on the other hand, System.OS_Constants is not available, so we |
| 2060 |
** declare an Ada constant (Osint.File_Attributes_Size) independently, which |
| 2061 |
** is at least as large as sizeof (struct file_attributes), and we have an |
| 2062 |
** assertion at initialization of Osint checking that the size is indeed at |
| 2063 |
** least sufficient. |
| 2064 |
**/ |
| 2065 |
#define SIZEOF_struct_file_attributes (sizeof (struct file_attributes)) |
| 2066 |
CND(SIZEOF_struct_file_attributes, "struct file_attributes") |
| 2067 |
|
| 2068 |
/** |
| 2069 |
** Maximal size of buffer for struct dirent. Note: Since POSIX.1 does not |
| 2070 |
** specify the size of the d_name field, and other nonstandard fields may |
| 2071 |
** precede that field within the dirent structure, we must make a conservative |
| 2072 |
** computation. |
| 2073 |
**/ |
| 2074 |
{ |
| 2075 |
struct dirent dent; |
| 2076 |
#define SIZEOF_struct_dirent_alloc \ |
| 2077 |
((char*) &dent.d_name - (char*) &dent) + NAME_MAX + 1 |
| 2078 |
CND(SIZEOF_struct_dirent_alloc, "struct dirent allocation") |
| 2079 |
} |
| 2080 |
|
| 2081 |
/** |
| 2082 |
** System-specific constants follow |
| 2083 |
** Each section should be activated if compiling for the corresponding |
| 2084 |
** platform *or* generating the dummy version for runtime test compilation. |
| 2085 |
**/ |
| 2086 |
|
| 2087 |
#if defined (__vxworks) || defined (DUMMY) |
| 2088 |
|
| 2089 |
/* |
| 2090 |
|
| 2091 |
-------------------------------- |
| 2092 |
-- VxWorks-specific constants -- |
| 2093 |
-------------------------------- |
| 2094 |
|
| 2095 |
-- These constants may be used only within the VxWorks version of |
| 2096 |
-- GNAT.Sockets.Thin. |
| 2097 |
*/ |
| 2098 |
|
| 2099 |
CND(OK, "VxWorks generic success") |
| 2100 |
CND(ERROR, "VxWorks generic error") |
| 2101 |
|
| 2102 |
#endif /* __vxworks */ |
| 2103 |
|
| 2104 |
#if defined (__MINGW32__) || defined (DUMMY) |
| 2105 |
/* |
| 2106 |
|
| 2107 |
------------------------------ |
| 2108 |
-- MinGW-specific constants -- |
| 2109 |
------------------------------ |
| 2110 |
|
| 2111 |
-- These constants may be used only within the MinGW version of |
| 2112 |
-- GNAT.Sockets.Thin. |
| 2113 |
*/ |
| 2114 |
|
| 2115 |
CND(WSASYSNOTREADY, "System not ready") |
| 2116 |
CND(WSAVERNOTSUPPORTED, "Version not supported") |
| 2117 |
CND(WSANOTINITIALISED, "Winsock not initialized") |
| 2118 |
CND(WSAEDISCON, "Disconnected") |
| 2119 |
|
| 2120 |
#endif /* __MINGW32__ */ |
| 2121 |
|
| 2122 |
/** |
| 2123 |
** End of constants definitions |
| 2124 |
**/ |
| 2125 |
|
| 2126 |
#ifdef NATIVE |
| 2127 |
putchar ('\n'); |
| 2128 |
#endif |
| 2129 |
|
| 2130 |
/* |
| 2131 |
|
| 2132 |
end System.OS_Constants; |
| 2133 |
*/ |
| 2134 |
} |