Commit Graph

256 Commits

Author SHA1 Message Date
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
kleink
cb697ba0d0 When reopening in append mode, seek to the end of file in order to have the
internally kept offset pointer reflect this; ftell(3) would report an
incorrect current offset otherwise.  From Geoff C. Wing in lib/6381.
1999-01-06 13:57:14 +00:00
kleink
8e8595b01c Need to wrap stdio stream locking around the function body. On the bright
side, getchar_unlocked() can now be used instead of getchar().
1998-11-20 14:49:19 +00:00
kleink
71f3223468 Deploy stdio stream locking. 1998-11-20 14:44:14 +00:00
kleink
e0962e0eae Oops, don't need <errno.h> any more. 1998-11-18 21:13:46 +00:00
kleink
6de55982d6 * Wrap file locking around the function body in order to have fseek() and
clearerr() executed as a single unit.
* Remove clearing of errno; this fseek() error indicator must be visible to
  the caller.
1998-11-18 21:11:09 +00:00
christos
373acb7941 revert previous change; this reveals another bug in lints LINTED option. 1998-11-17 16:13:59 +00:00
christos
e7f7fdba9a delint 1998-11-15 17:19:53 +00:00
christos
d1d407360d This is ugly. There is a const castaway inside the print macro, so we cannot
use /* LINTED */ comments, since cpp will expand comments only at the macro
definition location, not at every expansion.
1998-11-15 17:19:05 +00:00
christos
6865d51c46 st_blksize cannot be negative 1998-11-15 17:16:27 +00:00
christos
56395b9694 change len from size_t to int so that len = fp->_r does not get promoted
to unsigned. cast len appropriately to size_t later.
1998-11-15 17:15:18 +00:00
kleink
56068ec670 Don't return immediately if EOF encountered while matching format string white
space in the input stream since there may be `conversion' specifiers following
the (format string) white space that do not operate on the input stream,
i.e. %n; from Chris Torek.
1998-10-25 18:25:43 +00:00
dbj
f9bda95727 Backed out previous fclose(NULL) change. 1998-10-18 23:48:18 +00:00
dbj
f8b2da8194 Fix pr lib/6322
fclose(NULL) used to segfault.  Now it returns EOF and sets errno to EBADF.
1998-10-18 19:27:33 +00:00
kleink
3e8c90f694 Replace use of getdtablesize() with (the non-deprecated) sysconf(), hence no
need for an internal name for the former any more; suggested by Matthew Green.
1998-10-18 13:56:21 +00:00
kleink
45f04f24af Need "namespace.h" for getdtablesize(). 1998-10-16 20:48:06 +00:00
kleink
73ef151b8c Need an internal name for fgetln(). 1998-10-16 12:39:54 +00:00
mycroft
ef3079f0ee Make sure we free the buffer in all error cases.
Do the final realloc(3) to the size of the string, not the size of the buffer
allocated for the string (which is a noop).
1998-10-15 07:36:09 +00:00
mycroft
285284da77 Allocate space exponentially, not linearly. 1998-10-15 07:10:38 +00:00
kleink
abc6d45e5c Need "namespace.h". 1998-10-14 11:56:28 +00:00
kleink
f5092a6c94 Need an internal name for isatty(). 1998-10-13 15:05:02 +00:00
kleink
d541ca6d80 Need internal names for isinf() and isnan(). 1998-10-13 14:43:36 +00:00
kleink
ee1afe8b7c Need internal names for snprintf() and vsnprintf(). 1998-10-13 14:19:21 +00:00
kleink
8b3da7b7a8 Need an internal name for fdopen(). 1998-10-13 14:07:04 +00:00
tv
ff03cd6580 Document %ll[diouxX] as requested by <bgrayson@ece.utexas.edu> in PR
standards/3527.  Also describe the argument to such a format as "quad_t",
not "quad int".
1998-09-14 21:10:18 +00:00
kleink
1d1861e253 Make the fseek() return value description match XSH5 (again). 1998-09-09 20:17:27 +00:00
kleink
36bf9c3062 Typo; from Michael Richardson <mcr@sandelman.ottawa.on.ca> in PR misc/6053. 1998-09-09 19:51:39 +00:00
kleink
127dfcd147 Since perror() must be reentrant, change the storage class of the buffer used
to hold the error message from static to automatic.
1998-09-09 12:15:55 +00:00
kleink
0cca1fcb27 Perform stdio stream locking as appropriate. 1998-09-09 12:08:05 +00:00
kleink
96deb0c4ec s/c_plusplus/__cplusplus/ 1998-09-08 15:10:12 +00:00
kleink
83d4043d4c s/NULL/NUL/ where appropriate. 1998-09-08 14:13:36 +00:00
kleink
100b813fad Deploy stdio stream locking as necessary. 1998-09-07 14:37:13 +00:00
kleink
caa80a1e72 Sloppy stdio stream lock tracking. 1998-09-07 14:31:57 +00:00
kleink
18a528c1cf Minor KNF nit. 1998-09-07 14:22:30 +00:00
kleink
77c6af31c7 Sloppy stdio stream lock tracking. 1998-09-06 16:37:27 +00:00
perry
315aabd347 make sure asprintf and vasprintf get MLINKS to printf.3 1998-08-30 23:29:18 +00:00
lukem
ce83c69e00 first pass at fixing up capitalization of function names and
arguments; ensure that each is correct with respect to the
implementation, rather than being correct as per english.
1998-08-29 08:32:32 +00:00
perry
05ffc15e02 document asprintf and vasprintf 1998-08-28 22:21:23 +00:00
perry
253ef37df2 add asprintf and vasprintf, originally written by Todd Miller for OpenBSD 1998-08-28 21:33:10 +00:00
mycroft
0816a4773b Update the date on this man page. 1998-07-28 17:11:12 +00:00
mycroft
f1f53ef7e8 Add an internal name for perror(3). 1998-07-28 12:22:31 +00:00
mycroft
0bbc075c20 Document mkdtemp(3). 1998-07-27 16:41:40 +00:00
mycroft
90cb894b40 Mention mkdtemp() in the warnings. 1998-07-27 16:39:11 +00:00
mycroft
cbb3325e89 Actually, FreeBSD calls this mkdtemp(). No point in creating a new name. 1998-07-27 16:12:01 +00:00
mycroft
7daf213c0f Add a mktempdir(), like mkstemp(), but it creates a directory. 1998-07-27 16:05:07 +00:00
mycroft
1b5106953f Delint (partially). 1998-07-27 14:04:01 +00:00
mycroft
201e4eaca0 If AUDIT, do not compile certain functions. 1998-07-27 13:42:27 +00:00
mycroft
c427e33070 If AUDIT, do not compile certain functions. 1998-07-27 13:36:43 +00:00
mycroft
c18a540460 Minor nit. 1998-07-26 13:55:44 +00:00
mycroft
eb69773cbb const poisoning. 1998-07-26 13:51:44 +00:00
mycroft
dae9fd960e const poisoning. 1998-07-26 12:35:24 +00:00
mycroft
be9c427d60 const poisoning. 1998-07-26 12:29:33 +00:00
jeremy
20de71c33e Changed HISTORY section to reflect that vsnprintf and snprintf first
appeared in 4.4BSD, rather than ``the current release''.
1998-06-08 23:45:37 +00:00
lukem
fc90756956 Implement a new manual page category ``SECURITY CONSIDERATIONS''
(suggested by mycroft)
1998-06-08 12:41:41 +00:00
kleink
01709792a9 Need <stdlib.h> for mkstemp() prototype. 1998-06-01 20:19:46 +00:00
kleink
c1d274c3ee Need <stdlib.h> for mkstemp() and mktemp() prototypes. 1998-06-01 20:17:50 +00:00
kleink
4c4cda3733 Prototypes have moved: change inclusion of <unistd.h> to <stdlib.h>. 1998-06-01 20:16:37 +00:00
fair
a27dd1341b "System V" -> ".At V" 1998-04-28 20:59:29 +00:00
fair
8e1d7f3de1 fix mdoc references and other mistakes 1998-04-28 20:58:00 +00:00
fair
dc026e0515 Change occurrences of "UNIX" to .Ux or .At as appropriate. 1998-04-28 06:00:51 +00:00
lukem
c197a64bba don't assume buf is NL_TEXTMAX long 1998-02-16 11:27:15 +00:00
perry
312aca536f add LIBRARY section to man page 1998-02-05 18:45:17 +00:00
perry
a16d9e868b .Bx'ize 1998-02-03 21:42:54 +00:00
perry
c8bafd6265 remove obsolete register declarations 1998-02-03 18:38:12 +00:00
mycroft
704290aaa1 Deal with GCC warning. 1998-02-03 01:40:49 +00:00
perry
3da5be9552 merge lite-2 1998-02-02 03:32:51 +00:00
jtc
a1de770ebd Use rwlocks as appropriate. 1998-01-22 08:21:45 +00:00
jtc
b559f98b9b Use FLOCKFILE() and FUNLOCKFILE() macros from reentrant.h so that stdio
can be made thread-safe.
1998-01-22 06:35:01 +00:00
jtc
da2013ac86 Use FLOCKFILE() and FUNLOCKFILE() macros from reentrant.h so that stdio
can be made thread-safe.
1998-01-19 07:38:41 +00:00