summaryrefslogtreecommitdiff
path: root/include
AgeCommit message (Collapse)AuthorLines
2012-07-19fix typo in aio.hRich Felker-1/+1
2012-07-12workaround another sendmsg kernel bug on 64-bit machinesRich Felker-7/+0
the kernel wrongly expects the cmsg length field to be size_t instead of socklen_t. in order to work around the issue, we have to impose a length limit and copy to a local buffer. the length limit should be more than sufficient for any real-world use; these headers are only used for passing file descriptors and permissions between processes over unix sockets.
2012-07-12fix redef of sigprocmask constants on mipsRich Felker-2/+0
this fix is easier than trying to reorder the header stuff
2012-07-12more mips bits-header fixesRich Felker-0/+2
signal handling was very broken because of this
2012-07-04add prototypes for getw/putwRich Felker-0/+2
2012-07-03jmp_buf overhaul fixing several issuesRich Felker-1/+5
on arm, the location of the saved-signal-mask flag and mask were off by one between sigsetjmp and siglongjmp, causing incorrect behavior restoring the signal mask. this is because the siglongjmp code assumed an extra slot was in the non-sig jmp_buf for the flag, but arm did not have this. now, the extra slot is removed for all archs since it was useless. also, arm eabi requires jmp_buf to have 8-byte alignment. we achieve that using long long as the type rather than with non-portable gcc attribute tags.
2012-06-29replace old and ugly crypt implementationRich Felker-0/+20
the new version is largely the work of Solar Designer, with minor changes for integration with musl. compared to the old code, text size is reduced by about 7k, stack space usage by about 70k, and performance is greatly improved by avoiding expensive calculation of constant tables on each run. this version also adds support for extended des-based password hashes, which allow for unlimited key (password) length and configurable iteration counts. i've also published the interface for crypt_r in a new crypt.h header. especially since this is not a standard interface, i did not feel compelled to match the glibc abi for the crypt_data structure. the glibc structure is way too big to allocate on the stack; in fact it's so big that the first usage may cause the main thread to exceed its pre-committed stack size of 128k and thus could cause the program to crash even on systems with overcommit disabled. the only legitimate use of crypt_data for crypt_r is to store the hash string to return, so i've reserved 256 bytes, which should be more than sufficient (longest known password hashes are ~60 characters, and beyond that is possibly even exceeding some implementations' passwd file field size limit).
2012-06-23add process_vm_readv and process_vm_writev syscall wrappersRich Felker-0/+9
based on a patch submitted by Kristian L. <email@thexception.net>
2012-06-20proper error handling for fcntl F_GETOWN on modern kernelsRich Felker-0/+11
on old kernels, there's no way to detect errors; we must assume negative syscall return values are pgrp ids. but if the F_GETOWN_EX fcntl works, we can get a reliable answer.
2012-06-19include declarations for new stdio_ext functions (gnulib support)Rich Felker-0/+5
2012-06-15header file fixes: multiple include guard consistency and correctnessRich Felker-18/+18
one file was reusing another file's macro name, and many had inconsistent underscores and application of SYS prefix, etc. patch by Szabolcs Nagy (nsz)
2012-06-13revert one change in time.h; no evidence BSD_SOURCE should expose these..Rich Felker-1/+1
2012-06-13fix feature test macros in time.hRich Felker-5/+2
stime is not _XOPEN_SOURCE, and some functions were missing with _BSD_SOURCE..
2012-06-13add timegm function (inverse of gmtime), nonstandardRich Felker-0/+3
2012-06-13add (currently stubbed due to stubbed strverscmp) versionsort functionRich Felker-0/+5
based on patch by Emil Renner Berthing, with minor changes to dirent.h for LFS64 and organization of declarations this code should work unmodified once a real strverscmp is added, but I've been hesitant to add it because the GNU strverscmp behavior is harmful in a lot of cases (for instance if you have numeric filenames in hex). at some point I plan on trying to design a variant of the algorithm that behaves better on a mix of filename styles.
2012-06-08fix signedness errors in stdint.h constant macrosRich Felker-2/+2
the types of these expressions must match the integer promotions. unsigned 8- and 16-bit values promote to signed int, not unsigned int.
2012-06-07fix sysinfo, try 2. it seems to work this time.Rich Felker-10/+10
2012-06-07sysinfo struct was utter nonsense; no idea where it came from.Rich Felker-4/+3
this broke the busybox "free" utility (memory reporting) and possibly other things like uptime.
2012-06-04_GNU_SOURCE is supposed to imply _LARGEFILE64_SOURCERich Felker-15/+15
this is ugly and stupid, but now that the *64 symbol names exist, a lot of broken GNU software detects them in configure, then either breaks during build due to missing off64_t definition, or attempts to compile without function declarations/prototypes. "fixing" it here is easier than telling everyone to add yet another feature test macro to their builds.
2012-06-02declare environ in unistd.h when _GNU_SOURCE feature test macro is usedRich Felker-0/+1
lots of broken programs expect this, and it's gotten to the point of being a troubleshooting FAQ topic. best to just fix it.
2012-05-28there is no such GNU function fpurge, only __fpurge.Rich Felker-1/+0
no idea where I got the idea fpurge should exist...
2012-05-28add prototype for BSD/GNU stdio *_unlocked extension functionsRich Felker-2/+12
also fix up distinction of what is GNU-only and what's GNU+BSD
2012-05-28remove duplicate lfs64 cruft in stdio.hRich Felker-2/+0
2012-05-28math: fix nextafter definition in tgmath.hnsz-1/+1
2012-05-23debloat jmp_buf in _GNU_SOURCE modeRich Felker-3/+0
i originally made it the same size as the bloated GNU version, which contains space for saved signal mask, but this makes some structures containing jmp_buf become much larger for no benefit. we will never use the signal mask field with plain setjmp; sigsetjmp serves that purpose.
2012-05-22remove everything related to forkallRich Felker-1/+0
i made a best attempt, but the intended semantics of this function are fundamentally contradictory. there is no consistent way to handle ownership of locks when forking a multi-threaded process. the code could have worked by accident for programs that only used normal mutexes and nothing else (since they don't actually store or care about their owner), but that's about it. broken-by-design interfaces that aren't even in glibc (only solaris) don't belong in musl.
2012-05-22some feature test fixes for unistd.hRich Felker-16/+16
2012-05-22_GNU_SOURCE implies all BSD features except ones GNU rejectsRich Felker-1/+1
2012-05-22various header cleanups, some related to _BSD_SOURCE additionRich Felker-17/+9
there is no reason to avoid multiple identical macro definitions; this is perfectly legal C, and even with the maximal warning options enabled, gcc does not issue any warning for it.
2012-05-22bsd_signal is a legacy (removed) XSI function, not needed in _BSD_SOURCERich Felker-4/+1
its only purpose was for use on non-BSD systems that implement sysv semantics for signal() by default.
2012-05-22support _BSD_SOURCE feature test macroRich Felker-41/+126
patch by Isaac Dunham. matched closely (maybe not exact) to glibc's idea of what _BSD_SOURCE should make visible.
2012-05-20move getpass decl to the right placeRich Felker-1/+1
2012-05-14useless lastlog path just to make some stuff happyRich Felker-0/+1
2012-05-14missing limit LOGIN_NAME_MAXRich Felker-0/+1
2012-05-12use __h_errno_location for h_errnoRich Felker-1/+5
we do not bother making h_errno thread-local since the only interfaces that use it are inherently non-thread-safe. but still use the potentially-thread-local ABI to access it just to avoid lock-in.
2012-05-12susv4 removed gethostbyname, etc. legacy cruft.Rich Felker-9/+7
2012-05-12namespace cleanup - NI_* is NOT reserved by netdb.hRich Felker-3/+2
2012-05-12some gnu junk in netdb.hRich Felker-0/+8
2012-05-12fix missing va_list for vsyslogRich Felker-2/+2
2012-05-13search: add tdestroy (gnu extension)nsz-0/+2
2012-05-11add missing IN6_ARE_ADDR_EQUALRich Felker-0/+5
written to avoid multiple conditional jumps and avoid ugly repetitive lines in the header file.
2012-05-10add one more bogus legacy headerRich Felker-0/+9
this one is for program(s|ers) who haven't heard of uint16_t and uint32_t (which are obviously the correct types for use in such situations, as they're the argument/return types for ntohs/htons and ntohl/htonl).
2012-05-10move vsyslog out of SYSLOG_NAMES conditionalRich Felker-2/+4
2012-05-10fix missing parens in bit op macros (param.h)Rich Felker-1/+1
2012-05-10and another bug in setbit, etc. macros..Rich Felker-1/+1
2012-05-10fix typo in sys/param.h that broke setbit, etc. macrosRich Felker-1/+1
this is all junk, but some programs use it.
2012-05-09omit declaration of basename wrongly interpreted as prototype in C++Rich Felker-0/+2
the non-prototype declaration of basename in string.h is an ugly compromise to avoid breaking 2 types of broken software: 1. programs which assume basename is declared in string.h and thus would suffer from dangerous pointer-truncation if an implicit declaration were used. 2. programs which include string.h with _GNU_SOURCE defined but then declare their own prototype for basename using the incorrect GNU signature for the function (which would clash with a correct prototype). however, since C++ does not have non-prototype declarations and interprets them as prototypes for a function with no arguments, we must omit it when compiling C++ code. thankfully, all known broken apps that suffer from the above issues are written in C, not C++.
2012-05-06some extra legacy header stuffRich Felker-0/+32
2012-05-06take byte order from gcc if gcc has defined itRich Felker-0/+4
this only works with gcc 4.6 and later, but it allows us to support non-default endianness on archs like arm, mips, ppc, etc. that can do both without having separate header sets for both variants, and it saves one #include even on fixed-endianness archs like x86.
2012-05-06add isastream (obsolete STREAMS junk)Rich Felker-1/+2
apparently some packages see stropts.h and want to be able to use this. the implementation checks that the file descriptor is valid by using fcntl/F_GETFD so it can report an error if not (as specified).