Commit Graph

224 Commits

Author SHA1 Message Date
kleink a251b29d5a Clarify C standards situation a bit. 2001-04-30 08:47:59 +00:00
kleink fe3c9ceaf7 * Move definitions of exact-width integer types from <machine/types.h>
to <sys/types.h> and <sys/stdint.h>.
* Add a new C99 <stdint.h> header, which provides integer types of
  explicit width, related limits and integer constant macros.
* Extend <inttypes.h> to provide <stdint.h> definitions and format
  macros for printf() and scanf().
* Add C99 strtoimax() and strtoumax() functions.
* Use the latter within scanf().
* Add C99 %j, %t and %z printf()/scanf() conversions for
  intmax_t, pointer-type and size_t arguments.
2001-04-28 15:41:28 +00:00
kleink 568e812267 Fix an ... interesting pasto in the description of the l length modifier
that's been here forever.
2001-04-26 19:25:12 +00:00
kleink 6213f73707 Document getc_unlocked(3), getchar_unlocked(3), putc_unlocked(3) and
putchar_unlocked(3); fixes PR lib/11340.
2001-04-25 22:06:53 +00:00
kleink 3432ed7203 Need an internal name for asprintf(3). 2001-04-13 14:18:09 +00:00
jhawk 404ef082e4 Xr printf(9) 2001-04-03 13:59:22 +00:00
lukem fa11ebb133 apparently ansi c only required fread(3) to return 0 if size or nmembs == 0.
however, susv2 adds the same to fwrite(3), so add the explicit check.
document this for both fread & fwrite. move diagassert for buf!=NULL to after
the (size * nmembs) == 0 check.

this has the helpful side effect of preventing the _DIAGASSERT()ion in
fwrite() being triggered by lots of 3rdparty code that calls fwrite() with
buf=NULL count=0
2001-01-25 02:06:25 +00:00
itojun bb0bfe5b30 initialize mbstate_t properly. 2000-12-30 04:13:25 +00:00
kleink 81ab746b71 Sprinkle some __restrict into stdio. 2000-12-29 15:22:48 +00:00
itojun 1da6122f1e make printf-variant work with stateful encodings. 2000-12-23 13:19:31 +00:00
christos 86af4f2cf9 fix duplicate declaration of __glue. 2000-12-10 04:17:28 +00:00
christos ebb980fc21 This is for completeness only (to make fdopen symmetric with fopen and freopen)
and to match the documentation. Return an error if "f" was specified and the
file descriptor does not refer to a plain file.
2000-11-29 15:36:42 +00:00
christos 8955e88e2f Add checks for O_NDELAY [which indicates that we only want plain files],
and return an error if the file was not plain.
2000-11-29 15:31:10 +00:00
christos 2a213d0e9a make sure we preserve errno. 2000-11-29 15:30:20 +00:00
kleink 78eeef4b49 Actually EINVAL fits the circumstances better. 2000-10-19 09:47:43 +00:00
kleink 20b0e10891 C99: Passing a null pointer as the buffer argument to snprintf() and
vsnprintf() is permitted when the size argument is zero as well; mostly
from Peter Seebach in PR standards/9603.
2000-10-19 09:45:31 +00:00
kim 6ec737498a Make "f" standout better. 2000-10-18 15:40:52 +00:00
kleink 9c477a4e4e XCU5 -> XSH5. 2000-07-26 08:57:34 +00:00
kleink 7d93b767c2 Oops, forgot to define weak aliases for public names.
Fixes PR {pkg,lib}/10655.
2000-07-26 08:52:57 +00:00
jdolecek 5451455d06 v*scanf() are hardly 'new to this release' when they have
been around since 386BSD-0.1 import; they have been present in 4.4BSD-Lite
at least, can't currently check if even in 4.3BSD
put note aboud eventual removing of compatibility formats to NOTES, it's
   hardly a bug description
