Commit Graph

331 Commits

Author SHA1 Message Date
lukem
0f879c5d2a vfwprintf.c and vfwscanf.c now compile with -Wuninitialized 2005-06-12 05:49:12 +00:00
lukem
ef7b3cd60b Appease gcc -Wuninitialized 2005-06-12 05:48:41 +00:00
lukem
81c4b0d591 Ensure nconv isn't used in __mbsconv() before being initialized.
Appease gcc -Wuninitialized elsewhere.
2005-06-12 05:45:38 +00:00
lukem
88c3eadbfa Add missing __RCSID() 2005-06-12 05:21:25 +00:00
wiz
649ba88889 Sort options. 2005-06-03 20:32:20 +00:00
lukem
7fbaf47f83 Compile the following files with -Wno-uninitialized:
vfprintf.c	See rev 1.46 for why we can't fix this.
vfwprintf.c	Needs some effort
vfwscanf.c	Needs some effort
2005-06-01 11:06:01 +00:00
kleink
13034da908 Add restrict qualifiers to fopen()/freopen() arguments. 2005-05-25 16:01:24 +00:00
christos
f432bbb6fd Add the missing wide char support functions from freebsd.
XXX: long double support is missing until we get gdtoa, and add the
necessary wide functions.
2005-05-14 23:51:02 +00:00
dsl
7f90294800 Re-implement in terms of fseek0() 2005-03-04 16:25:20 +00:00
dsl
28c48df97b de __P 2005-03-04 16:04:58 +00:00
kleink
fd5cb0acea A little libc namespace housekeeping exercise:
* Make vfprintf_unlocked() an internal function, c.f. __svfscanf_unlocked().
* Add internal names for arc4random(), endnetpath(), fhstatvfs(),
  fstatvfs(), mkstemp(), shquote(), statvfs(), taddr2uaddr(), uaddr2taddr(),
  uuid_create_nil(), uuid_is_nil(), and wcwidth().
* Include namespace.h where supposed to.
2005-02-09 21:35:46 +00:00
christos
b725a0a1fa add a cast and remove another. 2005-01-09 05:04:02 +00:00
christos
4b9f9bad8c remove __UNCONST definition; it is now in <sys/cdefs.h> 2004-07-02 03:00:01 +00:00
jmc
b2f782612f Completely rework how tools/compat is done. Purge all uses/references to
_NETBSD_SOURCE as this makes cross building from older/newer versions of
NetBSD harder, not easier (and also makes the resulting tools 'different')

Wrap all required code with the inclusion of nbtool_config.h, attempt to
only use POSIX code in all places (or when reasonable test w. configure and
provide definitions: ala u_int, etc).

Reviewed by lukem. Tested on FreeBSD 4.9, Redhat Linux ES3, NetBSD 1.6.2 x86
NetBSD current (x86 and amd64) and Solaris 9.

Fixes PR's: PR#17762 PR#25944
2004-06-20 22:20:14 +00:00
drochner
f56a8e5871 make this build in the tools/compat reachover
case if HAVE_FPARSELN is not present
patch from Christian Limpach
2004-05-11 17:31:04 +00:00
drochner
d1a752ca4b put back the CAVEATS section
pointed out by wiz
2004-05-10 17:15:28 +00:00
drochner
1626697cbc remove the fgetstr manpage 2004-05-10 17:02:21 +00:00
drochner
64b5a4f2c6 Add FLOCKFILE() locking - should be threadsafe now.
(Didn't test the !HAVE_FPARSELN && !_REENTRANT case -- this might be
hit in tools/compat on some host platforms.)
2004-05-10 16:50:23 +00:00
drochner
db594c6591 After discussion with christos, turn fgetstr() into an internal function.
Its API in inherently non-threadsafe (and it depends on certain properties
of the underlying stdio implementation), so it shouldn't be a first-class
function for general use, polluting the application namespace.
Also remove the FLOCKFILE() code from it - this is under control of the
calling function now.
(XXX I'm not sure whether the FLOCKFILE() should be kept in fgetln(),
this function cannot be used in multiple threads anyway. It doesn't
hurt much, and it might prevent corruption of internal FILE structures.)
2004-05-10 16:47:11 +00:00
kleink
a060c8818b We now need an internal name for fileno(), since when buildling libc
_REENTRANT we can no longer use the macro version from <stdio.h>.
2004-05-09 17:27:53 +00:00
jdolecek
55c776851d fix reference Nx 2.1 to Nx 3.0 2004-05-05 08:48:36 +00:00
wiz
58da84e9bf Bump date for previous. 2004-04-21 00:21:04 +00:00
wiz
74eeae1bcf Drop trailing whitespace; null -> nul; & -> \*[Am] 2004-04-21 00:19:40 +00:00
christos
6321f42fe9 Add a generalized version of fgetln that can stop at an arbitrary delimiter,
and implement fgetln on top of that.
2004-04-21 00:01:57 +00:00
drochner
4634f0716d Don't zero a floating point variable on entry -- this causes the FPU to
be allocated needlessly by almost every program (at least on i386/amd64).
2004-03-03 11:19:05 +00:00
wiz
cef0afe940 Lots of grammar and wording changes from jmc@openbsd, with some
additional consistency changes by me.
2004-01-24 16:58:54 +00:00
martin
7fd2c31d41 Add support for scanf "hh" format modifiers - we use it in int_fmtio.h
for SCNd8 and friends - so we should support it properly (and not only
by pure luck on alignment blind little endian archs - it used the
"h" code path, storing a 16bit int via a byte pointer).

This makes sparc64 pass regress/lib/libc/int_fmtio.
2003-12-30 22:10:20 +00:00
lukem
a8c35a134f remove superfluous assignment 2003-12-14 23:56:28 +00:00
grant
9510307938 simplify a sentence 2003-12-09 21:40:54 +00:00
uebayasi
0b30fd3d69 Spaces. 2003-12-05 00:57:36 +00:00
grant
a1e0a00965 "The fgets() and functions gets() do not..." ->
"The fgets() and gets() functions do not..."
2003-10-30 12:59:23 +00:00
lukem
171d653219 Overhaul how `build.sh tools' are used:
*	Rename "config.h" to "nbtool_config.h" and
	HAVE_CONFIG_H to HAVE_NBTOOL_CONFIG_H.
	This makes in more obvious in the source when we're using
	tools/compat/config.h versus "standard autoconf" config.h

    *	Consistently move the inclusion of nbtool_config.h to before
    	<sys/cdefs.h> so that the former can provide __RCSID() (et al),
    	and there's no need to protect those macros any more.

These changes should make it easier to "tool-ify" a program by adding:
	#if HAVE_NBTOOL_CONFIG_H
	#include "nbtool_config.h"
	#endif
to the top of the source files (for the general case).
2003-10-27 00:12:41 +00:00
jmc
0c336c7f37 Move include for reentrant.h inside CONFIG_H test so this works correctly
with tools/compat. Fixes PR#21344
2003-10-23 20:06:16 +00:00
wiz
910124a085 Make the plural of X' X's instead of `Xs'.
Following a suggestion from jmc@openbsd.
2003-10-15 19:44:51 +00:00
christos
e752a6f68a PR/23158: Johan Danielsson: Portable usage of the mk*temp() functions requires
six `X's.
2003-10-14 14:29:46 +00:00
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