summaryrefslogtreecommitdiffstats
path: root/lib/libc/stdio (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* Add fwprintf, swprintf, vfwprintf, vswprintf, vwprintf, and wprintf to libc.stsp2011-04-248-3/+1806
| | | | | | Based on our vfprintf etc. implementations. Wide character parts based on NetBSD but with lots of macros expanded. Minor bump for libc. ok kettenis espie
* tweak previous; ok millertjmc2011-01-101-3/+4
|
* mkdtemp() is present in POSIX 1003.1-2008millert2011-01-101-11/+9
| | | | Add a warning about using less than 6 Xs causing an error on some systems
* mktemp(3) can be used, but not where mkstemp(3) is an alternative. Alsonicm2011-01-071-6/+6
| | | | | | trim an inaccurate comment about its future removal. ok deraadt
* mktemp(3) (and thus mktemp(1)) no longer use the process ID whenmillert2010-12-271-3/+2
| | | | | | replacing the Xs, it is now purely random. Also replace a use of .Fn that should be .Xr. OK jmc@
* Fix out of date comment; no code changemillert2010-12-221-2/+2
|
* The ssizearg member of union arg is pointless if it isn't of type ssize_tguenther2010-10-171-2/+2
| | | | Noted by Claus Assmann
* observe the following spelling:jmc2010-09-105-24/+24
| | | | | | | | | - wide character (noun) - wide-character (adjective) this is the "fix of least resistance", and appears to be in line with posix style; a tiny fix still needed for curses, but i'll mail that upstream;
* dispense with some wacky escape sequences;jmc2010-03-262-8/+8
|
* Various improvements, mainly regarding ERRORS.schwarze2010-03-221-40/+39
| | | | | | | | | | | | | * Document EINVAL and EEXIST. * Neither mkstemp nor mkdtemp use lstat, but mktemp does. * Documenting ENOTDIR is useless, it is documented in lstat(2), mkdir(2) and open(2), and it's just one thing out of several that could go wrong. * Refer to lstat(2) instead of stat(2), which is actually used here. * State that two of these functions are standardized in the XPG. * Move the sentence about mkdtemp and mkstemps to the new STANDARDS section. * Get rid of the ugly ".So Li X Sc Ns s", just use "Xs" (suggested by jmc@). tweaks and ok jmc@ millert@
* When all tried file names already existed, mktemp(3) returned withoutschwarze2010-03-211-1/+3
| | | | | | setting errno(2). Behaviour unchanged for mkstemp[s] and mkdtemp. ok guenther deraadt
* The previous commit didn't use the first X in the template if theguenther2010-02-111-3/+2
| | | | | | | entire template was Xs. Test suite written now to keep this from happening again. Problem caught by Vadim Zhukov again. ok millert@
* Don't underrun the buffer when the template is all X's.guenther2010-02-081-7/+2
| | | | | | | Also, remove a duplicate preconditions check. Based on a suggestion by Vadim Zhukov (persgray <at> gmail.com) ok millert@
* .Bl always requires .It, even in .Bl -column;schwarze2010-01-031-67/+67
| | | | | syntax errors found by mandoc(1), also required to fix the mandoc build; feedback and ok jmc@ and sobrado@
* Ooops, committed an unbaked changeguenther2009-11-211-2/+2
|
* Several stdio functions were failing to set the stream orientationguenther2009-11-216-7/+13
| | | | | | to 'narrow' as they should. "looks correct" millert@ "makes sense" blambert@
* Fix the handle locking in stdio to use flockfile/funlockfilekurt2009-11-0944-133/+276
| | | | | | | | | | | | | internally when and where required. Macros in <stdio.h> are updated to automatically call the underlying functions when the process is threaded to obtain the necessary locking. A private mutex is added to protect __sglue, the internal list of FILE handles, and another to protect the one-time initialization. Some routines in libc that use getc() change to use getc_unlocked() as they're either protected by their own lock or aren't thread-safe routines anyway. committing on behalf of and okay guenther@ now that we have install media space available.
* ansifystsp2009-11-081-5/+2
| | | | ok deraadt
* skip the \' formatting flag, grouping is not implemented; ok deraadt@naddy2009-10-281-1/+5
|
* Back out previous commit, as it caused too much growth for the installguenther2009-10-2244-276/+133
| | | | media to fit
* Fix the handle locking in stdio to use flockfile/funlockfileguenther2009-10-2144-133/+276
| | | | | | | | | | | | internally when and where required. Macros in <stdio.h> are updated to automatically call the underlying functions when the process is threaded to obtain the necessary locking. A private mutex is added to protect __sglue, the internal list of FILE handles, and another to protect the one-time initialization. Some routines in libc that use getc() change to use getc_unlocked() as they're either protected by their own lock or aren't thread-safe routines anyway. ok kurt@, earlier version tested by sthen@ and jj@
* teach gdtoa & its subroutines that malloc can fail; in which casemartynas2009-10-161-1/+17
| | | | | | ecvt, fcvt, gcvt, *printf, strtof, strtod, strtold act per ieee 1003.1. after these massive changes, remove unused files which would not work now. reported by Maksymilian Arciemowicz; ok theo
* cvs log message from ed@freebsd, revision 197045:jmc2009-09-101-3/+3
| | | | | | | | | | | Make the description of `b' a little better. If you have a one-byte sequence, `w', `b' is the second character. Not the third. Submitted by: Christoph Mallon checked by otto
* fwrite() should also return 0 if either size or nmemb are 0.millert2009-07-123-8/+22
| | | | Adapted from FreeBSD. OK deraadt@
* Set errno to EINVAL when fgets is given a non-positive size.ray2009-06-022-4/+11
| | | | OK millert otto
* accept %F, which actually behaves the same as %f. per C99martynas2009-04-052-4/+5
| | | | ok millert@
* Return -1 from mktemp_internal() on EINVAL like we used to.millert2009-03-201-3/+3
| | | | OK oga@ thib@
* Update to match mktemp.c changesmillert2009-03-011-4/+4
|
* New mktemp(3) based on the one from portable mktemp(1). Now includesmillert2009-03-011-89/+88
| | | | | | | digits (in addition to letters) in the random file name. Instead of looping forever, mktemp(3) will terminate when it has tried 2 * N^62 times where N is the number of X's. This is effectively forever for lots of X's.
* when the template is entirely XXX characters, would crashderaadt2009-02-171-4/+6
| | | | | from Vadim Zhukov <persgray@gmail ok millert
* from Yoshihiko Sarumaru, freebsd pr #76333: fseek(3) can clear EOF too;jmc2009-01-291-4/+2
| | | | ok millert
* The process number is longer used to replace trailing 'Xs'.tobias2009-01-101-4/+3
| | | | ok jmc, millert
* use decimal point from locale. ok millert@martynas2008-10-211-3/+3
|
* add missing header needed by strlen().chl2008-09-151-1/+2
| | | | ok millert@
* - describe how printf(1) and printf(3) %e, %E, %g, %G, %a, %A behavemartynas2008-09-151-2/+38
| | | | | when the argument is infinity/not-a-number ok millert@, jmc@
* describe %a/%A. from freebsdmartynas2008-09-141-2/+58
| | | | tweaks/ok millert@, jmc@
* - replace dtoa w/ David's gdtoa, version 2008-03-15martynas2008-09-072-162/+212
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - provide proper dtoa locks - use the real strtof implementation - add strtold, __hdtoa, __hldtoa - add %a/%A support - don't lose precision in printf, don't round to double anymore - implement extended-precision versions of libc functions: fpclassify, isnan, isinf, signbit, isnormal, isfinite, now that the ieee.h is fixed - separate vax versions of strtof, and __hdtoa - add complex math support. added functions: cacos, casin, catan, ccos, csin, ctan, cacosh, casinh, catanh, ccosh, csinh, ctanh, cexp, clog, cabs, cpow, csqrt, carg, cimag, conj, cproj, creal, cacosf, casinf, catanf, ccosf, csinf, ctanf, cacoshf, casinhf, catanhf, ccoshf, csinhf, ctanhf, cexpf, clogf, cabsf, cpowf, csqrtf, cargf, cimagf, conjf, cprojf, crealf - add fdim, fmax, fmin - add log2. (adapted implementation e_log.c. could be more acruate & faster, but it's good enough for now) - remove wrappers & cruft in libm, supposed to work-around mistakes in SVID, etc.; use ieee versions. fixes issues in python 2.6 for djm@ - make _digittoint static - proper definitions for i386, and amd64 in ieee.h - sh, powerpc don't really have extended-precision - add missing definitions for mips64 (quad), m{6,8}k (96-bit) float.h for LDBL_* - merge lead to frac for m{6,8}k, for gdtoa to work properly - add FRAC*BITS & EXT_TO_ARRAY32 definitions in ieee.h, for hdtoa&ldtoa to use - add EXT_IMPLICIT_NBIT definition, which indicates implicit normalization bit - add regression tests for libc: fpclassify and printf - arith.h & gd_qnan.h definitions - update ieee.h: hppa doesn't have quad-precision, hppa64 does - add missing prototypes to gdtoaimp - on 64-bit platforms make sure gdtoa doesn't use a long when it really wants an int - etc., what i may have forgotten... - bump libm major, due to removed&changed symbols - no libc bump, since this is riding on djm's libc major crank from a day ago discussed with / requested by / testing theo, sthen@, djm@, jsg@, merdely@, jsing@, tedu@, brad@, jakemsr@, and others. looks good to millert@ parts of the diff ok kettenis@ this commit does not include: - man page changes
* comment fixesmartynas2008-08-271-7/+7
|
* - add Fmartynas2008-08-262-11/+33
| | | | | | - make inf INF nan NAN comply to standards (eEfFgG) - extend man page bits ok millert@. w/ a man page tweak and ok jmc@
* don't zero-pad special values. ok millert@martynas2008-08-261-1/+3
|
* Replace the old algorithm that included the process id as part of themillert2008-08-221-49/+20
| | | | temporary file name with one that only uses random data. OK deraadt@
* Remove useless code, the kernel will set errno appropriately if anmillert2008-08-211-21/+1
| | | | element in the path does not exist. OK deraadt@ pvalchev@
* use arc4random_uniform(); ok djm millertderaadt2008-07-221-2/+2
|
* - handle sign of negative zero. use sign dtoa setsmartynas2008-07-101-11/+6
| | | | | | - remove 'value < 0' cruft, dtoa already clears sign bit for us discussed with, and tested by phessler@ ok millert@, who noticed to remove now-unused variable, and phessler@
* Fix ssize_t vs. size_t mismatchmillert2008-05-161-2/+2
|
* C99 says that for each va_copy() there must be a matching va_end().millert2008-05-161-30/+59
| | | | | Replace the non-portable hackery in __find_arguments() with a union. From FreeBSD.
* Don't forget to va_end() the va_list we get from va_copy(). From FreeBSD.millert2008-05-131-1/+2
|
* add missing header for getpagesizechl2008-05-051-1/+2
| | | | ok espie@
* add missing header for closechl2008-05-031-1/+2
| | | | ok otto@ espie@ millert@
* _file is only a short, so prevent truncation if we happen to hitotto2008-04-213-3/+28
| | | | | upon a fd > SHRT_MAX. From freebsd via Jan Schaumann; ok deraadt@ millert@ espie@