summaryrefslogtreecommitdiffstats
path: root/lib/libc
Commit message (Collapse)AuthorAgeFilesLines
* Rework the floating point code in printf(). Significant changes:das2003-04-052-151/+191
| | | | | | | | | | | | | | | | | | - We used to round long double arguments to double. Now we print them properly. - Bugs involving '%F', corner cases of '#' and 'g' format specifiers, and the '.*' precision specifier have been fixed. - Added support for the "'" specifier to print thousands' grouping characters in a locale-dependent manner. - Implement the __vfprintf() side of hexadecimal floating point support. All that is still needed is a routine to convert the mantissa to hex digits one nibble at a time in the style of ultoa(). Reviewed by: silence on standards@
* Add __ldtoa(), a wrapper around gdtoa() to make it look like dtoa().das2003-04-058-1/+135
| | | | | | | In support of this, add some MD macros to assist in converting long doubles to the format expected by gdtoa(). Reviewed by: silence on standards@
* Add missing #include to unbreak previous commit.das2003-04-051-0/+1
|
* Correct some buffer sizes.das2003-04-053-23/+42
| | | | | | | | | | - __vfprintf()'s 'buf' has never been used for floating point, so don't define it in terms of (incorrect) constants describing floating point numbers. The actual size needed depends on sizeof(uintmax_t) and locale details, so I slightly overestimated. - We don't need a 308-character buffer to store the string "308". With long doubles and %a we need more than three characters, though.
* MFp4: Link strtof.3 and strtold.3 to strtod.3.tjr2003-04-051-0/+1
|
* Zero out the struct tm supplied by the caller. Otherwise,mtm2003-04-051-0/+1
| | | | | | | | strange things might happen when garbage values in the struct get passed in to localtime_r() and family. Noticed by: marcus Approved by: markm (mentor)(implicit)
* MFp4: Pentium/Athlon-optimised implementation of wcschr().tjr2003-04-052-1/+78
|
* Implement makecontext.jake2003-04-013-3/+129
|
* [1] - Document EHOSTUNREACH as a possible errorceri2003-04-011-1/+3
| | | | | | | | [2] - Remove a contraction PR: docs/50401 Submitted by: [1] Slaven Rezic <slaven@rezic.de> MFC after: 1 week
* Add a facility allowing processes to inform the VM subsystem they arewes2003-03-311-0/+9
| | | | | | | | critical and should not be killed when pageout is looking for more memory pages in all the wrong places. Reviewed by: arch@ Sponsored by: St. Bernard Software
* BDE'ifyfjoe2003-03-291-79/+89
|
* fix truncation check and buffer overflow checkfjoe2003-03-291-11/+11
|
* Align signal frame placed on stack to 16 bytes so that SSE FPU registerdeischen2003-03-291-1/+2
| | | | | | restores can work. Also correct allocation for signal frame size. Reviewed by: mini
* Fill in the rest of the fields in the resulting struct tmmtm2003-03-291-2/+3
| | | | | | | | | | from strptime(3). Previously, they would get filled only for the %s specifier and as a side effect of using the the %Z specifier with a GMT time zone. PR: misc/48993 Approved by: markm (mentor) Silence on: -standards
* - MAXPATHLEN -> PATH_MAX (pass correct buffer size to readlink as well)fjoe2003-03-281-17/+17
| | | | Requested by: bde
* Make realpath() thread-safe. New implementation does not use chdir(2) at all.fjoe2003-03-272-111/+128
| | | | Submitted by: Constantin S. Svintsoff <kostik (at) iclub.nsu.ru>
* - Define a _spinunlock() function so that threading implementations may dojeff2003-03-262-1/+11
| | | | | | more complicated things than just setting the lock to 0. - Implement stubs for this function in libc and the two threading libraries that are currently in the tree.
* The .Fn functioncharnier2003-03-244-7/+11
| | | | The ... 2 system call
* The .Fn function. Use .Xr where appropriate.charnier2003-03-245-16/+27
|
* According to C99 decimal_point can't be emptyache2003-03-201-4/+1
|
* According to C99 decimal_point can't be the empty string, mention it.ache2003-03-201-1/+2
|
* decimal_point can't be "" according to C99, so set it to standard "."ache2003-03-201-1/+6
| | | | in that case.
* - Revamp the function _nis_initshells() to make getusershell() backedrobert2003-03-191-35/+30
| | | | | | | by NIS work, like nsswitch.conf(5) promises to be able to. (These modifications will be fed back to NetBSD, of course) - In endusershell(), do not set `sl' to NULL if we know it already has that value.
* If realloc(3) fails in copyline(), do not make matters worse byrobert2003-03-191-6/+11
| | | | leaving without deallocating `data' thereby creating a memory leak.
* The gdtoa import apparently hasn't caused anything or anyone todas2003-03-151-2429/+0
| | | | | explode, so nix the old strtod() / dtoa(). This change is part of the gdtoa patches reviewed on standards@.
* MFp4: Pentium/Athlon-optimised implementation of wcslen().tjr2003-03-142-1/+69
|
* Merge vfprintf.c revision 1.52.tjr2003-03-141-2/+2
|
* Kludge around a bug that results from printf() assuming thatdas2003-03-141-1/+1
| | | | | | | | | dtoa() is buggy. The bug would cause incorrect output to be generated when format strings such as '%5.0f' were used with nonzero numbers whose magnitude is less than 1. Reported by: df(1) by way of periodic(8) Reviewed by: mike
* Unexpand RCS tag.tjr2003-03-141-1/+1
|
* Clean up the way gdtoa sources are found.obrien2003-03-132-8/+7
| | | | OK'ed by: das
* Document return type of wordfree() (void). Reduce the space betweentjr2003-03-131-3/+4
| | | | | struct member names and the corresponding comments so the lines don't wrap on 80-column terminals.
* MFp4: Implementations of the wcstof() and wcstold() functions.tjr2003-03-134-10/+195
|
* MFp4: Catch up to recent __dtoa() interface changes and removal of cvt()'stjr2003-03-131-11/+10
| | | | last argument.
* Document strtof() and strtold(). Update vendor license.das2003-03-121-32/+75
| | | | Reviewed by: bde (briefly), mike (mentor), obrien
* Replace our ancient dtoa/strtod implementation with the gdtoadas2003-03-1220-10/+286
| | | | | | | | | | | | | | | | | | package, a more recent, generalized set of routines. Among the changes: - Declare strtof() and strtold() in stdlib.h. - Add glue to libc to support these routines for all kinds of ``long double''. - Update printf() to reflect the fact that dtoa works slightly differently now. As soon as I see that nothing has blown up, I will kill src/lib/libc/stdlib/strtod.c. Soon printf() will be able to use the new routines to output long doubles without loss of precision, but numerous bugs in the existing code must be addressed first. Reviewed by: bde (briefly), mike (mentor), obrien
* Ditch a static global and the mutex that protected it. Achieve themtm2003-03-121-27/+18
| | | | | | | | desired strptime(3) reentrancy by adding an extra argument to _strptime() instead. Approved by: markm (mentor) MFC: 4 weeks
* Document the fact that hdestory calls free on the keys added withdwmalone2003-03-121-5/+25
| | | | | | | hsearch(.., ENTER). Make the example reflect this. PR: 49951 Submitted by: Peter Jeremy <peterjeremy@optushome.com.au>
* Update sendfile.2 to include a TUNING section that documents theseanc2003-03-121-0/+38
| | | | | | | various tunables that are applicable to sendfile(2). Update tuning.7 to mention a reference to sendfile.2. Approved by: keramida
* MFp4: Reduce code size by 26 bytes by only aligning the jump targets thattjr2003-03-121-10/+1
| | | | are at the top of loops.
* MFp4: Make `spanp' const.tjr2003-03-121-3/+4
|
* MFp4: Pentium/Athlon-optimised implementation of wmemchr().tjr2003-03-122-1/+115
|
* MFp4: Pentium-optimised implementation of wcscmp(). Performs significantlytjr2003-03-102-1/+80
| | | | better than the code generated by gcc in many cases.
* MFp4: Add the standard "the {fgetws,fputws} function will fail if" texttjr2003-03-092-0/+6
| | | | to the Errors section.
* Clean up some signed/unsigned issues in the XDR code.nectar2003-03-073-12/+18
| | | | Obtained from: OpenBSD
* Remove NS and ISO stuff.peter2003-03-057-737/+3
|
* Fix threaded applications on ia64 that are linked dynamicly. We didmarcel2003-03-051-3/+5
| | | | | | | | | | | | | | | | | not save (restore) the global pointer (GP) in the jmpbuf in setjmp (longjmp) because it's not needed in general. GP is considered a scratch register at callsites and hence is always restored after a call (when it's possible that the call resolves to a symbol in a different loadmodule; otherwise GP does not have to be saved and restored at all), including calls to setjmp/longjmp. There's just one problem with this now that we use setjmp/longjmp for context switching: A new context must have GP defined properly for the thread's entry point. This means that we need to put GP in the jmpbuf and consequently that we have to restore is in longjmp. This automaticly requires us to save it as well. When setjmp/longjmp isn't used for context switching, this can be reverted again.
* ABI breaker: Move the J_SIGMASK field in the jmpbuf beforemarcel2003-03-051-2/+2
| | | | | | | | | | | the J_SIG0 field. While here, rename J_SIG0 to J_SIGSET and remove J_SIG1. The main reason for this change is that the 128-bit sigset_t is now aligned on a 16-byte boundary, which allows us to use 16-byte atomic loads and stores on CPUs that support it. The removal of J_SIG1 is done to avoid confusion: it is never accessed and should not be. Renaming J_SIG0 to J_SIGSET is the icing on the cake that's better done now than later.
* Restore vendor ID.obrien2003-03-031-2/+2
|
* Use __FBSDID.obrien2003-03-0335-44/+85
|
* Eliminate 19 warnings in libc (at level WARNS=2) of thenectar2003-02-2714-5/+33
| | | | `implicit declaration of function' variety.
OpenPOWER on IntegriCloud