2000-07-16 11:08:53 +00:00
sommerfeld 007c516740 Attach __format__ attributes to local __sbprintf function 2000-07-08 14:57:57 +00:00
kleink 6c16ef0bd2 Elaborate a bit on fseeko() and ftello(). 2000-07-08 14:13:05 +00:00
kleink 723bc5321e Bump date for fseeko() and ftello(). 2000-07-08 13:59:24 +00:00
kleink 7c5b39585f In fgetpos() and fsetpos(), use ftello() and fseeko(), respectively, to avoid
truncating the value stored in the fpos_t object operated on to that of a
long integer; adresses PR lib/6637.
2000-07-08 13:51:27 +00:00
kleink dae360611f XCU5: Add fseeko() and ftello() functions which provide the functionality of
fseek() and ftell(), respectively, but operate on file offsets of type off_t.
2000-07-08 13:46:33 +00:00
fair dc17a3ff45 Comment out a paragraph describing behavior which NetBSD's fopen(3) does
not exhibit, per PR 6072.
2000-05-17 10:09:35 +00:00
kleink 3031020afe Replace internal use of strto{,u}q() with strto{,u}ll(). 2000-03-08 19:33:47 +00:00
mycroft 605490369c Delint.
Remove trailing ; from uses of __weak_alias().  The macro inserts this if
needed.
2000-01-22 22:19:07 +00:00
wrstuden 9c658d828e Need to include "reentrant.h" for FLOCKFILE macros. 2000-01-21 23:12:33 +00:00
mycroft e70f76146b Do file locking. 2000-01-21 19:56:07 +00:00
mycroft b714bb5102 Just call fflush() from _cleanup(), since it does the right locking. 2000-01-21 19:55:02 +00:00
mycroft f9b319ca18 Call __sclearerr(), nor clearerr(), so we don\`t try to double lock. 2000-01-21 19:54:13 +00:00
mycroft 0b24b6555f Do the lock *after* checking that the fp is valid. 2000-01-21 19:53:02 +00:00
mycroft 442e96d230 Initialize f._file for locking primitives. 2000-01-21 19:51:36 +00:00
christos fc1a83184b add and "f" flag to fopen that makes sure we are opening a plain file,
so that there is no chance to block.
2000-01-15 01:11:45 +00:00
explorer 5e5a72ffef missing ; 1999-11-14 18:19:57 +00:00
jdolecek 7d96f3efd3 xref symlink(7) 1999-09-26 21:00:25 +00:00
lukem d896261208 back out the #ifdef _DIAGNOSTIC argument checks; too many people complained.
_DIAGASSERT() is still retained.
1999-09-20 04:38:56 +00:00
lukem e0f82c3ae3 revert previous; if we examine SUS more closely we find that unless explictly specified, use of a NULL pointer is undefined 1999-09-17 13:03:46 +00:00
lukem 3471ac6647 return (0) if size or count == 0 before check for _DIAGASSERT(buf != NULL).
this is ok according to SUS.
1999-09-16 12:45:34 +00:00
lukem b48252f365 * use _DIAGASSERT() to check pointer arguments against NULL and file
descriptors against -1 (as appropriate).
* add actual checks which to detect stuff that would trigger_DIAGASSERT(),
  and attempt to return a sane error condition.
* knf some code
* remove some `register' decls.

the first two items result in the addition of code similar to the
following in various functions:

		_DIAGASSERT(path != NULL)
	#ifdef _DIAGNOSTIC
		if (path == NULL) {
			errno = EFAULT;
			return (-1);
		}
	#endif
1999-09-16 11:44:54 +00:00
kleink ddb97cdc5a No need for "namespace.h". 1999-08-22 12:52:28 +00:00
garbled 38c96853cf Last of the .Os cleanups. .Os is defined in the tmac.doc-common file,
so we shouldn't override it with versions in the manpages.  Wheee!
1999-03-22 19:44:33 +00:00
christos 1452d0f916 braces for gcc-2.8.1 1999-03-19 12:56:16 +00:00
christos 7d0129b726 include <fcntl.h> instead of <sys/file.h> 1999-03-19 12:55:52 +00:00
kleink 55cb8b09ce Functionally back out namespace.h revision 1.7 and perror.c revision 1.15;
perror() is an identifier reserved by ANSI/ISO C, and in case of a redefition
the behavior is undefined.
1999-03-09 13:14:36 +00:00
kleink dde7993b2f Const poisoning. 1999-03-08 10:27:34 +00:00
kleink d041717701 stderr is not always but initially unbuffered. 1999-01-28 20:25:32 +00:00
kleink 18949858f3 Per ANSI C, place the error message on the stderr stream rather than on
STDERR_FILENO.
1999-01-28 20:13:40 +00:00
kleink 3b7ac44e6c * Add const keywords to function arguments as appropriate.
* Clarify the description of the initial position of the stream (some confusion
  due to the way fdopen() was merged into a former ANSI-only document).
1999-01-12 15:27:28 +00:00