summaryrefslogtreecommitdiff
path: root/lib/libc
Commit message (Collapse)AuthorAgeFilesLines
* Grab all the information we need about a character with one call toTim J. Robbins2004-05-231-7/+5
| | | | | | | __maskrune() instead of one direct call and one through iswprint(). Notes: svn path=/head/; revision=129608
* Perform conversions straight from the stream buffer instead of scanningTim J. Robbins2004-05-221-18/+19
| | | | | | | | | | through byte by byte with mbrtowc(). In the usual case (buffer is big enough to contain the multibyte character, character does not straddle buffer boundary) this results in only one call to mbrtowc() for each wide character read. Notes: svn path=/head/; revision=129584
* Associate a multibyte conversion state object with each stream. Reset itTim J. Robbins2004-05-227-42/+24
| | | | | | | | | | | | to the initial state when a stream is opened or seeked upon. Use the stream's conversion state object instead of a freshly-zeroed one in fgetwc(), fputwc() and ungetwc(). This is only a performance improvement for now, but it would also be required in order to support state-dependent encodings. Notes: svn path=/head/; revision=129583
* Update the document date.Alan Cox2004-05-201-1/+1
| | | | | | | Reminded by: ru@ Notes: svn path=/head/; revision=129508
* Remove a long obsolete paragraph from the BUGS section.Alan Cox2004-05-191-10/+0
| | | | Notes: svn path=/head/; revision=129414
* For amd64, explicitly compile mcount.po, rather than copying mcount.o. WePeter Wemm2004-05-181-0/+6
| | | | | | | | need to compile it with -fno-omit-frame-pointers since the mcount code depends on that, and by default it omits them without -pg. Notes: svn path=/head/; revision=129407
* Clarify and extend paragraphs on interoperationYaroslav Tykhiy2004-05-173-6/+55
| | | | | | | | | | | | of fcntl(2), flock(2), and lockf(3) advisory locks. Add such a paragraph to the flock(2) manpage for the sake of consistency. Reviewed by: Cyrille Lefevre and Kirk McKusick on -arch MFC after: 2 weeks Notes: svn path=/head/; revision=129369
* getgrent() and friends should set errno if there is an error.Tim Kientzle2004-05-172-1/+8
| | | | | | | | | Also, clarify the manpage description of when errno is set and explain that clients should set errno=0 first if they want useful error information. Notes: svn path=/head/; revision=129367
* POSIX prohibits any library function from setting errno to 0.Tim Kientzle2004-05-172-2/+6
| | | | | | | | | | | Correct my previous commit and add a comment to the manpage indicating that the user must set errno to 0 if they wish to distinguish "no such user" from "error". Pointed out by: Jacques Vidrine (nectar@) Notes: svn path=/head/; revision=129349
* Use conversion state objects to store the accumulated wide character,Tim J. Robbins2004-05-171-63/+67
| | | | | | | | | low bound, and the number of bytes remaining instead of storing the raw byte sequence and deriving them every time mbrtowc() is called. This is much faster -- about twice as fast in some crude benchmarks. Notes: svn path=/head/; revision=129336
* Use a simpler and faster buffering scheme for partial multibyte characters.Tim J. Robbins2004-05-172-52/+80
| | | | Notes: svn path=/head/; revision=129334
* If getpwent/getpwuid/getpwnam return NULL, they must also set errno.Tim Kientzle2004-05-171-0/+3
| | | | Notes: svn path=/head/; revision=129319
* Use a simpler, faster buffering scheme for partial characters in mbrtowc().Tim J. Robbins2004-05-141-21/+27
| | | | Notes: svn path=/head/; revision=129229
* Import the softfloat emulation library, needed for FreeBSD/arm right now.Olivier Houchard2004-05-1439-0/+14975
| | | | | | | | It should become useless when gcc 3.4 will be imported, as libgcc from gcc 3.4 contains this bits for arm. Notes: svn path=/head/; revision=129203
* Import the FreeBSD/arm libc bits.Olivier Houchard2004-05-1453-0/+6228
| | | | | | | Obtained from: NetBSD Notes: svn path=/head/; revision=129202
* We use __arm__, not __arm32__.Olivier Houchard2004-05-141-1/+1
| | | | Notes: svn path=/head/; revision=129201
* Define malloc_pageshift and malloc_minsize for arm.Olivier Houchard2004-05-141-0/+4
| | | | Notes: svn path=/head/; revision=129200
* Fixed some minor style bugs.Bruce Evans2004-05-132-14/+20
| | | | Notes: svn path=/head/; revision=129184
* Allow encoding modules to override the default implementations ofTim J. Robbins2004-05-138-9/+113
| | | | | | | | mbsrtowcs() and wcsrtombs(). Provide a fast implementation for the trivial "NONE" encoding. Notes: svn path=/head/; revision=129179
* Fix braino in previous: check that the second byte in the characterTim J. Robbins2004-05-132-2/+2
| | | | | | | | buffer is non-null when the character is two bytes long, not when the buffer is two bytes long. Notes: svn path=/head/; revision=129166
* Fix some^Wseveral style bugs from last commit.Peter Edwards2004-05-123-45/+38
| | | | | | | | | | | | | Remove "sys/types.h" as "sys/param.h" is already included Use cast rather than back-pointer to convert from public to private version of FTS data, and so avoid littering fts.h with any of the details. Pointed out By: bde, kientzle Notes: svn path=/head/; revision=129161
* Fix typo.Josef El-Rayes2004-05-121-1/+1
| | | | | | | | Submitted by: Michel Lavondes <fox@vader.aacc.cc.md.us> PR: docs/66576 Notes: svn path=/head/; revision=129160
* Reduce overhead by calling internal versions of the multibyte conversionTim J. Robbins2004-05-128-11/+19
| | | | | | | functions directly wherever possible. Notes: svn path=/head/; revision=129154
* Move prototypes of various encoding-related functions into a new headerTim J. Robbins2004-05-1216-71/+72
| | | | | | | file to avoid extern'ing them all over the place. Notes: svn path=/head/; revision=129153
* Link radixsort(3) to sradixsort(3), make the latter appear inRuslan Ermilov2004-05-122-1/+2
| | | | | | | the whatis(1) output. Notes: svn path=/head/; revision=129151
* Document the fact that in a jailed environment, sendto(2) could failChristian S.J. Peron2004-05-111-0/+4
| | | | | | | | | | returning EPERM if the source address specified in the IP header did not match the address bound to the prison. Approved by: bmilekic (mentor) Notes: svn path=/head/; revision=129120
* In the absence of proper validation, at least check that null bytesTim J. Robbins2004-05-114-1/+19
| | | | | | | do not appear as anything but the first byte of a multibyte character. Notes: svn path=/head/; revision=129117
* Remove a trailing newline, to behave as documented in syslog(3):Diomidis Spinellis2004-05-101-0/+4
| | | | | | | | | | | | | | | | "A trailing newline is added if none is present." The code in syslogd, stderr, and console output always adds a newline at the EOL. However, the existing code never actually removed a trailing newline, and apparently relied on syslogd to convert it into a space character. Thus, the existing newline was converted to a trailing space at the EOL by syslogd, while stderr, and console output resulted in an empty line. MFC after: 2 weeks Notes: svn path=/head/; revision=129091
* Fixed style bugs in previous commit (bogus forward declaration andBruce Evans2004-05-101-3/+1
| | | | | | | inconsistent capitalization in comments). Notes: svn path=/head/; revision=129081
* Use a binary search to find the range containing a character inTim J. Robbins2004-05-093-20/+34
| | | | | | | | | RuneRange arrays. This is much faster when there are hundreds of ranges (as is the case in UTF-8 locales) and was inspired by a similar change made by Apple in Darwin. Notes: svn path=/head/; revision=129065
* o fix a sentence to match with the synopsis [1]Christian Brueffer2004-05-091-3/+3
| | | | | | | | | | | | o fix grammar nit PR: 66289 [1] Submitted by: Michel Lavondès <fox@vader.aacc.cc.md.us> Obtained from: OpenBSD [1] MFC after: 3 days Notes: svn path=/head/; revision=129064
* The FTS_NOSTAT option is an optimisation that reduces the numberPeter Edwards2004-05-083-6/+153
| | | | | | | | | | | | | | | | | | | | | | of stat(2) calls by keeping an eye of the number of links a directory has. It assumes that each subdirectory will have a hard link to its parent, to represent the ".." node, and stops calling stat(2) when all links are accounted for in a given directory. This assumption is really only valid for UNIX-like filesystems: A concrete example is NTFS. The NTFS "i-node" does contain a link count, but most/all directories have a link count between 0 and 2 inclusive. The end result is that find on an NTFS volume won't actually traverse the entire hierarchy of the directories passed to it. (Those with a link count of two are not traversed at all) The fix checks the "UFSness" of the filesystem before enabling the optimisation. Reviewed By: Tim Kientzle (kientzle@) Notes: svn path=/head/; revision=129052
* A minor refactoring to simplify portability: assign the filenameTim Kientzle2004-05-052-10/+14
| | | | | | | | length to a separate variable so that it will be easier to adapt to systems that don't have d_namlen in struct dirent. Notes: svn path=/head/; revision=128946
* Remove bogus FBSDID.David E. O'Brien2004-05-021-3/+1
| | | | Notes: svn path=/head/; revision=128844
* Fix damaged FBSDID.David E. O'Brien2004-05-021-3/+1
| | | | Notes: svn path=/head/; revision=128843
* Merge vfscanf.c, v1.37:David Schultz2004-05-021-8/+7
| | | | | | | - s/#ifdef FLOATING_POINT/#ifndef NO_FLOATING_POINT/ Notes: svn path=/head/; revision=128822
* Merge vfprintf.c, v1.65:David Schultz2004-05-021-24/+17
| | | | | | | | - s/#ifdef FLOATING_POINT/#ifndef NO_FLOATING_POINT/ - Remove HEXFLOAT Notes: svn path=/head/; revision=128821
* Add option NO_FP_LIBC, which disables floating-point support inDavid Schultz2004-05-021-0/+3
| | | | | | | | | | | *printf() and *scanf(). Currently, this reduces the size of libc.so by 9K on i386. But the real savings are for static binaries that use *printf() or *scanf() but not strtod(); with an FP-disabled libc, these binaries will not depend on the gdtoa routines, making each binary about 22K smaller. Notes: svn path=/head/; revision=128820
* - To make it easier to compile *printf() and *scanf() withoutDavid Schultz2004-05-022-31/+21
| | | | | | | | | | | | floating-point support, remove default definition of FLOATING_POINT from the source, and change the compile-time option to NO_FLOATING_POINT. - Remove the HEXFLOAT option. It saves an insignificant amount of space (<0.1% of the size of libc on i386) and complicates vfprintf() and checkfmt(). Notes: svn path=/head/; revision=128819
* When *printf() and *scanf() are compiled without floating-pointDavid Schultz2004-05-021-0/+4
| | | | | | | | support, fmtcheck() should not accept format strings that contain floating-point formats. Notes: svn path=/head/; revision=128818
* Markup nit.Ruslan Ermilov2004-04-271-1/+1
| | | | Notes: svn path=/head/; revision=128674
* Rewrite split_lines() to operate safelyAndrey A. Chernov2004-04-251-3/+7
| | | | | | | | PR: 62694 Submitted by: moulin p <moulin.p@calyopea.com> Notes: svn path=/head/; revision=128650
* Use the correct size to allocate, copy and clear argument type tablesTim J. Robbins2004-04-222-12/+18
| | | | | | | | | | | | | after their change from an array of char to an array of enum. This fixes problems that occurred when using positional arguments in format strings, particularly with more than STATIC_ARG_TBL_SIZE (8) of them. PR: 65841 Submitted by: Steven Smith (mostly) Notes: svn path=/head/; revision=128550
* Fix a bug that could result in getpw*() incorrectly returning NULL when NISJonathan Chen2004-04-211-0/+1
| | | | | | | | | | adjunct maps are used. One symtom of this bug is sshd saying: login_get_lastlog: Cannot find account for uid X when logging in. The problem here is caused by an incorrect reuse of the rv variable when previous values are needed later. Notes: svn path=/head/; revision=128537
* Unbreak world.Ruslan Ermilov2004-04-211-3/+2
| | | | Notes: svn path=/head/; revision=128517
* MFdragonfly: resolver fix for timeouts on unqualified hostnamesNate Lawson2004-04-211-5/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | res_search only incremented got_servfail for h_errno == TRY_AGAIN *AND* hp->rcode == SERVFAIL. However, there are cases such as timeouts where rcode is not always set to SERVFAIL. This leads to inconsistent nameserver operation during multi-domain and truncated dot searches, especially during booting when portions of the network are being brought up simultanious with dns lookups. This patch attempts to correct the problem by unconditionally terminating the search if TRY_AGAIN is returned (after res_query has gone through all retries and name servers) instead of trying other domain elements in the domain seach path. This patch should fix reported problems (which I can reproduce) with some NFS mounts failing during boot. This occured because mount_nfs thought the host name lookup returned a definitive failure using a non-dotted host name when, in fact, it timed out on the first part (host.search.domain.name) and got a definitive host-not-found response on the second part (host.). Generally speaking, search path name server timeouts can exceed 60 seconds per element and most machines which consistently timeout on earlier portions of a search path are effectively non-operational due to the imposed delays. It is more important for DNS lookups to return the proper error code then to be able to recover a valid lookup in later portions of the search path in these situations. Obtained from: DragonFly MFC after: 3 weeks Notes: svn path=/head/; revision=128507
* Add mention of the fact that timeouts are silently limited to 24 hours.Colin Percival2004-04-201-0/+5
| | | | | | | Observed by: jmg Notes: svn path=/head/; revision=128499
* Document POSIX stupidity: Attempts to mmap zero bytes will succeed (andColin Percival2004-04-181-0/+7
| | | | | | | have no effect), while attempts to munmap zero bytes will fail. Notes: svn path=/head/; revision=128411
* Bring describtion of a sysctl in line with the source:Christian Brueffer2004-04-161-1/+1
| | | | | | | | | kern.acct_chkfreq is specified in seconds, not minutes. Cluebat provided by: kensmith Notes: svn path=/head/; revision=128336
* Remove unnecessary .Pp macro and bump document dateChristian Brueffer2004-04-161-2/+1
| | | | | | | Submitted by: ru Notes: svn path=/head/; revision=128335