Commit Graph

296 Commits

Author SHA1 Message Date
simonb
62887f0740 Remove another unneeded cast to size_t.
Pointed out by Anil Madhavapeddy in private email.
2003-10-10 05:38:45 +00:00
simonb
444e6dce83 No need to cast "len" to a size_t now that "len" is a size_t. 2003-10-09 00:50:34 +00:00
itojun
1bb83f4a4a avoid signed->unsigned assignment. openbsd PR 1709 2003-10-08 20:33:17 +00:00
wiz
dca9ccd375 Use St -isoC-9X instead of St -isoC9X, to be in sync with groff. 2003-09-08 17:54:31 +00:00
heas
6333112bb9 plural "characters" for ret of {v}snprintf 2003-08-27 18:47:14 +00:00
agc
eb7c1594f1 Move UCB-licensed code from 4-clause to 3-clause licence.
Patches provided by Joel Baker in PR 22280, verified by myself.
2003-08-07 16:42:00 +00:00
nathanw
6d30f1a3db Disable cancellation on the first lock, too, not just on internal
recursive locks (Duh).

Disable cancellation around the cond_wait() call, since that's also a
cancellation point. Arguably, that would be better handled with
pthread_cleanup_*(), but stubbing those for libc is difficult, and the
current non-exception-based implementation of cleanup handlers is
probably no faster than disabling and reenabling cancellation.
Finally, it only happens in the slow path where the thread is going to
sleep anyway...
2003-07-22 00:56:25 +00:00
nathanw
5a5cd67fff Set the _LOCKINTERNAL() count on initial locking as well as subsequent
recursive locks.
2003-07-21 22:24:47 +00:00
nathanw
d3ebb21ecd Use threadlib stub rather than pthread_setcancelstate() directly. 2003-07-19 05:06:16 +00:00
nathanw
a74e50ddaf #include "local.h" to get __flockfile_internal() prototype. 2003-07-18 21:52:16 +00:00
nathanw
ad09d62fcc Move guts of flockfile()/funlockfile() to __flockfile_internal(), which
takes an additional argument indicating whether this is an internal caller
taking the lock or an external (application) caller. When making an internal
lock, save the current thread cancellation state and disable cancellation
until the matching unlock. This should prevent canccelled threads from exiting
inside of stdio while holding a file lock and potentially leaving other
parts of the FILE structure in an inconsistent state.
2003-07-18 21:50:41 +00:00
nathanw
b5665a9b84 Add fields to struct __sfileext to track how many times the lock has been
taken by internal stdio functions, and what the cancellation state was when
the first such lock was taken.
2003-07-18 21:46:41 +00:00
thorpej
119837ff52 Fix handing of -ve hexadecimal numbers in the %i format. Fixes
PR lib/21691.  Patch from Simon Burge.
2003-05-27 14:32:29 +00:00
wiz
a363cdabc4 Drop trailing space. 2003-05-11 16:21:18 +00:00
kleink
861db62607 Oops, typo in previous. 2003-05-11 16:16:41 +00:00
kleink
8d06f60601 As prompted by Thomas Klausner, add a RETURN VALUES section. 2003-05-11 16:15:07 +00:00
wiz
737de9f803 Misc. fixes from jmc@openbsd. 2003-05-03 19:43:00 +00:00
wiz
472351e13d Use
.In header.h
instead of
.Fd #include \*[Lt]header.h\*[Gt]
Much easier to read and write, and supported by groff for ages.
Okayed by ross.
2003-04-16 13:34:34 +00:00
pooka
0e9bf3053c avoid using multiple different ways of saying the same thing 2003-03-28 17:00:49 +00:00
tshiozak
5abc4b4f43 add fgetws() and fputws() (lib/20576).
Note: fgetws.c, fgetws.3, fputws.c and fputws.3 are obtained from FreeBSD,
and fitted by sigsegv@infoseek.jp and me.
2003-03-07 07:11:35 +00:00
wiz
b3ee4720f5 Use strlcpy, not strcpy, in one more place. From deraadt. 2003-02-16 16:21:59 +00:00
nathanw
34c915eb3d Revert the conversion to libpthread's recursive mutexes. Too much
trouble is caused by the memory allocation in the mutex initialization,
and uncontested mutexes and condition variables have become faster in the
meantime.
2003-02-01 03:25:00 +00:00
wiz
9804cdc7fc a, b, and c. 2003-01-28 20:33:25 +00:00
kleink
5b62d84e6e Add a manual page for flockfile(3) etc.; while here, also add *_unlocked()
to stdio(3) overview documentation.  Fixes PR lib/20096 from Jason Thorpe.
2003-01-28 20:26:04 +00:00
nathanw
6003a24dd4 Use recursive mutexes from libpthread rather than implementing
our own with normal mutexes and condition variables.
2003-01-21 23:26:02 +00:00
thorpej
3fdac2b8c5 Merge the nathanw_sa branch. 2003-01-18 10:52:16 +00:00
kristerw
a505fc7826 Fix two bugs:
1. snprintf(foo, 0. "XXX") is guaranteed not to write in foo by the
   standard (ISO/IEC 9899 7.19.6.5) but our implementation handles this
   as if the buffer has a size of (size_t)-1.

