summaryrefslogtreecommitdiffstats
path: root/lib/libc/stdio (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Implement getdelim(3) and getline(3).fgsch2012-03-214-3/+332
| | | | | | | | | Prompted in a mail to tech@ by Jan Klemkow (j-dot-klemkow-at-wemelug-dot-de) but this is based on NetBSD's implementation instead with some tweaks by me. Further improvements would happen in tree. ok millert@; discussed with many others ports cleanup by naddy@, sthen@. Antti Harri, Gonzalo L. R. and myself.
* Credit Keith Sklower and 2BSD for the first implementation of read-writeschwarze2012-01-221-2/+7
| | | | | access; information found in the 2bsd directory of the CSRG archive CDs. feedback and ok jmc@
* Add missing header needed by iswspace()chl2012-01-181-1/+2
| | | | ok stsp@
* Add support for C99 %ls, %lc, and %l[ format directives to scanf(3).stsp2012-01-183-9/+210
| | | | | | Based on code from FreeBSD. Tested by myself (full release/install cycle on i386 and sparc64) and ajacoutot. Man page help from jmc.
* Document early history of a few functions specifically mentioned in 2BSDschwarze2012-01-152-4/+41
| | | | | | manuals; however, it turned out all of these actually predate 2BSD. All information from http://minnie.tuhs.org/cgi-bin/utree.pl. ok jmc@ sobrado@
* Make __svfscanf() the unlocked, core of vfscanf() and use it inguenther2011-11-086-46/+23
| | | | | | sscanf()/vsscanf() where locking is unnecessary. ok millert@
* Sync scanf(3) to wscanf(3), and a few bits the opposite way:schwarze2011-11-022-66/+50
| | | | | .Fd -> .In, .Li -> .Vt, and remove various other gratuitous differences. feedback and ok stsp@, ok jmc@
* Add wscanf(3) and friends. Based on our scanf(3) implementation, with widestsp2011-10-1610-10/+1531
| | | | | character support changes based on code from FreeBSD. ok espie guenther; man page help from schwarze
* signedness fix; ok millertdtucker2011-10-021-2/+2
|
* some minor tweaks;jmc2011-09-031-11/+6
|
* make -column lists pretty again;jmc2011-09-033-77/+77
| | | | | | | | | | specifically, rewrite them to permit some markup in the column headers, and use "Ta" instead of literal tabs; mandoc does not currently match groff 100%, but a mandoc fix may be some time off, and we've gone enough releases with poorly formatting column lists. in some cases i have rewritten the lists as -tag, where -column made little sense.
* missing $ in rcs tag; from Daniel Dickmansthen2011-07-291-1/+1
|
* Add support for C99 %ls and %lc format directives, as been documented instsp2011-07-062-7/+148
| | | | | | the vfprintf(3) man page for ages. Based on code from NetBSD/FreeBSD. Prevent ramdisk growth with a maze of #ifdefs. ok robert, no objections deraadt, espie, millert
* from Tim van der Molen:jmc2011-07-051-5/+12
| | | | | | | | | | | - State that ftell() and ftello() return -1 on error rather than just a non-zero value. The latter is not specific enough, because these functions can also return non-zero on success. - For clarity and search-friendliness, don't refer to fgetpos() and fsetpos() as "the others", but mention them by name. ok millert otto
* Recognize %a, %A format specifiers, per C99.martynas2011-07-032-17/+12
|
* Properly implement the long double (%Lf) scanf without the precisionmartynas2011-07-031-8/+10
| | | | loss.
* Make printf-like and scanf-like functions marked as such in llib-lc.lnmartynas2011-05-308-8/+16
| | | | | | | and llib-lwrap.ln databases; so that the lint features doing format strings checks are enabled by default. Looks good to millert@.
* remove Xr for a page we don;t yet have; ok stspjmc2011-05-161-4/+3
|
* Add a wprintf(3) man page based on FreeBSD's page. Help and ok schwarze jmcstsp2011-05-092-2/+592
|
* Always free the multibyte->wchar conversion buffer allocated in __mbsconv().stsp2011-05-091-1/+3
| | | | ok matthew dcoppa miod
* no need to escape `|'; as discussed with schwartzejmc2011-05-021-13/+3
|
* Bring back wprintf. We've sorted out what to do for gcc2 and gcc3.stsp2011-04-288-3/+1806
| | | | "Yes, go ahead then" deraadt
* Back out wprintf until we've determined what to do for gcc2 and gcc3 arches.stsp2011-04-248-1806/+3
|
* 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@