summaryrefslogtreecommitdiff
path: root/lib/libc
Commit message (Collapse)AuthorAgeFilesLines
* If handed a file pointer we can't write to, set errno properly to EBADFJordan K. Hubbard2004-03-021-1/+4
| | | | | | | | | | in order to get SUSv2 conformant behavior in higher level calls like fputs() and puts(). Reviewed by: bde Notes: svn path=/head/; revision=126506
* makecontext lib call.Peter Grehan2004-03-023-3/+167
| | | | | | | Submitted by: Suleiman Souhlal <refugee@segfaulted.com> Notes: svn path=/head/; revision=126475
* Improve GNU compatibility in several places, use internal GNU_COMPATIBLEAndrey A. Chernov2004-03-012-29/+49
| | | | | | | | | | define for it. Don't catch POSIXLY_CORRECT env. into static variable, it can be changed on the fly by program. Use P1003.2 standartized illoptchar[] Notes: svn path=/head/; revision=126452
* Comment out things related to getopt() replacement we not useAndrey A. Chernov2004-03-011-36/+36
| | | | Notes: svn path=/head/; revision=126440
* Change "-"-started options when POSIX_CORRECTLY is set handlingAndrey A. Chernov2004-03-011-17/+17
| | | | | | | | in favour of GNU instead of NetBSD, because configure's use us and expect GNU. Notes: svn path=/head/; revision=126439
* Change "-"-started options when POSIX_CORRECTLY is set handlingAndrey A. Chernov2004-03-011-1/+5
| | | | | | | | in favour of GNU instead of NetBSD, because configure's use us and expect GNU. Notes: svn path=/head/; revision=126438
* Make consistent with the better written wcsrtombs function:Diomidis Spinellis2004-02-271-4/+5
| | | | | | | | | - Fix syntax - Remove the (slightly wrong) duplicate explanation of the error condition - Change reference to invalid multibyte character into invalid wide character Notes: svn path=/head/; revision=126313
* Make the resolver(3) and many associated interfaces much more reentrant.Brian Feldman2004-02-2513-52/+280
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The getaddrinfo(3), getipnodebyname(3) and resolver(3) can coincide now with what should be totally reentrant, and h_errno values will now be preserved correctly, but this does not affect interfaces such as gethostbyname(3) which are still mostly non-reentrant. In all of these relevant functions, the thread-safety has been pushed down as far as it seems possible right now. This means that operations that are selected via nsdispatch(3) (i.e. files, yp, dns) are protected still under global locks that getaddrinfo(3) defines, but where possible the locking is greatly reduced. The most noticeable improvement is that multiple DNS lookups can now be run at the same time, and this shows major improvement in performance of DNS-lookup threaded programs, and solves the "Mozilla tab serialization" problem. No single-threaded applications need to be recompiled. Multi-threaded applications that reference "_res" to change resolver(3) options will need to be recompiled, and ones which reference "h_errno" will also if they desire the correct h_errno values. If the applications already understood that _res and h_errno were not thread-safe and had their own locking, they will see no performance improvement but will not actually break in any way. Please note that when NSS modules are used, or when nsdispatch(3) defaults to adding any lookups of its own to the individual libc _nsdispatch() calls, those MUST be reentrant as well. Notes: svn path=/head/; revision=126243
* Add getopt_long_only() from OpenBSD and other OpenBSD cleanupsAndrey A. Chernov2004-02-243-299/+459
| | | | | | | | PR: 63173 Submitted by: Marius Strobl <marius@alchemy.franken.de> Notes: svn path=/head/; revision=126189
* Apply style(9).Brian Feldman2004-02-231-2/+6
| | | | | | | | Submitted by: "Christian S.J. Peron" <maneo@bsdpro.com> PR: bin/63283 Notes: svn path=/head/; revision=126180
* Add signal numbers to signal(3).Josef El-Rayes2004-02-231-33/+36
| | | | | | | | | | Approved by: simon(mentor) Reviewed by: ru Submitted by: Stefan Farfeleder <stefan@fafoe.narf.at> PR: docs/60044 Notes: svn path=/head/; revision=126164
* Add optarg, optind, opterr, optopt, optreset to SYNOPSYSAndrey A. Chernov2004-02-231-0/+5
| | | | Notes: svn path=/head/; revision=126143
* POSIX clearly states that getsubopt() should be declared in <stdlib.h>Andrey A. Chernov2004-02-231-1/+1
| | | | | | | not in <unistd.h> Notes: svn path=/head/; revision=126139
* Remove unneccessary <unistd.h>Andrey A. Chernov2004-02-231-1/+0
| | | | Notes: svn path=/head/; revision=126138
* Change the syscall stub branch orders so that the static branch predictionPeter Wemm2004-02-224-12/+51
| | | | | | | will assume that syscalls will succeed rather than fail. Notes: svn path=/head/; revision=126107
* Remove the triplicity in the public functions by vectoring them allPoul-Henning Kamp2004-02-211-70/+49
| | | | | | | | | | | | | through a realloc like function. Make the malloc_active variable a local static to this new function. Don't warn about recursion more than once per base call. constify malloc_func. Notes: svn path=/head/; revision=126061
* Move the check for sensitive processes to the point where the exceptionPoul-Henning Kamp2004-02-211-14/+7
| | | | | | | | | | | | has been hit, this makes it cover more cases. Call the message function directly rather than fiddle with flag-saving when we find an unknown character in our options. The 'A' flag should not trigger on legal out of memory conditions. Notes: svn path=/head/; revision=126060
* add destination address selection support for getipnodebyname(3).Hajimu UMEMOTO2004-02-201-1/+225
| | | | | | | | though getipnodebyname(3) is obsoleted api, some major applications such as Mozilla are still using it. so, it will help ipv4 users. Notes: svn path=/head/; revision=126052
* Unbreak the upgrade path from 4.9 after removal of GNU getopt andRuslan Ermilov2004-02-201-2/+0
| | | | | | | <gnuregex.h>. Notes: svn path=/head/; revision=126039
* Document dependence of mktemp(3) on the non-reentrant arc4random(3).Brian Feldman2004-02-201-0/+7
| | | | Notes: svn path=/head/; revision=126034
* Remove the code and an associated comment for gcc 1.x compatibilityDavid Schultz2004-02-161-9/+1
| | | | | | | and fix a typo in the !__GNUC__ case. Notes: svn path=/head/; revision=125867
* Fix a typo in the !__GNUC__ case and remove an obsolete comment.David Schultz2004-02-161-3/+1
| | | | Notes: svn path=/head/; revision=125866
* Fix some aliasing problems.David Schultz2004-02-166-52/+94
| | | | Notes: svn path=/head/; revision=125865
* Add forgotten IEEE functions. The Perl 5.8 port now compiles.Peter Grehan2004-02-129-2/+428
| | | | | | | | Submitted by: Suleiman Souhlal <refugee@segfaulted.com> Obtained from: NetBSD Notes: svn path=/head/; revision=125733
* style cleanup: Remove duplicate $FreeBSD$ tags.Colin Percival2004-02-103-6/+0
| | | | | | | | | | | These files had tags after teh copyright notice, inside the comment block (incorrect, removed), and outside the comment block (correct). Approved by: rwatson (mentor) Notes: svn path=/head/; revision=125669
* style cleanup: Remove duplicate $FreeBSD$ tags.Colin Percival2004-02-102-5/+1
| | | | | | | | | | | These files had tags after the copyright notice, inside the comment block (incorrect, removed), and outside the comment block (correct). Approved by: rwatson (mentor) Notes: svn path=/head/; revision=125668
* style cleanup: Remove duplicate $FreeBSD$ tags.Colin Percival2004-02-103-4/+0
| | | | | | | | | | | These files had tags at the start of the file (incorrect, removed), and after the copyright notices (correct). Approved by: rwatson (mentor) Notes: svn path=/head/; revision=125667
* Rewrite fabs.S to use pure SSE2 operations. I got the clues how to doPeter Wemm2004-02-081-10/+35
| | | | | | | this from looking at code generated by gcc. Notes: svn path=/head/; revision=125600
* Update the documentation for setpgrp(2) to reflect the access controlDavid Schultz2004-02-081-7/+21
| | | | | | | | | | checks that the code actually performs. Judging from the 4.2BSD release notes, the docs have only been out of date for 20 years. PR: 29844 Notes: svn path=/head/; revision=125592
* Document the SF_NODISKIO flag, and fix a small typo.Mike Silbersack2004-02-081-2/+10
| | | | Notes: svn path=/head/; revision=125587
* Unbreak world.Ruslan Ermilov2004-02-071-2/+2
| | | | Notes: svn path=/head/; revision=125562
* getnetbyname fixes:Diomidis Spinellis2004-02-071-22/+67
| | | | | | | | | | Do not choke on malformed network addresses. Return n_name in static space, not on the function's stack. MFC after: 1 week Notes: svn path=/head/; revision=125555
* Prevent memory leak on sem_destroy() by destroying the semaphore'sDaniel Eischen2004-02-061-1/+4
| | | | | | | internal mutex and CV. Notes: svn path=/head/; revision=125521
* Only allow the semaphore to be taken when the value is positive.Daniel Eischen2004-02-061-2/+1
| | | | | | | | | Don't decrement it twice when it is taken. Reported by: kris Notes: svn path=/head/; revision=125518
* Correct check for invalid semaphore on sem_destroy() (s/==/!=/).Daniel Eischen2004-02-051-1/+1
| | | | | | | Reported by: kris Notes: svn path=/head/; revision=125509
* Correct the weak reference for sem_unlink.Daniel Eischen2004-02-051-1/+1
| | | | Notes: svn path=/head/; revision=125502
* Allow libc's version of sem_trywait() to work for non-pshared mutexes.Daniel Eischen2004-02-041-2/+17
| | | | Notes: svn path=/head/; revision=125446
* Modify the implementation of libc semaphores so that they can beDaniel Eischen2004-02-031-146/+132
| | | | | | | | | | | | | | | overridden by the threads library to provide a userland version of non-pshared semaphores and cancellation points. Also add a sem_timedwait(). The libc version of semaphores always uses kernel semaphores regardless of whether pshared is set or not. When threads are not present, it is difficult to get sem_wait() or sem_timedwait() to do the right thing (since pthread_cond_timedwait() and pthread_cond_wait() are stubs in libc and just return immediately). Notes: svn path=/head/; revision=125372
* Merge vfscanf.c,v 1.35.David Schultz2004-01-311-4/+10
| | | | Notes: svn path=/head/; revision=125283
* Fix the handling of negative hexadecimal numbers in integer formats.David Schultz2004-01-311-3/+9
| | | | | | | | | | Note that this bug is unrelated to recent work in this area; it seems to have been present since revision 1.1. Obtained from: NetBSD Notes: svn path=/head/; revision=125282
* LC_ALL not always take priority over other LC_*Andrey A. Chernov2004-01-311-22/+35
| | | | | | | | Obtained from: NetBSD PR: 62047 Notes: svn path=/head/; revision=125274
* Add reference to environ(7)Andrey A. Chernov2004-01-291-1/+2
| | | | Notes: svn path=/head/; revision=125190
* Xref kqueue and pollEivind Eklund2004-01-261-0/+2
| | | | Notes: svn path=/head/; revision=125039
* Xref kqueueEivind Eklund2004-01-261-0/+1
| | | | Notes: svn path=/head/; revision=125038
* Describe EOVERFLOW caseAndrey A. Chernov2004-01-251-0/+9
| | | | Notes: svn path=/head/; revision=124952
* When writing/reading longs use explicit 32bit temporary values.Martin Blapp2004-01-241-3/+4
| | | | | | | | | | | MFNetBSD rev. 1.15 + rev 1.16 PR: bin/60901 Submitted by: Logan Gabriel <gersh@sonn.com> Obtained from: NetBSD Notes: svn path=/head/; revision=124897
* Merge vfprintf.c, v1.61 and 1.62. For compatibility with __hdtoa()David Schultz2004-01-231-19/+25
| | | | | | | | | | and to reduce diffs between vfprintf.c and vfwprintf.c, declare xdigs* to be char arrays rather than wchar_t arrays. In collaboration with: tjr Notes: svn path=/head/; revision=124887
* Include <stdlib.h> to get abort() prototype.Peter Grehan2004-01-211-0/+2
| | | | Notes: svn path=/head/; revision=124769
* Updated manh shift constant type to 'ULL' for PPC to fixPeter Grehan2004-01-211-1/+1
| | | | | | | | | shift-too-large compile error reviewed by: das Notes: svn path=/head/; revision=124767
* Discard the first 1024 bytes of output as suggested byDavid Schultz2004-01-201-1/+13
| | | | | | | | | | | http://citeseer.nj.nec.com/fluhrer01weaknesses.html and http://citeseer.nj.nec.com/531224.html . PR: 61126 Submitted by: Jeff Ito <jeffi@rcn.com> Notes: svn path=/head/; revision=124741