Commit Graph

470 Commits

Author SHA1 Message Date
joerg 8331b95fa9 Fix trailing whitespace 2010-05-14 03:22:49 +00:00
joerg f0c7b477dc Fix markup 2010-05-14 03:04:32 +00:00
joerg 332c9caca2 Use plain references and don't depend on multiple expansion runs. 2010-05-13 21:52:43 +00:00
joerg fb270d1e3d Mask %U, it is a macro nowadays. 2010-05-13 21:50:11 +00:00
jruoho f05bdd5ecd Remove the note about the standard recommending fgets(3);
should be clear enough from the big warning to "NEVER use gets()".
2010-05-13 18:38:24 +00:00
wiz 968a574a9b Wording. 2010-05-08 11:35:14 +00:00
jruoho 2184425c2a Note that EBADF is optional for fileno() in POSIX. 2010-05-06 09:18:06 +00:00
jruoho dccc94a2b3 Put the historical note to its own section. Note that also the other
functions (except the _unlocked variants) were in early UNIX versions.
2010-05-06 09:01:34 +00:00
jruoho aa18298cd3 Note POSIX compliance. 2010-05-06 08:58:57 +00:00
jruoho 4c0553eda5 Correct the discussion about return values: fileno() may fail and return -1.
Note that in such cases the NetBSD implementation does not set errno to
EBADF, hence diverging from the standard in this small detail.
2010-05-06 08:14:08 +00:00
jruoho 29cfcc518e Upon lukem@'s request, put the list of functions back.
XXX: Someone needs to go through all standard I/O functions in the libc,
     update the list, and keep it updated. While at it, please convert the
     list to use .Xr so that we can have links in HTML pages.
2010-05-05 04:13:16 +00:00
jruoho dd121e1e5b Remove the list of functions.
This list was updated only two times in nearly two decades.

(If people need to learn the standard I/O functions in C, it would be better
to mention K&R or some other textbook; if people need to know the list of
functions, it would be better to point out the location of the standard.)

In addition, some clean-up and structural editing.
2010-05-04 07:43:12 +00:00
wiz 779fbbb100 Wording. 2010-04-30 06:54:16 +00:00
jruoho 1ad0e6c25b Put SECURITY CONSIDERATIONS as the last section. 2010-04-30 06:23:56 +00:00
jruoho 2f941c83c7 Fix the mess in the sections; someone went to sleep in the middle of a
sentence...
2010-04-30 06:22:28 +00:00
jruoho b0e9ddf609 They've finally made gets(3) obsolete (in POSIX, at least). 2010-04-30 06:00:14 +00:00
jruoho 1b80a21f09 Add HISTORY. 2010-04-30 05:56:14 +00:00
jruoho 4078f3e9d1 Also tmpnam(3) and tempnam(3) are now obsolete in POSIX. 2010-04-30 04:55:10 +00:00
wiz a917229f2a Improve a sentence. 2010-04-29 07:26:39 +00:00
jruoho 157d0c3eea Add some STANDARDS lingo, mainly to note the functions that have been
removed from POSIX (2008).
2010-04-29 06:54:26 +00:00
joerg 20fc76af98 Fix escape sequences 2010-04-05 21:35:36 +00:00
joerg 727da1104c \\ -> \e 2010-04-05 21:33:54 +00:00
joerg 1c3412fa2f Use .In for header files instead of .Ar Pa and variations. 2010-03-22 19:30:53 +00:00
jruoho 66475d5b9d Break the (too) big lead paragraph into three smaller ones. 2010-03-22 13:15:54 +00:00
jruoho 67dcd1d1f0 Bump date for previous. 2010-03-21 20:38:20 +00:00
jruoho 341372abaa Note inttypes(3) also here. 2010-03-21 20:34:52 +00:00
jruoho 61f4a4ebdc Mention the recommended usage of inttypes(3) when applicable. 2010-03-21 19:55:19 +00:00
joerg 00711901b6 Use a proper char */size_t pair in __sfileext to keep track of the line
buffer for fgetln and fgetwln. Simplifies code by dropping the INT_MAX
related logic. Drop conditionals around FREELB, free(NULL) is valid.
2010-01-11 20:39:29 +00:00
christos b56987f3f3 PR/42466: Yasuoka Masahiko: vsnprintf_ss() causes infinite loop 2009-12-17 15:19:48 +00:00
wiz 6277279df4 Whitespace nit. 2009-12-14 07:29:23 +00:00
dholland 34a411910a whoops, bump date for previous. 2009-12-14 04:40:29 +00:00
dholland cd1a57ae6d Document %ll. Closes PR 42283. 2009-12-14 04:39:29 +00:00
joerg f65504295d Fix markup. 2009-12-09 18:06:08 +00:00
roy c9c21f1ecc Test against SSIZE_MAX as pointed out by enami tsugutomo. 2009-12-07 21:31:43 +00:00
roy 5eba354808 Pass lint. 2009-12-02 11:14:47 +00:00
roy 7cfa046806 Reinstate __getdelim which does no locking.
Callers are now required to FLOCKFILE so they can operate on fp as well.
2009-12-02 09:03:13 +00:00
roy 142091db36 Protect getline. 2009-12-02 08:46:33 +00:00
wiz 9e3ffe49a3 Make HTML-ready, use standard section headers, fix Xr. 2009-12-01 08:15:50 +00:00
roy 3490b83a1f Protect getdelim when used internally. 2009-12-01 00:52:13 +00:00
roy 755657be4b Remove __getdelim and just use getdelim.
fgetstr now works with strings up to SSIZE_MAX as a result, but may
reallocate buffers needlessly just like it used to when the buffer size
exceeds INT_MAX.
fgetstr converts errno EOVERFLOW to EINVAL on getdelim error.
2009-12-01 00:03:53 +00:00
roy ec4d484515 Note that callers should use feof(3) or ferror(3) to distinguish between
EOF or an error.
2009-11-30 23:23:29 +00:00
roy 4cf0472d7d Note that EOF returns -1 when no characters are read.
Add code example.
2009-11-30 22:51:46 +00:00
christos cfbb35ed03 revert some of dsl's changes to make things build on i386; he can undo what
he wants when he comes back.
2009-10-25 20:44:13 +00:00
dsl 5f1a9bea9e Lint is differentially far too picky...
Remove some warnings that only appear on i386 (not on amd64) and that
for some reason best known to others are deemed fatal for i386.
Making this code 'pass lint' does absolutely nothing for its readability (etc).
2009-10-25 17:09:34 +00:00
dsl 0b807be843 Remove a load of pointless casts - one that even lint doesn't bleat about. 2009-10-24 15:20:15 +00:00
dsl 695bc79994 Check for EOF before erroring fgets() with length <= 0.
If length is invalid, set errno = EINVAL and __SERR as well returning NULL.
Should let me close PR/41992.
2009-10-24 14:50:48 +00:00
snj 550147bd6a Remove 3rd and 4th clauses in christos' license. OK christos. 2009-10-21 01:07:44 +00:00
dsl 40f437887d Reverse previous, committed by mistake. 2009-10-15 06:19:35 +00:00
roy 5f96926957 Handle errors from getdelim better. 2009-10-15 00:36:24 +00:00
dsl 01a0f8ea84 Change a while () {} into a do {} while() so that fgets(buf, 1, file)
detects EOF on an empty file.
Fixes most of PR/41992
2009-10-14 21:25:52 +00:00