summaryrefslogtreecommitdiffstats
path: root/lib/libc (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Build static netent and hostent structure in a nicer and hopefully noteric2012-08-191-95/+100
| | | | | broken way. Make it almost trivial to implement gethostby*_r() family of functions when needed.
* When building dynamic hostent and netent, allocate a single linear buffer toeric2012-08-196-104/+88
| | | | | | hold both the structure and the data. The freehostent() and freenetent() API functions are not needed anymore. While there, ensure that the constructed addr and alias lists are really NULL terminated.
* ensure that async_run() and async_run_sync() always preserve errno.eric2012-08-183-13/+27
|
* RFC updates:jmc2012-08-181-3/+3
| | | | | | 5322 obsoletes 2822 5321 obsoletes 821 and 2821 6409 obsoletes 2476 and 4409
* RFCs 2461 and 2462 have been replaced by, respectively, RFCs 4861 and 4862;jmc2012-08-181-6/+6
|
* getrrsetyname() only uses ERRSET_* and is not supposed to set errno.eric2012-08-182-12/+12
| | | | make sure to save and restore errno properly.
* Simplify error reporting in hostaddr_async(). Only use EAI_* error codes.eric2012-08-181-11/+2
|
* Improve error reporting in getnameinfo_async() and getaddrinfo_async().eric2012-08-183-57/+46
| | | | | | | | | | They do not have to deal with h_errno at all. Also, errno is only kept for EAI_SYSTEM. Small code cleanup while there. Adapt getnameinfo() and getaddrinfo() wrappers to correctly save errno and overwrite it in the EAI_SYSTEM case. General errno handling issue reported by mikeb@.
* within Rs/Re reference blocks, use %U instead of %O (or any otherjmc2012-08-181-3/+3
| | | | | | | | | variants) for URLs, allowing mandoc -Thtml to properly generate links; (sendmail.8 changes are simply using Lk, which i somehow missed in previous) ingo reminded me to verify that gnu groff recognises %U: 1.20.1 does not, but 1.21 does;
* A couple small but long anticipated changes:matthew2012-08-151-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | - Link libpthread.so with -znodlopen. Because libpthread overrides the weak symbols in libc, we can't allow it to be dynamically loaded or else libc's weak symbols might have already been resolved by ld.so. (Also, major bump because this is technically a backwards incompat change in behavior, although dlopen()ing libpthread never really worked.) - Link libc.so with -nodefaultlibs -lgcc. This ensures that libc doesn't try to link against itself (which ld.so wouldn't like). - Change GCC 4 to link shared objects with -lpthread and -lc as appropriate, now that there's no issues with doing so. This means that it's no longer necessary to patch software to use -pthread instead of -lpthread. (Ports tree rejoice!) Also, to preemptively answer this question: No, this does not eliminate the need for LD_PRELOAD=libpthread.so. That's a separate issue that won't be resolved until we eliminate libc's weak symbols. Discussed extensively on email and icb over the past few months. ok deraadt
* remove unused variablechl2012-08-141-2/+1
| | | | ok matthew@
* Fix almost ten-years old bug in siglongjmp(), which would not restore a signalmiod2012-08-123-87/+57
| | | | | | | | | | | | | mask of zero (because of flawed logic assuming finding zero in the sigjmp_buf signal mask means sigsetjmp was invoked with a zero `savemask' argument). While there, clean comments of all *{set,long}jmp routines, and shave a few instructions by using bcnd insead of cmp + bb to test for zero values. Passes the regress tests, and now devel/libsigsegv configure siglongjmp test will not spin (this test is however flawed as it expects a signal handler declared as running on the sigaltstack and `returning' through siglongjmp to be invoked on the signal stack the next time the signal is raised).
* remove leftover NOLINT, WANTLINT, LINTFLAGS, LOBJ vars and lint targets.okan2012-08-022-24/+2
| | | | ok guenther@
* must be zero'd (found by regress)eric2012-07-291-1/+2
|
* remove reference to no longer existing description of nonexistent devices;naddy2012-07-261-7/+4
| | | | ok deraadt@ tedu@, wording tweaks jmc@
* Remove outdated reference to BSD 4.4 symlink behavior. Equivalentmatthew2012-07-171-11/+2
| | | | text was removed from symlink.7 over 16 years ago.
* Document new pathconf() variables.matthew2012-07-171-10/+51
| | | | From Brad, with tweaks by me.
* properly report EAI_SERVICE when the given servname is not defined foreric2012-07-131-2/+4
| | | | the given protocol.
* Use same (lame) verbiage to explain ifa_dstaddr as is used forkrw2012-07-131-3/+4
| | | | | | | | ifa_broadaddr. i.e. make it make clear that this field is only valid for P2P. (Hint: one's a field, and one's a #define giving a new name to said field) ok guenther@
* unused variableseric2012-07-121-2/+2
|
* implement res_mkqueryeric2012-07-111-1/+47
|
* fix an off-by-one error where the return value would point to thenaddy2012-07-111-2/+2
| | | | character after the '\0'; ok guenther@
* same code update and fix as for gethostnamadr_asynceric2012-07-101-55/+77
|
* simplify the code, improve error handling and plug a potential fd leak on erroreric2012-07-101-71/+101
|
* use the value actually passed to the functioneric2012-07-101-2/+2
|
* Better handling of servname in getaddrinfo_async. Do not necessarilyeric2012-07-101-11/+16
| | | | | fail if there is no entry for a given protocol. Fix issue reported by early testers.
* use PAGE_SHIFT instead of PGSHIFT, in preperation for futurederaadt2012-07-091-2/+2
| | | | | param.h symbol reduction. ok guenther
* implement res_querydomain() required by sendmaileric2012-07-081-1/+30
|
* add stub function for gethostent(), and move things around a bit while here.eric2012-07-081-12/+19
|
* Zap extra spaces from function pointer argumentsguenther2012-07-082-8/+8
| | | | Pointed out by Joachim Schipper (joachim at joachimschipper.nl)
* Describe tdelete()'s return value correctly and update the related CAVEATguenther2012-07-081-12/+15
| | | | | Based on a note from Steffen Daode Nurpmeso (sdaoden at googlemail.com) ok jmc@
* rename function to avoid symbol clasheric2012-07-073-12/+8
|
* remove bogus include of bsd.lib.mkeric2012-07-071-3/+1
|
* adapt the NetBSD code to make sigpending work on shjsg2012-07-031-2/+6
| | | | ok miod@ kettenis@
* The kernel returns the pending set; this stub has to save it throughguenther2012-07-011-4/+8
| | | | | | the pointer ok miod@ kettenis@
* make this actually workkettenis2012-07-011-23/+21
| | | | ok miod@
* after a talk with ariane, use MAP_FIXED for mquery to avoid the cost oftedu2012-06-261-2/+2
| | | | | | scanning for free space if the hint isn't available. also, on further inspection, this will prevent pmap_prefer from "improving" our hint.
* simplify a little of the posix standards talk. ok deraadt guenther jmctedu2012-06-263-34/+12
|
* Use nl_langinfo(RADIXCHAR) instead of localeconv()->decimal_point inmatthew2012-06-262-4/+10
| | | | | | | | | | | | | | | | printf() and avoid calling it unless needed (i.e., when we have a floating point value to print). This isn't a big concern currently due to our limited locale support and current localeconv() implementation, but it's still technically a data race and implementing POSIX 2008 per-thread locales is likely to make it worse. nl_langinfo() isn't guaranteed by POSIX to be thread-safe either, but at least our current implementation is thread-safe and it's a simpler interface to keep that way. Printing floating point values isn't async-signal-safe anyway due to gdtoa()'s use of malloc(), so that's not an issue. ok deraadt, stsp, millert
* Do not use <machine/float.h>, that is an deformed BSD-ism.deraadt2012-06-259-18/+18
| | | | | It turns out <float.h> is the right file to pull in. ok millert
* In sysconf(), don't bother querying the kernel for userspace-onlymatthew2012-06-241-40/+19
| | | | | | values or features that POSIX now requires to always be provided. From Brad; ok guenther and me; incorporates feedback from millert too
* Change arc4random_uniform() to calculate ``2**32 % upper_bound'' asmatthew2012-06-241-12/+3
| | | | | | | | | | ``-upper_bound % upper_bound''. Simplifies the code and makes it the same on both ILP32 and LP64 architectures, and also slightly faster on LP64 architectures by using a 32-bit remainder instead of a 64-bit remainder. Pointed out by Jorden Verwer on tech@ ok deraadt; no objections from djm or otto
* - document newly imported AF_INET6 support to net_inet_{pton,ntop}gilles2012-06-241-5/+26
| | | | diff from Florian Obser, ok jmc@
* add support for AF_INET6 to inet_net_pton() and inet_net_ntop()gilles2012-06-222-2/+68
| | | | | | using inet_pton() and inet_ntop() as suggested by claudio ok claudio@
* two changes which should improve realloc. first, fix zapcacheregion totedu2012-06-221-10/+19
| | | | | | clear out the entire requested area, not just a perfect fit. second, use mquery to check for room to avoid getting an address we don't like and having to send it back.
* For now... libpthread is just a container directory, since all the newderaadt2012-06-211-1/+1
| | | | | | | | goop is in librthread. As a result, the top-level Makefile and shlib_version here are simply very confusing and tell lies. Remove them, and update the instructions in libc to not make my mistake again. ok guenther
* __tfork() needs to set the stack address of the new thread in the kernel,guenther2012-06-2115-127/+74
| | | | | | | | | so that it can't get a signal while still running on the parent thread's stack. Also, pass in sizeof(struct __tfork) to provide forward compat when more members are added. This is an ABI change, so switch syscall numbers and bump lib majors this time. ok deraadt@ matthew@
* two small fixes to free page cache. first, we need two nibbles of randomtedu2012-06-201-4/+4
| | | | | | in order to span the the entire cache. second, on free use the same offset to put things in the cache instead of always starting at zero. ok otto
* oops, forgot to install getdtablecount(2); noted by teduderaadt2012-06-191-3/+3
|
* Support larger-than-page-alignment requests in posix_memalign() bymatthew2012-06-182-23/+130
| | | | | | overallocating and then releasing unneeded memory pages. ok otto