Fix bugs in cosmocc toolchain

This change integrates e58abc1110b335a3341e8ad5821ad8e3880d9bb2 from
https://github.com/ahgamut/musl-cross-make/ which fixes the issues we
were having with our C language extension for symbolic constants. This
change also performs some code cleanup and bug fixes to getaddrinfo().
It's now possible to compile projects like ncurses, readline and python
without needing to patch anything upstream, except maybe a line or two.
Pretty soon it should be possible to build a Linux distro on Cosmo.
This commit is contained in:
Justine Tunney 2023-06-08 23:44:03 -07:00
parent 22f81a8d50
commit 23e235b7a5
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
272 changed files with 3491 additions and 4350 deletions

View file

@ -12,7 +12,7 @@ OUTPUT_FORMAT("elf64-littleaarch64",
SECTIONS {
PROVIDE(__executable_start = SEGMENT_START("text-segment", IMAGE_BASE_VIRTUAL));
__executable_start = SEGMENT_START("text-segment", IMAGE_BASE_VIRTUAL);
. = SEGMENT_START("text-segment", IMAGE_BASE_VIRTUAL) + SIZEOF_HEADERS;
.interp : { *(.interp) }
@ -40,12 +40,13 @@ SECTIONS {
.rela.plt : {
*(.rela.plt)
PROVIDE_HIDDEN(__rela_iplt_start = .);
__rela_iplt_start = .;
*(.rela.iplt)
PROVIDE_HIDDEN(__rela_iplt_end = .);
__rela_iplt_end = .;
}
.init : {
*(.start)
KEEP(*(.initprologue))
KEEP(*(SORT_NONE(.init)))
KEEP(*(.initepilogue))
@ -71,13 +72,10 @@ SECTIONS {
KEEP(*(SORT_NONE(.fini)))
} =0x1f2003d5
. = ALIGN(__privileged_end > __privileged_start ? 0x4000 : 1);
.privileged : {
PROVIDE_HIDDEN(__privileged_start = .);
.privileged ALIGN(CONSTANT(MAXPAGESIZE)) : {
__privileged_start = .;
*(.privileged*)
PROVIDE_HIDDEN(__privileged_end = .);
}
} =0x1f2003d6
.rodata : {
KEEP(*(.rodata.pytab.0));
@ -90,7 +88,7 @@ SECTIONS {
}
.comment : {
PROVIDE_HIDDEN(kLegalNotices = .);
__comment_start = .;
KEEP(*(.comment))
BYTE(0);
}
@ -117,11 +115,11 @@ SECTIONS {
*(.exception_ranges*)
}
PROVIDE(__etext = .);
PROVIDE(_etext = .);
__etext = .;
_etext = .;
PROVIDE(etext = .);
. = ALIGN(0x4000);
. = ALIGN(CONSTANT(MAXPAGESIZE));
. = DATA_SEGMENT_ALIGN(CONSTANT(MAXPAGESIZE), CONSTANT(COMMONPAGESIZE));
.eh_frame : ONLY_IF_RW {
@ -142,38 +140,37 @@ SECTIONS {
}
.tdata : {
PROVIDE_HIDDEN(_tdata_start = .);
PROVIDE_HIDDEN(__tdata_start = .);
_tdata_start = .;
__tdata_start = .;
*(.tdata .tdata.* .gnu.linkonce.td.*)
PROVIDE_HIDDEN(_tdata_end = .);
_tdata_end = .;
}
.tbss : {
PROVIDE_HIDDEN(_tbss_start = .);
_tbss_start = .;
*(.tbss .tbss.* .gnu.linkonce.tb.*)
*(.tcommon)
PROVIDE_HIDDEN(_tbss_end = .);
_tbss_end = .;
}
.init_array : {
PROVIDE_HIDDEN(__init_array_start = .);
__init_array_start = .;
KEEP(*(SORT_BY_INIT_PRIORITY(.init_array.*) SORT_BY_INIT_PRIORITY(.ctors.*)))
KEEP(*(.init_array EXCLUDE_FILE(*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .ctors))
PROVIDE_HIDDEN(__init_array_end = .);
__init_array_end = .;
}
.fini_array : {
PROVIDE_HIDDEN(__fini_array_start = .);
__fini_array_start = .;
KEEP(*(SORT_BY_INIT_PRIORITY(.fini_array.*) SORT_BY_INIT_PRIORITY(.dtors.*)))
KEEP(*(.fini_array EXCLUDE_FILE(*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .dtors))
PROVIDE_HIDDEN(__fini_array_end = .);
__fini_array_end = .;
}
.data.rel.ro : {
KEEP(*(SORT_BY_NAME(.piro.relo.sort.*)))
*(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*)
*(.data.rel.ro .data.rel.ro.* .gnu.linkonce.d.rel.ro.*)
. = ALIGN(__SIZEOF_POINTER__);
KEEP(*(SORT_BY_NAME(.piro.relo.sort.*)))
}
.dynamic : {
@ -193,8 +190,7 @@ SECTIONS {
}
.data : {
PROVIDE(__data_start = .);
. = ALIGN(__SIZEOF_POINTER__);
__data_start = .;
KEEP(*(SORT_BY_NAME(.piro.data.sort.*)))
*(.data .data.* .gnu.linkonce.d.*)
KEEP(*(SORT_BY_NAME(.sort.data.*)))
@ -269,27 +265,24 @@ SECTIONS {
*(.gnu_debuglink)
*(.text.windows)
*(.gnu.lto_*)
*(.eh_frame)
*(.idata.*)
*(.head)
}
}
HIDDEN(__privileged_addr = ROUNDDOWN(__privileged_start, PAGESIZE));
HIDDEN(__privileged_size = (ROUNDUP(__privileged_end, PAGESIZE) -
ROUNDDOWN(__privileged_start, PAGESIZE)));
PROVIDE(ape_stack_memsz = DEFINED(ape_stack_memsz) ? ape_stack_memsz : STACKSIZE);
PROVIDE_HIDDEN(_tls_size = _tbss_end - _tdata_start);
PROVIDE_HIDDEN(_tdata_size = _tdata_end - _tdata_start);
PROVIDE_HIDDEN(_tbss_size = _tbss_end - _tbss_start);
PROVIDE_HIDDEN(_tbss_offset = _tbss_start - _tdata_start);
PROVIDE_HIDDEN(_tls_content = (_tdata_end - _tdata_start) + (_tbss_end - _tbss_start));
PROVIDE_HIDDEN(_tls_align = MAX(ALIGNOF(.tdata), ALIGNOF(.tbss)));
PROVIDE_HIDDEN(__zip_start_rva = DEFINED(__zip_start) ? __zip_start - __executable_start : 0);
ape_stack_memsz = DEFINED(ape_stack_memsz) ? ape_stack_memsz : STACKSIZE;
_tls_size = _tbss_end - _tdata_start;
_tdata_size = _tdata_end - _tdata_start;
_tbss_size = _tbss_end - _tbss_start;
_tbss_offset = _tbss_start - _tdata_start;
_tls_content = (_tdata_end - _tdata_start) + (_tbss_end - _tbss_start);
_tls_align = MAX(ALIGNOF(.tdata), ALIGNOF(.tbss));
__zip_start_rva = DEFINED(__zip_start) ? __zip_start - __executable_start : 0;
/* ZIP End of Central Directory header */
#define ZIPCONST(NAME, VAL) HIDDEN(NAME = DEFINED(__zip_start) ? VAL : 0);
ZIPCONST(v_zip_cdoffset, __zip_start - IMAGE_BASE_VIRTUAL);
#define ZIPCONST(NAME, VAL) NAME = DEFINED(__zip_start) ? VAL : 0;
ZIPCONST(v_zip_cdoffset, __zip_start - __executable_start);
ZIPCONST(v_zip_cdirsize, __zip_end - __zip_start);
ASSERT(v_zip_cdirsize % kZipCdirHdrLinkableSize == 0, "bad zip cdir");
ZIPCONST(v_zip_records, v_zip_cdirsize / kZipCdirHdrLinkableSize);

View file

@ -1863,10 +1863,10 @@ kernel: movabs $ape_stack_vaddr,%rsp
.type __test_end,@object
.section .commentprologue,"a",@progbits
.globl kLegalNotices
.type kLegalNotices,@object
.hidden kLegalNotices
kLegalNotices:/*
.globl __comment_start
.type __comment_start,@object
.hidden __comment_start
__comment_start:/*
...
decentralized content
...

View file

@ -313,9 +313,9 @@ SECTIONS {
KEEP(*(.ape.pad.privileged));
. = ALIGN(__privileged_end > __privileged_start ? PAGESIZE : 1);
/*END: morphable code */
HIDDEN(__privileged_start = .);
__privileged_start = .;
*(.privileged)
HIDDEN(__privileged_end = .);
__privileged_end = .;
. += . > 0 ? CODE_GRANULE : 0;
/*BEGIN: Read Only Data */
@ -502,7 +502,6 @@ SECTIONS {
*(__mcount_loc)
*(.discard)
*(.yoink)
*(.*)
}
}
@ -520,10 +519,6 @@ HIDDEN(_tbss_offset = _tbss_start - _tdata_start);
HIDDEN(_tls_content = (_tdata_end - _tdata_start) + (_tbss_end - _tbss_start));
HIDDEN(_tls_align = 1);
HIDDEN(__privileged_addr = ROUNDDOWN(__privileged_start, PAGESIZE));
HIDDEN(__privileged_size = (ROUNDUP(__privileged_end, PAGESIZE) -
ROUNDDOWN(__privileged_start, PAGESIZE)));
HIDDEN(ape_rom_offset = 0);
HIDDEN(ape_rom_vaddr = ADDR(.head));
HIDDEN(ape_rom_paddr = LOADADDR(.head));

View file

@ -3,7 +3,9 @@
#if !(__ASSEMBLER__ + __LINKER__ + 0)
COSMOPOLITAN_C_START_
extern const char __comment_start[] __attribute__((__weak__));
extern unsigned char __executable_start[] __attribute__((__weak__));
extern unsigned char __privileged_start[] __attribute__((__weak__));
extern unsigned char _ehead[] __attribute__((__weak__));
extern unsigned char _etext[] __attribute__((__weak__));
extern unsigned char _edata[] __attribute__((__weak__));
@ -15,10 +17,6 @@ extern unsigned char _tdata_end[] __attribute__((__weak__));
extern unsigned char _tbss_start[] __attribute__((__weak__));
extern unsigned char _tbss_end[] __attribute__((__weak__));
extern unsigned char _tls_align[] __attribute__((__weak__));
extern unsigned char __privileged_start[] __attribute__((__weak__));
extern unsigned char __privileged_addr[] __attribute__((__weak__));
extern unsigned char __privileged_size[] __attribute__((__weak__));
extern unsigned char __privileged_end[] __attribute__((__weak__));
extern unsigned char __test_start[] __attribute__((__weak__));
extern unsigned char __ro[] __attribute__((__weak__));
extern uint8_t __zip_start[] __attribute__((__weak__));

View file

@ -245,7 +245,7 @@ DEFAULT_LDFLAGS = \
-nostdlib \
--gc-sections \
--build-id=none \
--no-dynamic-linker #--cref -Map=$@.map
--no-dynamic-linker --cref -Map=$@.map
ifeq ($(ARCH), aarch64)
DEFAULT_LDFLAGS += \

View file

@ -1,381 +0,0 @@
#ifndef ACTUALLY_MODS
#define ACTUALLY_MODS
#if !(__ASSEMBLER__ + __LINKER__ + 0)
static const int __tmpcosmo_AF_ALG = -15823936;
static const int __tmpcosmo_AF_APPLETALK = -15823820;
static const int __tmpcosmo_AF_ASH = -15823924;
static const int __tmpcosmo_AF_ATMPVC = -15824070;
static const int __tmpcosmo_AF_ATMSVC = -15824056;
static const int __tmpcosmo_AF_AX25 = -15824014;
static const int __tmpcosmo_AF_BLUETOOTH = -15823992;
static const int __tmpcosmo_AF_BRIDGE = -15823812;
static const int __tmpcosmo_AF_CAIF = -15823850;
static const int __tmpcosmo_AF_CAN = -15823868;
static const int __tmpcosmo_AF_ECONET = -15823852;
static const int __tmpcosmo_AF_FILE = -15824118;
static const int __tmpcosmo_AF_IB = -15823966;
static const int __tmpcosmo_AF_IEEE802154 = -15823906;
static const int __tmpcosmo_AF_IPX = -15824002;
static const int __tmpcosmo_AF_IRDA = -15823860;
static const int __tmpcosmo_AF_ISDN = -15823978;
static const int __tmpcosmo_AF_IUCV = -15824106;
static const int __tmpcosmo_AF_KCM = -15824024;
static const int __tmpcosmo_AF_KEY = -15823948;
static const int __tmpcosmo_AF_LINK = -15823878;
static const int __tmpcosmo_AF_LLC = -15823824;
static const int __tmpcosmo_AF_LOCAL = -15823928;
static const int __tmpcosmo_AF_MAX = -15824082;
static const int __tmpcosmo_AF_MPLS = -15824026;
static const int __tmpcosmo_AF_NETBEUI = -15824124;
static const int __tmpcosmo_AF_NETLINK = -15824004;
static const int __tmpcosmo_AF_NETROM = -15823886;
static const int __tmpcosmo_AF_NFC = -15824142;
static const int __tmpcosmo_AF_PACKET = -15824028;
static const int __tmpcosmo_AF_PHONET = -15823830;
static const int __tmpcosmo_AF_PPPOX = -15823876;
static const int __tmpcosmo_AF_ROSE = -15824016;
static const int __tmpcosmo_AF_ROUTE = -15824100;
static const int __tmpcosmo_AF_RXRPC = -15823926;
static const int __tmpcosmo_AF_SECURITY = -15824136;
static const int __tmpcosmo_AF_SNA = -15823950;
static const int __tmpcosmo_AF_TIPC = -15824034;
static const int __tmpcosmo_AF_VSOCK = -15824146;
static const int __tmpcosmo_AF_WANPIPE = -15823960;
static const int __tmpcosmo_AF_X25 = -15823864;
static const int __tmpcosmo_E2BIG = -15823698;
static const int __tmpcosmo_EACCES = -15823580;
static const int __tmpcosmo_EADDRINUSE = -15823756;
static const int __tmpcosmo_EADDRNOTAVAIL = -15823592;
static const int __tmpcosmo_EADV = -15823574;
static const int __tmpcosmo_EAFNOSUPPORT = -15823748;
static const int __tmpcosmo_EAGAIN = -15823506;
static const int __tmpcosmo_EALREADY = -15823530;
static const int __tmpcosmo_EAUTH = -15823702;
static const int __tmpcosmo_EBADARCH = -15823738;
static const int __tmpcosmo_EBADE = -15823740;
static const int __tmpcosmo_EBADEXEC = -15823684;
static const int __tmpcosmo_EBADF = -15823744;
static const int __tmpcosmo_EBADFD = -15823554;
static const int __tmpcosmo_EBADMACHO = -15823618;
static const int __tmpcosmo_EBADMSG = -15823650;
static const int __tmpcosmo_EBADR = -15823570;
static const int __tmpcosmo_EBADRPC = -15823626;
static const int __tmpcosmo_EBADRQC = -15823688;
static const int __tmpcosmo_EBADSLT = -15823788;
static const int __tmpcosmo_EBUSY = -15823550;
static const int __tmpcosmo_ECANCELED = -15823676;
static const int __tmpcosmo_ECHILD = -15823662;
static const int __tmpcosmo_ECHRNG = -15823722;
static const int __tmpcosmo_ECOMM = -15823634;
static const int __tmpcosmo_ECONNABORTED = -15823616;
static const int __tmpcosmo_ECONNREFUSED = -15823556;
static const int __tmpcosmo_ECONNRESET = -15823548;
static const int __tmpcosmo_EDEADLK = -15823718;
static const int __tmpcosmo_EDESTADDRREQ = -15823658;
static const int __tmpcosmo_EDEVERR = -15823518;
static const int __tmpcosmo_EDOM = -15823798;
static const int __tmpcosmo_EDOTDOT = -15823726;
static const int __tmpcosmo_EDQUOT = -15823620;
static const int __tmpcosmo_EEXIST = -15823594;
static const int __tmpcosmo_EFAULT = -15823686;
static const int __tmpcosmo_EFBIG = -15823768;
static const int __tmpcosmo_EFTYPE = -15823568;
static const int __tmpcosmo_EHOSTDOWN = -15823596;
static const int __tmpcosmo_EHOSTUNREACH = -15823742;
static const int __tmpcosmo_EHWPOISON = -15823680;
static const int __tmpcosmo_EIDRM = -15823644;
static const int __tmpcosmo_EILSEQ = -15823540;
static const int __tmpcosmo_EINPROGRESS = -15823720;
static const int __tmpcosmo_EINTR = -15823710;
static const int __tmpcosmo_EINVAL = -15823624;
static const int __tmpcosmo_EIO = -15823544;
static const int __tmpcosmo_EISCONN = -15823704;
static const int __tmpcosmo_EISDIR = -15823758;
static const int __tmpcosmo_EISNAM = -15823682;
static const int __tmpcosmo_EKEYEXPIRED = -15823520;
static const int __tmpcosmo_EKEYREJECTED = -15823712;
static const int __tmpcosmo_EKEYREVOKED = -15823780;
static const int __tmpcosmo_EL2HLT = -15823510;
static const int __tmpcosmo_EL2NSYNC = -15823670;
static const int __tmpcosmo_EL3HLT = -15823792;
static const int __tmpcosmo_EL3RST = -15823654;
static const int __tmpcosmo_ELIBACC = -15823708;
static const int __tmpcosmo_ELIBBAD = -15823564;
static const int __tmpcosmo_ELIBEXEC = -15823696;
static const int __tmpcosmo_ELIBMAX = -15823724;
static const int __tmpcosmo_ELIBSCN = -15823786;
static const int __tmpcosmo_ELNRNG = -15823732;
static const int __tmpcosmo_ELOOP = -15823672;
static const int __tmpcosmo_EMEDIUMTYPE = -15823508;
static const int __tmpcosmo_EMFILE = -15823762;
static const int __tmpcosmo_EMLINK = -15823694;
static const int __tmpcosmo_EMSGSIZE = -15823536;
static const int __tmpcosmo_EMULTIHOP = -15823750;
static const int __tmpcosmo_ENAMETOOLONG = -15823600;
static const int __tmpcosmo_ENAVAIL = -15823656;
static const int __tmpcosmo_ENEEDAUTH = -15823766;
static const int __tmpcosmo_ENETDOWN = -15823730;
static const int __tmpcosmo_ENETRESET = -15823604;
static const int __tmpcosmo_ENETUNREACH = -15823524;
static const int __tmpcosmo_ENFILE = -15823700;
static const int __tmpcosmo_ENOANO = -15823734;
static const int __tmpcosmo_ENOATTR = -15823606;
static const int __tmpcosmo_ENOBUFS = -15823628;
static const int __tmpcosmo_ENOCSI = -15823760;
static const int __tmpcosmo_ENODATA = -15823516;
static const int __tmpcosmo_ENODEV = -15823774;
static const int __tmpcosmo_ENOENT = -15823590;
static const int __tmpcosmo_ENOEXEC = -15823512;
static const int __tmpcosmo_ENOKEY = -15823764;
static const int __tmpcosmo_ENOLCK = -15823782;
static const int __tmpcosmo_ENOLINK = -15823538;
static const int __tmpcosmo_ENOMEDIUM = -15823598;
static const int __tmpcosmo_ENOMEM = -15823514;
static const int __tmpcosmo_ENOMSG = -15823796;
static const int __tmpcosmo_ENONET = -15823642;
static const int __tmpcosmo_ENOPKG = -15823664;
static const int __tmpcosmo_ENOPOLICY = -15823716;
static const int __tmpcosmo_ENOPROTOOPT = -15823608;
static const int __tmpcosmo_ENOSPC = -15823646;
static const int __tmpcosmo_ENOSR = -15823558;
static const int __tmpcosmo_ENOSTR = -15823706;
static const int __tmpcosmo_ENOSYS = -15823636;
static const int __tmpcosmo_ENOTBLK = -15823640;
static const int __tmpcosmo_ENOTCONN = -15823778;
static const int __tmpcosmo_ENOTDIR = -15823648;
static const int __tmpcosmo_ENOTEMPTY = -15823552;
static const int __tmpcosmo_ENOTNAM = -15823532;
static const int __tmpcosmo_ENOTRECOVERABLE = -15823746;
static const int __tmpcosmo_ENOTSOCK = -15823582;
static const int __tmpcosmo_ENOTSUP = -15823602;
static const int __tmpcosmo_ENOTTY = -15823528;
static const int __tmpcosmo_ENOTUNIQ = -15823790;
static const int __tmpcosmo_ENXIO = -15823622;
static const int __tmpcosmo_EOPNOTSUPP = -15823588;
static const int __tmpcosmo_EOVERFLOW = -15823736;
static const int __tmpcosmo_EOWNERDEAD = -15823562;
static const int __tmpcosmo_EPERM = -15823754;
static const int __tmpcosmo_EPFNOSUPPORT = -15823690;
static const int __tmpcosmo_EPIPE = -15823534;
static const int __tmpcosmo_EPROCLIM = -15823610;
static const int __tmpcosmo_EPROCUNAVAIL = -15823546;
static const int __tmpcosmo_EPROGMISMATCH = -15823572;
static const int __tmpcosmo_EPROGUNAVAIL = -15823526;
static const int __tmpcosmo_EPROTO = -15823678;
static const int __tmpcosmo_EPROTONOSUPPORT = -15823576;
static const int __tmpcosmo_EPROTOTYPE = -15823614;
static const int __tmpcosmo_EPWROFF = -15823692;
static const int __tmpcosmo_ERANGE = -15823772;
static const int __tmpcosmo_EREMCHG = -15823666;
static const int __tmpcosmo_EREMOTE = -15823560;
static const int __tmpcosmo_EREMOTEIO = -15823794;
static const int __tmpcosmo_ERESTART = -15823728;
static const int __tmpcosmo_ERFKILL = -15823612;
static const int __tmpcosmo_EROFS = -15823566;
static const int __tmpcosmo_ERPCMISMATCH = -15823542;
static const int __tmpcosmo_ESHLIBVERS = -15823584;
static const int __tmpcosmo_ESHUTDOWN = -15823660;
static const int __tmpcosmo_ESOCKTNOSUPPORT = -15823776;
static const int __tmpcosmo_ESPIPE = -15823652;
static const int __tmpcosmo_ESRCH = -15823674;
static const int __tmpcosmo_ESRMNT = -15823714;
static const int __tmpcosmo_ESTALE = -15823632;
static const int __tmpcosmo_ESTRPIPE = -15823770;
static const int __tmpcosmo_ETIME = -15823630;
static const int __tmpcosmo_ETIMEDOUT = -15823522;
static const int __tmpcosmo_ETOOMANYREFS = -15823586;
static const int __tmpcosmo_ETXTBSY = -15823638;
static const int __tmpcosmo_EUCLEAN = -15823578;
static const int __tmpcosmo_EUNATCH = -15823504;
static const int __tmpcosmo_EUSERS = -15823668;
static const int __tmpcosmo_EXDEV = -15823752;
static const int __tmpcosmo_EXFULL = -15823784;
static const int __tmpcosmo_F_DUPFD_CLOEXEC = -15823938;
static const int __tmpcosmo_F_GETLEASE = -15823862;
static const int __tmpcosmo_F_GETLK = -15823916;
static const int __tmpcosmo_F_GETLK64 = -15823846;
static const int __tmpcosmo_F_GETOWN = -15824116;
static const int __tmpcosmo_F_GETPATH = -15824128;
static const int __tmpcosmo_F_GETPIPE_SZ = -15824006;
static const int __tmpcosmo_F_GETSIG = -15824112;
static const int __tmpcosmo_F_MAXFD = -15823896;
static const int __tmpcosmo_F_NOCACHE = -15824048;
static const int __tmpcosmo_F_NOTIFY = -15823898;
static const int __tmpcosmo_F_RDLCK = -15823826;
static const int __tmpcosmo_F_SETLEASE = -15823884;
static const int __tmpcosmo_F_SETLK = -15824088;
static const int __tmpcosmo_F_SETLK64 = -15824154;
static const int __tmpcosmo_F_SETLKW = -15824096;
static const int __tmpcosmo_F_SETLKW64 = -15824104;
static const int __tmpcosmo_F_SETOWN = -15823874;
static const int __tmpcosmo_F_SETPIPE_SZ = -15823958;
static const int __tmpcosmo_F_SETSIG = -15823832;
static const int __tmpcosmo_F_UNLCK = -15824148;
static const int __tmpcosmo_F_WRLCK = -15824058;
static const int __tmpcosmo_IFF_ALLMULTI = -15824140;
static const int __tmpcosmo_IFF_AUTOMEDIA = -15823962;
static const int __tmpcosmo_IFF_DYNAMIC = -15823848;
static const int __tmpcosmo_IFF_MASTER = -15823900;
static const int __tmpcosmo_IFF_MULTICAST = -15824000;
static const int __tmpcosmo_IFF_NOARP = -15823802;
static const int __tmpcosmo_IFF_NOTRAILERS = -15824130;
static const int __tmpcosmo_IFF_POINTOPOINT = -15824138;
static const int __tmpcosmo_IFF_PORTSEL = -15824150;
static const int __tmpcosmo_IFF_PROMISC = -15824010;
static const int __tmpcosmo_IFF_RUNNING = -15824080;
static const int __tmpcosmo_IFF_SLAVE = -15824022;
static const int __tmpcosmo_LOCAL_PEERCRED = -15823986;
static const int __tmpcosmo_SIGBUS = -15824132;
static const int __tmpcosmo_SIGCHLD = -15824036;
static const int __tmpcosmo_SIGCONT = -15823836;
static const int __tmpcosmo_SIGEMT = -15823972;
static const int __tmpcosmo_SIGINFO = -15824086;
static const int __tmpcosmo_SIGIO = -15823912;
static const int __tmpcosmo_SIGPOLL = -15823854;
static const int __tmpcosmo_SIGPWR = -15824114;
static const int __tmpcosmo_SIGRTMAX = -15824040;
static const int __tmpcosmo_SIGRTMIN = -15824134;
static const int __tmpcosmo_SIGSTKFLT = -15823934;
static const int __tmpcosmo_SIGSTOP = -15824158;
static const int __tmpcosmo_SIGSYS = -15823922;
static const int __tmpcosmo_SIGTHR = -15823902;
static const int __tmpcosmo_SIGTSTP = -15823988;
static const int __tmpcosmo_SIGUNUSED = -15823970;
static const int __tmpcosmo_SIGURG = -15823952;
static const int __tmpcosmo_SIGUSR1 = -15824018;
static const int __tmpcosmo_SIGUSR2 = -15823998;
static const int __tmpcosmo_SIG_BLOCK = -15823800;
static const int __tmpcosmo_SIG_SETMASK = -15824090;
static const int __tmpcosmo_SIG_UNBLOCK = -15824078;
static const int __tmpcosmo_SOL_AAL = -15823976;
static const int __tmpcosmo_SOL_ALG = -15823956;
static const int __tmpcosmo_SOL_ATM = -15823914;
static const int __tmpcosmo_SOL_BLUETOOTH = -15824062;
static const int __tmpcosmo_SOL_CAIF = -15823904;
static const int __tmpcosmo_SOL_DCCP = -15823814;
static const int __tmpcosmo_SOL_DECNET = -15823842;
static const int __tmpcosmo_SOL_ICMPV6 = -15823908;
static const int __tmpcosmo_SOL_IPV6 = -15823808;
static const int __tmpcosmo_SOL_IRDA = -15823880;
static const int __tmpcosmo_SOL_IUCV = -15824156;
static const int __tmpcosmo_SOL_KCM = -15824092;
static const int __tmpcosmo_SOL_LLC = -15823930;
static const int __tmpcosmo_SOL_NETBEUI = -15823894;
static const int __tmpcosmo_SOL_NETLINK = -15824012;
static const int __tmpcosmo_SOL_NFC = -15823942;
static const int __tmpcosmo_SOL_PACKET = -15823806;
static const int __tmpcosmo_SOL_PNPIPE = -15823968;
static const int __tmpcosmo_SOL_PPPOL2TP = -15823816;
static const int __tmpcosmo_SOL_RAW = -15824044;
static const int __tmpcosmo_SOL_RDS = -15824020;
static const int __tmpcosmo_SOL_RXRPC = -15823984;
static const int __tmpcosmo_SOL_SOCKET = -15824050;
static const int __tmpcosmo_SOL_TIPC = -15823940;
static const int __tmpcosmo_SOL_X25 = -15823856;
static const int __tmpcosmo_SO_ACCEPTCONN = -15823872;
static const int __tmpcosmo_SO_ATTACH_BPF = -15824072;
static const int __tmpcosmo_SO_ATTACH_FILTER = -15824094;
static const int __tmpcosmo_SO_ATTACH_REUSEPORT_CBPF = -15823964;
static const int __tmpcosmo_SO_ATTACH_REUSEPORT_EBPF = -15824060;
static const int __tmpcosmo_SO_BINDTODEVICE = -15823990;
static const int __tmpcosmo_SO_BPF_EXTENSIONS = -15824030;
static const int __tmpcosmo_SO_BROADCAST = -15823882;
static const int __tmpcosmo_SO_BSDCOMPAT = -15824038;
static const int __tmpcosmo_SO_BUSY_POLL = -15823944;
static const int __tmpcosmo_SO_CNX_ADVICE = -15823828;
static const int __tmpcosmo_SO_DETACH_BPF = -15824068;
static const int __tmpcosmo_SO_DETACH_FILTER = -15824032;
static const int __tmpcosmo_SO_DOMAIN = -15823980;
static const int __tmpcosmo_SO_DONTROUTE = -15823918;
static const int __tmpcosmo_SO_ERROR = -15823892;
static const int __tmpcosmo_SO_EXCLUSIVEADDRUSE = -15823858;
static const int __tmpcosmo_SO_GET_FILTER = -15823834;
static const int __tmpcosmo_SO_INCOMING_CPU = -15824074;
static const int __tmpcosmo_SO_KEEPALIVE = -15823890;
static const int __tmpcosmo_SO_LINGER = -15824084;
static const int __tmpcosmo_SO_LOCK_FILTER = -15823804;
static const int __tmpcosmo_SO_MARK = -15824008;
static const int __tmpcosmo_SO_MAX_PACING_RATE = -15824120;
static const int __tmpcosmo_SO_NOFCS = -15823818;
static const int __tmpcosmo_SO_NO_CHECK = -15824152;
static const int __tmpcosmo_SO_OOBINLINE = -15823838;
static const int __tmpcosmo_SO_PASSCRED = -15823888;
static const int __tmpcosmo_SO_PASSSEC = -15823866;
static const int __tmpcosmo_SO_PEEK_OFF = -15823870;
static const int __tmpcosmo_SO_PEERCRED = -15823954;
static const int __tmpcosmo_SO_PEERNAME = -15824042;
static const int __tmpcosmo_SO_PEERSEC = -15823844;
static const int __tmpcosmo_SO_PRIORITY = -15824122;
static const int __tmpcosmo_SO_PROTOCOL = -15823982;
static const int __tmpcosmo_SO_RCVBUF = -15823974;
static const int __tmpcosmo_SO_RCVBUFFORCE = -15823994;
static const int __tmpcosmo_SO_RCVLOWAT = -15824076;
static const int __tmpcosmo_SO_RCVTIMEO = -15824046;
static const int __tmpcosmo_SO_REUSEADDR = -15823810;
static const int __tmpcosmo_SO_REUSEPORT = -15823822;
static const int __tmpcosmo_SO_RXQ_OVFL = -15824066;
static const int __tmpcosmo_SO_SECURITY_AUTHENTICATION = -15824098;
static const int __tmpcosmo_SO_SECURITY_ENCRYPTION_NETWORK = -15824126;
static const int __tmpcosmo_SO_SELECT_ERR_QUEUE = -15824052;
static const int __tmpcosmo_SO_SETFIB = -15823920;
static const int __tmpcosmo_SO_SNDBUF = -15824102;
static const int __tmpcosmo_SO_SNDBUFFORCE = -15823840;
static const int __tmpcosmo_SO_SNDLOWAT = -15823946;
static const int __tmpcosmo_SO_SNDTIMEO = -15824064;
static const int __tmpcosmo_SO_TIMESTAMP = -15823932;
static const int __tmpcosmo_SO_TIMESTAMPING = -15824054;
static const int __tmpcosmo_SO_TIMESTAMPNS = -15823910;
static const int __tmpcosmo_SO_TYPE = -15824144;
static const int __tmpcosmo_SO_USELOOPBACK = -15824110;
static const int __tmpcosmo_SO_WIFI_STATUS = -15824108;
static const unsigned int __tmpcosmo_B1000000 = 15823512;
static const unsigned int __tmpcosmo_B110 = 15823518;
static const unsigned int __tmpcosmo_B115200 = 15823540;
static const unsigned int __tmpcosmo_B1152000 = 15823538;
static const unsigned int __tmpcosmo_B1200 = 15823548;
static const unsigned int __tmpcosmo_B134 = 15823510;
static const unsigned int __tmpcosmo_B150 = 15823542;
static const unsigned int __tmpcosmo_B1500000 = 15823508;
static const unsigned int __tmpcosmo_B1800 = 15823522;
static const unsigned int __tmpcosmo_B19200 = 15823546;
static const unsigned int __tmpcosmo_B200 = 15823528;
static const unsigned int __tmpcosmo_B2000000 = 15823524;
static const unsigned int __tmpcosmo_B230400 = 15823516;
static const unsigned int __tmpcosmo_B2400 = 15823526;
static const unsigned int __tmpcosmo_B2500000 = 15823558;
static const unsigned int __tmpcosmo_B300 = 15823534;
static const unsigned int __tmpcosmo_B3000000 = 15823530;
static const unsigned int __tmpcosmo_B3500000 = 15823544;
static const unsigned int __tmpcosmo_B38400 = 15823514;
static const unsigned int __tmpcosmo_B4000000 = 15823520;
static const unsigned int __tmpcosmo_B4800 = 15823556;
static const unsigned int __tmpcosmo_B50 = 15823532;
static const unsigned int __tmpcosmo_B500000 = 15823550;
static const unsigned int __tmpcosmo_B57600 = 15823552;
static const unsigned int __tmpcosmo_B576000 = 15823506;
static const unsigned int __tmpcosmo_B600 = 15823554;
static const unsigned int __tmpcosmo_B75 = 15823536;
static const unsigned int __tmpcosmo_B9600 = 15823504;
static const unsigned short __tmpcosmo_AF_INET6 = 58236;
static const unsigned __tmpcosmo_RLIMIT_AS = 1377206941;
static const unsigned __tmpcosmo_RLIMIT_CORE = -671407877;
static const unsigned __tmpcosmo_RLIMIT_CPU = 628127131;
static const unsigned __tmpcosmo_RLIMIT_DATA = -808550207;
static const unsigned __tmpcosmo_RLIMIT_FSIZE = -961275389;
static const unsigned __tmpcosmo_RLIMIT_LOCKS = -606515345;
static const unsigned __tmpcosmo_RLIMIT_MEMLOCK = -638383635;
static const unsigned __tmpcosmo_RLIMIT_MSGQUEUE = -200712823;
static const unsigned __tmpcosmo_RLIMIT_NICE = -1263433607;
static const unsigned __tmpcosmo_RLIMIT_NOFILE = -974136242;
static const unsigned __tmpcosmo_RLIMIT_NPROC = 1234964928;
static const unsigned __tmpcosmo_RLIMIT_NPTS = 1890977319;
static const unsigned __tmpcosmo_RLIMIT_RSS = 1507822220;
static const unsigned __tmpcosmo_RLIMIT_RTPRIO = 343598136;
static const unsigned __tmpcosmo_RLIMIT_RTTIME = 1950976769;
static const unsigned __tmpcosmo_RLIMIT_SBSIZE = 914114957;
static const unsigned __tmpcosmo_RLIMIT_SIGPENDING = 1652182385;
static const unsigned __tmpcosmo_RLIMIT_STACK = 1324847124;
static const unsigned __tmpcosmo_RLIMIT_SWAP = 1231678046;
static const unsigned __tmpcosmo_RLIMIT_VMEM = 119083983;
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
#endif /* ACTUALLY_MODS */

View file

@ -210,7 +210,7 @@ const char *zerr(int rc) {
case Z_VERSION_ERROR:
return "zlib version mismatch!";
default:
unreachable;
__builtin_unreachable();
}
}

View file

@ -82,7 +82,7 @@ const char *zerr(int rc) {
case Z_VERSION_ERROR:
return "zlib version mismatch!";
default:
unreachable;
__builtin_unreachable();
}
}

View file

@ -113,7 +113,7 @@ const char *describemouseevent(int e) {
strcat(buf, " right");
break;
default:
unreachable;
__builtin_unreachable();
}
if (e & 0x20) {
strcat(buf, " drag");

View file

@ -570,9 +570,9 @@
#define CD_PHYSICAL 1
#define CD_PRINT 2
#define EMPTY -2
#define CLOSED -1
#define PIPESIZE 4096
#define EMPTY -2
#define CLOSED -1
#define PIPESIZE 4096
#define rootshell (!shlvl)
@ -626,9 +626,12 @@
#define is_digit(c) ((unsigned)((c) - '0') <= 9)
#define is_in_name(c) ((c) == '_' || isalnum((unsigned char)(c)))
#define is_name(c) ((c) == '_' || isalpha((unsigned char)(c)))
#define is_special(c) ((is_type + SYNBASE)[(signed char)(c)] & (ISSPECL | ISDIGIT))
#define is_special(c) \
((is_type + SYNBASE)[(signed char)(c)] & (ISSPECL | ISDIGIT))
#define uninitialized_var(x) x = x /* suppress uninitialized warning w/o code */
#define uninitialized_var(x) \
x = x /* suppress uninitialized warning w/o code \
*/
/*
* Shell variables.
@ -1101,10 +1104,11 @@ static struct tblentry *cmdtable[CMDTABLESIZE];
static struct Var *vartab[VTABSIZE];
static union node *redirnode;
static union yystype yylval;
static unsigned closed_redirs; /* Bit map of currently closed file descriptors. */
static unsigned
closed_redirs; /* Bit map of currently closed file descriptors. */
static unsigned expdir_max;
static unsigned njobs; /* size of array */
static volatile sig_atomic_t gotsigchld; /* received SIGCHLD */
static unsigned njobs; /* size of array */
static volatile sig_atomic_t gotsigchld; /* received SIGCHLD */
static volatile sig_atomic_t intpending;
static volatile sig_atomic_t pending_sig; /* last pending signal */
static struct alias *atab[ATABSIZE];
@ -1137,19 +1141,22 @@ static struct output *out2 = &errout;
/* Array indicating which tokens mark the end of a list */
static const char tokendlist[] = {
1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 0, 0, 0, 1,
1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0,
1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 0, 0, 0, 1,
};
static const char *const tokname[] = {
"end of file", "newline", "\";\"", "\"&\"", "\"&&\"", "\"||\"",
"\"|\"", "\"(\"", "\")\"", "\";;\"", "\"`\"", "redirection",
"word", "\"!\"", "\"case\"", "\"do\"", "\"done\"", "\"elif\"",
"\"else\"", "\"esac\"", "\"fi\"", "\"for\"", "\"if\"", "\"in\"",
"\"then\"", "\"until\"", "\"while\"", "\"{\"", "\"}\"",
"end of file", "newline", "\";\"", "\"&\"", "\"&&\"",
"\"||\"", "\"|\"", "\"(\"", "\")\"", "\";;\"",
"\"`\"", "redirection", "word", "\"!\"", "\"case\"",
"\"do\"", "\"done\"", "\"elif\"", "\"else\"", "\"esac\"",
"\"fi\"", "\"for\"", "\"if\"", "\"in\"", "\"then\"",
"\"until\"", "\"while\"", "\"{\"", "\"}\"",
};
static const char *const parsekwd[] = {"!", "case", "do", "done", "elif", "else", "esac", "fi",
"for", "if", "in", "then", "until", "while", "{", "}"};
static const char *const parsekwd[] = {
"!", "case", "do", "done", "elif", "else", "esac", "fi",
"for", "if", "in", "then", "until", "while", "{", "}"};
static const char defpathvar[] =
"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin";
@ -1161,7 +1168,8 @@ static const char *const optnames[NOPTS] = {
};
static const char optletters[NOPTS] = {
'e', 'f', 'I', 'i', 'm', 'n', 's', 'x', 'v', 'V', 'E', 'C', 'a', 'b', 'u', 0, 0,
'e', 'f', 'I', 'i', 'm', 'n', 's', 'x', 'v',
'V', 'E', 'C', 'a', 'b', 'u', 0, 0,
};
static const char spcstr[] = " ";
@ -1169,7 +1177,8 @@ static const char snlfmt[] = "%s\n";
static const char qchars[] = {CTLESC, CTLQUOTEMARK, 0};
static const char illnum[] = "Illegal number: %s";
static const char homestr[] = "HOME";
static const char dolatstr[] = {CTLQUOTEMARK, CTLVAR, VSNORMAL, '@', '=', CTLQUOTEMARK, '\0'};
static const char dolatstr[] = {CTLQUOTEMARK, CTLVAR, VSNORMAL, '@',
'=', CTLQUOTEMARK, '\0'};
/* TODO(jart): What's wrong with varinit? */
#if defined(__GNUC__) || defined(__llvm__)
@ -1584,7 +1593,8 @@ static int pstrcmp(const void *a, const void *b) {
/*
* Find a string is in a sorted array.
*/
static const char *const *findstring(const char *s, const char *const *array, unsigned nmemb) {
static const char *const *findstring(const char *s, const char *const *array,
unsigned nmemb) {
return bsearch(&s, array, nmemb, sizeof(const char *), pstrcmp);
}
@ -1667,8 +1677,9 @@ static pointer ckrealloc(pointer p, unsigned nbytes) {
if (l > m) (p) = makestrspace(l, q); \
0; \
})
#define USTPUTC(c, p) (*p++ = (c))
#define STACKSTRNUL(p) ((p) == sstrend ? (p = growstackstr(), *p = '\0') : (*p = '\0'))
#define USTPUTC(c, p) (*p++ = (c))
#define STACKSTRNUL(p) \
((p) == sstrend ? (p = growstackstr(), *p = '\0') : (*p = '\0'))
#define STUNPUTC(p) (--p)
#define STTOPC(p) p[-1]
#define STADJUST(amount, p) (p += (amount))
@ -1768,7 +1779,8 @@ static void flushall(void) {
via malloc, rather than doing a fork and reading the
output of the command via a pipe. */
static int xvsnprintf(char *outbuf, unsigned length, const char *fmt, va_list ap) {
static int xvsnprintf(char *outbuf, unsigned length, const char *fmt,
va_list ap) {
int ret;
INTOFF;
ret = vsnprintf(outbuf, length, fmt, ap);
@ -1833,7 +1845,8 @@ static void outcslow(int c, struct output *dest) {
outmem(&buf, 1, dest);
}
printfesque(3) static int fmtstr(char *outbuf, unsigned length, const char *fmt, ...) {
printfesque(3) static int fmtstr(char *outbuf, unsigned length, const char *fmt,
...) {
va_list ap;
int ret;
va_start(ap, fmt);
@ -1954,14 +1967,16 @@ wontreturn static void yyerror(const char *s) {
wontreturn static void synexpect(int token) {
char msg[64];
if (token >= 0) {
fmtstr(msg, 64, "%s unexpected (expecting %s)", tokname[lasttoken], tokname[token]);
fmtstr(msg, 64, "%s unexpected (expecting %s)", tokname[lasttoken],
tokname[token]);
} else {
fmtstr(msg, 64, "%s unexpected", tokname[lasttoken]);
}
synerror(msg);
}
wontreturn static void varunset(const char *end, const char *var_, const char *umsg, int varflags) {
wontreturn static void varunset(const char *end, const char *var_,
const char *umsg, int varflags) {
const char *msg;
const char *tail;
tail = nullstr;
@ -2105,7 +2120,8 @@ static char *stputs(const char *s, char *p) {
return stnputs(s, strlen(s), p);
}
static char *nodesavestr(s) char *s;
static char *nodesavestr(s)
char *s;
{
char *rtn = funcstring;
funcstring = stpcpy(funcstring, s) + 1;
@ -2194,7 +2210,8 @@ static struct alias *freealias(struct alias *);
static struct alias *lookupalias(const char *, int);
static struct funcnode *copyfunc(union node *);
static struct job *makejob(union node *, int);
static struct job *vforkexec(union node *n, char **argv, const char *path, int idx);
static struct job *vforkexec(union node *n, char **argv, const char *path,
int idx);
static struct localvar_list *pushlocalvars(int push);
static struct nodelist *copynodelist(struct nodelist *);
static struct redirtab *pushredir(union node *redir);
@ -2777,12 +2794,14 @@ static int64_t binop2(int64_t a, int op, int prec, int noeval) {
val = yylval;
b = primary(token, &val, shlex(), noeval);
op2 = last_token;
if (op2 >= ARITH_BINOP_MIN && op2 < ARITH_BINOP_MAX && higher_prec(op2, op)) {
if (op2 >= ARITH_BINOP_MIN && op2 < ARITH_BINOP_MAX &&
higher_prec(op2, op)) {
b = binop2(b, op2, arith_prec(op), noeval);
op2 = last_token;
}
a = noeval ? b : do_binop(op, a, b);
if (op2 < ARITH_BINOP_MIN || op2 >= ARITH_BINOP_MAX || arith_prec(op2) >= prec) {
if (op2 < ARITH_BINOP_MIN || op2 >= ARITH_BINOP_MAX ||
arith_prec(op2) >= prec) {
return a;
}
op = op2;
@ -2842,7 +2861,10 @@ static int64_t assignment(int var_, int noeval) {
result = assignment(shlex(), noeval);
if (noeval) return result;
return setvarint(
val.name, (op == ARITH_ASS ? result : do_binop(op - 11, lookupvarint(val.name), result)), 0);
val.name,
(op == ARITH_ASS ? result
: do_binop(op - 11, lookupvarint(val.name), result)),
0);
}
static int64_t arith(const char *s) {
@ -2926,7 +2948,7 @@ step6:
goto docd;
err:
sh_error("can't cd to %s", dest);
unreachable;
__builtin_unreachable();
out:
if (flags & CD_PRINT) out1fmt(snlfmt, curdir);
return 0;
@ -3154,7 +3176,8 @@ static int evaltree(union node *n, int flags) {
case NOR:
case NSEMI:
isor = n->type - NAND;
status = evaltree(n->nbinary.ch1, (flags | ((isor >> 1) - 1)) & EV_TESTED);
status =
evaltree(n->nbinary.ch1, (flags | ((isor >> 1) - 1)) & EV_TESTED);
if ((!status) == isor || evalskip) break;
n = n->nbinary.ch2;
evaln:
@ -3489,17 +3512,18 @@ static void evalbackcmd(union node *n, struct backcmd *result) {
}
ifsfree();
evaltreenr(n, EV_EXIT);
unreachable;
__builtin_unreachable();
}
close(pip[1]);
result->fd = pip[0];
result->jp = jp;
out:
TRACE(("evalbackcmd done: fd=%d buf=0x%x nleft=%d jp=0x%x\n", result->fd, result->buf,
result->nleft, result->jp));
TRACE(("evalbackcmd done: fd=%d buf=0x%x nleft=%d jp=0x%x\n", result->fd,
result->buf, result->nleft, result->jp));
}
static struct strlist *fill_arglist(struct arglist *arglist, union node **argpp) {
static struct strlist *fill_arglist(struct arglist *arglist,
union node **argpp) {
struct strlist **lastp = arglist->lastp;
union node *argp;
while ((argp = *argpp)) {
@ -3510,7 +3534,8 @@ static struct strlist *fill_arglist(struct arglist *arglist, union node **argpp)
return *lastp;
}
static int parse_command_args(struct arglist *arglist, union node **argpp, const char **path) {
static int parse_command_args(struct arglist *arglist, union node **argpp,
const char **path) {
struct strlist *sp = arglist->list;
char *cp, c;
for (;;) {
@ -3587,7 +3612,8 @@ static int evalcommand(union node *cmd, int flags) {
if ((osp = fill_arglist(&arglist, &argp))) {
int pseudovarflag = 0;
for (;;) {
find_command(arglist.list->text, &cmdentry, cmd_flag | DO_REGBLTIN, pathval());
find_command(arglist.list->text, &cmdentry, cmd_flag | DO_REGBLTIN,
pathval());
vlocal++;
/* implement bltin and command here */
if (cmdentry.cmdtype != CMDBUILTIN) break;
@ -3602,9 +3628,10 @@ static int evalcommand(union node *cmd, int flags) {
if (!cmd_flag) break;
}
for (; argp; argp = argp->narg.next) {
expandarg(
argp, &arglist,
(pseudovarflag && isassignment(argp->narg.text)) ? EXP_VARTILDE : EXP_FULL | EXP_TILDE);
expandarg(argp, &arglist,
(pseudovarflag && isassignment(argp->narg.text))
? EXP_VARTILDE
: EXP_FULL | EXP_TILDE);
}
for (sp = arglist.list; sp; sp = sp->next) argc++;
if (execcmd && argc > 1) vflags = VEXPORT;
@ -3654,7 +3681,8 @@ static int evalcommand(union node *cmd, int flags) {
outcslow('\n', out);
}
/* Now locate the command. */
if (cmdentry.cmdtype != CMDBUILTIN || !(cmdentry.u.cmd->flags & BUILTIN_REGULAR)) {
if (cmdentry.cmdtype != CMDBUILTIN ||
!(cmdentry.u.cmd->flags & BUILTIN_REGULAR)) {
path = unlikely(path != NULL) ? path : pathval(); /* wut */
find_command(argv[0], &cmdentry, cmd_flag | DO_ERR, path);
}
@ -3672,7 +3700,7 @@ static int evalcommand(union node *cmd, int flags) {
break;
}
shellexec(argv, path, cmdentry.u.index);
unreachable;
__builtin_unreachable();
case CMDBUILTIN:
if (evalbltin(cmdentry.u.cmd, argc, argv, flags) &&
!(exception == EXERROR && spclbltin <= 0)) {
@ -3701,7 +3729,8 @@ out:
return status;
}
static int evalbltin(const struct builtincmd *cmd, int argc, char **argv, int flags) {
static int evalbltin(const struct builtincmd *cmd, int argc, char **argv,
int flags) {
char *volatile savecmdname;
struct jmploc *volatile savehandler;
struct jmploc jmploc;
@ -3909,9 +3938,12 @@ wontreturn static void shellexec(char **argv, const char *path, int idx) {
}
}
/* Map to POSIX errors */
exerrno = (e == ELOOP || e == ENAMETOOLONG || e == ENOENT || e == ENOTDIR) ? 127 : 126;
exerrno = (e == ELOOP || e == ENAMETOOLONG || e == ENOENT || e == ENOTDIR)
? 127
: 126;
exitstatus = exerrno;
TRACE(("shellexec failed for %s, errno %d, suppressint %d\n", argv[0], e, suppressint));
TRACE(("shellexec failed for %s, errno %d, suppressint %d\n", argv[0], e,
suppressint));
exerror(EXEND, "%s: %s", argv[0], errmsg(e, E_EXEC));
}
@ -4019,8 +4051,8 @@ static int hashcmd(int argc, char **argv) {
while ((name = *argptr) != NULL) {
if ((cmdp = cmdlookup(name, 0)) &&
(cmdp->cmdtype == CMDNORMAL ||
(cmdp->cmdtype == CMDBUILTIN && !(cmdp->param.cmd->flags & BUILTIN_REGULAR) &&
builtinloc > 0))) {
(cmdp->cmdtype == CMDBUILTIN &&
!(cmdp->param.cmd->flags & BUILTIN_REGULAR) && builtinloc > 0))) {
delete_cmd_entry();
}
find_command(name, &entry, DO_ERR, pathval());
@ -4059,7 +4091,8 @@ static void readcmdfile(char *name) {
* Search the table of builtin commands.
*/
static struct builtincmd *find_builtin(const char *name) {
return bsearch(&name, kBuiltinCmds, sizeof(kBuiltinCmds) / sizeof(kBuiltinCmds[0]),
return bsearch(&name, kBuiltinCmds,
sizeof(kBuiltinCmds) / sizeof(kBuiltinCmds[0]),
sizeof(kBuiltinCmds[0]), pstrcmp);
}
@ -4067,7 +4100,8 @@ static struct builtincmd *find_builtin(const char *name) {
* Resolve a command name. If you change this routine, you may have to
* change the shellexec routine as well.
*/
static void find_command(char *name, struct cmdentry *entry, int act, const char *path) {
static void find_command(char *name, struct cmdentry *entry, int act,
const char *path) {
char *fullname;
struct stat statb;
struct tblentry *cmdp;
@ -4112,7 +4146,8 @@ static void find_command(char *name, struct cmdentry *entry, int act, const char
}
/* If %builtin not in path, check for builtin next */
bcmd = find_builtin(name);
if (bcmd && ((bcmd->flags & BUILTIN_REGULAR) | (act & DO_ALTPATH) | (builtinloc <= 0))) {
if (bcmd && ((bcmd->flags & BUILTIN_REGULAR) | (act & DO_ALTPATH) |
(builtinloc <= 0))) {
goto builtin_success;
}
if (act & DO_REGBLTIN) goto fail;
@ -4209,8 +4244,8 @@ static void hashcd(void) {
for (pp = cmdtable; pp < &cmdtable[CMDTABLESIZE]; pp++) {
for (cmdp = *pp; cmdp; cmdp = cmdp->next) {
if (cmdp->cmdtype == CMDNORMAL ||
(cmdp->cmdtype == CMDBUILTIN && !(cmdp->param.cmd->flags & BUILTIN_REGULAR) &&
builtinloc > 0)) {
(cmdp->cmdtype == CMDBUILTIN &&
!(cmdp->param.cmd->flags & BUILTIN_REGULAR) && builtinloc > 0)) {
cmdp->rehash = 1;
}
}
@ -4257,8 +4292,8 @@ static void clearcmdentry(void) {
pp = tblp;
while ((cmdp = *pp) != NULL) {
if (cmdp->cmdtype == CMDNORMAL ||
(cmdp->cmdtype == CMDBUILTIN && !(cmdp->param.cmd->flags & BUILTIN_REGULAR) &&
builtinloc > 0)) {
(cmdp->cmdtype == CMDBUILTIN &&
!(cmdp->param.cmd->flags & BUILTIN_REGULAR) && builtinloc > 0)) {
*pp = cmdp->next;
ckfree(cmdp);
} else {
@ -4358,7 +4393,8 @@ static int typecmd(int argc, char **argv) {
return err;
}
static int describe_command(struct output *out, char *command, const char *path, int verbose) {
static int describe_command(struct output *out, char *command, const char *path,
int verbose) {
struct cmdentry entry;
struct tblentry *cmdp;
const struct alias *ap;
@ -4442,7 +4478,8 @@ out:
return 0;
}
static int commandcmd(argc, argv) int argc;
static int commandcmd(argc, argv)
int argc;
char **argv;
{
char *cmd;
@ -4540,8 +4577,9 @@ out:
*/
static char *argstr(char *p, int flag) {
static const int DOLATSTRLEN = 6;
static const char spclchars[] = {'=', ':', CTLQUOTEMARK, CTLENDVAR, CTLESC,
CTLVAR, CTLBACKQ, CTLARI, CTLENDARI, 0};
static const char spclchars[] = {'=', ':', CTLQUOTEMARK, CTLENDVAR,
CTLESC, CTLVAR, CTLBACKQ, CTLARI,
CTLENDARI, 0};
const char *reject = spclchars;
int c;
int breakall = (flag & (EXP_WORD | EXP_QUOTED)) == EXP_WORD;
@ -4782,13 +4820,16 @@ static void expbackq(union node *cmd, int flag) {
if (!(flag & EXP_QUOTED)) {
recordregion(startloc, dest - (char *)stackblock(), 0);
}
TRACE(("evalbackq: size=%d: \"%.*s\"\n", (dest - (char *)stackblock()) - startloc,
(dest - (char *)stackblock()) - startloc, (char *)stackblock() + startloc));
TRACE(("evalbackq: size=%d: \"%.*s\"\n",
(dest - (char *)stackblock()) - startloc,
(dest - (char *)stackblock()) - startloc,
(char *)stackblock() + startloc));
out:
argbackq = argbackq->next;
}
static char *scanleft(char *startp, char *rmesc, char *rmescend, char *str, int quotes, int zero) {
static char *scanleft(char *startp, char *rmesc, char *rmescend, char *str,
int quotes, int zero) {
char *loc;
char *loc2;
char c;
@ -4812,7 +4853,8 @@ static char *scanleft(char *startp, char *rmesc, char *rmescend, char *str, int
return 0;
}
static char *scanright(char *startp, char *rmesc, char *rmescend, char *str, int quotes, int zero) {
static char *scanright(char *startp, char *rmesc, char *rmescend, char *str,
int quotes, int zero) {
int esc = 0;
char *loc;
char *loc2;
@ -4841,7 +4883,8 @@ static char *scanright(char *startp, char *rmesc, char *rmescend, char *str, int
return 0;
}
static char *subevalvar(char *start, char *str, int strloc, int startloc, int varflags, int flag) {
static char *subevalvar(char *start, char *str, int strloc, int startloc,
int varflags, int flag) {
int subtype = varflags & VSTYPE;
int quotes = flag & QUOTES_ESC;
char *startp;
@ -4861,7 +4904,7 @@ static char *subevalvar(char *start, char *str, int strloc, int startloc, int va
goto out;
case VSQUESTION:
varunset(start, str, startp, varflags);
unreachable;
__builtin_unreachable();
}
subtype -= VSTRIMRIGHT;
rmesc = startp;
@ -4930,7 +4973,8 @@ again:
goto record;
case VSASSIGN:
case VSQUESTION:
p = subevalvar(p, var_, 0, startloc, varflags, (flag & ~QUOTES_ESC) | (discard ^ EXP_DISCARD));
p = subevalvar(p, var_, 0, startloc, varflags,
(flag & ~QUOTES_ESC) | (discard ^ EXP_DISCARD));
if ((flag | ~discard) & EXP_DISCARD) goto record;
varflags &= ~VSNUL;
subtype = VSNORMAL;
@ -5007,7 +5051,8 @@ static long varvalue(char *name, int varflags, int flags, int quoted) {
char sepc;
char **ap;
int subtype = varflags & VSTYPE;
int discard = (subtype == VSPLUS || subtype == VSLENGTH) | (flags & EXP_DISCARD);
int discard =
(subtype == VSPLUS || subtype == VSLENGTH) | (flags & EXP_DISCARD);
long len = 0;
char c;
if (!subtype) {
@ -5445,12 +5490,18 @@ static int ccmatch(const char *p, int chr, const char **r) {
static const struct class {
char name[10];
int (*fn)(int);
} classes[] = {{.name = ":alnum:]", .fn = isalnum}, {.name = ":cntrl:]", .fn = iscntrl},
{.name = ":lower:]", .fn = islower}, {.name = ":space:]", .fn = isspace},
{.name = ":alpha:]", .fn = isalpha}, {.name = ":digit:]", .fn = isdigit},
{.name = ":print:]", .fn = isprint}, {.name = ":upper:]", .fn = isupper},
{.name = ":blank:]", .fn = isblank}, {.name = ":graph:]", .fn = isgraph},
{.name = ":punct:]", .fn = ispunct}, {.name = ":xdigit:]", .fn = isxdigit}};
} classes[] = {{.name = ":alnum:]", .fn = isalnum},
{.name = ":cntrl:]", .fn = iscntrl},
{.name = ":lower:]", .fn = islower},
{.name = ":space:]", .fn = isspace},
{.name = ":alpha:]", .fn = isalpha},
{.name = ":digit:]", .fn = isdigit},
{.name = ":print:]", .fn = isprint},
{.name = ":upper:]", .fn = isupper},
{.name = ":blank:]", .fn = isblank},
{.name = ":graph:]", .fn = isgraph},
{.name = ":punct:]", .fn = ispunct},
{.name = ":xdigit:]", .fn = isxdigit}};
const struct class *class, *end;
end = classes + sizeof(classes) / sizeof(classes[0]);
for (class = classes; class < end; class ++) {
@ -5667,7 +5718,8 @@ static void AddUniqueCompletion(linenoiseCompletions *c, char *s) {
c->cvec[c->len - 1] = s;
}
static void CompleteCommand(const char *p, const char *q, const char *b, linenoiseCompletions *c) {
static void CompleteCommand(const char *p, const char *q, const char *b,
linenoiseCompletions *c) {
DIR *d;
size_t i;
struct dirent *e;
@ -5700,7 +5752,8 @@ static void CompleteCommand(const char *p, const char *q, const char *b, linenoi
}
}
static void CompleteFilename(const char *p, const char *q, const char *b, linenoiseCompletions *c) {
static void CompleteFilename(const char *p, const char *q, const char *b,
linenoiseCompletions *c) {
DIR *d;
char *buf;
const char *g;
@ -5717,7 +5770,8 @@ static void CompleteFilename(const char *p, const char *q, const char *b, lineno
if (!strcmp(e->d_name, ".")) continue;
if (!strcmp(e->d_name, "..")) continue;
if (!strncmp(e->d_name, p, q - p)) {
snprintf(buf, 512, "%.*s%s%s", p - b, b, e->d_name, e->d_type == DT_DIR ? "/" : "");
snprintf(buf, 512, "%.*s%s%s", p - b, b, e->d_name,
e->d_type == DT_DIR ? "/" : "");
AddUniqueCompletion(c, strdup(buf));
}
}
@ -5733,8 +5787,9 @@ static void ShellCompletion(const char *p, linenoiseCompletions *c) {
struct tblentry **pp, *cmdp;
for (slashed = false, b = p, q = (p += strlen(p)); p > b; --p) {
if (p[-1] == '/' && p[-1] == '\\') slashed = true;
if (!isalnum(p[-1]) && (p[-1] != '.' && p[-1] != '_' && p[-1] != '-' && p[-1] != '+' &&
p[-1] != '[' && p[-1] != '/' && p[-1] != '\\')) {
if (!isalnum(p[-1]) &&
(p[-1] != '.' && p[-1] != '_' && p[-1] != '-' && p[-1] != '+' &&
p[-1] != '[' && p[-1] != '/' && p[-1] != '\\')) {
break;
}
}
@ -5810,7 +5865,8 @@ static int preadbuffer(void) {
popstring();
return pgetc_nofree();
}
if (unlikely(parsefile->nleft == EOF_NLEFT || parsefile->buf == NULL)) return PEOF;
if (unlikely(parsefile->nleft == EOF_NLEFT || parsefile->buf == NULL))
return PEOF;
flushall();
more = parsefile->lleft;
if (more <= 0) {
@ -6119,7 +6175,8 @@ static int decode_signum(const char *string) {
return signo;
}
static int killcmd(argc, argv) int argc;
static int killcmd(argc, argv)
int argc;
char **argv;
{
int signo = -1;
@ -6600,7 +6657,7 @@ static void forkparent(struct job *jp, union node *n, int mode, int pid) {
TRACE(("Fork failed, errno=%d", errno));
if (jp) freejob(jp);
sh_error("Cannot fork");
unreachable;
__builtin_unreachable();
}
TRACE(("In parent shell: child = %d\n", pid));
if (!jp) return;
@ -6638,7 +6695,8 @@ static int forkshell(struct job *jp, union node *n, int mode) {
return pid;
}
static struct job *vforkexec(union node *n, char **argv, const char *path, int idx) {
static struct job *vforkexec(union node *n, char **argv, const char *path,
int idx) {
struct job *jp;
int pid;
jp = makejob(n, 1);
@ -6649,7 +6707,7 @@ static struct job *vforkexec(union node *n, char **argv, const char *path, int i
forkchild(jp, n, FORK_FG);
sigclearmask();
shellexec(argv, path, idx);
unreachable;
__builtin_unreachable();
}
vforked = 0;
sigclearmask();
@ -6722,8 +6780,8 @@ static int waitone(int block, struct job *job) {
sp = jp->ps;
do {
if (sp->pid == pid) {
TRACE(("Job %d: changing status of proc %d from 0x%x to 0x%x\n", jobno(jp), pid, sp->status,
status));
TRACE(("Job %d: changing status of proc %d from 0x%x to 0x%x\n",
jobno(jp), pid, sp->status, status));
sp->status = status;
thisjob = jp;
}
@ -6741,7 +6799,8 @@ gotjob:
if (state != JOBRUNNING) {
thisjob->changed = 1;
if (thisjob->state != state) {
TRACE(("Job %d: changing state from %d to %d\n", jobno(thisjob), thisjob->state, state));
TRACE(("Job %d: changing state from %d to %d\n", jobno(thisjob),
thisjob->state, state));
thisjob->state = state;
if (state == JOBSTOPPED) {
set_curjob(thisjob, CUR_STOPPED);
@ -7105,8 +7164,8 @@ static int getstatus(struct job *job) {
}
retval += 128;
}
TRACE(("getstatus: job %d, nproc %d, status %x, retval %x\n", jobno(job), job->nprocs, status,
retval));
TRACE(("getstatus: job %d, nproc %d, status %x, retval %x\n", jobno(job),
job->nprocs, status, retval));
return retval;
}
@ -7346,7 +7405,8 @@ static int umaskcmd(int argc, char **argv) {
enum limtype { SOFT = 0x1, HARD = 0x2 };
static void printlim(enum limtype how, const struct rlimit *limit, const struct limits *l) {
static void printlim(enum limtype how, const struct rlimit *limit,
const struct limits *l) {
uint64_t val;
val = limit->rlim_max;
if (how & SOFT) val = limit->rlim_cur;
@ -7413,7 +7473,8 @@ static int ulimitcmd(int argc, char **argv) {
if (set) {
if (how & HARD) limit.rlim_max = val;
if (how & SOFT) limit.rlim_cur = val;
if (setrlimit(l->cmd, &limit) < 0) sh_error("error setting limit (%s)", strerror(errno));
if (setrlimit(l->cmd, &limit) < 0)
sh_error("error setting limit (%s)", strerror(errno));
} else {
printlim(how, &limit, l);
}
@ -7517,7 +7578,7 @@ static void setoption(int flag, int val) {
return;
}
sh_error("Illegal option -%c", flag);
unreachable;
__builtin_unreachable();
}
/*
@ -7967,7 +8028,7 @@ static union node *command(void) {
switch (readtoken()) {
default:
synexpect(-1);
unreachable;
__builtin_unreachable();
case TIF:
n1 = (union node *)stalloc(sizeof(struct nif));
n1->type = NIF;
@ -7998,7 +8059,8 @@ static union node *command(void) {
n1->type = (lasttoken == TWHILE) ? NWHILE : NUNTIL;
n1->nbinary.ch1 = list(0);
if ((got = readtoken()) != TDO) {
TRACE(("expecting DO got %s %s\n", tokname[got], got == TWORD ? wordtext : ""));
TRACE(("expecting DO got %s %s\n", tokname[got],
got == TWORD ? wordtext : ""));
synexpect(TDO);
}
n1->nbinary.ch2 = list(0);
@ -8174,7 +8236,8 @@ static union node *simplecmd(void) {
/* We have a function */
if (readtoken() != TRP) synexpect(TRP);
name = n->narg.text;
if (!goodname(name) || ((bcmd = find_builtin(name)) && bcmd->flags & BUILTIN_SPECIAL))
if (!goodname(name) ||
((bcmd = find_builtin(name)) && bcmd->flags & BUILTIN_SPECIAL))
synerror("Bad function name");
n->type = NDEFUN;
checkkwd = CHKNL | CHKKWD | CHKALIAS;
@ -8414,7 +8477,8 @@ static int pgetc_top(struct synstack *stack) {
return stack->syntax == SQSYNTAX ? pgetc() : pgetc_eatbnl();
}
static void synstack_push(struct synstack **stack, struct synstack *next, const char *syntax) {
static void synstack_push(struct synstack **stack, struct synstack *next,
const char *syntax) {
memset(next, 0, sizeof(*next));
next->syntax = syntax;
next->next = *stack;
@ -8471,7 +8535,8 @@ static void synstack_pop(struct synstack **stack) {
parsearith_return:; \
}
static int readtoken1(int firstc, char const *syntax, char *eofmark, int striptabs) {
static int readtoken1(int firstc, char const *syntax, char *eofmark,
int striptabs) {
int c = firstc;
char *out;
unsigned len;
@ -8501,7 +8566,8 @@ loop : { /* for each line, until end of word */
USTPUTC(c, out);
break;
case CCTL:
if ((!eofmark) | synstack->dblquote | synstack->varnest) USTPUTC(CTLESC, out);
if ((!eofmark) | synstack->dblquote | synstack->varnest)
USTPUTC(CTLESC, out);
USTPUTC(c, out);
break;
/* backslash */
@ -8602,7 +8668,8 @@ loop : { /* for each line, until end of word */
}
endword:
if (synstack->syntax == ARISYNTAX) synerror("Missing '))'");
if (synstack->syntax != BASESYNTAX && eofmark == NULL) synerror("Unterminated quoted string");
if (synstack->syntax != BASESYNTAX && eofmark == NULL)
synerror("Unterminated quoted string");
if (synstack->varnest != 0) {
/* { */
synerror("Missing '}'");
@ -8611,7 +8678,8 @@ endword:
len = out - (char *)stackblock();
out = stackblock();
if (eofmark == NULL) {
if ((c == '>' || c == '<') && quotef == 0 && len <= 2 && (*out == '\0' || is_digit(*out))) {
if ((c == '>' || c == '<') && quotef == 0 && len <= 2 &&
(*out == '\0' || is_digit(*out))) {
PARSEREDIR();
return lasttoken = TREDIR;
} else {
@ -8733,7 +8801,8 @@ parsesub : {
char *p;
static const char types[] = "}-+?=";
c = pgetc_eatbnl();
if ((checkkwd & CHKEOFMARK) || (c != '(' && c != '{' && !is_name(c) && !is_special(c))) {
if ((checkkwd & CHKEOFMARK) ||
(c != '(' && c != '{' && !is_name(c) && !is_special(c))) {
USTPUTC('$', out);
pungetc();
} else if (c == '(') { /* $(command) or $((arith)) */
@ -8815,8 +8884,10 @@ parsesub : {
pungetc();
}
if (newsyn == ARISYNTAX) newsyn = DQSYNTAX;
if ((newsyn != synstack->syntax || synstack->innerdq) && subtype != VSNORMAL) {
synstack_push(&synstack, synstack->prev ?: alloca(sizeof(*synstack)), newsyn);
if ((newsyn != synstack->syntax || synstack->innerdq) &&
subtype != VSNORMAL) {
synstack_push(&synstack, synstack->prev ?: alloca(sizeof(*synstack)),
newsyn);
synstack->varpushed++;
synstack->dblquote = newsyn != BASESYNTAX;
}
@ -8867,7 +8938,8 @@ parsebackq : {
goto done;
case '\\':
pc = pgetc();
if (pc != '\\' && pc != '`' && pc != '$' && (!synstack->dblquote || pc != '"'))
if (pc != '\\' && pc != '`' && pc != '$' &&
(!synstack->dblquote || pc != '"'))
STPUTC('\\', pout);
break;
case PEOF:
@ -8928,7 +9000,8 @@ parsebackq : {
* Parse an arithmetic expansion (indicate start of one and set state)
*/
parsearith : {
synstack_push(&synstack, synstack->prev ?: alloca(sizeof(*synstack)), ARISYNTAX);
synstack_push(&synstack, synstack->prev ?: alloca(sizeof(*synstack)),
ARISYNTAX);
synstack->dblquote = 1;
USTPUTC(CTLARI, out);
goto parsearith_return;
@ -9059,7 +9132,8 @@ static void redirect(union node *redir, int flags) {
dupredirect(n, newfd);
} while ((n = n->nfile.next));
INTON;
if (flags & REDIR_SAVEFD2 && sv->renamed[2] >= 0) preverrout.fd = sv->renamed[2];
if (flags & REDIR_SAVEFD2 && sv->renamed[2] >= 0)
preverrout.fd = sv->renamed[2];
}
wontreturn static int sh_open_fail(const char *pathname, int flags, int e) {
@ -9097,14 +9171,14 @@ static int openredirect(union node *redir) {
f = sh_open(redir->nfile.expfname, flags, 0);
break;
case NFROMTO:
flags = O_RDWR|O_CREAT;
flags = O_RDWR | O_CREAT;
goto do_open;
case NTO:
/* Take care of noclobber mode. */
if (Cflag) {
fname = redir->nfile.expfname;
if (stat(fname, &sb) < 0) {
flags = O_WRONLY|O_CREAT|O_EXCL;
flags = O_WRONLY | O_CREAT | O_EXCL;
goto do_open;
}
if (S_ISREG(sb.st_mode)) goto ecreate;
@ -9117,10 +9191,10 @@ static int openredirect(union node *redir) {
}
/* FALLTHROUGH */
case NCLOBBER:
flags = O_WRONLY|O_CREAT|O_TRUNC;
flags = O_WRONLY | O_CREAT | O_TRUNC;
goto do_open;
case NAPPEND:
flags = O_WRONLY|O_CREAT|O_APPEND;
flags = O_WRONLY | O_CREAT | O_APPEND;
goto do_open;
case NTOFD:
case NFROMFD:
@ -9931,7 +10005,8 @@ eval:
t_wp = argv;
res ^= oexpr(n);
argv = t_wp;
if (argv[0] != NULL && argv[1] != NULL) syntax(argv[0], "unexpected operator");
if (argv[0] != NULL && argv[1] != NULL)
syntax(argv[0], "unexpected operator");
return res;
}
@ -10091,7 +10166,8 @@ static enum token t_lex(char **tp) {
return EOI;
}
op = getop(s);
if (op && !(op->op_type == UNOP && isoperand(tp)) && !(op->op_num == LPAREN && !tp[1])) {
if (op && !(op->op_type == UNOP && isoperand(tp)) &&
!(op->op_num == LPAREN && !tp[1])) {
t_wp_op = op;
return op->op_num;
}
@ -10112,14 +10188,16 @@ static int newerf(const char *f1, const char *f2) {
struct stat b1, b2;
return (stat(f1, &b1) == 0 && stat(f2, &b2) == 0 &&
(b1.st_mtim.tv_sec > b2.st_mtim.tv_sec ||
(b1.st_mtim.tv_sec == b2.st_mtim.tv_sec && (b1.st_mtim.tv_nsec > b2.st_mtim.tv_nsec))));
(b1.st_mtim.tv_sec == b2.st_mtim.tv_sec &&
(b1.st_mtim.tv_nsec > b2.st_mtim.tv_nsec))));
}
static int olderf(const char *f1, const char *f2) {
struct stat b1, b2;
return (stat(f1, &b1) == 0 && stat(f2, &b2) == 0 &&
(b1.st_mtim.tv_sec < b2.st_mtim.tv_sec ||
(b1.st_mtim.tv_sec == b2.st_mtim.tv_sec && (b1.st_mtim.tv_nsec < b2.st_mtim.tv_nsec))));
(b1.st_mtim.tv_sec == b2.st_mtim.tv_sec &&
(b1.st_mtim.tv_nsec < b2.st_mtim.tv_nsec))));
}
static int equalf(const char *f1, const char *f2) {
@ -10272,8 +10350,8 @@ static struct Var *setvareq(char *s, int flags) {
if (flags & VNOSET) goto out;
if (vp->func && (flags & VNOFUNC) == 0) (*vp->func)(strchrnul(s, '=') + 1);
if ((vp->flags & (VTEXTFIXED | VSTACK)) == 0) ckfree(vp->text);
if (((flags & (VEXPORT | VREADONLY | VSTRFIXED | VUNSET)) | (vp->flags & VSTRFIXED)) ==
VUNSET) {
if (((flags & (VEXPORT | VREADONLY | VSTRFIXED | VUNSET)) |
(vp->flags & VSTRFIXED)) == VUNSET) {
*vpp = vp->next;
ckfree(vp);
out_free:
@ -10283,7 +10361,8 @@ static struct Var *setvareq(char *s, int flags) {
flags |= vp->flags & ~(VTEXTFIXED | VSTACK | VNOSAVE | VUNSET);
} else {
if (flags & VNOSET) goto out;
if ((flags & (VEXPORT | VREADONLY | VSTRFIXED | VUNSET)) == VUNSET) goto out_free;
if ((flags & (VEXPORT | VREADONLY | VSTRFIXED | VUNSET)) == VUNSET)
goto out_free;
/* not found */
vp = ckmalloc(sizeof(*vp));
vp->next = *vpp;
@ -10566,8 +10645,8 @@ static void init() {
setvareq(ppid, VTEXTFIXED);
p = lookupvar("PWD");
if (p) {
if (*p != '/' || stat(p, &st1) || stat(".", &st2) || st1.st_dev != st2.st_dev ||
st1.st_ino != st2.st_ino) {
if (*p != '/' || stat(p, &st1) || stat(".", &st2) ||
st1.st_dev != st2.st_dev || st1.st_ino != st2.st_ino) {
p = 0;
}
}
@ -10584,7 +10663,8 @@ static void exitreset() {
/* from eval.c: */
{
if (savestatus >= 0) {
if (exception == EXEXIT || evalskip == SKIPFUNCDEF) exitstatus = savestatus;
if (exception == EXEXIT || evalskip == SKIPFUNCDEF)
exitstatus = savestatus;
savestatus = -1;
}
evalskip = 0;
@ -10615,19 +10695,15 @@ static void forkreset() {
}
}
/* from main.c: */
{
handler = &main_handler;
}
{ handler = &main_handler; }
/* from redir.c: */
{
redirlist = NULL;
}
{ redirlist = NULL; }
/* from trap.c: */
{
char **tp;
INTOFF;
for (tp = trap ; tp < &trap[NSIG] ; tp++) {
if (*tp && **tp) { /* trap not NULL or SIG_IGN */
for (tp = trap; tp < &trap[NSIG]; tp++) {
if (*tp && **tp) { /* trap not NULL or SIG_IGN */
ckfree(*tp);
*tp = NULL;
if (tp != &trap[0]) setsignal(tp - trap);
@ -10651,9 +10727,7 @@ static void reset() {
popallfiles();
}
/* from var.c: */
{
unwindlocalvars(0);
}
{ unwindlocalvars(0); }
}
static void calcsize(union node *n) {
@ -10939,7 +11013,8 @@ static char *find_dot_file(char *basename) {
if (strchr(basename, '/')) return basename;
while ((len = padvance(&path, basename)) >= 0) {
fullname = stackblock();
if ((!pathopt || *pathopt == 'f') && !stat(fullname, &statb) && S_ISREG(statb.st_mode)) {
if ((!pathopt || *pathopt == 'f') && !stat(fullname, &statb) &&
S_ISREG(statb.st_mode)) {
/* This will be freed by the caller. */
return stalloc(len);
}

View file

@ -31,7 +31,7 @@ void __assert_fail(const char *, const char *, int) _Hide relegated;
#define _unassert(x) \
({ \
if (__builtin_expect(!(x), 0)) { \
unreachable; \
__builtin_unreachable(); \
} \
(void)0; \
})

View file

@ -53,7 +53,7 @@ static int ioctl_tcgets_sysv(int fd, struct termios *tio) {
} else if (IsFreebsd() || IsOpenbsd() || IsNetbsd()) {
COPY_TERMIOS(tio, &mt.bsd);
} else {
unreachable;
__builtin_unreachable();
}
}
return rc;

View file

@ -1260,8 +1260,8 @@ static privileged void OnSigSys(int sig, siginfo_t *si, void *vctx) {
}
}
if (!found) {
Log("error: bad syscall ", GetSyscallName(si->si_syscall),
" (ord=", ord, ")\n", NULL);
Log("error: bad syscall ", GetSyscallName(si->si_syscall), " (ord=", ord,
")\n", NULL);
}
switch (mode & PLEDGE_PENALTY_MASK) {
case PLEDGE_PENALTY_KILL_PROCESS:
@ -1366,24 +1366,6 @@ static privileged void AllowMonitor(struct Filter *f) {
AppendFilter(f, PLEDGE(fragment));
}
// SYSCALL is only allowed in the .privileged section
// We assume program image is loaded in 32-bit spaces
static privileged void AppendOriginVerification(struct Filter *f) {
long x = (long)__privileged_start;
long y = (long)__privileged_end;
struct sock_filter fragment[] = {
/*L0*/ BPF_STMT(BPF_LD | BPF_W | BPF_ABS, OFF(instruction_pointer) + 4),
/*L1*/ BPF_JUMP(BPF_JMP | BPF_JEQ | BPF_K, 0, 0, 5 - 2),
/*L2*/ BPF_STMT(BPF_LD | BPF_W | BPF_ABS, OFF(instruction_pointer)),
/*L3*/ BPF_JUMP(BPF_JMP | BPF_JGE | BPF_K, x, 0, 5 - 4),
/*L4*/ BPF_JUMP(BPF_JMP | BPF_JGE | BPF_K, y, 0, 6 - 5),
/*L5*/ BPF_STMT(BPF_RET | BPF_K, SECCOMP_RET_KILL),
/*L6*/ BPF_STMT(BPF_LD | BPF_W | BPF_ABS, OFF(nr)),
/*L7*/ /* next filter */
};
AppendFilter(f, PLEDGE(fragment));
}
// The first argument of sys_clone_linux() must NOT have:
//
// - CLONE_NEWNS (0x00020000)
@ -1615,7 +1597,6 @@ static privileged void AllowGetsockoptRestrict(struct Filter *f) {
// - MAP_HUGETLB (0x40000)
//
static privileged void AllowMmapExec(struct Filter *f) {
long y = (long)__privileged_end;
static const struct sock_filter fragment[] = {
/*L0*/ BPF_JUMP(BPF_JMP | BPF_JEQ | BPF_K, __NR_linux_mmap, 0, 6 - 1),
/*L1*/ BPF_STMT(BPF_LD | BPF_W | BPF_ABS, OFF(args[3])), // flags

View file

@ -106,7 +106,7 @@ textwindows int sys_poll_nt(struct pollfd *fds, uint64_t nfds, uint64_t *ms,
pipefds[pn].events = fds[i].events & (POLLIN | POLLOUT);
break;
default:
unreachable;
__builtin_unreachable();
}
++pn;
} else {

View file

@ -255,7 +255,7 @@ ssize_t readansi(int fd, char *p, size_t n) {
}
break;
default:
unreachable;
__builtin_unreachable();
}
} while (t != kDone);
errno = e;

View file

@ -106,5 +106,5 @@ noasan noubsan int setcontext(const ucontext_t *uc) {
"ret"
: /* no outputs */
: "m"(uc->uc_mcontext.rip), "m"(uc->uc_mcontext.rdi));
unreachable;
__builtin_unreachable();
}

View file

@ -65,7 +65,7 @@ struct addrinfo {
};
int getaddrinfo(const char *, const char *, const struct addrinfo *,
struct addrinfo **) paramsnonnull((4));
struct addrinfo **);
void freeaddrinfo(struct addrinfo *);
int getnameinfo(const struct sockaddr *, socklen_t, char *, socklen_t, char *,
socklen_t, int);

View file

@ -51,21 +51,28 @@ int getaddrinfo(const char *name, const char *service,
struct addrinfo *ai;
char proto[32];
port = 0;
if (!name && !service) return EAI_NONAME;
if (!name && (hints->ai_flags & AI_CANONNAME)) return EAI_BADFLAGS;
if (!name && !service) {
return EAI_NONAME;
}
if (!name && hints && (hints->ai_flags & AI_CANONNAME)) {
return EAI_BADFLAGS;
}
if (service && (port = parseport(service)) == -1) {
if (hints->ai_socktype == SOCK_STREAM)
if (hints && hints->ai_socktype == SOCK_STREAM) {
strcpy(proto, "tcp");
else if (hints->ai_socktype == SOCK_DGRAM)
} else if (hints && hints->ai_socktype == SOCK_DGRAM) {
strcpy(proto, "udp");
else /* ai_socktype == 0 */
} else { // ai_socktype == 0
strcpy(proto, "");
}
if ((port = LookupServicesByName(service, proto, sizeof(proto), NULL, 0,
NULL)) == -1) {
return EAI_NONAME;
}
}
if (!(ai = newaddrinfo(port))) return EAI_MEMORY;
if (!(ai = newaddrinfo(port))) {
return EAI_MEMORY;
}
if (service) ai->ai_addr4->sin_port = htons(port);
if (hints) {
ai->ai_socktype = hints->ai_socktype;
@ -74,8 +81,8 @@ int getaddrinfo(const char *name, const char *service,
if (!name) {
ai->ai_addr4->sin_addr.s_addr =
(hints && (hints->ai_flags & AI_PASSIVE) == AI_PASSIVE)
? INADDR_ANY
: INADDR_LOOPBACK;
? htonl(INADDR_ANY)
: htonl(INADDR_LOOPBACK);
*res = ai;
return 0;
}

View file

@ -35,7 +35,6 @@
#include "libc/fmt/itoa.h"
#include "libc/intrin/safemacros.internal.h"
#include "libc/mem/mem.h"
#include "libc/sock/sock.h"
#include "libc/str/str.h"
#include "libc/sysv/consts/af.h"
#include "libc/sysv/consts/inaddr.h"

View file

@ -16,6 +16,14 @@ COSMOPOLITAN_C_START_
asm("call\t__errno_location" : "=a"(_ep) : /* no inputs */ : "cc"); \
_ep; \
}))
#elif defined(__GNUC__) && defined(__aarch64__) && \
!defined(__STRICT_ANSI__) && !defined(__cplusplus)
#define errno \
(*({ \
errno_t *_ep; \
asm("sub\t%0,x28,#1092" : "=r"(_ep)); \
_ep; \
}))
#else
#define errno (*__errno_location())
#endif
@ -696,6 +704,155 @@ extern const errno_t EXFULL;
#define EXDEV EXDEV
#define EXFULL EXFULL
#define __tmpcosmo_E2BIG -15823698
#define __tmpcosmo_EACCES -15823580
#define __tmpcosmo_EADDRINUSE -15823756
#define __tmpcosmo_EADDRNOTAVAIL -15823592
#define __tmpcosmo_EADV -15823574
#define __tmpcosmo_EAFNOSUPPORT -15823748
#define __tmpcosmo_EAGAIN -15823506
#define __tmpcosmo_EALREADY -15823530
#define __tmpcosmo_EAUTH -15823702
#define __tmpcosmo_EBADARCH -15823738
#define __tmpcosmo_EBADE -15823740
#define __tmpcosmo_EBADEXEC -15823684
#define __tmpcosmo_EBADF -15823744
#define __tmpcosmo_EBADFD -15823554
#define __tmpcosmo_EBADMACHO -15823618
#define __tmpcosmo_EBADMSG -15823650
#define __tmpcosmo_EBADR -15823570
#define __tmpcosmo_EBADRPC -15823626
#define __tmpcosmo_EBADRQC -15823688
#define __tmpcosmo_EBADSLT -15823788
#define __tmpcosmo_EBUSY -15823550
#define __tmpcosmo_ECANCELED -15823676
#define __tmpcosmo_ECHILD -15823662
#define __tmpcosmo_ECHRNG -15823722
#define __tmpcosmo_ECOMM -15823634
#define __tmpcosmo_ECONNABORTED -15823616
#define __tmpcosmo_ECONNREFUSED -15823556
#define __tmpcosmo_ECONNRESET -15823548
#define __tmpcosmo_EDEADLK -15823718
#define __tmpcosmo_EDESTADDRREQ -15823658
#define __tmpcosmo_EDEVERR -15823518
#define __tmpcosmo_EDOM -15823798
#define __tmpcosmo_EDOTDOT -15823726
#define __tmpcosmo_EDQUOT -15823620
#define __tmpcosmo_EEXIST -15823594
#define __tmpcosmo_EFAULT -15823686
#define __tmpcosmo_EFBIG -15823768
#define __tmpcosmo_EFTYPE -15823568
#define __tmpcosmo_EHOSTDOWN -15823596
#define __tmpcosmo_EHOSTUNREACH -15823742
#define __tmpcosmo_EHWPOISON -15823680
#define __tmpcosmo_EIDRM -15823644
#define __tmpcosmo_EILSEQ -15823540
#define __tmpcosmo_EINPROGRESS -15823720
#define __tmpcosmo_EINTR -15823710
#define __tmpcosmo_EINVAL -15823624
#define __tmpcosmo_EIO -15823544
#define __tmpcosmo_EISCONN -15823704
#define __tmpcosmo_EISDIR -15823758
#define __tmpcosmo_EISNAM -15823682
#define __tmpcosmo_EKEYEXPIRED -15823520
#define __tmpcosmo_EKEYREJECTED -15823712
#define __tmpcosmo_EKEYREVOKED -15823780
#define __tmpcosmo_EL2HLT -15823510
#define __tmpcosmo_EL2NSYNC -15823670
#define __tmpcosmo_EL3HLT -15823792
#define __tmpcosmo_EL3RST -15823654
#define __tmpcosmo_ELIBACC -15823708
#define __tmpcosmo_ELIBBAD -15823564
#define __tmpcosmo_ELIBEXEC -15823696
#define __tmpcosmo_ELIBMAX -15823724
#define __tmpcosmo_ELIBSCN -15823786
#define __tmpcosmo_ELNRNG -15823732
#define __tmpcosmo_ELOOP -15823672
#define __tmpcosmo_EMEDIUMTYPE -15823508
#define __tmpcosmo_EMFILE -15823762
#define __tmpcosmo_EMLINK -15823694
#define __tmpcosmo_EMSGSIZE -15823536
#define __tmpcosmo_EMULTIHOP -15823750
#define __tmpcosmo_ENAMETOOLONG -15823600
#define __tmpcosmo_ENAVAIL -15823656
#define __tmpcosmo_ENEEDAUTH -15823766
#define __tmpcosmo_ENETDOWN -15823730
#define __tmpcosmo_ENETRESET -15823604
#define __tmpcosmo_ENETUNREACH -15823524
#define __tmpcosmo_ENFILE -15823700
#define __tmpcosmo_ENOANO -15823734
#define __tmpcosmo_ENOATTR -15823606
#define __tmpcosmo_ENOBUFS -15823628
#define __tmpcosmo_ENOCSI -15823760
#define __tmpcosmo_ENODATA -15823516
#define __tmpcosmo_ENODEV -15823774
#define __tmpcosmo_ENOENT -15823590
#define __tmpcosmo_ENOEXEC -15823512
#define __tmpcosmo_ENOKEY -15823764
#define __tmpcosmo_ENOLCK -15823782
#define __tmpcosmo_ENOLINK -15823538
#define __tmpcosmo_ENOMEDIUM -15823598
#define __tmpcosmo_ENOMEM -15823514
#define __tmpcosmo_ENOMSG -15823796
#define __tmpcosmo_ENONET -15823642
#define __tmpcosmo_ENOPKG -15823664
#define __tmpcosmo_ENOPOLICY -15823716
#define __tmpcosmo_ENOPROTOOPT -15823608
#define __tmpcosmo_ENOSPC -15823646
#define __tmpcosmo_ENOSR -15823558
#define __tmpcosmo_ENOSTR -15823706
#define __tmpcosmo_ENOSYS -15823636
#define __tmpcosmo_ENOTBLK -15823640
#define __tmpcosmo_ENOTCONN -15823778
#define __tmpcosmo_ENOTDIR -15823648
#define __tmpcosmo_ENOTEMPTY -15823552
#define __tmpcosmo_ENOTNAM -15823532
#define __tmpcosmo_ENOTRECOVERABLE -15823746
#define __tmpcosmo_ENOTSOCK -15823582
#define __tmpcosmo_ENOTSUP -15823602
#define __tmpcosmo_ENOTTY -15823528
#define __tmpcosmo_ENOTUNIQ -15823790
#define __tmpcosmo_ENXIO -15823622
#define __tmpcosmo_EOPNOTSUPP -15823588
#define __tmpcosmo_EOVERFLOW -15823736
#define __tmpcosmo_EOWNERDEAD -15823562
#define __tmpcosmo_EPERM -15823754
#define __tmpcosmo_EPFNOSUPPORT -15823690
#define __tmpcosmo_EPIPE -15823534
#define __tmpcosmo_EPROCLIM -15823610
#define __tmpcosmo_EPROCUNAVAIL -15823546
#define __tmpcosmo_EPROGMISMATCH -15823572
#define __tmpcosmo_EPROGUNAVAIL -15823526
#define __tmpcosmo_EPROTO -15823678
#define __tmpcosmo_EPROTONOSUPPORT -15823576
#define __tmpcosmo_EPROTOTYPE -15823614
#define __tmpcosmo_EPWROFF -15823692
#define __tmpcosmo_ERANGE -15823772
#define __tmpcosmo_EREMCHG -15823666
#define __tmpcosmo_EREMOTE -15823560
#define __tmpcosmo_EREMOTEIO -15823794
#define __tmpcosmo_ERESTART -15823728
#define __tmpcosmo_ERFKILL -15823612
#define __tmpcosmo_EROFS -15823566
#define __tmpcosmo_ERPCMISMATCH -15823542
#define __tmpcosmo_ESHLIBVERS -15823584
#define __tmpcosmo_ESHUTDOWN -15823660
#define __tmpcosmo_ESOCKTNOSUPPORT -15823776
#define __tmpcosmo_ESPIPE -15823652
#define __tmpcosmo_ESRCH -15823674
#define __tmpcosmo_ESRMNT -15823714
#define __tmpcosmo_ESTALE -15823632
#define __tmpcosmo_ESTRPIPE -15823770
#define __tmpcosmo_ETIME -15823630
#define __tmpcosmo_ETIMEDOUT -15823522
#define __tmpcosmo_ETOOMANYREFS -15823586
#define __tmpcosmo_ETXTBSY -15823638
#define __tmpcosmo_EUCLEAN -15823578
#define __tmpcosmo_EUNATCH -15823504
#define __tmpcosmo_EUSERS -15823668
#define __tmpcosmo_EXDEV -15823752
#define __tmpcosmo_EXFULL -15823784
extern errno_t __errno;
errno_t *__errno_location(void);

View file

@ -413,7 +413,7 @@ _Hide int __fmt(void *fn, void *arg, const char *format, va_list va) {
va_arg(va, long double);
break;
default:
unreachable;
__builtin_unreachable();
}
#endif /* __aarch64__ */
break;

View file

@ -607,21 +607,17 @@ typedef struct {
#define noubsan
#endif
#ifndef unreachable
#define unreachable __builtin_unreachable()
#endif
#ifdef __STRICT_ANSI__
void abort(void) wontreturn;
#define notpossible abort()
#else
#ifdef __x86_64__
#define notpossible \
do { \
asm("nop\n\t" \
"ud2\n\t" \
"nop"); \
unreachable; \
#define notpossible \
do { \
asm("nop\n\t" \
"ud2\n\t" \
"nop"); \
__builtin_unreachable(); \
} while (0)
#else
#define notpossible __builtin_trap()

View file

@ -88,7 +88,7 @@ wontreturn void _Exit(int exitcode) {
"lidt\t(%rsp)");
for (;;) asm("ud2");
#else
unreachable;
__builtin_unreachable();
#endif
}

View file

@ -67,11 +67,11 @@ privileged wontreturn void _Exit1(int rc) {
: /* no outputs */
: "a"(__NR_exit_group), "D"(rc)
: "rcx", "r11", "memory");
unreachable;
__builtin_unreachable();
}
} else if (IsWindows()) {
__imp_ExitThread(rc);
unreachable;
__builtin_unreachable();
}
notpossible;
#elif defined(__aarch64__)

View file

@ -35,7 +35,7 @@ STATIC_YOINK("_init_g_fds");
#endif
struct Fds g_fds;
static struct Fd g_fds_static[8];
static struct Fd g_fds_static[OPEN_MAX];
static textwindows dontinline void SetupWinStd(struct Fds *fds, int i, int x) {
int64_t h;
@ -46,7 +46,7 @@ static textwindows dontinline void SetupWinStd(struct Fds *fds, int i, int x) {
atomic_store_explicit(&fds->f, i + 1, memory_order_relaxed);
}
textstartup void InitializeFileDescriptors(void) {
textstartup void __init_fds(void) {
struct Fds *fds;
__fds_lock_obj._type = PTHREAD_MUTEX_RECURSIVE;
fds = VEIL("r", &g_fds);
@ -59,7 +59,7 @@ textstartup void InitializeFileDescriptors(void) {
kMemtrackFdsStart + kMemtrackFdsSize);
} else {
fds->p = g_fds_static;
fds->e = g_fds_static + ARRAYLEN(g_fds_static);
fds->e = g_fds_static + OPEN_MAX;
}
if (IsMetal()) {
extern const char vga_console[];

View file

@ -21,7 +21,7 @@
.init.start 305,_init_g_fds
push %rdi
push %rsi
call InitializeFileDescriptors
call __init_fds
pop %rsi
pop %rdi
.init.end 305,_init_g_fds

View file

@ -267,6 +267,7 @@ privileged static size_t kformat(char *b, size_t n, const char *fmt,
p = b;
f = fmt;
e = p + n; // assume if n was negative e < p will be the case
tib = __tls_enabled ? __get_tls_privileged() : 0;
for (;;) {
for (;;) {
if (!(c = *f++) || c == '%') break;
@ -377,7 +378,6 @@ privileged static size_t kformat(char *b, size_t n, const char *fmt,
goto FormatUnsigned;
case 'P':
tib = __tls_enabled ? __get_tls_privileged() : 0;
if (!(tib && (tib->tib_flags & TIB_FLAG_VFORKED))) {
if (tib) {
x = atomic_load_explicit(&tib->tib_tid, memory_order_relaxed);
@ -524,7 +524,7 @@ privileged static size_t kformat(char *b, size_t n, const char *fmt,
case 'm': {
int unixerr;
uint32_t winerr;
unixerr = errno;
unixerr = tib ? tib->tib_errno : __errno;
winerr = 0;
if (IsWindows()) {
if (type == 1 && _weaken(__imp_WSAGetLastError)) {

View file

@ -19,7 +19,7 @@
#include "libc/macros.internal.h"
// Decentralized section for leaky functions.
.section .piro.relo.sort.leaky.1,"aw",@nobits
.section .piro.relo.sort.leaky.1,"aw",@progbits
.type _leaky_start,@object
.type _leaky_end,@object
.globl _leaky_start,_leaky_end
@ -32,7 +32,7 @@ _leaky_start:
...
decentralized content
...
*/.section .piro.relo.sort.leaky.3,"aw",@nobits
*/.section .piro.relo.sort.leaky.3,"aw",@progbits
_leaky_end:
.quad 0
.overrun

View file

@ -24,6 +24,7 @@
#include "libc/nt/runtime.h"
#include "libc/sock/internal.h"
#include "libc/sysv/errfuns.h"
#include "libc/thread/tls2.h"
/**
* Return path for failed Win32 API calls.
@ -38,6 +39,10 @@ privileged int64_t __winerr(void) {
} else {
e = ENOSYS;
}
errno = e;
if (__tls_enabled) {
__get_tls_privileged()->tib_errno = e;
} else {
__errno = e;
}
return -1;
}

View file

@ -9,4 +9,5 @@
#include "libc/sysv/consts/o.h"
#include "libc/sysv/consts/posix.h"
#include "libc/sysv/consts/s.h"
#include "libc/sysv/consts/splice.h"
#endif

View file

@ -8,7 +8,7 @@ forceinline wontreturn long LinuxExit(long rc) {
: /* no outputs */
: "a"(0xE7), "D"(rc)
: "memory");
unreachable;
__builtin_unreachable();
}
COSMOPOLITAN_C_END_

View file

@ -29,7 +29,7 @@ COSMOPOLITAN_C_START_
if (((uintptr_t)VAR & ((BYTES)-1u))) { \
__check_fail_aligned(BYTES, (uintptr_t)VAR, __FILE__, __LINE__, \
"" __VA_ARGS__); \
unreachable; \
__builtin_unreachable(); \
} \
VAR = (typeof(VAR))__builtin_assume_aligned(VAR, BYTES); \
} while (0)
@ -38,7 +38,7 @@ COSMOPOLITAN_C_START_
do { \
if (((uintptr_t)VAR & ((BYTES)-1u))) { \
__DCHK_ALIGNED(BYTES, (uintptr_t)VAR, "" __VA_ARGS__); \
unreachable; \
__builtin_unreachable(); \
} \
VAR = (typeof(VAR))__builtin_assume_aligned(VAR, BYTES); \
} while (0)
@ -55,7 +55,7 @@ COSMOPOLITAN_C_START_
__check_fail_##SUFFIX((uint64_t)Want, (uint64_t)Got, __FILE__, \
__LINE__, 0, __VA_ARGS__); \
} \
unreachable; \
__builtin_unreachable(); \
} \
} while (0)
@ -65,7 +65,7 @@ COSMOPOLITAN_C_START_
autotype(GOT) Got = (GOT); \
autotype(WANT) Want = (WANT); \
if (!(Want OP Got)) { \
unreachable; \
__builtin_unreachable(); \
} \
} while (0)
#else

View file

@ -78,5 +78,5 @@ relegated void __check_fail(const char *suffix, //
}
kprintf("%s\n", RESET);
__die();
unreachable;
__builtin_unreachable();
}

View file

@ -83,7 +83,7 @@ extern unsigned __log_level; /* log level for runtime check */
do { \
if (!_LOG_TINY) _log_untrace(); \
ffatalf(kLogFatal, __FILE__, __LINE__, NULL, FMT, ##__VA_ARGS__); \
unreachable; \
__builtin_unreachable(); \
} while (0)
#define ERRORF(FMT, ...) \

View file

@ -149,7 +149,7 @@ static void __memlog_update(void *p2, void *p) {
return;
}
}
unreachable;
__builtin_unreachable();
}
static void __memlog_log(struct StackFrame *frame, const char *op, void *res,

View file

@ -137,7 +137,7 @@ void(vflogf)(unsigned level, const char *file, int line, FILE *f,
"exiting due to aforementioned error (host %s pid %d tid %d)\n",
buf32, getpid(), gettid());
__die();
unreachable;
__builtin_unreachable();
}
ALLOW_CANCELLATIONS;

View file

@ -201,7 +201,7 @@
ud2 // crash if contract is broken
#elif !defined(NDEBUG) && defined(__aarch64__)
brk #1000
#elif defined(__FNO_OMIT_FRAME_POINTER__)
#elif defined(__FNO_OMIT_FRAME_POINTER__) && defined(__x86_64__)
nop // avoid noreturn tail call backtrace ambiguity
#endif
.endm

View file

@ -87,7 +87,7 @@ __gc: .ftrace2
stp q2,q3,[sp,112]
stp q4,q5,[sp,144]
stp q6,q7,[sp,176]
mov x1,x10
mov x0,x10
blr x9
ldp q6,q7,[sp,176]
ldp q4,q5,[sp,144]

View file

@ -38,11 +38,12 @@ __zip_end:
.short v_zip_records // number of records on disk
.short v_zip_records // records
.long v_zip_cdirsize // size of central directory
.weak v_zip_cdoffset
.long v_zip_cdoffset // central directory offset
.short v_zip_commentsize // comment size
.endobj __zip_end,globl,hidden
.previous
.weak v_zip_records
.weak v_zip_cdirsize
.weak v_zip_cdoffset
.weak v_zip_commentsize
.previous

View file

@ -650,7 +650,7 @@ static char *Tokenize(void) {
break;
default:
unreachable;
__builtin_unreachable();
}
}
}

View file

@ -144,7 +144,7 @@ textstartup void cosmo(long *sp, struct Syslib *m1) {
#endif
// initialize file system
InitializeFileDescriptors();
__init_fds();
// set helpful globals
__argc = argc;

View file

@ -258,7 +258,7 @@ __msabi noasan EFI_STATUS EfiMain(EFI_HANDLE ImageHandle,
* Switches to copied image and launches program.
*/
_EfiPostboot(mm, pml4t, Args, ArgBlock->Args);
unreachable;
__builtin_unreachable();
}
#endif /* __x86_64__ */

View file

@ -26,10 +26,8 @@
#include "libc/runtime/runtime.h"
#include "libc/thread/tls.h"
extern int __threadcalls_end[];
extern int __threadcalls_start[];
#pragma weak __threadcalls_start
#pragma weak __threadcalls_end
extern int __threadcalls_end[] __attribute__((__weak__));
extern int __threadcalls_start[] __attribute__((__weak__));
static privileged dontinline void FixupLockNops(void) {
sigset_t mask;

View file

@ -117,7 +117,7 @@ privileged noinstrument noasan int __hook(void *dest, struct SymbolTable *st) {
for (i = 0; i < st->count; ++i) {
if (st->symbols[i].x < 9) continue;
if (st->addr_base + st->symbols[i].x < lowest) continue;
if (st->addr_base + st->symbols[i].y >= (intptr_t)__privileged_addr) break;
if (st->addr_base + st->symbols[i].y >= (intptr_t)__privileged_start) break;
p = (code_t *)((char *)st->addr_base + st->symbols[i].x);
pe = (code_t *)((char *)st->addr_base + st->symbols[i].y);
if (pe - p < 2) continue;

View file

@ -47,8 +47,8 @@ int sys_mprotect_nt(void *, size_t, int) _Hide;
int __inflate(void *, size_t, const void *, size_t);
noasan void *_Mmap(void *, size_t, int, int, int, int64_t) _Hide;
noasan int _Munmap(char *, size_t) _Hide;
void InitializeFileDescriptors(void);
void __on_arithmetic_overflow(void);
void __init_fds(void);
COSMOPOLITAN_C_END_
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */

View file

@ -118,7 +118,7 @@ privileged void __morph_begin(sigset_t *save) {
#else
#error "unsupported architecture"
#endif
__morph_mprotect(__executable_start, __privileged_addr - __executable_start,
__morph_mprotect(__executable_start, __privileged_start - __executable_start,
PROT_READ | PROT_WRITE, kNtPageWritecopy);
}
@ -129,7 +129,7 @@ privileged void __morph_end(sigset_t *save) {
int ax;
long dx;
bool cf;
__morph_mprotect(__executable_start, __privileged_addr - __executable_start,
__morph_mprotect(__executable_start, __privileged_start - __executable_start,
PROT_READ | PROT_EXEC, kNtPageExecuteRead);
#ifdef __x86_64__
if (IsOpenbsd()) {

View file

@ -92,7 +92,7 @@ static noasan void MunmapImpl(char *p, size_t n) {
beg = MAX(_mmi.p[i].x, l);
end = _mmi.p[i].y;
} else {
unreachable;
__builtin_unreachable();
}
// openbsd even requires that if we mapped, for instance a 5 byte
// file, that we be sure to call munmap(file, 5). let's abstract!

View file

@ -33,11 +33,11 @@ void PrintGarbage(void) {
const char *symbol;
struct Garbages *g;
kprintf("\n");
kprintf(" SHADOW STACK @ %p\n", __builtin_frame_address(0));
kprintf(" SHADOW STACK %P @ %p\n", __builtin_frame_address(0));
kprintf("garbage ent. parent frame original ret callback arg \n");
kprintf("------------ ------------ ------------------ ------------------ ------------------\n");
if ((g = __tls_enabled ? __get_tls()->tib_garbages:0) && g->i) {
for (i = g->i; i--;) {
for (i = g->n; i--;) {
symbol = GetSymbolByAddr(g->p[i].ret);
if (symbol) {
ksnprintf(name, sizeof(name), "%s", symbol);

View file

@ -1,14 +0,0 @@
#ifndef COSMOPOLITAN_LIBC_RUNTIME_SYMBOLIC_H_
#define COSMOPOLITAN_LIBC_RUNTIME_SYMBOLIC_H_
#ifdef __ASSEMBLER__
/* clang-format off */
#define SYMBOLIC(NAME) NAME(%rip)
#define LITERALLY(NAME) $NAME
/* clang-format on */
#else
#define SYMBOLIC(NAME) NAME
#define LITERALLY(NAME) NAME
#endif
#endif /* COSMOPOLITAN_LIBC_RUNTIME_SYMBOLIC_H_ */

View file

@ -983,7 +983,7 @@ static textwindows int sock_update(struct PortState *port_state,
sock_state->poll_status = kPollPending;
sock_state->pending_events = sock_state->user_events;
} else {
unreachable;
__builtin_unreachable();
}
port_cancel_socket_update(port_state, sock_state);
return 0;

View file

@ -78,7 +78,7 @@ const char *inet_ntop(int af, const void *src, char *dst, uint32_t size) {
*p++ = ':';
break;
default:
unreachable;
__builtin_unreachable();
}
a = (ip[i + 0] & 0xF0) >> 4;
b = (ip[i + 0] & 0x0F) >> 0;

View file

@ -36,6 +36,6 @@ char *sys_xinet_ntop(int af, const void *src) {
} else {
if (_weaken(__die)) _weaken(__die)();
abort();
unreachable;
__builtin_unreachable();
}
}

View file

@ -561,7 +561,7 @@ int __fmt_dtoa(int (*out)(const char *, void *, size_t), void *arg, int d,
while (--width >= 0) __FMT_PUT(' ');
break;
default:
unreachable;
__builtin_unreachable();
}
return consumed;
}

View file

@ -51,7 +51,7 @@ static int RunFileActions(struct _posix_faction *a) {
}
return 0;
default:
unreachable;
__builtin_unreachable();
}
}

View file

@ -34,13 +34,16 @@ typedef long long v2di __attribute__((__vector_size__(16), __aligned__(1)));
*
* @param p points to file memory
* @param n is byte size of file
* @return pointer to EOCD64 or EOCD, or NULL if not found
* @param e may receive error code when null is returned
* @return pointer to EOCD64 or EOCD, otherwise null
*/
void *GetZipCdir(const uint8_t *p, size_t n) {
void *GetZipEocd(const uint8_t *p, size_t n, int *e) {
v2di x;
int err;
size_t i, j;
uint32_t magic;
i = n - 4;
err = kZipErrorEocdNotFound;
do {
#ifdef __x86_64__
v8hi pk = {READ16LE("PK"), READ16LE("PK"), READ16LE("PK"), READ16LE("PK"),
@ -63,19 +66,21 @@ void *GetZipCdir(const uint8_t *p, size_t n) {
--i;
}
if (magic == kZipCdir64LocatorMagic && i + kZipCdir64LocatorSize <= n &&
IsZipCdir64(p, n, ZIP_LOCATE64_OFFSET(p + i))) {
(err = IsZipEocd64(p, n, ZIP_LOCATE64_OFFSET(p + i))) == kZipOk) {
return p + ZIP_LOCATE64_OFFSET(p + i);
} else if (magic == kZipCdirHdrMagic && IsZipCdir32(p, n, i)) {
} else if (magic == kZipCdirHdrMagic &&
(err = IsZipEocd32(p, n, i)) == kZipOk) {
j = i;
do {
if (READ32LE(p + j) == kZipCdir64LocatorMagic &&
j + kZipCdir64LocatorSize <= n &&
IsZipCdir64(p, n, ZIP_LOCATE64_OFFSET(p + j))) {
IsZipEocd64(p, n, ZIP_LOCATE64_OFFSET(p + j)) == kZipOk) {
return p + ZIP_LOCATE64_OFFSET(p + j);
}
} while (j-- && i - j < 128);
return p + i;
}
} while (i > 0 && i-- + 0x10000 + 0x1000 >= n);
if (e) *e = err;
return 0;
}

View file

@ -121,7 +121,7 @@ noasan bool _isutf8(const void *data, size_t size) {
return false; // missing cont
}
default:
unreachable;
__builtin_unreachable();
}
}
return true;

View file

@ -16,23 +16,32 @@
TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
*/
#include "libc/intrin/bits.h"
#include "libc/zip.h"
/**
* Returns true if zip end of central directory header seems legit.
* Determines if ZIP EOCD record seems legit.
*/
bool IsZipCdir32(const uint8_t *p, size_t n, size_t i) {
if (i > n || n - i < kZipCdirHdrMinSize) return false;
if (READ32LE(p + i) != kZipCdirHdrMagic) return false;
if (i + ZIP_CDIR_HDRSIZE(p + i) > n) return false;
if (ZIP_CDIR_DISK(p + i) != ZIP_CDIR_STARTINGDISK(p + i)) return false;
if (ZIP_CDIR_RECORDSONDISK(p + i) != ZIP_CDIR_RECORDS(p + i)) return false;
int IsZipEocd32(const uint8_t *p, size_t n, size_t i) {
if (i > n || n - i < kZipCdirHdrMinSize) {
return kZipErrorEocdOffsetOverflow;
}
if (READ32LE(p + i) != kZipCdirHdrMagic) {
return kZipErrorEocdMagicNotFound;
}
if (i + ZIP_CDIR_HDRSIZE(p + i) > n) {
return kZipErrorEocdSizeOverflow;
}
if (ZIP_CDIR_DISK(p + i) != ZIP_CDIR_STARTINGDISK(p + i)) {
return kZipErrorEocdDiskMismatch;
}
if (ZIP_CDIR_RECORDSONDISK(p + i) != ZIP_CDIR_RECORDS(p + i)) {
return kZipErrorCdirRecordsMismatch;
}
if (ZIP_CDIR_RECORDS(p + i) * kZipCfileHdrMinSize > ZIP_CDIR_SIZE(p + i)) {
return false;
return kZipErrorCdirRecordsOverflow;
}
if (ZIP_CDIR_OFFSET(p + i) + ZIP_CDIR_SIZE(p + i) > i) {
return false;
return kZipErrorCdirOffsetPastEocd;
}
return true;
return kZipOk;
}

View file

@ -16,31 +16,34 @@
TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
*/
#include "libc/intrin/bits.h"
#include "libc/zip.h"
/**
* Returns true if zip64 end of central directory header seems legit.
* Returns kZipOk if zip64 end of central directory header seems legit.
*/
bool IsZipCdir64(const uint8_t *p, size_t n, size_t i) {
if (i + kZipCdir64HdrMinSize > n) return false;
if (READ32LE(p + i) != kZipCdir64HdrMagic) return false;
int IsZipEocd64(const uint8_t *p, size_t n, size_t i) {
if (i + kZipCdir64HdrMinSize > n) {
return kZipErrorEocdOffsetOverflow;
}
if (READ32LE(p + i) != kZipCdir64HdrMagic) {
return kZipErrorEocdMagicNotFound;
}
if (i + ZIP_CDIR64_HDRSIZE(p + i) + kZipCdir64LocatorSize > n) {
return false;
return kZipErrorEocdSizeOverflow;
}
if (ZIP_LOCATE64_MAGIC(p + i + ZIP_CDIR64_HDRSIZE(p + i)) !=
kZipCdir64LocatorMagic) {
return false;
return kZipErrorCdirLocatorMagic;
}
if (ZIP_LOCATE64_OFFSET(p + i + ZIP_CDIR64_HDRSIZE(p + i)) != i) {
return false;
return kZipErrorCdirLocatorOffset;
}
if (ZIP_CDIR64_RECORDS(p + i) * kZipCfileHdrMinSize >
ZIP_CDIR64_SIZE(p + i)) {
return false;
return kZipErrorCdirRecordsOverflow;
}
if (ZIP_CDIR64_OFFSET(p + i) + ZIP_CDIR64_SIZE(p + i) > i) {
return false;
return kZipErrorCdirOffsetPastEocd;
}
return true;
return kZipOk;
}

View file

@ -54,7 +54,7 @@ o/$(MODE)/libc/str/dosdatetimetounix.o: private \
CFLAGS += \
-O3
o/$(MODE)/libc/str/getzipcdir.o \
o/$(MODE)/libc/str/getzipeocd.o \
o/$(MODE)/libc/str/getzipcdircomment.o \
o/$(MODE)/libc/str/getzipcdircommentsize.o \
o/$(MODE)/libc/str/getzipcdiroffset.o \

View file

@ -83,7 +83,7 @@ int strnwidth(const char *s, size_t n, size_t o) {
}
break;
default:
unreachable;
__builtin_unreachable();
}
} else {
break;

View file

@ -1,2 +0,0 @@
#include "libc/sysv/macros.internal.h"
.scall posix_fallocate,0x9dffffa12fffffff,4095,4095,globl,hidden

View file

@ -0,0 +1,2 @@
#include "libc/sysv/macros.internal.h"
.scall sys_posix_fallocate,0x9dffffa12fffffff,4095,4095,globl,hidden

View file

@ -1,6 +1,5 @@
#ifndef COSMOPOLITAN_LIBC_SYSV_CONSTS_AF_H_
#define COSMOPOLITAN_LIBC_SYSV_CONSTS_AF_H_
#include "libc/runtime/symbolic.h"
#if !(__ASSEMBLER__ + __LINKER__ + 0)
COSMOPOLITAN_C_START_
@ -50,53 +49,95 @@ extern const int AF_VSOCK;
extern const int AF_WANPIPE;
extern const int AF_X25;
#define AF_ALG AF_ALG
#define AF_LINK AF_LINK
#define AF_APPLETALK AF_APPLETALK
#define AF_ASH AF_ASH
#define AF_ATMPVC AF_ATMPVC
#define AF_ATMSVC AF_ATMSVC
#define AF_AX25 AF_AX25
#define AF_BLUETOOTH AF_BLUETOOTH
#define AF_BRIDGE AF_BRIDGE
#define AF_CAIF AF_CAIF
#define AF_CAN AF_CAN
#define AF_ECONET AF_ECONET
#define AF_FILE AF_FILE
#define AF_IB AF_IB
#define AF_IEEE802154 AF_IEEE802154
#define AF_INET 2
#define AF_INET6 AF_INET6
#define AF_IPX AF_IPX
#define AF_IRDA AF_IRDA
#define AF_ISDN AF_ISDN
#define AF_IUCV AF_IUCV
#define AF_KCM AF_KCM
#define AF_KEY AF_KEY
#define AF_LLC AF_LLC
#define AF_LOCAL AF_LOCAL
#define AF_MAX AF_MAX
#define AF_MPLS AF_MPLS
#define AF_NETBEUI AF_NETBEUI
#define AF_NETLINK AF_NETLINK
#define AF_NETROM AF_NETROM
#define AF_NFC AF_NFC
#define AF_PACKET AF_PACKET
#define AF_PHONET AF_PHONET
#define AF_PPPOX AF_PPPOX
#define AF_ROSE AF_ROSE
#define AF_ROUTE AF_ROUTE
#define AF_RXRPC AF_RXRPC
#define AF_SECURITY AF_SECURITY
#define AF_SNA AF_SNA
#define AF_TIPC AF_TIPC
#define AF_UNIX 1
#define AF_UNSPEC 0
#define AF_VSOCK AF_VSOCK
#define AF_WANPIPE AF_WANPIPE
#define AF_X25 AF_X25
#define __tmpcosmo_AF_ALG -15823936
#define __tmpcosmo_AF_APPLETALK -15823820
#define __tmpcosmo_AF_ASH -15823924
#define __tmpcosmo_AF_ATMPVC -15824070
#define __tmpcosmo_AF_ATMSVC -15824056
#define __tmpcosmo_AF_AX25 -15824014
#define __tmpcosmo_AF_BLUETOOTH -15823992
#define __tmpcosmo_AF_BRIDGE -15823812
#define __tmpcosmo_AF_CAIF -15823850
#define __tmpcosmo_AF_CAN -15823868
#define __tmpcosmo_AF_ECONET -15823852
#define __tmpcosmo_AF_FILE -15824118
#define __tmpcosmo_AF_IB -15823966
#define __tmpcosmo_AF_IEEE802154 -15823906
#define __tmpcosmo_AF_IPX -15824002
#define __tmpcosmo_AF_IRDA -15823860
#define __tmpcosmo_AF_ISDN -15823978
#define __tmpcosmo_AF_IUCV -15824106
#define __tmpcosmo_AF_KCM -15824024
#define __tmpcosmo_AF_KEY -15823948
#define __tmpcosmo_AF_LINK -15823878
#define __tmpcosmo_AF_LLC -15823824
#define __tmpcosmo_AF_LOCAL -15823928
#define __tmpcosmo_AF_MAX -15824082
#define __tmpcosmo_AF_MPLS -15824026
#define __tmpcosmo_AF_NETBEUI -15824124
#define __tmpcosmo_AF_NETLINK -15824004
#define __tmpcosmo_AF_NETROM -15823886
#define __tmpcosmo_AF_NFC -15824142
#define __tmpcosmo_AF_PACKET -15824028
#define __tmpcosmo_AF_PHONET -15823830
#define __tmpcosmo_AF_PPPOX -15823876
#define __tmpcosmo_AF_ROSE -15824016
#define __tmpcosmo_AF_ROUTE -15824100
#define __tmpcosmo_AF_RXRPC -15823926
#define __tmpcosmo_AF_SECURITY -15824136
#define __tmpcosmo_AF_SNA -15823950
#define __tmpcosmo_AF_TIPC -15824034
#define __tmpcosmo_AF_VSOCK -15824146
#define __tmpcosmo_AF_WANPIPE -15823960
#define __tmpcosmo_AF_X25 -15823864
#define __tmpcosmo_AF_INET6 1498323847
COSMOPOLITAN_C_END_
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
#define AF_ALG SYMBOLIC(AF_ALG)
#define AF_LINK SYMBOLIC(AF_LINK)
#define AF_APPLETALK SYMBOLIC(AF_APPLETALK)
#define AF_ASH SYMBOLIC(AF_ASH)
#define AF_ATMPVC SYMBOLIC(AF_ATMPVC)
#define AF_ATMSVC SYMBOLIC(AF_ATMSVC)
#define AF_AX25 SYMBOLIC(AF_AX25)
#define AF_BLUETOOTH SYMBOLIC(AF_BLUETOOTH)
#define AF_BRIDGE SYMBOLIC(AF_BRIDGE)
#define AF_CAIF SYMBOLIC(AF_CAIF)
#define AF_CAN SYMBOLIC(AF_CAN)
#define AF_ECONET SYMBOLIC(AF_ECONET)
#define AF_FILE SYMBOLIC(AF_FILE)
#define AF_IB SYMBOLIC(AF_IB)
#define AF_IEEE802154 SYMBOLIC(AF_IEEE802154)
#define AF_INET LITERALLY(2)
#define AF_INET6 SYMBOLIC(AF_INET6)
#define AF_IPX SYMBOLIC(AF_IPX)
#define AF_IRDA SYMBOLIC(AF_IRDA)
#define AF_ISDN SYMBOLIC(AF_ISDN)
#define AF_IUCV SYMBOLIC(AF_IUCV)
#define AF_KCM SYMBOLIC(AF_KCM)
#define AF_KEY SYMBOLIC(AF_KEY)
#define AF_LLC SYMBOLIC(AF_LLC)
#define AF_LOCAL SYMBOLIC(AF_LOCAL)
#define AF_MAX SYMBOLIC(AF_MAX)
#define AF_MPLS SYMBOLIC(AF_MPLS)
#define AF_NETBEUI SYMBOLIC(AF_NETBEUI)
#define AF_NETLINK SYMBOLIC(AF_NETLINK)
#define AF_NETROM SYMBOLIC(AF_NETROM)
#define AF_NFC SYMBOLIC(AF_NFC)
#define AF_PACKET SYMBOLIC(AF_PACKET)
#define AF_PHONET SYMBOLIC(AF_PHONET)
#define AF_PPPOX SYMBOLIC(AF_PPPOX)
#define AF_ROSE SYMBOLIC(AF_ROSE)
#define AF_ROUTE SYMBOLIC(AF_ROUTE)
#define AF_RXRPC SYMBOLIC(AF_RXRPC)
#define AF_SECURITY SYMBOLIC(AF_SECURITY)
#define AF_SNA SYMBOLIC(AF_SNA)
#define AF_TIPC SYMBOLIC(AF_TIPC)
#define AF_UNIX LITERALLY(1)
#define AF_UNSPEC LITERALLY(0)
#define AF_VSOCK SYMBOLIC(AF_VSOCK)
#define AF_WANPIPE SYMBOLIC(AF_WANPIPE)
#define AF_X25 SYMBOLIC(AF_X25)
#endif /* COSMOPOLITAN_LIBC_SYSV_CONSTS_AF_H_ */

View file

@ -1,16 +1,15 @@
#ifndef COSMOPOLITAN_LIBC_SYSV_CONSTS_ALG_H_
#define COSMOPOLITAN_LIBC_SYSV_CONSTS_ALG_H_
#include "libc/runtime/symbolic.h"
#define ALG_SET_AEAD_ASSOCLEN SYMBOLIC(ALG_SET_AEAD_ASSOCLEN)
#define ALG_SET_AEAD_AUTHSIZE SYMBOLIC(ALG_SET_AEAD_AUTHSIZE)
#define ALG_SET_DRBG_ENTROPY SYMBOLIC(ALG_SET_DRBG_ENTROPY)
#define ALG_SET_IV SYMBOLIC(ALG_SET_IV)
#define ALG_SET_KEY SYMBOLIC(ALG_SET_KEY)
#define ALG_SET_OP SYMBOLIC(ALG_SET_OP)
#define ALG_SET_AEAD_ASSOCLEN ALG_SET_AEAD_ASSOCLEN
#define ALG_SET_AEAD_AUTHSIZE ALG_SET_AEAD_AUTHSIZE
#define ALG_SET_DRBG_ENTROPY ALG_SET_DRBG_ENTROPY
#define ALG_SET_IV ALG_SET_IV
#define ALG_SET_KEY ALG_SET_KEY
#define ALG_SET_OP ALG_SET_OP
#define ALG_OP_DECRYPT SYMBOLIC(ALG_OP_DECRYPT)
#define ALG_OP_ENCRYPT SYMBOLIC(ALG_OP_ENCRYPT)
#define ALG_OP_DECRYPT ALG_OP_DECRYPT
#define ALG_OP_ENCRYPT ALG_OP_ENCRYPT
#if !(__ASSEMBLER__ + __LINKER__ + 0)
COSMOPOLITAN_C_START_

View file

@ -1,15 +1,14 @@
#ifndef COSMOPOLITAN_LIBC_SYSV_CONSTS_ARPHRD_H_
#define COSMOPOLITAN_LIBC_SYSV_CONSTS_ARPHRD_H_
#include "libc/runtime/symbolic.h"
#define ARPHRD_ETHER SYMBOLIC(ARPHRD_ETHER)
#define ARPHRD_FCFABRIC SYMBOLIC(ARPHRD_FCFABRIC)
#define ARPHRD_IEEE80211 SYMBOLIC(ARPHRD_IEEE80211)
#define ARPHRD_IEEE80211_PRISM SYMBOLIC(ARPHRD_IEEE80211_PRISM)
#define ARPHRD_IEEE80211_RADIOTAP SYMBOLIC(ARPHRD_IEEE80211_RADIOTAP)
#define ARPHRD_IEEE802154 SYMBOLIC(ARPHRD_IEEE802154)
#define ARPHRD_IEEE802_TR SYMBOLIC(ARPHRD_IEEE802_TR)
#define ARPHRD_LOCALTLK SYMBOLIC(ARPHRD_LOCALTLK)
#define ARPHRD_ETHER ARPHRD_ETHER
#define ARPHRD_FCFABRIC ARPHRD_FCFABRIC
#define ARPHRD_IEEE80211 ARPHRD_IEEE80211
#define ARPHRD_IEEE80211_PRISM ARPHRD_IEEE80211_PRISM
#define ARPHRD_IEEE80211_RADIOTAP ARPHRD_IEEE80211_RADIOTAP
#define ARPHRD_IEEE802154 ARPHRD_IEEE802154
#define ARPHRD_IEEE802_TR ARPHRD_IEEE802_TR
#define ARPHRD_LOCALTLK ARPHRD_LOCALTLK
#if !(__ASSEMBLER__ + __LINKER__ + 0)
COSMOPOLITAN_C_START_

View file

@ -1,6 +1,5 @@
#ifndef COSMOPOLITAN_LIBC_SYSV_CONSTS_AT_H_
#define COSMOPOLITAN_LIBC_SYSV_CONSTS_AT_H_
#include "libc/runtime/symbolic.h"
#if !(__ASSEMBLER__ + __LINKER__ + 0)
COSMOPOLITAN_C_START_
@ -19,11 +18,18 @@ extern const int AT_EMPTY_PATH;
COSMOPOLITAN_C_END_
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
#define AT_FDCWD SYMBOLIC(AT_FDCWD)
#define AT_SYMLINK_FOLLOW SYMBOLIC(AT_SYMLINK_FOLLOW)
#define AT_SYMLINK_NOFOLLOW SYMBOLIC(AT_SYMLINK_NOFOLLOW)
#define AT_REMOVEDIR SYMBOLIC(AT_REMOVEDIR)
#define AT_EACCESS SYMBOLIC(AT_EACCESS)
#define AT_EMPTY_PATH SYMBOLIC(AT_EMPTY_PATH)
#define AT_FDCWD AT_FDCWD
#define AT_SYMLINK_FOLLOW AT_SYMLINK_FOLLOW
#define AT_SYMLINK_NOFOLLOW AT_SYMLINK_NOFOLLOW
#define AT_REMOVEDIR AT_REMOVEDIR
#define AT_EACCESS AT_EACCESS
#define AT_EMPTY_PATH AT_EMPTY_PATH
#define __tmpcosmo_AT_FDCWD 1179405227
#define __tmpcosmo_AT_SYMLINK_FOLLOW 2095634819
#define __tmpcosmo_AT_SYMLINK_NOFOLLOW -527548073
#define __tmpcosmo_AT_REMOVEDIR -1645201444
#define __tmpcosmo_AT_EACCESS 1250381332
#define __tmpcosmo_AT_EMPTY_PATH -905338016
#endif /* COSMOPOLITAN_LIBC_SYSV_CONSTS_AT_H_ */

View file

@ -1,6 +1,5 @@
#ifndef COSMOPOLITAN_LIBC_CALLS_AUXV_H_
#define COSMOPOLITAN_LIBC_CALLS_AUXV_H_
#include "libc/runtime/symbolic.h"
#if !(__ASSEMBLER__ + __LINKER__ + 0)
COSMOPOLITAN_C_START_
@ -46,43 +45,82 @@ extern const unsigned long AT_UID;
COSMOPOLITAN_C_END_
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
#define AT_BASE SYMBOLIC(AT_BASE)
#define AT_BASE_PLATFORM SYMBOLIC(AT_BASE_PLATFORM)
#define AT_CANARY SYMBOLIC(AT_CANARY)
#define AT_CANARYLEN SYMBOLIC(AT_CANARYLEN)
#define AT_CLKTCK SYMBOLIC(AT_CLKTCK)
#define AT_DCACHEBSIZE SYMBOLIC(AT_DCACHEBSIZE)
#define AT_EGID SYMBOLIC(AT_EGID)
#define AT_EHDRFLAGS SYMBOLIC(AT_EHDRFLAGS)
#define AT_ENTRY SYMBOLIC(AT_ENTRY)
#define AT_EUID SYMBOLIC(AT_EUID)
#define AT_EXECFD SYMBOLIC(AT_EXECFD)
#define AT_EXECFN SYMBOLIC(AT_EXECFN)
#define AT_EXECPATH SYMBOLIC(AT_EXECPATH)
#define AT_FLAGS SYMBOLIC(AT_FLAGS)
#define AT_GID SYMBOLIC(AT_GID)
#define AT_HWCAP SYMBOLIC(AT_HWCAP)
#define AT_HWCAP2 SYMBOLIC(AT_HWCAP2)
#define AT_ICACHEBSIZE SYMBOLIC(AT_ICACHEBSIZE)
#define AT_MINSIGSTKSZ SYMBOLIC(AT_MINSIGSTKSZ)
#define AT_NCPUS SYMBOLIC(AT_NCPUS)
#define AT_NOTELF SYMBOLIC(AT_NOTELF)
#define AT_NO_AUTOMOUNT SYMBOLIC(AT_NO_AUTOMOUNT)
#define AT_OSRELDATE SYMBOLIC(AT_OSRELDATE)
#define AT_PAGESIZES SYMBOLIC(AT_PAGESIZES)
#define AT_PAGESIZESLEN SYMBOLIC(AT_PAGESIZESLEN)
#define AT_PAGESZ SYMBOLIC(AT_PAGESZ)
#define AT_PHDR SYMBOLIC(AT_PHDR)
#define AT_PHENT SYMBOLIC(AT_PHENT)
#define AT_PHNUM SYMBOLIC(AT_PHNUM)
#define AT_PLATFORM SYMBOLIC(AT_PLATFORM)
#define AT_RANDOM SYMBOLIC(AT_RANDOM)
#define AT_SECURE SYMBOLIC(AT_SECURE)
#define AT_STACKBASE SYMBOLIC(AT_STACKBASE)
#define AT_STACKPROT SYMBOLIC(AT_STACKPROT)
#define AT_SYSINFO_EHDR SYMBOLIC(AT_SYSINFO_EHDR)
#define AT_TIMEKEEP SYMBOLIC(AT_TIMEKEEP)
#define AT_UCACHEBSIZE SYMBOLIC(AT_UCACHEBSIZE)
#define AT_UID SYMBOLIC(AT_UID)
#define AT_BASE AT_BASE
#define AT_BASE_PLATFORM AT_BASE_PLATFORM
#define AT_CANARY AT_CANARY
#define AT_CANARYLEN AT_CANARYLEN
#define AT_CLKTCK AT_CLKTCK
#define AT_DCACHEBSIZE AT_DCACHEBSIZE
#define AT_EGID AT_EGID
#define AT_EHDRFLAGS AT_EHDRFLAGS
#define AT_ENTRY AT_ENTRY
#define AT_EUID AT_EUID
#define AT_EXECFD AT_EXECFD
#define AT_EXECFN AT_EXECFN
#define AT_EXECPATH AT_EXECPATH
#define AT_FLAGS AT_FLAGS
#define AT_GID AT_GID
#define AT_HWCAP AT_HWCAP
#define AT_HWCAP2 AT_HWCAP2
#define AT_ICACHEBSIZE AT_ICACHEBSIZE
#define AT_MINSIGSTKSZ AT_MINSIGSTKSZ
#define AT_NCPUS AT_NCPUS
#define AT_NOTELF AT_NOTELF
#define AT_NO_AUTOMOUNT AT_NO_AUTOMOUNT
#define AT_OSRELDATE AT_OSRELDATE
#define AT_PAGESIZES AT_PAGESIZES
#define AT_PAGESIZESLEN AT_PAGESIZESLEN
#define AT_PAGESZ AT_PAGESZ
#define AT_PHDR AT_PHDR
#define AT_PHENT AT_PHENT
#define AT_PHNUM AT_PHNUM
#define AT_PLATFORM AT_PLATFORM
#define AT_RANDOM AT_RANDOM
#define AT_SECURE AT_SECURE
#define AT_STACKBASE AT_STACKBASE
#define AT_STACKPROT AT_STACKPROT
#define AT_SYSINFO_EHDR AT_SYSINFO_EHDR
#define AT_TIMEKEEP AT_TIMEKEEP
#define AT_UCACHEBSIZE AT_UCACHEBSIZE
#define AT_UID AT_UID
#define __tmpcosmo_AT_BASE -1855992398
#define __tmpcosmo_AT_BASE_PLATFORM 1808921239
#define __tmpcosmo_AT_CANARY 970484702
#define __tmpcosmo_AT_CANARYLEN -1519746688
#define __tmpcosmo_AT_CLKTCK 1992240562
#define __tmpcosmo_AT_DCACHEBSIZE 863586363
#define __tmpcosmo_AT_EGID 1532201139
#define __tmpcosmo_AT_EHDRFLAGS 1117498191
#define __tmpcosmo_AT_ENTRY -881318004
#define __tmpcosmo_AT_EUID -94994583
#define __tmpcosmo_AT_EXECFD 1401411855
#define __tmpcosmo_AT_EXECFN -1457019650
#define __tmpcosmo_AT_EXECPATH 887479731
#define __tmpcosmo_AT_FLAGS 1235860257
#define __tmpcosmo_AT_GID -9520266
#define __tmpcosmo_AT_HWCAP -1179314026
#define __tmpcosmo_AT_HWCAP2 -1420265774
#define __tmpcosmo_AT_ICACHEBSIZE 1580363101
#define __tmpcosmo_AT_MINSIGSTKSZ -75267465
#define __tmpcosmo_AT_NCPUS -995438071
#define __tmpcosmo_AT_NOTELF 1219739005
#define __tmpcosmo_AT_NO_AUTOMOUNT -76603664
#define __tmpcosmo_AT_OSRELDATE 1821203372
#define __tmpcosmo_AT_PAGESIZES 569939040
#define __tmpcosmo_AT_PAGESIZESLEN 164991034
#define __tmpcosmo_AT_PAGESZ 712839957
#define __tmpcosmo_AT_PHDR -392168925
#define __tmpcosmo_AT_PHENT 1997583295
#define __tmpcosmo_AT_PHNUM 965878207
#define __tmpcosmo_AT_PLATFORM -1302967068
#define __tmpcosmo_AT_RANDOM 41281473
#define __tmpcosmo_AT_SECURE -197675851
#define __tmpcosmo_AT_STACKBASE -1736872741
#define __tmpcosmo_AT_STACKPROT 217825885
#define __tmpcosmo_AT_SYSINFO_EHDR -473176894
#define __tmpcosmo_AT_TIMEKEEP -1193655847
#define __tmpcosmo_AT_UCACHEBSIZE 1555124849
#define __tmpcosmo_AT_UID 1722564595
#endif /* COSMOPOLITAN_LIBC_CALLS_AUXV_H_ */

View file

@ -1,6 +1,5 @@
#ifndef COSMOPOLITAN_LIBC_SYSV_CONSTS_BAUD_H_
#define COSMOPOLITAN_LIBC_SYSV_CONSTS_BAUD_H_
#include "libc/runtime/symbolic.h"
#if !(__ASSEMBLER__ + __LINKER__ + 0)
COSMOPOLITAN_C_START_
@ -34,37 +33,65 @@ extern const uint32_t B3000000;
extern const uint32_t B3500000;
extern const uint32_t B4000000;
#define B0 0
#define B50 B50
#define B75 B75
#define B110 B110
#define B134 B134
#define B150 B150
#define B200 B200
#define B300 B300
#define B600 B600
#define B1200 B1200
#define B1800 B1800
#define B2400 B2400
#define B4800 B4800
#define B9600 B9600
#define B19200 B19200
#define B38400 B38400
#define B57600 B57600
#define B115200 B115200
#define B230400 B230400
#define B500000 B500000
#define B576000 B576000
#define B1000000 B1000000
#define B1152000 B1152000
#define B1500000 B1500000
#define B2000000 B2000000
#define B2500000 B2500000
#define B3000000 B3000000
#define B3500000 B3500000
#define B4000000 B4000000
#define __tmpcosmo_B50 -953383397
#define __tmpcosmo_B75 1130536802
#define __tmpcosmo_B110 -659509311
#define __tmpcosmo_B134 -131437328
#define __tmpcosmo_B150 -1673428193
#define __tmpcosmo_B200 2138567959
#define __tmpcosmo_B300 -1445271060
#define __tmpcosmo_B600 1252327384
#define __tmpcosmo_B1200 -389937088
#define __tmpcosmo_B1800 773974105
#define __tmpcosmo_B2400 -1936595377
#define __tmpcosmo_B4800 -1608072774
#define __tmpcosmo_B9600 -1161161922
#define __tmpcosmo_B19200 91389144
#define __tmpcosmo_B38400 239735293
#define __tmpcosmo_B57600 -1507679301
#define __tmpcosmo_B115200 217987560
#define __tmpcosmo_B230400 -1641848795
#define __tmpcosmo_B500000 1083827308
#define __tmpcosmo_B576000 1010987036
#define __tmpcosmo_B1000000 -1265517687
#define __tmpcosmo_B1152000 1805492829
#define __tmpcosmo_B1500000 1858564109
#define __tmpcosmo_B2000000 -597557560
#define __tmpcosmo_B2500000 1415439593
#define __tmpcosmo_B3000000 907032447
#define __tmpcosmo_B3500000 -610258643
#define __tmpcosmo_B4000000 -1412738484
COSMOPOLITAN_C_END_
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
#define B0 LITERALLY(0)
#define B50 SYMBOLIC(B50)
#define B75 SYMBOLIC(B75)
#define B110 SYMBOLIC(B110)
#define B134 SYMBOLIC(B134)
#define B150 SYMBOLIC(B150)
#define B200 SYMBOLIC(B200)
#define B300 SYMBOLIC(B300)
#define B600 SYMBOLIC(B600)
#define B1200 SYMBOLIC(B1200)
#define B1800 SYMBOLIC(B1800)
#define B2400 SYMBOLIC(B2400)
#define B4800 SYMBOLIC(B4800)
#define B9600 SYMBOLIC(B9600)
#define B19200 SYMBOLIC(B19200)
#define B38400 SYMBOLIC(B38400)
#define B57600 SYMBOLIC(B57600)
#define B115200 SYMBOLIC(B115200)
#define B230400 SYMBOLIC(B230400)
#define B500000 SYMBOLIC(B500000)
#define B576000 SYMBOLIC(B576000)
#define B1000000 SYMBOLIC(B1000000)
#define B1152000 SYMBOLIC(B1152000)
#define B1500000 SYMBOLIC(B1500000)
#define B2000000 SYMBOLIC(B2000000)
#define B2500000 SYMBOLIC(B2500000)
#define B3000000 SYMBOLIC(B3000000)
#define B3500000 SYMBOLIC(B3500000)
#define B4000000 SYMBOLIC(B4000000)
#endif /* COSMOPOLITAN_LIBC_SYSV_CONSTS_BAUD_H_ */

View file

@ -1,6 +1,5 @@
#ifndef COSMOPOLITAN_LIBC_SYSV_CONSTS_CLOCK_H_
#define COSMOPOLITAN_LIBC_SYSV_CONSTS_CLOCK_H_
#include "libc/runtime/symbolic.h"
#if !(__ASSEMBLER__ + __LINKER__ + 0)
COSMOPOLITAN_C_START_
@ -27,26 +26,9 @@ extern const int CLOCK_UPTIME_PRECISE;
COSMOPOLITAN_C_END_
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
#define CLOCK_REALTIME LITERALLY(0)
#define CLOCK_REALTIME 0
#define CLOCK_MONOTONIC CLOCK_MONOTONIC
#define CLOCK_BOOTTIME SYMBOLIC(CLOCK_BOOTTIME)
#define CLOCK_BOOTTIME_ALARM SYMBOLIC(CLOCK_BOOTTIME_ALARM)
#define CLOCK_MONOTONIC SYMBOLIC(CLOCK_MONOTONIC)
#define CLOCK_MONOTONIC_COARSE SYMBOLIC(CLOCK_MONOTONIC_COARSE)
#define CLOCK_MONOTONIC_FAST SYMBOLIC(CLOCK_MONOTONIC_FAST)
#define CLOCK_MONOTONIC_PRECISE SYMBOLIC(CLOCK_MONOTONIC_PRECISE)
#define CLOCK_MONOTONIC_RAW SYMBOLIC(CLOCK_MONOTONIC_RAW)
#define CLOCK_PROCESS_CPUTIME_ID SYMBOLIC(CLOCK_PROCESS_CPUTIME_ID)
#define CLOCK_PROF SYMBOLIC(CLOCK_PROF)
#define CLOCK_REALTIME_ALARM SYMBOLIC(CLOCK_REALTIME_ALARM)
#define CLOCK_REALTIME_COARSE SYMBOLIC(CLOCK_REALTIME_COARSE)
#define CLOCK_REALTIME_FAST SYMBOLIC(CLOCK_REALTIME_FAST)
#define CLOCK_REALTIME_PRECISE SYMBOLIC(CLOCK_REALTIME_PRECISE)
#define CLOCK_SECOND SYMBOLIC(CLOCK_SECOND)
#define CLOCK_TAI SYMBOLIC(CLOCK_TAI)
#define CLOCK_THREAD_CPUTIME_ID SYMBOLIC(CLOCK_THREAD_CPUTIME_ID)
#define CLOCK_UPTIME SYMBOLIC(CLOCK_UPTIME)
#define CLOCK_UPTIME_FAST SYMBOLIC(CLOCK_UPTIME_FAST)
#define CLOCK_UPTIME_PRECISE SYMBOLIC(CLOCK_UPTIME_PRECISE)
#define __tmpcosmo_CLOCK_MONOTONIC 52735271
#endif /* COSMOPOLITAN_LIBC_SYSV_CONSTS_CLOCK_H_ */

View file

@ -1,5 +1,6 @@
#ifndef COSMOPOLITAN_LIBC_SYSV_CONSTS_CLONE_H_
#define COSMOPOLITAN_LIBC_SYSV_CONSTS_CLONE_H_
#ifdef COSMO
#define CSIGNAL 0x000000ff
#define CLONE_VM 0x00000100
@ -27,4 +28,5 @@
#define CLONE_NEWNET 0x40000000
#define CLONE_IO 0x80000000
#endif /* COSMO */
#endif /* COSMOPOLITAN_LIBC_SYSV_CONSTS_CLONE_H_ */

View file

@ -1,6 +1,5 @@
#ifndef COSMOPOLITAN_LIBC_SYSV_CONSTS_CLOSE_H_
#define COSMOPOLITAN_LIBC_SYSV_CONSTS_CLOSE_H_
#include "libc/runtime/symbolic.h"
#if !(__ASSEMBLER__ + __LINKER__ + 0)
COSMOPOLITAN_C_START_
@ -10,7 +9,7 @@ extern const unsigned int CLOSE_RANGE_CLOEXEC;
COSMOPOLITAN_C_END_
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
#define CLOSE_RANGE_UNSHARE SYMBOLIC(CLOSE_RANGE_UNSHARE)
#define CLOSE_RANGE_CLOEXEC SYMBOLIC(CLOSE_RANGE_CLOEXEC)
#define CLOSE_RANGE_UNSHARE CLOSE_RANGE_UNSHARE
#define CLOSE_RANGE_CLOEXEC CLOSE_RANGE_CLOEXEC
#endif /* COSMOPOLITAN_LIBC_SYSV_CONSTS_CLOSE_H_ */

View file

@ -1,6 +1,5 @@
#ifndef COSMOPOLITAN_LIBC_SYSV_CONSTS_DT_H_
#define COSMOPOLITAN_LIBC_SYSV_CONSTS_DT_H_
#include "libc/runtime/symbolic.h"
#if !(__ASSEMBLER__ + __LINKER__ + 0)
COSMOPOLITAN_C_START_
@ -16,13 +15,13 @@ extern const uint8_t DT_SOCK;
COSMOPOLITAN_C_END_
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
#define DT_UNKNOWN LITERALLY(0)
#define DT_FIFO LITERALLY(1)
#define DT_CHR LITERALLY(2)
#define DT_DIR LITERALLY(4)
#define DT_BLK LITERALLY(6)
#define DT_REG LITERALLY(8)
#define DT_LNK LITERALLY(10)
#define DT_SOCK LITERALLY(12)
#define DT_UNKNOWN 0
#define DT_FIFO 1
#define DT_CHR 2
#define DT_DIR 4
#define DT_BLK 6
#define DT_REG 8
#define DT_LNK 10
#define DT_SOCK 12
#endif /* COSMOPOLITAN_LIBC_SYSV_CONSTS_DT_H_ */

View file

@ -1,6 +1,5 @@
#ifndef COSMOPOLITAN_LIBC_SYSV_CONSTS_EPOLL_H_
#define COSMOPOLITAN_LIBC_SYSV_CONSTS_EPOLL_H_
#include "libc/runtime/symbolic.h"
#include "libc/sysv/consts/o.h"
#if !(__ASSEMBLER__ + __LINKER__ + 0)
COSMOPOLITAN_C_START_
@ -27,29 +26,28 @@ extern const uint32_t EPOLLWAKEUP;
extern const uint32_t EPOLLONESHOT;
extern const uint32_t EPOLLET;
COSMOPOLITAN_C_END_
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
#define EPOLL_CLOEXEC O_CLOEXEC
#define EPOLL_CTL_ADD LITERALLY(1)
#define EPOLL_CTL_DEL LITERALLY(2)
#define EPOLL_CTL_MOD LITERALLY(3)
#define EPOLL_CTL_ADD 1
#define EPOLL_CTL_DEL 2
#define EPOLL_CTL_MOD 3
#define EPOLLIN LITERALLY(1)
#define EPOLLPRI LITERALLY(2)
#define EPOLLOUT LITERALLY(4)
#define EPOLLERR LITERALLY(8)
#define EPOLLHUP LITERALLY(0x10)
#define EPOLLRDNORM LITERALLY(0x40)
#define EPOLLRDBAND LITERALLY(0x80)
#define EPOLLWRNORM LITERALLY(0x0100)
#define EPOLLWRBAND LITERALLY(0x0200)
#define EPOLLMSG LITERALLY(0x0400)
#define EPOLLRDHUP LITERALLY(0x2000)
#define EPOLLEXCLUSIVE LITERALLY(0x10000000)
#define EPOLLWAKEUP LITERALLY(0x20000000)
#define EPOLLONESHOT LITERALLY(0x40000000)
#define EPOLLET LITERALLY(0x80000000)
#define EPOLLIN 1
#define EPOLLPRI 2
#define EPOLLOUT 4
#define EPOLLERR 8
#define EPOLLHUP 0x10
#define EPOLLRDNORM 0x40
#define EPOLLRDBAND 0x80
#define EPOLLWRNORM 0x0100
#define EPOLLWRBAND 0x0200
#define EPOLLMSG 0x0400
#define EPOLLRDHUP 0x2000
#define EPOLLEXCLUSIVE 0x10000000
#define EPOLLWAKEUP 0x20000000
#define EPOLLONESHOT 0x40000000
#define EPOLLET 0x80000000
COSMOPOLITAN_C_END_
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
#endif /* COSMOPOLITAN_LIBC_SYSV_CONSTS_EPOLL_H_ */

View file

@ -1,6 +1,5 @@
#ifndef COSMOPOLITAN_LIBC_SYSV_CONSTS_F_H_
#define COSMOPOLITAN_LIBC_SYSV_CONSTS_F_H_
#include "libc/runtime/symbolic.h"
#if !(__ASSEMBLER__ + __LINKER__ + 0)
COSMOPOLITAN_C_START_
@ -43,42 +42,56 @@ extern const int F_WRLCK;
COSMOPOLITAN_C_END_
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
#define F_DUPFD LITERALLY(0)
#define F_GETFD LITERALLY(1)
#define F_SETFD LITERALLY(2)
#define F_GETFL LITERALLY(3)
#define F_SETFL LITERALLY(4)
#define F_DUPFD 0
#define F_GETFD 1
#define F_SETFD 2
#define F_GETFL 3
#define F_SETFL 4
#define F_DUPFD_CLOEXEC SYMBOLIC(F_DUPFD_CLOEXEC)
#define F_GETLEASE SYMBOLIC(F_GETLEASE)
#define F_GETLK SYMBOLIC(F_GETLK)
#define F_GETLK64 SYMBOLIC(F_GETLK64)
#define F_GETOWN SYMBOLIC(F_GETOWN)
#define F_GETPATH SYMBOLIC(F_GETPATH)
#define F_GETPIPE_SZ SYMBOLIC(F_GETPIPE_SZ)
#define F_GETSIG SYMBOLIC(F_GETSIG)
#define F_MAXFD SYMBOLIC(F_MAXFD)
#define F_NOCACHE SYMBOLIC(F_NOCACHE)
#define F_NOTIFY SYMBOLIC(F_NOTIFY)
#define F_RDLCK SYMBOLIC(F_RDLCK)
#define F_SETLEASE SYMBOLIC(F_SETLEASE)
#define F_SETLK SYMBOLIC(F_SETLK)
#define F_SETLK64 SYMBOLIC(F_SETLK64)
#define F_SETLKW SYMBOLIC(F_SETLKW)
#define F_SETLKW64 SYMBOLIC(F_SETLKW64)
#define F_SETOWN SYMBOLIC(F_SETOWN)
#define F_SETPIPE_SZ SYMBOLIC(F_SETPIPE_SZ)
#define F_SETSIG SYMBOLIC(F_SETSIG)
#define F_UNLCK SYMBOLIC(F_UNLCK)
#define F_WRLCK SYMBOLIC(F_WRLCK)
#define F_DUPFD_CLOEXEC F_DUPFD_CLOEXEC
#define F_GETLEASE F_GETLEASE
#define F_GETLK F_GETLK
#define F_GETLK64 F_GETLK64
#define F_GETOWN F_GETOWN
#define F_GETPATH F_GETPATH
#define F_GETPIPE_SZ F_GETPIPE_SZ
#define F_GETSIG F_GETSIG
#define F_MAXFD F_MAXFD
#define F_NOCACHE F_NOCACHE
#define F_NOTIFY F_NOTIFY
#define F_RDLCK F_RDLCK
#define F_SETLEASE F_SETLEASE
#define F_SETLK F_SETLK
#define F_SETLK64 F_SETLK64
#define F_SETLKW F_SETLKW
#define F_SETLKW64 F_SETLKW64
#define F_SETOWN F_SETOWN
#define F_SETPIPE_SZ F_SETPIPE_SZ
#define F_SETSIG F_SETSIG
#define F_UNLCK F_UNLCK
#define F_WRLCK F_WRLCK
/* avoid leading #ifdef configurations astray */
/* #define F_FULLFSYNC SYMBOLIC(F_FULLFSYNC) */
/* #define F_BARRIERFSYNC SYMBOLIC(F_BARRIERFSYNC) */
/* #define F_OFD_GETLK SYMBOLIC(F_OFD_GETLK) */
/* #define F_OFD_SETLK SYMBOLIC(F_OFD_SETLK) */
/* #define F_OFD_SETLKW SYMBOLIC(F_OFD_SETLKW) */
/* #define F_SETNOSIGPIPE SYMBOLIC(F_SETNOSIGPIPE) */
/* #define F_GETNOSIGPIPE SYMBOLIC(F_GETNOSIGPIPE) */
#define __tmpcosmo_F_DUPFD_CLOEXEC -15823938
#define __tmpcosmo_F_GETLEASE -15823862
#define __tmpcosmo_F_GETLK -15823916
#define __tmpcosmo_F_GETLK64 -15823846
#define __tmpcosmo_F_GETOWN -15824116
#define __tmpcosmo_F_GETPATH -15824128
#define __tmpcosmo_F_GETPIPE_SZ -15824006
#define __tmpcosmo_F_GETSIG -15824112
#define __tmpcosmo_F_MAXFD -15823896
#define __tmpcosmo_F_NOCACHE -15824048
#define __tmpcosmo_F_NOTIFY -15823898
#define __tmpcosmo_F_RDLCK -15823826
#define __tmpcosmo_F_SETLEASE -15823884
#define __tmpcosmo_F_SETLK -15824088
#define __tmpcosmo_F_SETLK64 -15824154
#define __tmpcosmo_F_SETLKW -15824096
#define __tmpcosmo_F_SETLKW64 -15824104
#define __tmpcosmo_F_SETOWN -15823874
#define __tmpcosmo_F_SETPIPE_SZ -15823958
#define __tmpcosmo_F_SETSIG -15823832
#define __tmpcosmo_F_UNLCK -15824148
#define __tmpcosmo_F_WRLCK -15824058
#endif /* COSMOPOLITAN_LIBC_SYSV_CONSTS_F_H_ */

View file

@ -1,6 +1,5 @@
#ifndef COSMOPOLITAN_LIBC_SYSV_CONSTS_FALLOC_H_
#define COSMOPOLITAN_LIBC_SYSV_CONSTS_FALLOC_H_
#include "libc/runtime/symbolic.h"
#if !(__ASSEMBLER__ + __LINKER__ + 0)
COSMOPOLITAN_C_START_
@ -14,13 +13,4 @@ extern const int FALLOC_FL_UNSHARE_RANGE;
COSMOPOLITAN_C_END_
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
#define FALLOC_FL_KEEP_SIZE SYMBOLIC(FALLOC_FL_KEEP_SIZE)
#define FALLOC_FL_PUNCH_HOLE SYMBOLIC(FALLOC_FL_PUNCH_HOLE)
#define FALLOC_FL_NO_HIDE_STALE SYMBOLIC(FALLOC_FL_NO_HIDE_STALE)
#define FALLOC_FL_COLLAPSE_RANGE SYMBOLIC(FALLOC_FL_COLLAPSE_RANGE)
#define FALLOC_FL_ZERO_RANGE SYMBOLIC(FALLOC_FL_ZERO_RANGE)
#define FALLOC_FL_INSERT_RANGE SYMBOLIC(FALLOC_FL_INSERT_RANGE)
#define FALLOC_FL_UNSHARE_RANGE SYMBOLIC(FALLOC_FL_UNSHARE_RANGE)
#endif /* COSMOPOLITAN_LIBC_SYSV_CONSTS_FALLOC_H_ */

View file

@ -1,6 +1,5 @@
#ifndef COSMOPOLITAN_LIBC_SYSV_CONSTS_FB_H_
#define COSMOPOLITAN_LIBC_SYSV_CONSTS_FB_H_
#include "libc/runtime/symbolic.h"
#if !(__ASSEMBLER__ + __LINKER__ + 0)
COSMOPOLITAN_C_START_
@ -14,13 +13,4 @@ extern const uint64_t FBIO_WAITFORVSYNC;
COSMOPOLITAN_C_END_
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
#define FBIOGET_VSCREENINFO SYMBOLIC(FBIOGET_VSCREENINFO)
#define FBIOPUT_VSCREENINFO SYMBOLIC(FBIOPUT_VSCREENINFO)
#define FBIOGET_FSCREENINFO SYMBOLIC(FBIOGET_FSCREENINFO)
#define FBIOGETCMAP SYMBOLIC(FBIOGETCMAP)
#define FBIOPUTCMAP SYMBOLIC(FBIOPUTCMAP)
#define FBIOPAN_DISPLAY SYMBOLIC(FBIOPAN_DISPLAY)
#define FBIO_WAITFORVSYNC SYMBOLIC(FBIO_WAITFORVSYNC)
#endif /* COSMOPOLITAN_LIBC_SYSV_CONSTS_FB_H_ */

View file

@ -1,14 +1,12 @@
#ifndef COSMOPOLITAN_LIBC_SYSV_CONSTS_FD_H_
#define COSMOPOLITAN_LIBC_SYSV_CONSTS_FD_H_
#include "libc/runtime/symbolic.h"
#if !(__ASSEMBLER__ + __LINKER__ + 0)
COSMOPOLITAN_C_START_
extern const int FD_CLOEXEC;
#define FD_CLOEXEC 1
COSMOPOLITAN_C_END_
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
#define FD_CLOEXEC LITERALLY(1)
#endif /* COSMOPOLITAN_LIBC_SYSV_CONSTS_FD_H_ */

View file

@ -1,9 +1,8 @@
#ifndef COSMOPOLITAN_LIBC_SYSV_CONSTS_FILENO_H_
#define COSMOPOLITAN_LIBC_SYSV_CONSTS_FILENO_H_
#include "libc/runtime/symbolic.h"
#define STDIN_FILENO LITERALLY(0)
#define STDOUT_FILENO LITERALLY(1)
#define STDERR_FILENO LITERALLY(2)
#define STDIN_FILENO 0
#define STDOUT_FILENO 1
#define STDERR_FILENO 2
#endif /* COSMOPOLITAN_LIBC_SYSV_CONSTS_FILENO_H_ */

View file

@ -1,6 +1,5 @@
#ifndef COSMOPOLITAN_LIBC_SYSV_CONSTS_FIO_H_
#define COSMOPOLITAN_LIBC_SYSV_CONSTS_FIO_H_
#include "libc/runtime/symbolic.h"
#if !(__ASSEMBLER__ + __LINKER__ + 0)
COSMOPOLITAN_C_START_
@ -13,10 +12,10 @@ extern const uint32_t FIONREAD;
COSMOPOLITAN_C_END_
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
#define FIOASYNC SYMBOLIC(FIOASYNC)
#define FIOCLEX SYMBOLIC(FIOCLEX)
#define FIONBIO SYMBOLIC(FIONBIO)
#define FIONCLEX SYMBOLIC(FIONCLEX)
#define FIONREAD SYMBOLIC(FIONREAD)
#define FIOASYNC FIOASYNC
#define FIOCLEX FIOCLEX
#define FIONBIO FIONBIO
#define FIONCLEX FIONCLEX
#define FIONREAD FIONREAD
#endif /* COSMOPOLITAN_LIBC_SYSV_CONSTS_FIO_H_ */

View file

@ -1,10 +1,16 @@
#ifndef COSMOPOLITAN_LIBC_SYSV_CONSTS_FUTEX_H_
#define COSMOPOLITAN_LIBC_SYSV_CONSTS_FUTEX_H_
#include "libc/runtime/symbolic.h"
#ifdef COSMO
#if !(__ASSEMBLER__ + __LINKER__ + 0)
COSMOPOLITAN_C_START_
#define FUTEX_WAIT SYMBOLIC(FUTEX_WAIT)
#define FUTEX_WAKE SYMBOLIC(FUTEX_WAKE)
#define FUTEX_REQUEUE SYMBOLIC(FUTEX_REQUEUE)
extern const int FUTEX_WAIT;
extern const int FUTEX_WAKE;
extern const int FUTEX_REQUEUE;
#define FUTEX_WAIT FUTEX_WAIT
#define FUTEX_WAKE FUTEX_WAKE
#define FUTEX_REQUEUE FUTEX_REQUEUE
#define FUTEX_PRIVATE_FLAG 128
#define FUTEX_WAIT_PRIVATE (FUTEX_WAIT | FUTEX_PRIVATE_FLAG)
@ -15,13 +21,7 @@
#define FUTEX_CLOCK_REALTIME 256
#define FUTEX_BITSET_MATCH_ANY 0xffffffff
#if !(__ASSEMBLER__ + __LINKER__ + 0)
COSMOPOLITAN_C_START_
extern const int FUTEX_WAIT;
extern const int FUTEX_WAKE;
extern const int FUTEX_REQUEUE;
COSMOPOLITAN_C_END_
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
#endif /* COSMO */
#endif /* COSMOPOLITAN_LIBC_SYSV_CONSTS_FUTEX_H_ */

View file

@ -1,6 +1,5 @@
#ifndef COSMOPOLITAN_LIBC_SYSV_CONSTS_GRND_H_
#define COSMOPOLITAN_LIBC_SYSV_CONSTS_GRND_H_
#include "libc/runtime/symbolic.h"
#define GRND_NONBLOCK 1
#define GRND_RANDOM 2

View file

@ -1,40 +1,39 @@
#ifndef COSMOPOLITAN_LIBC_SYSV_CONSTS_ICMP6_H_
#define COSMOPOLITAN_LIBC_SYSV_CONSTS_ICMP6_H_
#include "libc/runtime/symbolic.h"
#define ICMP6_DST_UNREACH SYMBOLIC(ICMP6_DST_UNREACH)
#define ICMP6_DST_UNREACH_ADDR SYMBOLIC(ICMP6_DST_UNREACH_ADDR)
#define ICMP6_DST_UNREACH_ADMIN SYMBOLIC(ICMP6_DST_UNREACH_ADMIN)
#define ICMP6_DST_UNREACH_BEYONDSCOPE SYMBOLIC(ICMP6_DST_UNREACH_BEYONDSCOPE)
#define ICMP6_DST_UNREACH_NOPORT SYMBOLIC(ICMP6_DST_UNREACH_NOPORT)
#define ICMP6_DST_UNREACH_NOROUTE SYMBOLIC(ICMP6_DST_UNREACH_NOROUTE)
#define ICMP6_ECHO_REPLY SYMBOLIC(ICMP6_ECHO_REPLY)
#define ICMP6_ECHO_REQUEST SYMBOLIC(ICMP6_ECHO_REQUEST)
#define ICMP6_FILTER SYMBOLIC(ICMP6_FILTER)
#define ICMP6_INFOMSG_MASK SYMBOLIC(ICMP6_INFOMSG_MASK)
#define ICMP6_PACKET_TOO_BIG SYMBOLIC(ICMP6_PACKET_TOO_BIG)
#define ICMP6_PARAMPROB_HEADER SYMBOLIC(ICMP6_PARAMPROB_HEADER)
#define ICMP6_PARAMPROB_NEXTHEADER SYMBOLIC(ICMP6_PARAMPROB_NEXTHEADER)
#define ICMP6_PARAMPROB_OPTION SYMBOLIC(ICMP6_PARAMPROB_OPTION)
#define ICMP6_PARAM_PROB SYMBOLIC(ICMP6_PARAM_PROB)
#define ICMP6_ROUTER_RENUMBERING SYMBOLIC(ICMP6_ROUTER_RENUMBERING)
#define ICMP6_RR_FLAGS_FORCEAPPLY SYMBOLIC(ICMP6_RR_FLAGS_FORCEAPPLY)
#define ICMP6_RR_FLAGS_PREVDONE SYMBOLIC(ICMP6_RR_FLAGS_PREVDONE)
#define ICMP6_RR_FLAGS_REQRESULT SYMBOLIC(ICMP6_RR_FLAGS_REQRESULT)
#define ICMP6_RR_FLAGS_SPECSITE SYMBOLIC(ICMP6_RR_FLAGS_SPECSITE)
#define ICMP6_RR_FLAGS_TEST SYMBOLIC(ICMP6_RR_FLAGS_TEST)
#define ICMP6_DST_UNREACH ICMP6_DST_UNREACH
#define ICMP6_DST_UNREACH_ADDR ICMP6_DST_UNREACH_ADDR
#define ICMP6_DST_UNREACH_ADMIN ICMP6_DST_UNREACH_ADMIN
#define ICMP6_DST_UNREACH_BEYONDSCOPE ICMP6_DST_UNREACH_BEYONDSCOPE
#define ICMP6_DST_UNREACH_NOPORT ICMP6_DST_UNREACH_NOPORT
#define ICMP6_DST_UNREACH_NOROUTE ICMP6_DST_UNREACH_NOROUTE
#define ICMP6_ECHO_REPLY ICMP6_ECHO_REPLY
#define ICMP6_ECHO_REQUEST ICMP6_ECHO_REQUEST
#define ICMP6_FILTER ICMP6_FILTER
#define ICMP6_INFOMSG_MASK ICMP6_INFOMSG_MASK
#define ICMP6_PACKET_TOO_BIG ICMP6_PACKET_TOO_BIG
#define ICMP6_PARAMPROB_HEADER ICMP6_PARAMPROB_HEADER
#define ICMP6_PARAMPROB_NEXTHEADER ICMP6_PARAMPROB_NEXTHEADER
#define ICMP6_PARAMPROB_OPTION ICMP6_PARAMPROB_OPTION
#define ICMP6_PARAM_PROB ICMP6_PARAM_PROB
#define ICMP6_ROUTER_RENUMBERING ICMP6_ROUTER_RENUMBERING
#define ICMP6_RR_FLAGS_FORCEAPPLY ICMP6_RR_FLAGS_FORCEAPPLY
#define ICMP6_RR_FLAGS_PREVDONE ICMP6_RR_FLAGS_PREVDONE
#define ICMP6_RR_FLAGS_REQRESULT ICMP6_RR_FLAGS_REQRESULT
#define ICMP6_RR_FLAGS_SPECSITE ICMP6_RR_FLAGS_SPECSITE
#define ICMP6_RR_FLAGS_TEST ICMP6_RR_FLAGS_TEST
#define ICMP6_RR_PCOUSE_FLAGS_DECRPLTIME \
SYMBOLIC(ICMP6_RR_PCOUSE_FLAGS_DECRPLTIME)
ICMP6_RR_PCOUSE_FLAGS_DECRPLTIME
#define ICMP6_RR_PCOUSE_FLAGS_DECRVLTIME \
SYMBOLIC(ICMP6_RR_PCOUSE_FLAGS_DECRVLTIME)
#define ICMP6_RR_PCOUSE_RAFLAGS_AUTO SYMBOLIC(ICMP6_RR_PCOUSE_RAFLAGS_AUTO)
#define ICMP6_RR_PCOUSE_RAFLAGS_ONLINK SYMBOLIC(ICMP6_RR_PCOUSE_RAFLAGS_ONLINK)
ICMP6_RR_PCOUSE_FLAGS_DECRVLTIME
#define ICMP6_RR_PCOUSE_RAFLAGS_AUTO ICMP6_RR_PCOUSE_RAFLAGS_AUTO
#define ICMP6_RR_PCOUSE_RAFLAGS_ONLINK ICMP6_RR_PCOUSE_RAFLAGS_ONLINK
#define ICMP6_RR_RESULT_FLAGS_FORBIDDEN \
SYMBOLIC(ICMP6_RR_RESULT_FLAGS_FORBIDDEN)
#define ICMP6_RR_RESULT_FLAGS_OOB SYMBOLIC(ICMP6_RR_RESULT_FLAGS_OOB)
#define ICMP6_TIME_EXCEEDED SYMBOLIC(ICMP6_TIME_EXCEEDED)
#define ICMP6_TIME_EXCEED_REASSEMBLY SYMBOLIC(ICMP6_TIME_EXCEED_REASSEMBLY)
#define ICMP6_TIME_EXCEED_TRANSIT SYMBOLIC(ICMP6_TIME_EXCEED_TRANSIT)
ICMP6_RR_RESULT_FLAGS_FORBIDDEN
#define ICMP6_RR_RESULT_FLAGS_OOB ICMP6_RR_RESULT_FLAGS_OOB
#define ICMP6_TIME_EXCEEDED ICMP6_TIME_EXCEEDED
#define ICMP6_TIME_EXCEED_REASSEMBLY ICMP6_TIME_EXCEED_REASSEMBLY
#define ICMP6_TIME_EXCEED_TRANSIT ICMP6_TIME_EXCEED_TRANSIT
#if !(__ASSEMBLER__ + __LINKER__ + 0)
COSMOPOLITAN_C_START_

View file

@ -40,4 +40,17 @@ COSMOPOLITAN_C_END_
#define IFF_RUNNING IFF_RUNNING
#define IFF_SLAVE IFF_SLAVE
#define __tmpcosmo_IFF_ALLMULTI -15824140
#define __tmpcosmo_IFF_AUTOMEDIA -15823962
#define __tmpcosmo_IFF_DYNAMIC -15823848
#define __tmpcosmo_IFF_MASTER -15823900
#define __tmpcosmo_IFF_MULTICAST -15824000
#define __tmpcosmo_IFF_NOARP -15823802
#define __tmpcosmo_IFF_NOTRAILERS -15824130
#define __tmpcosmo_IFF_POINTOPOINT -15824138
#define __tmpcosmo_IFF_PORTSEL -15824150
#define __tmpcosmo_IFF_PROMISC -15824010
#define __tmpcosmo_IFF_RUNNING -15824080
#define __tmpcosmo_IFF_SLAVE -15824022
#endif /* COSMOPOLITAN_LIBC_SYSV_CONSTS_IFF_H_ */

View file

@ -1,6 +1,5 @@
#ifndef COSMOPOLITAN_LIBC_SYSV_CONSTS_IOV_H_
#define COSMOPOLITAN_LIBC_SYSV_CONSTS_IOV_H_
#include "libc/runtime/symbolic.h"
#if !(__ASSEMBLER__ + __LINKER__ + 0)
COSMOPOLITAN_C_START_
@ -9,6 +8,6 @@ extern const int IOV_MAX;
COSMOPOLITAN_C_END_
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
#define IOV_MAX SYMBOLIC(IOV_MAX)
#define IOV_MAX IOV_MAX
#endif /* COSMOPOLITAN_LIBC_SYSV_CONSTS_IOV_H_ */

View file

@ -1,57 +1,5 @@
#ifndef COSMOPOLITAN_LIBC_SYSV_CONSTS_IP_H_
#define COSMOPOLITAN_LIBC_SYSV_CONSTS_IP_H_
#include "libc/runtime/symbolic.h"
#define IP_ADD_MEMBERSHIP SYMBOLIC(IP_ADD_MEMBERSHIP)
#define IP_ADD_SOURCE_MEMBERSHIP SYMBOLIC(IP_ADD_SOURCE_MEMBERSHIP)
#define IP_BIND_ADDRESS_NO_PORT SYMBOLIC(IP_BIND_ADDRESS_NO_PORT)
#define IP_BLOCK_SOURCE SYMBOLIC(IP_BLOCK_SOURCE)
#define IP_CHECKSUM SYMBOLIC(IP_CHECKSUM)
#define IP_DEFAULT_MULTICAST_LOOP SYMBOLIC(IP_DEFAULT_MULTICAST_LOOP)
#define IP_DEFAULT_MULTICAST_TTL SYMBOLIC(IP_DEFAULT_MULTICAST_TTL)
#define IP_DROP_MEMBERSHIP SYMBOLIC(IP_DROP_MEMBERSHIP)
#define IP_DROP_SOURCE_MEMBERSHIP SYMBOLIC(IP_DROP_SOURCE_MEMBERSHIP)
#define IP_FREEBIND SYMBOLIC(IP_FREEBIND)
#define IP_HDRINCL SYMBOLIC(IP_HDRINCL)
#define IP_IPSEC_POLICY SYMBOLIC(IP_IPSEC_POLICY)
#define IP_MAX_MEMBERSHIPS SYMBOLIC(IP_MAX_MEMBERSHIPS)
#define IP_MINTTL SYMBOLIC(IP_MINTTL)
#define IP_MSFILTER SYMBOLIC(IP_MSFILTER)
#define IP_MTU SYMBOLIC(IP_MTU)
#define IP_MTU_DISCOVER SYMBOLIC(IP_MTU_DISCOVER)
#define IP_MULTICAST_ALL SYMBOLIC(IP_MULTICAST_ALL)
#define IP_MULTICAST_IF SYMBOLIC(IP_MULTICAST_IF)
#define IP_MULTICAST_LOOP SYMBOLIC(IP_MULTICAST_LOOP)
#define IP_MULTICAST_TTL SYMBOLIC(IP_MULTICAST_TTL)
#define IP_NODEFRAG SYMBOLIC(IP_NODEFRAG)
#define IP_OPTIONS SYMBOLIC(IP_OPTIONS)
#define IP_ORIGDSTADDR SYMBOLIC(IP_ORIGDSTADDR)
#define IP_PASSSEC SYMBOLIC(IP_PASSSEC)
#define IP_PKTINFO SYMBOLIC(IP_PKTINFO)
#define IP_PKTOPTIONS SYMBOLIC(IP_PKTOPTIONS)
#define IP_PMTUDISC SYMBOLIC(IP_PMTUDISC)
#define IP_PMTUDISC_DO SYMBOLIC(IP_PMTUDISC_DO)
#define IP_PMTUDISC_DONT SYMBOLIC(IP_PMTUDISC_DONT)
#define IP_PMTUDISC_INTERFACE SYMBOLIC(IP_PMTUDISC_INTERFACE)
#define IP_PMTUDISC_OMIT SYMBOLIC(IP_PMTUDISC_OMIT)
#define IP_PMTUDISC_PROBE SYMBOLIC(IP_PMTUDISC_PROBE)
#define IP_PMTUDISC_WANT SYMBOLIC(IP_PMTUDISC_WANT)
#define IP_RECVDSTADDR SYMBOLIC(IP_RECVDSTADDR)
#define IP_RECVERR SYMBOLIC(IP_RECVERR)
#define IP_RECVOPTS SYMBOLIC(IP_RECVOPTS)
#define IP_RECVORIGDSTADDR SYMBOLIC(IP_RECVORIGDSTADDR)
#define IP_RECVRETOPTS SYMBOLIC(IP_RECVRETOPTS)
#define IP_RECVTOS SYMBOLIC(IP_RECVTOS)
#define IP_RECVTTL SYMBOLIC(IP_RECVTTL)
#define IP_RETOPTS SYMBOLIC(IP_RETOPTS)
#define IP_ROUTER_ALERT SYMBOLIC(IP_ROUTER_ALERT)
#define IP_TOS SYMBOLIC(IP_TOS)
#define IP_TRANSPARENT SYMBOLIC(IP_TRANSPARENT)
#define IP_TTL SYMBOLIC(IP_TTL)
#define IP_UNBLOCK_SOURCE SYMBOLIC(IP_UNBLOCK_SOURCE)
#define IP_UNICAST_IF SYMBOLIC(IP_UNICAST_IF)
#define IP_XFRM_POLICY SYMBOLIC(IP_XFRM_POLICY)
#if !(__ASSEMBLER__ + __LINKER__ + 0)
COSMOPOLITAN_C_START_
@ -105,6 +53,106 @@ extern const int IP_UNBLOCK_SOURCE;
extern const int IP_UNICAST_IF;
extern const int IP_XFRM_POLICY;
#define IP_ADD_MEMBERSHIP IP_ADD_MEMBERSHIP
#define IP_ADD_SOURCE_MEMBERSHIP IP_ADD_SOURCE_MEMBERSHIP
#define IP_BIND_ADDRESS_NO_PORT IP_BIND_ADDRESS_NO_PORT
#define IP_BLOCK_SOURCE IP_BLOCK_SOURCE
#define IP_CHECKSUM IP_CHECKSUM
#define IP_DEFAULT_MULTICAST_LOOP IP_DEFAULT_MULTICAST_LOOP
#define IP_DEFAULT_MULTICAST_TTL IP_DEFAULT_MULTICAST_TTL
#define IP_DROP_MEMBERSHIP IP_DROP_MEMBERSHIP
#define IP_DROP_SOURCE_MEMBERSHIP IP_DROP_SOURCE_MEMBERSHIP
#define IP_FREEBIND IP_FREEBIND
#define IP_HDRINCL IP_HDRINCL
#define IP_IPSEC_POLICY IP_IPSEC_POLICY
#define IP_MAX_MEMBERSHIPS IP_MAX_MEMBERSHIPS
#define IP_MINTTL IP_MINTTL
#define IP_MSFILTER IP_MSFILTER
#define IP_MTU IP_MTU
#define IP_MTU_DISCOVER IP_MTU_DISCOVER
#define IP_MULTICAST_ALL IP_MULTICAST_ALL
#define IP_MULTICAST_IF IP_MULTICAST_IF
#define IP_MULTICAST_LOOP IP_MULTICAST_LOOP
#define IP_MULTICAST_TTL IP_MULTICAST_TTL
#define IP_NODEFRAG IP_NODEFRAG
#define IP_OPTIONS IP_OPTIONS
#define IP_ORIGDSTADDR IP_ORIGDSTADDR
#define IP_PASSSEC IP_PASSSEC
#define IP_PKTINFO IP_PKTINFO
#define IP_PKTOPTIONS IP_PKTOPTIONS
#define IP_PMTUDISC IP_PMTUDISC
#define IP_PMTUDISC_DO IP_PMTUDISC_DO
#define IP_PMTUDISC_DONT IP_PMTUDISC_DONT
#define IP_PMTUDISC_INTERFACE IP_PMTUDISC_INTERFACE
#define IP_PMTUDISC_OMIT IP_PMTUDISC_OMIT
#define IP_PMTUDISC_PROBE IP_PMTUDISC_PROBE
#define IP_PMTUDISC_WANT IP_PMTUDISC_WANT
#define IP_RECVDSTADDR IP_RECVDSTADDR
#define IP_RECVERR IP_RECVERR
#define IP_RECVOPTS IP_RECVOPTS
#define IP_RECVORIGDSTADDR IP_RECVORIGDSTADDR
#define IP_RECVRETOPTS IP_RECVRETOPTS
#define IP_RECVTOS IP_RECVTOS
#define IP_RECVTTL IP_RECVTTL
#define IP_RETOPTS IP_RETOPTS
#define IP_ROUTER_ALERT IP_ROUTER_ALERT
#define IP_TOS IP_TOS
#define IP_TRANSPARENT IP_TRANSPARENT
#define IP_TTL IP_TTL
#define IP_UNBLOCK_SOURCE IP_UNBLOCK_SOURCE
#define IP_UNICAST_IF IP_UNICAST_IF
#define IP_XFRM_POLICY IP_XFRM_POLICY
#define __tmpcosmo_IP_ADD_MEMBERSHIP -1321562193
#define __tmpcosmo_IP_ADD_SOURCE_MEMBERSHIP -105214734
#define __tmpcosmo_IP_BIND_ADDRESS_NO_PORT 1524082293
#define __tmpcosmo_IP_BLOCK_SOURCE -197478650
#define __tmpcosmo_IP_CHECKSUM 1604855002
#define __tmpcosmo_IP_DEFAULT_MULTICAST_LOOP 1845412306
#define __tmpcosmo_IP_DEFAULT_MULTICAST_TTL 78428386
#define __tmpcosmo_IP_DROP_MEMBERSHIP -1095356696
#define __tmpcosmo_IP_DROP_SOURCE_MEMBERSHIP 1161532229
#define __tmpcosmo_IP_FREEBIND -492780725
#define __tmpcosmo_IP_HDRINCL -578403232
#define __tmpcosmo_IP_IPSEC_POLICY -1171119592
#define __tmpcosmo_IP_MAX_MEMBERSHIPS -758085748
#define __tmpcosmo_IP_MINTTL 53022500
#define __tmpcosmo_IP_MSFILTER -791684253
#define __tmpcosmo_IP_MTU -379904604
#define __tmpcosmo_IP_MTU_DISCOVER 1351700838
#define __tmpcosmo_IP_MULTICAST_ALL -28373322
#define __tmpcosmo_IP_MULTICAST_IF 327169407
#define __tmpcosmo_IP_MULTICAST_LOOP -2016601761
#define __tmpcosmo_IP_MULTICAST_TTL 60677445
#define __tmpcosmo_IP_NODEFRAG -1549326603
#define __tmpcosmo_IP_OPTIONS 1075977940
#define __tmpcosmo_IP_ORIGDSTADDR 773066970
#define __tmpcosmo_IP_PASSSEC 904572014
#define __tmpcosmo_IP_PKTINFO -1059188119
#define __tmpcosmo_IP_PKTOPTIONS -1589901127
#define __tmpcosmo_IP_PMTUDISC -41501151
#define __tmpcosmo_IP_PMTUDISC_DO 1915857897
#define __tmpcosmo_IP_PMTUDISC_DONT 1947820643
#define __tmpcosmo_IP_PMTUDISC_INTERFACE -1353197859
#define __tmpcosmo_IP_PMTUDISC_OMIT -900368620
#define __tmpcosmo_IP_PMTUDISC_PROBE 28801554
#define __tmpcosmo_IP_PMTUDISC_WANT -565258238
#define __tmpcosmo_IP_RECVDSTADDR -889890721
#define __tmpcosmo_IP_RECVERR -1654149047
#define __tmpcosmo_IP_RECVOPTS 1261356589
#define __tmpcosmo_IP_RECVORIGDSTADDR 1699400438
#define __tmpcosmo_IP_RECVRETOPTS 919008264
#define __tmpcosmo_IP_RECVTOS 453403469
#define __tmpcosmo_IP_RECVTTL 737320736
#define __tmpcosmo_IP_RETOPTS 1069898501
#define __tmpcosmo_IP_ROUTER_ALERT 1014101924
#define __tmpcosmo_IP_TOS -4973360
#define __tmpcosmo_IP_TRANSPARENT 579002269
#define __tmpcosmo_IP_TTL 2114723474
#define __tmpcosmo_IP_UNBLOCK_SOURCE 82069799
#define __tmpcosmo_IP_UNICAST_IF -1900602318
#define __tmpcosmo_IP_XFRM_POLICY 1051426490
COSMOPOLITAN_C_END_
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
#endif /* COSMOPOLITAN_LIBC_SYSV_CONSTS_IP_H_ */

View file

@ -1,6 +1,5 @@
#ifndef COSMOPOLITAN_LIBC_SYSV_CONSTS_IPPORT_H_
#define COSMOPOLITAN_LIBC_SYSV_CONSTS_IPPORT_H_
#include "libc/runtime/symbolic.h"
/**
* ARPA network ports.
@ -30,7 +29,7 @@
#define IPPORT_WHOSERVER 513
#define IPPORT_ROUTESERVER 520
#define IPPORT_RESERVED 1024
#define IPPORT_USERRESERVED SYMBOLIC(IPPORT_USERRESERVED)
#define IPPORT_USERRESERVED IPPORT_USERRESERVED
/**
* Modern network ports.

View file

@ -1,6 +1,5 @@
#ifndef COSMOPOLITAN_LIBC_SYSV_CONSTS_IPPROTO_H_
#define COSMOPOLITAN_LIBC_SYSV_CONSTS_IPPROTO_H_
#include "libc/runtime/symbolic.h"
#if !(__ASSEMBLER__ + __LINKER__ + 0)
COSMOPOLITAN_C_START_
@ -38,42 +37,69 @@ extern const int IPPROTO_TP;
extern const int IPPROTO_UDP;
extern const int IPPROTO_UDPLITE;
#define IPPROTO_IP 0
#define IPPROTO_ICMP 1
#define IPPROTO_TCP 6
#define IPPROTO_UDP 17
#define IPPROTO_RAW 255
#define IPPROTO_MAX 263 /* xxx */
#define IPPROTO_AH IPPROTO_AH
#define IPPROTO_BEETPH IPPROTO_BEETPH
#define IPPROTO_COMP IPPROTO_COMP
#define IPPROTO_DCCP IPPROTO_DCCP
#define IPPROTO_DSTOPTS IPPROTO_DSTOPTS
#define IPPROTO_EGP IPPROTO_EGP
#define IPPROTO_ENCAP IPPROTO_ENCAP
#define IPPROTO_ESP IPPROTO_ESP
#define IPPROTO_FRAGMENT IPPROTO_FRAGMENT
#define IPPROTO_GRE IPPROTO_GRE
#define IPPROTO_HOPOPTS IPPROTO_HOPOPTS
#define IPPROTO_ICMPV6 IPPROTO_ICMPV6
#define IPPROTO_IDP IPPROTO_IDP
#define IPPROTO_IGMP IPPROTO_IGMP
#define IPPROTO_IPIP IPPROTO_IPIP
#define IPPROTO_IPV6 IPPROTO_IPV6
#define IPPROTO_MH IPPROTO_MH
#define IPPROTO_MPLS IPPROTO_MPLS
#define IPPROTO_MTP IPPROTO_MTP
#define IPPROTO_NONE IPPROTO_NONE
#define IPPROTO_PIM IPPROTO_PIM
#define IPPROTO_PUP IPPROTO_PUP
#define IPPROTO_ROUTING IPPROTO_ROUTING
#define IPPROTO_RSVP IPPROTO_RSVP
#define IPPROTO_SCTP IPPROTO_SCTP
#define IPPROTO_TP IPPROTO_TP
#define IPPROTO_UDPLITE IPPROTO_UDPLITE
#define __tmpcosmo_IPPROTO_AH -1870674383
#define __tmpcosmo_IPPROTO_BEETPH -88002196
#define __tmpcosmo_IPPROTO_COMP -1180207155
#define __tmpcosmo_IPPROTO_DCCP -1414939404
#define __tmpcosmo_IPPROTO_DSTOPTS -301626931
#define __tmpcosmo_IPPROTO_EGP 1981296310
#define __tmpcosmo_IPPROTO_ENCAP -1186890893
#define __tmpcosmo_IPPROTO_ESP 1912922673
#define __tmpcosmo_IPPROTO_FRAGMENT 815526741
#define __tmpcosmo_IPPROTO_GRE -1086664412
#define __tmpcosmo_IPPROTO_HOPOPTS 288110026
#define __tmpcosmo_IPPROTO_ICMPV6 -517548243
#define __tmpcosmo_IPPROTO_IDP -33178791
#define __tmpcosmo_IPPROTO_IGMP 1855375045
#define __tmpcosmo_IPPROTO_IPIP -1399362390
#define __tmpcosmo_IPPROTO_IPV6 -710044241
#define __tmpcosmo_IPPROTO_MH 1137562059
#define __tmpcosmo_IPPROTO_MPLS -796619090
#define __tmpcosmo_IPPROTO_MTP -1938822508
#define __tmpcosmo_IPPROTO_NONE -1481051745
#define __tmpcosmo_IPPROTO_PIM 1072180675
#define __tmpcosmo_IPPROTO_PUP 1814067734
#define __tmpcosmo_IPPROTO_ROUTING -1022888846
#define __tmpcosmo_IPPROTO_RSVP -568010455
#define __tmpcosmo_IPPROTO_SCTP -1561155298
#define __tmpcosmo_IPPROTO_TP -1222369418
#define __tmpcosmo_IPPROTO_UDPLITE -444852753
COSMOPOLITAN_C_END_
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
#define IPPROTO_IP LITERALLY(0)
#define IPPROTO_ICMP LITERALLY(1)
#define IPPROTO_TCP LITERALLY(6)
#define IPPROTO_UDP LITERALLY(17)
#define IPPROTO_RAW LITERALLY(255)
#define IPPROTO_MAX LITERALLY(263) /* xxx */
#define IPPROTO_AH SYMBOLIC(IPPROTO_AH)
#define IPPROTO_BEETPH SYMBOLIC(IPPROTO_BEETPH)
#define IPPROTO_COMP SYMBOLIC(IPPROTO_COMP)
#define IPPROTO_DCCP SYMBOLIC(IPPROTO_DCCP)
#define IPPROTO_DSTOPTS SYMBOLIC(IPPROTO_DSTOPTS)
#define IPPROTO_EGP SYMBOLIC(IPPROTO_EGP)
#define IPPROTO_ENCAP SYMBOLIC(IPPROTO_ENCAP)
#define IPPROTO_ESP SYMBOLIC(IPPROTO_ESP)
#define IPPROTO_FRAGMENT SYMBOLIC(IPPROTO_FRAGMENT)
#define IPPROTO_GRE SYMBOLIC(IPPROTO_GRE)
#define IPPROTO_HOPOPTS SYMBOLIC(IPPROTO_HOPOPTS)
#define IPPROTO_ICMPV6 SYMBOLIC(IPPROTO_ICMPV6)
#define IPPROTO_IDP SYMBOLIC(IPPROTO_IDP)
#define IPPROTO_IGMP SYMBOLIC(IPPROTO_IGMP)
#define IPPROTO_IPIP SYMBOLIC(IPPROTO_IPIP)
#define IPPROTO_IPV6 SYMBOLIC(IPPROTO_IPV6)
#define IPPROTO_MH SYMBOLIC(IPPROTO_MH)
#define IPPROTO_MPLS SYMBOLIC(IPPROTO_MPLS)
#define IPPROTO_MTP SYMBOLIC(IPPROTO_MTP)
#define IPPROTO_NONE SYMBOLIC(IPPROTO_NONE)
#define IPPROTO_PIM SYMBOLIC(IPPROTO_PIM)
#define IPPROTO_PUP SYMBOLIC(IPPROTO_PUP)
#define IPPROTO_ROUTING SYMBOLIC(IPPROTO_ROUTING)
#define IPPROTO_RSVP SYMBOLIC(IPPROTO_RSVP)
#define IPPROTO_SCTP SYMBOLIC(IPPROTO_SCTP)
#define IPPROTO_TP SYMBOLIC(IPPROTO_TP)
#define IPPROTO_UDPLITE SYMBOLIC(IPPROTO_UDPLITE)
#endif /* COSMOPOLITAN_LIBC_SYSV_CONSTS_IPPROTO_H_ */

View file

@ -1,67 +1,5 @@
#ifndef COSMOPOLITAN_LIBC_SYSV_CONSTS_IPV6_H_
#define COSMOPOLITAN_LIBC_SYSV_CONSTS_IPV6_H_
#include "libc/runtime/symbolic.h"
#define IPV6_2292DSTOPTS SYMBOLIC(IPV6_2292DSTOPTS)
#define IPV6_2292HOPLIMIT SYMBOLIC(IPV6_2292HOPLIMIT)
#define IPV6_2292HOPOPTS SYMBOLIC(IPV6_2292HOPOPTS)
#define IPV6_2292PKTINFO SYMBOLIC(IPV6_2292PKTINFO)
#define IPV6_2292PKTOPTIONS SYMBOLIC(IPV6_2292PKTOPTIONS)
#define IPV6_2292RTHDR SYMBOLIC(IPV6_2292RTHDR)
#define IPV6_ADDRFORM SYMBOLIC(IPV6_ADDRFORM)
#define IPV6_ADD_MEMBERSHIP SYMBOLIC(IPV6_ADD_MEMBERSHIP)
#define IPV6_AUTHHDR SYMBOLIC(IPV6_AUTHHDR)
#define IPV6_AUTOFLOWLABEL SYMBOLIC(IPV6_AUTOFLOWLABEL)
#define IPV6_CHECKSUM SYMBOLIC(IPV6_CHECKSUM)
#define IPV6_DONTFRAG SYMBOLIC(IPV6_DONTFRAG)
#define IPV6_DROP_MEMBERSHIP SYMBOLIC(IPV6_DROP_MEMBERSHIP)
#define IPV6_DSTOPTS SYMBOLIC(IPV6_DSTOPTS)
#define IPV6_HDRINCL SYMBOLIC(IPV6_HDRINCL)
#define IPV6_HOPLIMIT SYMBOLIC(IPV6_HOPLIMIT)
#define IPV6_HOPOPTS SYMBOLIC(IPV6_HOPOPTS)
#define IPV6_IPSEC_POLICY SYMBOLIC(IPV6_IPSEC_POLICY)
#define IPV6_JOIN_ANYCAST SYMBOLIC(IPV6_JOIN_ANYCAST)
#define IPV6_JOIN_GROUP SYMBOLIC(IPV6_JOIN_GROUP)
#define IPV6_LEAVE_ANYCAST SYMBOLIC(IPV6_LEAVE_ANYCAST)
#define IPV6_LEAVE_GROUP SYMBOLIC(IPV6_LEAVE_GROUP)
#define IPV6_MINHOPCOUNT SYMBOLIC(IPV6_MINHOPCOUNT)
#define IPV6_MTU SYMBOLIC(IPV6_MTU)
#define IPV6_MTU_DISCOVER SYMBOLIC(IPV6_MTU_DISCOVER)
#define IPV6_MULTICAST_HOPS SYMBOLIC(IPV6_MULTICAST_HOPS)
#define IPV6_MULTICAST_IF SYMBOLIC(IPV6_MULTICAST_IF)
#define IPV6_MULTICAST_LOOP SYMBOLIC(IPV6_MULTICAST_LOOP)
#define IPV6_NEXTHOP SYMBOLIC(IPV6_NEXTHOP)
#define IPV6_ORIGDSTADDR SYMBOLIC(IPV6_ORIGDSTADDR)
#define IPV6_PATHMTU SYMBOLIC(IPV6_PATHMTU)
#define IPV6_PKTINFO SYMBOLIC(IPV6_PKTINFO)
#define IPV6_PMTUDISC_DO SYMBOLIC(IPV6_PMTUDISC_DO)
#define IPV6_PMTUDISC_DONT SYMBOLIC(IPV6_PMTUDISC_DONT)
#define IPV6_PMTUDISC_INTERFACE SYMBOLIC(IPV6_PMTUDISC_INTERFACE)
#define IPV6_PMTUDISC_OMIT SYMBOLIC(IPV6_PMTUDISC_OMIT)
#define IPV6_PMTUDISC_PROBE SYMBOLIC(IPV6_PMTUDISC_PROBE)
#define IPV6_PMTUDISC_WANT SYMBOLIC(IPV6_PMTUDISC_WANT)
#define IPV6_RECVDSTOPTS SYMBOLIC(IPV6_RECVDSTOPTS)
#define IPV6_RECVERR SYMBOLIC(IPV6_RECVERR)
#define IPV6_RECVHOPLIMIT SYMBOLIC(IPV6_RECVHOPLIMIT)
#define IPV6_RECVHOPOPTS SYMBOLIC(IPV6_RECVHOPOPTS)
#define IPV6_RECVORIGDSTADDR SYMBOLIC(IPV6_RECVORIGDSTADDR)
#define IPV6_RECVPATHMTU SYMBOLIC(IPV6_RECVPATHMTU)
#define IPV6_RECVPKTINFO SYMBOLIC(IPV6_RECVPKTINFO)
#define IPV6_RECVRTHDR SYMBOLIC(IPV6_RECVRTHDR)
#define IPV6_RECVTCLASS SYMBOLIC(IPV6_RECVTCLASS)
#define IPV6_ROUTER_ALERT SYMBOLIC(IPV6_ROUTER_ALERT)
#define IPV6_RTHDR SYMBOLIC(IPV6_RTHDR)
#define IPV6_RTHDRDSTOPTS SYMBOLIC(IPV6_RTHDRDSTOPTS)
#define IPV6_RTHDR_LOOSE SYMBOLIC(IPV6_RTHDR_LOOSE)
#define IPV6_RTHDR_STRICT SYMBOLIC(IPV6_RTHDR_STRICT)
#define IPV6_RTHDR_TYPE_0 SYMBOLIC(IPV6_RTHDR_TYPE_0)
#define IPV6_RXDSTOPTS SYMBOLIC(IPV6_RXDSTOPTS)
#define IPV6_RXHOPOPTS SYMBOLIC(IPV6_RXHOPOPTS)
#define IPV6_TCLASS SYMBOLIC(IPV6_TCLASS)
#define IPV6_UNICAST_HOPS SYMBOLIC(IPV6_UNICAST_HOPS)
#define IPV6_V6ONLY SYMBOLIC(IPV6_V6ONLY)
#define IPV6_XFRM_POLICY SYMBOLIC(IPV6_XFRM_POLICY)
#if !(__ASSEMBLER__ + __LINKER__ + 0)
COSMOPOLITAN_C_START_
@ -125,6 +63,126 @@ extern const int IPV6_UNICAST_HOPS;
extern const int IPV6_V6ONLY;
extern const int IPV6_XFRM_POLICY;
#define IPV6_2292DSTOPTS IPV6_2292DSTOPTS
#define IPV6_2292HOPLIMIT IPV6_2292HOPLIMIT
#define IPV6_2292HOPOPTS IPV6_2292HOPOPTS
#define IPV6_2292PKTINFO IPV6_2292PKTINFO
#define IPV6_2292PKTOPTIONS IPV6_2292PKTOPTIONS
#define IPV6_2292RTHDR IPV6_2292RTHDR
#define IPV6_ADDRFORM IPV6_ADDRFORM
#define IPV6_ADD_MEMBERSHIP IPV6_ADD_MEMBERSHIP
#define IPV6_AUTHHDR IPV6_AUTHHDR
#define IPV6_AUTOFLOWLABEL IPV6_AUTOFLOWLABEL
#define IPV6_CHECKSUM IPV6_CHECKSUM
#define IPV6_DONTFRAG IPV6_DONTFRAG
#define IPV6_DROP_MEMBERSHIP IPV6_DROP_MEMBERSHIP
#define IPV6_DSTOPTS IPV6_DSTOPTS
#define IPV6_HDRINCL IPV6_HDRINCL
#define IPV6_HOPLIMIT IPV6_HOPLIMIT
#define IPV6_HOPOPTS IPV6_HOPOPTS
#define IPV6_IPSEC_POLICY IPV6_IPSEC_POLICY
#define IPV6_JOIN_ANYCAST IPV6_JOIN_ANYCAST
#define IPV6_JOIN_GROUP IPV6_JOIN_GROUP
#define IPV6_LEAVE_ANYCAST IPV6_LEAVE_ANYCAST
#define IPV6_LEAVE_GROUP IPV6_LEAVE_GROUP
#define IPV6_MINHOPCOUNT IPV6_MINHOPCOUNT
#define IPV6_MTU IPV6_MTU
#define IPV6_MTU_DISCOVER IPV6_MTU_DISCOVER
#define IPV6_MULTICAST_HOPS IPV6_MULTICAST_HOPS
#define IPV6_MULTICAST_IF IPV6_MULTICAST_IF
#define IPV6_MULTICAST_LOOP IPV6_MULTICAST_LOOP
#define IPV6_NEXTHOP IPV6_NEXTHOP
#define IPV6_ORIGDSTADDR IPV6_ORIGDSTADDR
#define IPV6_PATHMTU IPV6_PATHMTU
#define IPV6_PKTINFO IPV6_PKTINFO
#define IPV6_PMTUDISC_DO IPV6_PMTUDISC_DO
#define IPV6_PMTUDISC_DONT IPV6_PMTUDISC_DONT
#define IPV6_PMTUDISC_INTERFACE IPV6_PMTUDISC_INTERFACE
#define IPV6_PMTUDISC_OMIT IPV6_PMTUDISC_OMIT
#define IPV6_PMTUDISC_PROBE IPV6_PMTUDISC_PROBE
#define IPV6_PMTUDISC_WANT IPV6_PMTUDISC_WANT
#define IPV6_RECVDSTOPTS IPV6_RECVDSTOPTS
#define IPV6_RECVERR IPV6_RECVERR
#define IPV6_RECVHOPLIMIT IPV6_RECVHOPLIMIT
#define IPV6_RECVHOPOPTS IPV6_RECVHOPOPTS
#define IPV6_RECVORIGDSTADDR IPV6_RECVORIGDSTADDR
#define IPV6_RECVPATHMTU IPV6_RECVPATHMTU
#define IPV6_RECVPKTINFO IPV6_RECVPKTINFO
#define IPV6_RECVRTHDR IPV6_RECVRTHDR
#define IPV6_RECVTCLASS IPV6_RECVTCLASS
#define IPV6_ROUTER_ALERT IPV6_ROUTER_ALERT
#define IPV6_RTHDR IPV6_RTHDR
#define IPV6_RTHDRDSTOPTS IPV6_RTHDRDSTOPTS
#define IPV6_RTHDR_LOOSE IPV6_RTHDR_LOOSE
#define IPV6_RTHDR_STRICT IPV6_RTHDR_STRICT
#define IPV6_RTHDR_TYPE_0 IPV6_RTHDR_TYPE_0
#define IPV6_RXDSTOPTS IPV6_RXDSTOPTS
#define IPV6_RXHOPOPTS IPV6_RXHOPOPTS
#define IPV6_TCLASS IPV6_TCLASS
#define IPV6_UNICAST_HOPS IPV6_UNICAST_HOPS
#define IPV6_V6ONLY IPV6_V6ONLY
#define IPV6_XFRM_POLICY IPV6_XFRM_POLICY
#define __tmpcosmo_IPV6_2292DSTOPTS 678069209
#define __tmpcosmo_IPV6_2292HOPLIMIT 1561068259
#define __tmpcosmo_IPV6_2292HOPOPTS 1907714767
#define __tmpcosmo_IPV6_2292PKTINFO 356029652
#define __tmpcosmo_IPV6_2292PKTOPTIONS 117081374
#define __tmpcosmo_IPV6_2292RTHDR 1636035669
#define __tmpcosmo_IPV6_ADDRFORM -1054757172
#define __tmpcosmo_IPV6_ADD_MEMBERSHIP -1680307522
#define __tmpcosmo_IPV6_AUTHHDR -1947213388
#define __tmpcosmo_IPV6_AUTOFLOWLABEL -1657222883
#define __tmpcosmo_IPV6_CHECKSUM -1542493753
#define __tmpcosmo_IPV6_DONTFRAG 189943592
#define __tmpcosmo_IPV6_DROP_MEMBERSHIP 1820062161
#define __tmpcosmo_IPV6_DSTOPTS -1331897775
#define __tmpcosmo_IPV6_HDRINCL -1699190495
#define __tmpcosmo_IPV6_HOPLIMIT -343952270
#define __tmpcosmo_IPV6_HOPOPTS -394761213
#define __tmpcosmo_IPV6_IPSEC_POLICY -2131021232
#define __tmpcosmo_IPV6_JOIN_ANYCAST 335351523
#define __tmpcosmo_IPV6_JOIN_GROUP 1555568929
#define __tmpcosmo_IPV6_LEAVE_ANYCAST 501463808
#define __tmpcosmo_IPV6_LEAVE_GROUP -1539743215
#define __tmpcosmo_IPV6_MINHOPCOUNT 1901629805
#define __tmpcosmo_IPV6_MTU 131760667
#define __tmpcosmo_IPV6_MTU_DISCOVER -1763058519
#define __tmpcosmo_IPV6_MULTICAST_HOPS 1551727279
#define __tmpcosmo_IPV6_MULTICAST_IF 1035413489
#define __tmpcosmo_IPV6_MULTICAST_LOOP -2077388688
#define __tmpcosmo_IPV6_NEXTHOP -1526051079
#define __tmpcosmo_IPV6_ORIGDSTADDR -957168735
#define __tmpcosmo_IPV6_PATHMTU -1790974186
#define __tmpcosmo_IPV6_PKTINFO 1905020529
#define __tmpcosmo_IPV6_PMTUDISC_DO -251721867
#define __tmpcosmo_IPV6_PMTUDISC_DONT 1152249305
#define __tmpcosmo_IPV6_PMTUDISC_INTERFACE 2128741179
#define __tmpcosmo_IPV6_PMTUDISC_OMIT -1459360179
#define __tmpcosmo_IPV6_PMTUDISC_PROBE 1737493952
#define __tmpcosmo_IPV6_PMTUDISC_WANT -231692414
#define __tmpcosmo_IPV6_RECVDSTOPTS 2118319635
#define __tmpcosmo_IPV6_RECVERR 743926555
#define __tmpcosmo_IPV6_RECVHOPLIMIT -213901102
#define __tmpcosmo_IPV6_RECVHOPOPTS -2068065960
#define __tmpcosmo_IPV6_RECVORIGDSTADDR -1432385217
#define __tmpcosmo_IPV6_RECVPATHMTU -2019840272
#define __tmpcosmo_IPV6_RECVPKTINFO 844434218
#define __tmpcosmo_IPV6_RECVRTHDR -1243605968
#define __tmpcosmo_IPV6_RECVTCLASS 38392473
#define __tmpcosmo_IPV6_ROUTER_ALERT -1302625266
#define __tmpcosmo_IPV6_RTHDR 238156690
#define __tmpcosmo_IPV6_RTHDRDSTOPTS 872395219
#define __tmpcosmo_IPV6_RTHDR_LOOSE -2022259083
#define __tmpcosmo_IPV6_RTHDR_STRICT 1510455360
#define __tmpcosmo_IPV6_RTHDR_TYPE_0 -1059520334
#define __tmpcosmo_IPV6_RXDSTOPTS 838357545
#define __tmpcosmo_IPV6_RXHOPOPTS -296413457
#define __tmpcosmo_IPV6_TCLASS 251757835
#define __tmpcosmo_IPV6_UNICAST_HOPS -774486644
#define __tmpcosmo_IPV6_V6ONLY -1291858455
#define __tmpcosmo_IPV6_XFRM_POLICY 774963753
COSMOPOLITAN_C_END_
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
#endif /* COSMOPOLITAN_LIBC_SYSV_CONSTS_IPV6_H_ */

View file

@ -1,6 +1,5 @@
#ifndef COSMOPOLITAN_LIBC_SYSV_CONSTS_KD_H_
#define COSMOPOLITAN_LIBC_SYSV_CONSTS_KD_H_
#include "libc/runtime/symbolic.h"
#if !(__ASSEMBLER__ + __LINKER__ + 0)
COSMOPOLITAN_C_START_
@ -18,16 +17,16 @@ extern const uint64_t KDFONTOP;
COSMOPOLITAN_C_END_
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
#define GIO_FONT SYMBOLIC(GIO_FONT)
#define PIO_FONT SYMBOLIC(PIO_FONT)
#define GIO_FONTX SYMBOLIC(GIO_FONTX)
#define PIO_FONTX SYMBOLIC(PIO_FONTX)
#define PIO_FONT8x8 SYMBOLIC(PIO_FONT8x8)
#define PIO_FONT8x14 SYMBOLIC(PIO_FONT8x14)
#define PIO_FONT8x16 SYMBOLIC(PIO_FONT8x14)
#define PIO_VFONT SYMBOLIC(PIO_VFONT)
#define PIO_FONTRESET SYMBOLIC(PIO_FONTRESET)
#define KDFONTOP SYMBOLIC(KDFONTOP)
#define GIO_FONT GIO_FONT
#define PIO_FONT PIO_FONT
#define GIO_FONTX GIO_FONTX
#define PIO_FONTX PIO_FONTX
#define PIO_FONT8x8 PIO_FONT8x8
#define PIO_FONT8x14 PIO_FONT8x14
#define PIO_FONT8x16 PIO_FONT8x14
#define PIO_VFONT PIO_VFONT
#define PIO_FONTRESET PIO_FONTRESET
#define KDFONTOP KDFONTOP
#ifdef _BSD_SOURCE
#define PIO_VFONT_DEFAULT PIO_FONTRESET

View file

@ -1,6 +1,5 @@
#ifndef COSMOPOLITAN_LIBC_SYSV_CONSTS_LIMITS_H_
#define COSMOPOLITAN_LIBC_SYSV_CONSTS_LIMITS_H_
#include "libc/runtime/symbolic.h"
#if !(__ASSEMBLER__ + __LINKER__ + 0)
COSMOPOLITAN_C_START_
@ -15,18 +14,28 @@ extern const int LINK_MAX;
extern const int MAX_CANON;
extern const int MAX_INPUT;
#define NGROUPS_MAX NGROUPS_MAX
#define PIPE_BUF PIPE_BUF
#define SOMAXCONN SOMAXCONN
#define _ARG_MAX _ARG_MAX
#define _NAME_MAX _NAME_MAX
#define _NSIG _NSIG
#define _PATH_MAX _PATH_MAX
#define LINK_MAX LINK_MAX
#define MAX_CANON MAX_CANON
#define MAX_INPUT MAX_INPUT
#define __tmpcosmo_NGROUPS_MAX 1969598838
#define __tmpcosmo_PIPE_BUF 1992386673
#define __tmpcosmo_SOMAXCONN -1069247464
#define __tmpcosmo__ARG_MAX 794592230
#define __tmpcosmo__NAME_MAX -1301020103
#define __tmpcosmo__NSIG 1488054137
#define __tmpcosmo__PATH_MAX -1722847523
#define __tmpcosmo_LINK_MAX 1127355053
#define __tmpcosmo_MAX_CANON -1111005462
#define __tmpcosmo_MAX_INPUT -1378721420
COSMOPOLITAN_C_END_
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
#define NGROUPS_MAX SYMBOLIC(NGROUPS_MAX)
#define PIPE_BUF SYMBOLIC(PIPE_BUF)
#define SOMAXCONN SYMBOLIC(SOMAXCONN)
#define _ARG_MAX SYMBOLIC(_ARG_MAX)
#define _NAME_MAX SYMBOLIC(_NAME_MAX)
#define _NSIG SYMBOLIC(_NSIG)
#define _PATH_MAX SYMBOLIC(_PATH_MAX)
#define LINK_MAX SYMBOLIC(LINK_MAX)
#define MAX_CANON SYMBOLIC(MAX_CANON)
#define MAX_INPUT SYMBOLIC(MAX_INPUT)
#endif /* COSMOPOLITAN_LIBC_SYSV_CONSTS_LIMITS_H_ */

View file

@ -1,12 +1,11 @@
#ifndef COSMOPOLITAN_LIBC_SYSV_CONSTS_LIO_H_
#define COSMOPOLITAN_LIBC_SYSV_CONSTS_LIO_H_
#include "libc/runtime/symbolic.h"
#define LIO_NOP SYMBOLIC(LIO_NOP)
#define LIO_NOWAIT SYMBOLIC(LIO_NOWAIT)
#define LIO_READ SYMBOLIC(LIO_READ)
#define LIO_WAIT SYMBOLIC(LIO_WAIT)
#define LIO_WRITE SYMBOLIC(LIO_WRITE)
#define LIO_NOP LIO_NOP
#define LIO_NOWAIT LIO_NOWAIT
#define LIO_READ LIO_READ
#define LIO_WAIT LIO_WAIT
#define LIO_WRITE LIO_WRITE
#if !(__ASSEMBLER__ + __LINKER__ + 0)
COSMOPOLITAN_C_START_

View file

@ -1,6 +1,5 @@
#ifndef COSMOPOLITAN_LIBC_SYSV_CONSTS_LOCK_H_
#define COSMOPOLITAN_LIBC_SYSV_CONSTS_LOCK_H_
#include "libc/runtime/symbolic.h"
#if !(__ASSEMBLER__ + __LINKER__ + 0)
COSMOPOLITAN_C_START_
@ -13,10 +12,13 @@ extern const int LOCK_UNLOCK_CACHE;
COSMOPOLITAN_C_END_
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
#define LOCK_EX LITERALLY(2)
#define LOCK_NB SYMBOLIC(LOCK_NB)
#define LOCK_SH SYMBOLIC(LOCK_SH)
#define LOCK_UN SYMBOLIC(LOCK_UN)
#define LOCK_UNLOCK_CACHE SYMBOLIC(LOCK_UNLOCK_CACHE)
#define LOCK_EX 2
#define LOCK_NB LOCK_NB
#define LOCK_SH LOCK_SH
#define LOCK_UN LOCK_UN
#define __tmpcosmo_LOCK_NB -453005435
#define __tmpcosmo_LOCK_SH 1639584913
#define __tmpcosmo_LOCK_UN 17921936
#endif /* COSMOPOLITAN_LIBC_SYSV_CONSTS_LOCK_H_ */

View file

@ -1,6 +1,5 @@
#ifndef COSMOPOLITAN_LIBC_SYSV_CONSTS_MADV_H_
#define COSMOPOLITAN_LIBC_SYSV_CONSTS_MADV_H_
#include "libc/runtime/symbolic.h"
#if !(__ASSEMBLER__ + __LINKER__ + 0)
COSMOPOLITAN_C_START_
@ -21,25 +20,11 @@ extern const unsigned MADV_SEQUENTIAL;
extern const unsigned MADV_UNMERGEABLE;
extern const unsigned MADV_WILLNEED;
#define MADV_NORMAL 0
#define MADV_RANDOM 1
#define MADV_SEQUENTIAL 2
#define MADV_WILLNEED 3
COSMOPOLITAN_C_END_
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
#define MADV_NORMAL LITERALLY(0)
#define MADV_RANDOM LITERALLY(1)
#define MADV_SEQUENTIAL LITERALLY(2)
#define MADV_WILLNEED LITERALLY(3)
#define MADV_DODUMP SYMBOLIC(MADV_DODUMP)
#define MADV_DOFORK SYMBOLIC(MADV_DOFORK)
#define MADV_DONTDUMP SYMBOLIC(MADV_DONTDUMP)
#define MADV_DONTFORK SYMBOLIC(MADV_DONTFORK)
#define MADV_DONTNEED SYMBOLIC(MADV_DONTNEED)
#define MADV_FREE SYMBOLIC(MADV_FREE)
#define MADV_HUGEPAGE SYMBOLIC(MADV_HUGEPAGE)
#define MADV_HWPOISON SYMBOLIC(MADV_HWPOISON)
#define MADV_MERGEABLE SYMBOLIC(MADV_MERGEABLE)
#define MADV_NOHUGEPAGE SYMBOLIC(MADV_NOHUGEPAGE)
#define MADV_REMOVE SYMBOLIC(MADV_REMOVE)
#define MADV_UNMERGEABLE SYMBOLIC(MADV_UNMERGEABLE)
#endif /* COSMOPOLITAN_LIBC_SYSV_CONSTS_MADV_H_ */

View file

@ -1,6 +1,5 @@
#ifndef COSMOPOLITAN_LIBC_SYSV_CONSTS_MAP_H_
#define COSMOPOLITAN_LIBC_SYSV_CONSTS_MAP_H_
#include "libc/runtime/symbolic.h"
#if !(__ASSEMBLER__ + __LINKER__ + 0)
COSMOPOLITAN_C_START_
@ -37,25 +36,21 @@ COSMOPOLITAN_C_END_
#define MAP_TYPE 15
#define MAP_FIXED 16
#define MAP_32BIT SYMBOLIC(MAP_32BIT)
#define MAP_ANONYMOUS SYMBOLIC(MAP_ANONYMOUS)
#define MAP_CONCEAL SYMBOLIC(MAP_CONCEAL)
#define MAP_DENYWRITE SYMBOLIC(MAP_DENYWRITE)
#define MAP_EXECUTABLE SYMBOLIC(MAP_EXECUTABLE)
#define MAP_FIXED_NOREPLACE SYMBOLIC(MAP_FIXED_NOREPLACE)
#define MAP_HASSEMAPHORE SYMBOLIC(MAP_HASSEMAPHORE)
#define MAP_HUGETLB SYMBOLIC(MAP_HUGETLB)
#define MAP_HUGE_MASK SYMBOLIC(MAP_HUGE_MASK)
#define MAP_HUGE_SHIFT SYMBOLIC(MAP_HUGE_SHIFT)
#define MAP_INHERIT SYMBOLIC(MAP_INHERIT)
#define MAP_LOCKED SYMBOLIC(MAP_LOCKED)
#define MAP_NONBLOCK SYMBOLIC(MAP_NONBLOCK)
#define MAP_NORESERVE SYMBOLIC(MAP_NORESERVE)
#define MAP_NOSYNC SYMBOLIC(MAP_NOSYNC)
#define MAP_POPULATE SYMBOLIC(MAP_POPULATE)
#define MAP_SHARED_VALIDATE SYMBOLIC(MAP_SHARED_VALIDATE)
#define MAP_ANONYMOUS MAP_ANONYMOUS
#define MAP_CONCEAL MAP_CONCEAL
#define MAP_EXECUTABLE MAP_EXECUTABLE
#define MAP_FIXED_NOREPLACE MAP_FIXED_NOREPLACE
#define MAP_HASSEMAPHORE MAP_HASSEMAPHORE
#define MAP_POPULATE MAP_POPULATE
#define MAP_ANON MAP_ANONYMOUS
#define MAP_NOCORE MAP_CONCEAL
#define __tmpcosmo_MAP_ANONYMOUS 582365471
#define __tmpcosmo_MAP_CONCEAL -155176713
#define __tmpcosmo_MAP_EXECUTABLE 140777257
#define __tmpcosmo_MAP_FIXED_NOREPLACE -1715515271
#define __tmpcosmo_MAP_HASSEMAPHORE 674508674
#define __tmpcosmo_MAP_POPULATE -2076654178
#endif /* COSMOPOLITAN_LIBC_SYSV_CONSTS_MAP_H_ */

View file

@ -1,16 +1,15 @@
#ifndef COSMOPOLITAN_LIBC_SYSV_CONSTS_MCAST_H_
#define COSMOPOLITAN_LIBC_SYSV_CONSTS_MCAST_H_
#include "libc/runtime/symbolic.h"
#define MCAST_BLOCK_SOURCE SYMBOLIC(MCAST_BLOCK_SOURCE)
#define MCAST_EXCLUDE SYMBOLIC(MCAST_EXCLUDE)
#define MCAST_INCLUDE SYMBOLIC(MCAST_INCLUDE)
#define MCAST_JOIN_GROUP SYMBOLIC(MCAST_JOIN_GROUP)
#define MCAST_JOIN_SOURCE_GROUP SYMBOLIC(MCAST_JOIN_SOURCE_GROUP)
#define MCAST_LEAVE_GROUP SYMBOLIC(MCAST_LEAVE_GROUP)
#define MCAST_LEAVE_SOURCE_GROUP SYMBOLIC(MCAST_LEAVE_SOURCE_GROUP)
#define MCAST_MSFILTER SYMBOLIC(MCAST_MSFILTER)
#define MCAST_UNBLOCK_SOURCE SYMBOLIC(MCAST_UNBLOCK_SOURCE)
#define MCAST_BLOCK_SOURCE MCAST_BLOCK_SOURCE
#define MCAST_EXCLUDE MCAST_EXCLUDE
#define MCAST_INCLUDE MCAST_INCLUDE
#define MCAST_JOIN_GROUP MCAST_JOIN_GROUP
#define MCAST_JOIN_SOURCE_GROUP MCAST_JOIN_SOURCE_GROUP
#define MCAST_LEAVE_GROUP MCAST_LEAVE_GROUP
#define MCAST_LEAVE_SOURCE_GROUP MCAST_LEAVE_SOURCE_GROUP
#define MCAST_MSFILTER MCAST_MSFILTER
#define MCAST_UNBLOCK_SOURCE MCAST_UNBLOCK_SOURCE
#if !(__ASSEMBLER__ + __LINKER__ + 0)
COSMOPOLITAN_C_START_

View file

@ -1,6 +1,5 @@
#ifndef COSMOPOLITAN_LIBC_SYSV_CONSTS_MLOCK_H_
#define COSMOPOLITAN_LIBC_SYSV_CONSTS_MLOCK_H_
#include "libc/runtime/symbolic.h"
#if !(__ASSEMBLER__ + __LINKER__ + 0)
COSMOPOLITAN_C_START_
@ -11,8 +10,8 @@ extern const int MCL_ONFAULT;
COSMOPOLITAN_C_END_
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
#define MCL_CURRENT LITERALLY(1)
#define MCL_FUTURE LITERALLY(2)
#define MCL_ONFAULT SYMBOLIC(MCL_ONFAULT)
#define MCL_CURRENT 1
#define MCL_FUTURE 2
#define MCL_ONFAULT MCL_ONFAULT
#endif /* COSMOPOLITAN_LIBC_SYSV_CONSTS_MLOCK_H_ */

View file

@ -1,6 +1,5 @@
#ifndef COSMOPOLITAN_LIBC_SYSV_CONSTS_MODEM_H_
#define COSMOPOLITAN_LIBC_SYSV_CONSTS_MODEM_H_
#include "libc/runtime/symbolic.h"
#if !(__ASSEMBLER__ + __LINKER__ + 0)
COSMOPOLITAN_C_START_
@ -21,24 +20,28 @@ extern const int TIOCM_RTS;
extern const int TIOCM_SR;
extern const int TIOCM_ST;
#define TIOCM_LE 0x01
#define TIOCM_DTR 0x02
#define TIOCM_RTS 0x04
#define TIOCM_ST 0x08
#define TIOCM_SR 0x10
#define TIOCM_CTS 0x20
#define TIOCM_CAR 0x40
#define TIOCM_CD 0x40
#define TIOCM_RI 0x80
#define TIOCM_RNG 0x80
#define TIOCM_DSR 0x0100
#define TIOCMGET TIOCMGET
#define TIOCMSET TIOCMSET
#define TIOCMBIC TIOCMBIC
#define TIOCMBIS TIOCMBIS
#define __tmpcosmo_TIOCMGET -1558289563
#define __tmpcosmo_TIOCMSET 1411834535
#define __tmpcosmo_TIOCMBIC 1398206874
#define __tmpcosmo_TIOCMBIS 522158367
COSMOPOLITAN_C_END_
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
#define TIOCMGET SYMBOLIC(TIOCMGET)
#define TIOCMSET SYMBOLIC(TIOCMSET)
#define TIOCMBIC SYMBOLIC(TIOCMBIC)
#define TIOCMBIS SYMBOLIC(TIOCMBIS)
#define TIOCM_LE LITERALLY(0x01)
#define TIOCM_DTR LITERALLY(0x02)
#define TIOCM_RTS LITERALLY(0x04)
#define TIOCM_ST LITERALLY(0x08)
#define TIOCM_SR LITERALLY(0x10)
#define TIOCM_CTS LITERALLY(0x20)
#define TIOCM_CAR LITERALLY(0x40)
#define TIOCM_CD LITERALLY(0x40)
#define TIOCM_RI LITERALLY(0x80)
#define TIOCM_RNG LITERALLY(0x80)
#define TIOCM_DSR LITERALLY(0x0100)
#endif /* COSMOPOLITAN_LIBC_SYSV_CONSTS_MODEM_H_ */

View file

@ -1,6 +1,5 @@
#ifndef COSMOPOLITAN_LIBC_SYSV_CONSTS_MOUNT_H_
#define COSMOPOLITAN_LIBC_SYSV_CONSTS_MOUNT_H_
#include "libc/runtime/symbolic.h"
#if !(__ASSEMBLER__ + __LINKER__ + 0)
COSMOPOLITAN_C_START_
@ -49,52 +48,94 @@ extern const int MNT_NOCLUSTERR;
extern const int MNT_NOCLUSTERW;
extern const int MNT_SNAPSHOT;
#define MS_RDONLY 0x00000001
#define MNT_RDONLY 0x00000001
#define MS_NOSUID MS_NOSUID
#define MNT_NOSUID MNT_NOSUID
#define MS_NODEV MS_NODEV
#define MNT_NODEV MNT_NODEV
#define MS_NOEXEC MS_NOEXEC
#define MNT_NOEXEC MNT_NOEXEC
#define MS_SYNCHRONOUS MS_SYNCHRONOUS
#define MNT_SYNCHRONOUS MNT_SYNCHRONOUS
#define MS_REMOUNT MS_REMOUNT
#define MNT_UPDATE MNT_UPDATE
#define MS_MANDLOCK MS_MANDLOCK
#define MS_DIRSYNC MS_DIRSYNC
#define MS_NOATIME MS_NOATIME
#define MNT_NOATIME MNT_NOATIME
#define MS_NODIRATIME MS_NODIRATIME
#define MS_BIND MS_BIND
#define MS_MOVE MS_MOVE
#define MS_REC MS_REC
#define MS_SILENT MS_SILENT
#define MS_POSIXACL MS_POSIXACL
#define MS_UNBINDABLE MS_UNBINDABLE
#define MS_PRIVATE MS_PRIVATE
#define MS_SLAVE MS_SLAVE
#define MS_SHARED MS_SHARED
#define MS_RELATIME MS_RELATIME
#define MNT_RELATIME MNT_RELATIME
#define MS_KERNMOUNT MS_KERNMOUNT
#define MS_I_VERSION MS_I_VERSION
#define MS_STRICTATIME MS_STRICTATIME
#define MNT_STRICTATIME MNT_STRICTATIME
#define MS_LAZYTIME MS_LAZYTIME
#define MS_ACTIVE MS_ACTIVE
#define MS_NOUSER MS_NOUSER
#define MS_RMT_MASK MS_RMT_MASK
#define MS_MGC_VAL MS_MGC_VAL
#define MS_MGC_MSK MS_MGC_MSK
#define MNT_ASYNC MNT_ASYNC
#define MNT_RELOAD MNT_RELOAD
#define MNT_SUIDDIR MNT_SUIDDIR
#define MNT_NOCLUSTERR MNT_NOCLUSTERR
#define MNT_NOCLUSTERW MNT_NOCLUSTERW
#define MNT_SNAPSHOT MNT_SNAPSHOT
#define __tmpcosmo_MS_NOSUID -1606122789
#define __tmpcosmo_MNT_NOSUID -1447475041
#define __tmpcosmo_MS_NODEV 1395530069
#define __tmpcosmo_MNT_NODEV 1936393733
#define __tmpcosmo_MS_NOEXEC 617413422
#define __tmpcosmo_MNT_NOEXEC -306506772
#define __tmpcosmo_MS_SYNCHRONOUS 957465984
#define __tmpcosmo_MNT_SYNCHRONOUS 934826893
#define __tmpcosmo_MS_REMOUNT 413574493
#define __tmpcosmo_MNT_UPDATE 920970183
#define __tmpcosmo_MS_MANDLOCK -831013869
#define __tmpcosmo_MS_DIRSYNC -1479267152
#define __tmpcosmo_MS_NOATIME 1168305905
#define __tmpcosmo_MNT_NOATIME 765975990
#define __tmpcosmo_MS_NODIRATIME 259117157
#define __tmpcosmo_MS_BIND 731286897
#define __tmpcosmo_MS_MOVE -808863326
#define __tmpcosmo_MS_REC -888579348
#define __tmpcosmo_MS_SILENT 1518034597
#define __tmpcosmo_MS_POSIXACL -1836436617
#define __tmpcosmo_MS_UNBINDABLE -1064128266
#define __tmpcosmo_MS_PRIVATE -869857793
#define __tmpcosmo_MS_SLAVE -1484401575
#define __tmpcosmo_MS_SHARED 1527550647
#define __tmpcosmo_MS_RELATIME -1251574211
#define __tmpcosmo_MNT_RELATIME 1860322269
#define __tmpcosmo_MS_KERNMOUNT -2091601207
#define __tmpcosmo_MS_I_VERSION -323807485
#define __tmpcosmo_MS_STRICTATIME -1587037133
#define __tmpcosmo_MNT_STRICTATIME -1140691829
#define __tmpcosmo_MS_LAZYTIME 1112443532
#define __tmpcosmo_MS_ACTIVE -2142880216
#define __tmpcosmo_MS_NOUSER 1270935574
#define __tmpcosmo_MS_RMT_MASK 376610379
#define __tmpcosmo_MS_MGC_VAL -1272539746
#define __tmpcosmo_MS_MGC_MSK 1522806541
#define __tmpcosmo_MNT_ASYNC -1141454736
#define __tmpcosmo_MNT_RELOAD 814423179
#define __tmpcosmo_MNT_SUIDDIR -1859059495
#define __tmpcosmo_MNT_NOCLUSTERR -1032466906
#define __tmpcosmo_MNT_NOCLUSTERW 203320937
#define __tmpcosmo_MNT_SNAPSHOT -1441878956
COSMOPOLITAN_C_END_
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
#define MS_RDONLY LITERALLY(0x00000001)
#define MNT_RDONLY LITERALLY(0x00000001)
#define MS_NOSUID SYMBOLIC(MS_NOSUID)
#define MNT_NOSUID SYMBOLIC(MNT_NOSUID)
#define MS_NODEV SYMBOLIC(MS_NODEV)
#define MNT_NODEV SYMBOLIC(MNT_NODEV)
#define MS_NOEXEC SYMBOLIC(MS_NOEXEC)
#define MNT_NOEXEC SYMBOLIC(MNT_NOEXEC)
#define MS_SYNCHRONOUS SYMBOLIC(MS_SYNCHRONOUS)
#define MNT_SYNCHRONOUS SYMBOLIC(MNT_SYNCHRONOUS)
#define MS_REMOUNT SYMBOLIC(MS_REMOUNT)
#define MNT_UPDATE SYMBOLIC(MNT_UPDATE)
#define MS_MANDLOCK SYMBOLIC(MS_MANDLOCK)
#define MS_DIRSYNC SYMBOLIC(MS_DIRSYNC)
#define MS_NOATIME SYMBOLIC(MS_NOATIME)
#define MNT_NOATIME SYMBOLIC(MNT_NOATIME)
#define MS_NODIRATIME SYMBOLIC(MS_NODIRATIME)
#define MS_BIND SYMBOLIC(MS_BIND)
#define MS_MOVE SYMBOLIC(MS_MOVE)
#define MS_REC SYMBOLIC(MS_REC)
#define MS_SILENT SYMBOLIC(MS_SILENT)
#define MS_POSIXACL SYMBOLIC(MS_POSIXACL)
#define MS_UNBINDABLE SYMBOLIC(MS_UNBINDABLE)
#define MS_PRIVATE SYMBOLIC(MS_PRIVATE)
#define MS_SLAVE SYMBOLIC(MS_SLAVE)
#define MS_SHARED SYMBOLIC(MS_SHARED)
#define MS_RELATIME SYMBOLIC(MS_RELATIME)
#define MNT_RELATIME SYMBOLIC(MNT_RELATIME)
#define MS_KERNMOUNT SYMBOLIC(MS_KERNMOUNT)
#define MS_I_VERSION SYMBOLIC(MS_I_VERSION)
#define MS_STRICTATIME SYMBOLIC(MS_STRICTATIME)
#define MNT_STRICTATIME SYMBOLIC(MNT_STRICTATIME)
#define MS_LAZYTIME SYMBOLIC(MS_LAZYTIME)
#define MS_ACTIVE SYMBOLIC(MS_ACTIVE)
#define MS_NOUSER SYMBOLIC(MS_NOUSER)
#define MS_RMT_MASK SYMBOLIC(MS_RMT_MASK)
#define MS_MGC_VAL SYMBOLIC(MS_MGC_VAL)
#define MS_MGC_MSK SYMBOLIC(MS_MGC_MSK)
#define MNT_ASYNC SYMBOLIC(MNT_ASYNC)
#define MNT_RELOAD SYMBOLIC(MNT_RELOAD)
#define MNT_SUIDDIR SYMBOLIC(MNT_SUIDDIR)
#define MNT_NOCLUSTERR SYMBOLIC(MNT_NOCLUSTERR)
#define MNT_NOCLUSTERW SYMBOLIC(MNT_NOCLUSTERW)
#define MNT_SNAPSHOT SYMBOLIC(MNT_SNAPSHOT)
#endif /* COSMOPOLITAN_LIBC_SYSV_CONSTS_MOUNT_H_ */

View file

@ -1,6 +1,5 @@
#ifndef COSMOPOLITAN_LIBC_SYSV_CONSTS_MSG_H_
#define COSMOPOLITAN_LIBC_SYSV_CONSTS_MSG_H_
#include "libc/runtime/symbolic.h"
#if !(__ASSEMBLER__ + __LINKER__ + 0)
COSMOPOLITAN_C_START_
@ -34,37 +33,64 @@ extern const int MSG_TRUNC;
extern const int MSG_WAITALL;
extern const int MSG_WAITFORONE;
#define MSG_DONTROUTE 4
#define MSG_OOB 1
#define MSG_PEEK 2
#define MSG_BATCH MSG_BATCH
#define MSG_BCAST MSG_BCAST
#define MSG_CMSG_CLOEXEC MSG_CMSG_CLOEXEC
#define MSG_CONFIRM MSG_CONFIRM
#define MSG_CTRUNC MSG_CTRUNC
#define MSG_DONTWAIT MSG_DONTWAIT
#define MSG_EOF MSG_EOF
#define MSG_EOR MSG_EOR
#define MSG_ERRQUEUE MSG_ERRQUEUE
#define MSG_EXCEPT MSG_EXCEPT
#define MSG_FASTOPEN MSG_FASTOPEN
#define MSG_FIN MSG_FIN
#define MSG_INFO MSG_INFO
#define MSG_MCAST MSG_MCAST
#define MSG_MORE MSG_MORE
#define MSG_NOERROR MSG_NOERROR
#define MSG_NOSIGNAL MSG_NOSIGNAL
#define MSG_NOTIFICATION MSG_NOTIFICATION
#define MSG_PARITY_ERROR MSG_PARITY_ERROR
#define MSG_PROXY MSG_PROXY
#define MSG_RST MSG_RST
#define MSG_STAT MSG_STAT
#define MSG_SYN MSG_SYN
#define MSG_TRUNC MSG_TRUNC
#define MSG_WAITALL MSG_WAITALL
#define MSG_WAITFORONE MSG_WAITFORONE
#define __tmpcosmo_MSG_BATCH -1134416743
#define __tmpcosmo_MSG_BCAST 370853917
#define __tmpcosmo_MSG_CMSG_CLOEXEC -1745056044
#define __tmpcosmo_MSG_CONFIRM -1373446954
#define __tmpcosmo_MSG_CTRUNC -1111700304
#define __tmpcosmo_MSG_DONTWAIT -667086557
#define __tmpcosmo_MSG_EOF -602741896
#define __tmpcosmo_MSG_EOR -91925267
#define __tmpcosmo_MSG_ERRQUEUE 1651845516
#define __tmpcosmo_MSG_EXCEPT 460132348
#define __tmpcosmo_MSG_FASTOPEN -394051246
#define __tmpcosmo_MSG_FIN 1618968310
#define __tmpcosmo_MSG_INFO -1121675098
#define __tmpcosmo_MSG_MCAST -782610984
#define __tmpcosmo_MSG_MORE 1239285605
#define __tmpcosmo_MSG_NOERROR -1816652550
#define __tmpcosmo_MSG_NOSIGNAL -1026018855
#define __tmpcosmo_MSG_NOTIFICATION -1641797121
#define __tmpcosmo_MSG_PARITY_ERROR 742069756
#define __tmpcosmo_MSG_PROXY -2048250956
#define __tmpcosmo_MSG_RST -1659007642
#define __tmpcosmo_MSG_STAT -1766577788
#define __tmpcosmo_MSG_SYN -105011009
#define __tmpcosmo_MSG_TRUNC 1248152008
#define __tmpcosmo_MSG_WAITALL -209697144
#define __tmpcosmo_MSG_WAITFORONE -583987704
COSMOPOLITAN_C_END_
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
#define MSG_BATCH SYMBOLIC(MSG_BATCH)
#define MSG_BCAST SYMBOLIC(MSG_BCAST)
#define MSG_CMSG_CLOEXEC SYMBOLIC(MSG_CMSG_CLOEXEC)
#define MSG_CONFIRM SYMBOLIC(MSG_CONFIRM)
#define MSG_CTRUNC SYMBOLIC(MSG_CTRUNC)
#define MSG_DONTROUTE LITERALLY(4)
#define MSG_DONTWAIT SYMBOLIC(MSG_DONTWAIT)
#define MSG_EOF SYMBOLIC(MSG_EOF)
#define MSG_EOR SYMBOLIC(MSG_EOR)
#define MSG_ERRQUEUE SYMBOLIC(MSG_ERRQUEUE)
#define MSG_EXCEPT SYMBOLIC(MSG_EXCEPT)
#define MSG_FASTOPEN SYMBOLIC(MSG_FASTOPEN)
#define MSG_FIN SYMBOLIC(MSG_FIN)
#define MSG_INFO SYMBOLIC(MSG_INFO)
#define MSG_MCAST SYMBOLIC(MSG_MCAST)
#define MSG_MORE SYMBOLIC(MSG_MORE)
#define MSG_NOERROR SYMBOLIC(MSG_NOERROR)
#define MSG_NOSIGNAL SYMBOLIC(MSG_NOSIGNAL)
#define MSG_NOTIFICATION SYMBOLIC(MSG_NOTIFICATION)
#define MSG_OOB LITERALLY(1)
#define MSG_PARITY_ERROR SYMBOLIC(MSG_PARITY_ERROR)
#define MSG_PEEK LITERALLY(2)
#define MSG_PROXY SYMBOLIC(MSG_PROXY)
#define MSG_RST SYMBOLIC(MSG_RST)
#define MSG_STAT SYMBOLIC(MSG_STAT)
#define MSG_SYN SYMBOLIC(MSG_SYN)
#define MSG_TRUNC SYMBOLIC(MSG_TRUNC)
#define MSG_WAITALL SYMBOLIC(MSG_WAITALL)
#define MSG_WAITFORONE SYMBOLIC(MSG_WAITFORONE)
#endif /* COSMOPOLITAN_LIBC_SYSV_CONSTS_MSG_H_ */

Some files were not shown because too many files have changed in this diff Show more