2. snprintf(NULL, 0, "XXX") leaks memory since cantwrite() allocates
   memory if _bf._base == NULL, and this buffer is never freed
   (PR 16483).
2003-01-05 11:05:47 +00:00
mjl
71b7c0b242 Fix typos (from PR 19650) 2003-01-03 21:41:28 +00:00
lukem
b1e79510cf - Migrate fparseln(3) from libutil to libc, where it should have been in
the first place...
- Bump libutil major (to 7.0) and libc minor (to 12.91).
2002-11-30 03:04:44 +00:00
simonb
0b3c8ee193 Document that the *printf() functions can return a negative value under
output error conditions.
2002-11-11 17:26:19 +00:00
wiz
6569c5c509 New sentence, new line. From Robert Elz. 2002-10-01 17:22:00 +00:00
thorpej
922525072e Allow mktemp to be built as a host tool. 2002-09-14 04:26:23 +00:00
wiz
3f9c36b9de Drop superfluous Ns and fix a formatting glitch. 2002-08-20 16:10:01 +00:00
yamt
e7d9fe95ae - add description of the race.
- fix typo.
from OpenBSD.
2002-08-10 16:34:29 +00:00
yamt
dccfe06f50 use more Xs for filename templates.
from OpenBSD.
2002-08-10 16:28:51 +00:00
yamt
04adc81fbf if the path is directory, remove(3) behaves as rmdir instead of unlink.
from OpenBSD.
2002-08-10 09:42:23 +00:00
yamt
5d8e52e7ab bring in EXAMPLES and BUGS from openbsd. 2002-08-10 09:32:19 +00:00
mjl
a32f58ffa9 Correct wrong comparison in example. 2002-07-21 19:04:03 +00:00
yamt
673cbedc13 import CAVEATS sections from OpenBSD.
with little tweak by me.
2002-07-10 14:37:12 +00:00
wiz
53f8a68c5f Add Xr to fileno(3). 2002-06-12 09:21:40 +00:00
wiz
3fb28eec1f __STDC__ is always defined on NetBSD. 2002-05-26 14:43:59 +00:00
thorpej
42320e8223 * Move the prototype of __svfscanf from <stdio.h> to libc/stdio/local.h.
* Add prototype for vfscanf to <stdio.h>.
* Remove #define of vfscanf to __svfscanf from <stdio.h>.
* Include local.h in libc files which need __svfscanf.
* Add vfscanf weak alias to __svfscanf.

Fixes standards/16997.

NOTE: libc minor not bumped -- ride on the bump to 12.84 made by
itojun today.
2002-05-24 22:17:20 +00:00
kleink
eedae55de3 Consistent wording: plain files -> regular files. 2002-05-15 07:00:22 +00:00
bjh21
c9e4965681 Revert addition of mkdtemp() to libnbcompat. I don't think we need mktemp(1)
after all.
2002-04-01 13:59:34 +00:00
bjh21
58017a564d Add mkdtemp to libnbcompat, since glibc doesn't have it an mktemp(1) will
need it.
2002-03-31 18:04:11 +00:00
yamt
ffca92c5a2 putwc and putwchar's argument is wchar_t, not wint_t. 2002-03-14 21:21:00 +00:00
christos
9588aa8fef fully initialize the structure to avoid gcc complaints. 2002-03-12 22:56:16 +00:00
ross
814f296b77 Generate <>& symbolically. 2002-02-07 07:00:09 +00:00
wiz
38462ff661 Punctuation nit, and slight grammar improvement. 2002-02-02 10:50:52 +00:00
yamt
ec88065e0f note that our fsetpos/fgetpos don't know about stream's state.
it's a bug since we now have stateful encodings like iso2022 and
wide char functions like fgetwc.
2002-02-02 08:56:53 +00:00