summaryrefslogtreecommitdiff
path: root/lib/libc
Commit message (Collapse)AuthorAgeFilesLines
* Call __sgetc() directly in getchar() instead of taking an expensiveTim J. Robbins2004-03-101-1/+1
| | | | | | | detour through getc(). Notes: svn path=/head/; revision=126804
* Set the stream orientation explicitly in fgetln() instead of relying onTim J. Robbins2004-03-101-0/+1
| | | | | | | __srefill() to do it. Notes: svn path=/head/; revision=126802
* Set stream orientation in puts().Tim J. Robbins2004-03-101-0/+2
| | | | Notes: svn path=/head/; revision=126800
* Backout the previous revision due to objections.John Birrell2004-03-092-10/+4
| | | | Notes: svn path=/head/; revision=126765
* On 4.X it was possible for an application to initialise a local FILEJohn Birrell2004-03-092-4/+10
| | | | | | | | | | | | structure and call stdio functions. In 5.X this was broken when FILE locking was introduced into libc. This change makes most (relevant) stdio functions work again when the _extra file in FILE isn't initialised (and can't be without a libc function to do it since the __sFILEX structure is private to libc). Notes: svn path=/head/; revision=126760
* Rearrange (centralize) initialization of mallocs internals to always bePoul-Henning Kamp2004-03-071-19/+13
| | | | | | | | | done before the first call, even if this is a malloc(0) call. PR: 62859 Notes: svn path=/head/; revision=126727
* Merge some fixes from NetBSD's getopt.3 v1.31:Andrey A. Chernov2004-03-061-43/+88
| | | | | | | cleanup, add more sections, better explanation, declaration Notes: svn path=/head/; revision=126697
* Merge some fixes from NetBSD's getopt.c v1.26:Andrey A. Chernov2004-03-061-26/+43
| | | | | | | | | | | cleanups, handling 'ls -l-', handling '--*' Note this is in the same time back out of our v1.3 "Don't print an error message if the bad option is '?'" because it directly violates POSIX. Notes: svn path=/head/; revision=126696
* Fix typo, was 'W'; instead of `W;'Andrey A. Chernov2004-03-061-1/+1
| | | | Notes: svn path=/head/; revision=126693
* Make GNU-compatible following case:Andrey A. Chernov2004-03-062-23/+27
| | | | | | | single '-' in command line and '-' (non-first) in options Notes: svn path=/head/; revision=126692
* Make NULL a (void*)0 whereever possible, and fix the warnings(-Werror)Mark Murray2004-03-054-8/+8
| | | | | | | | | | | | | | | | | | that this provokes. "Wherever possible" means "In the kernel OR NOT C++" (implying C). There are places where (void *) pointers are not valid, such as for function pointers, but in the special case of (void *)0, agreement settles on it being OK. Most of the fixes were NULL where an integer zero was needed; many of the fixes were NULL where ascii <nul> ('\0') was needed, and a few were just "other". Tested on: i386 sparc64 Notes: svn path=/head/; revision=126643
* Document missing EFAULT errno value.Diomidis Spinellis2004-03-031-0/+8
| | | | | | | MFC after: 2 weeks Notes: svn path=/head/; revision=126553
* Make return code in noarg case GNU-compatibleAndrey A. Chernov2004-03-032-20/+24
| | | | Notes: svn path=/head/; revision=126535
* Be more GNU-compatible in diagnosticsAndrey A. Chernov2004-03-031-11/+61
| | | | Notes: svn path=/head/; revision=126518
* 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