Commit Graph

227 Commits

Author SHA1 Message Date
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
kleink
f47d490f87 Change several functions to return -1 instead of EOF, which was semantically
wrong.
1997-12-19 14:08:41 +00:00
mrg
4e252e8c4d add missing .Nm entries. from spz@serpens.swb.de. 1997-11-14 02:04:36 +00:00
thorpej
2a43f22095 __warn_references and __indr_reference semicolon fixups. From
Chris Demetriou <cgd@pa.dec.com>.
1997-11-04 23:52:05 +00:00
lukem
d0e23d974a - use CPPFLAGS instead of CFLAGS
- use ${COMPILE.C} ... instead of ${CC} ${CFLAGS} -c ...
1997-10-22 23:14:04 +00:00
mycroft
15de1c9fd2 Use S_IS*(), not S_IF*. 1997-10-19 17:54:18 +00:00
mycroft
3c891ba5b1 Fix a bizarre formatting error. 1997-10-14 07:27:57 +00:00
hubertf
26f31c2590 Partly backing out last change, only leaving lstat() instead of stat().
Pointed out by Enami Tsugutomo <enami@but-b.or.jp>.
1997-10-07 00:02:44 +00:00
hubertf
681b2f48bc remove(3) doesn't remove dangling links due to stat() returning an
error. Now try lstat() before really aborting.
OK'd by thorpej.
1997-10-06 00:28:14 +00:00
phil
a25ce426d4 Remove the flag test when seeing if _double is zero or not. We
are only testing for the cvt problem, not for alternate forms.
This change makes %#e and %e both correctly print 0.  It is just
a question of is it the proper number of zeros or not?
1997-08-29 05:31:11 +00:00
kleink
c213a3af8b Add missing `STANDARDS' compliance statements. As we #define _POSIX_VERSION
to 199009L, bump existing statements to 1003.1-1990.
1997-07-14 23:19:39 +00:00
christos
0c339c443a Fix RCSID's
Fix gcc warnings.
Add prototypes for functions that were declared in more than one place
to local.h or extern.h and use that instead.
1997-07-13 20:15:17 +00:00
christos
23312f88d4 Fix RCSID's
Fix gcc warnings.
Add prototypes for functions that were declared in more than one place
to local.h or extern.h and use that instead.
1997-07-13 20:14:49 +00:00
phil
4de11835a6 Modify to have _gettemp generate different names on repeated calls even if the
file was not created.  Tempnam modified to make use of full possibilities.
1997-07-07 17:47:00 +00:00
kleink
72a0532ba2 Add an Xref to rmdir(2). 1997-06-03 22:28:25 +00:00
kleink
5ddc3f534d Always use rmdir(2) to remove a directory, as the file system may prohibit
using unlink(2) on directories.
1997-06-03 22:26:38 +00:00
kleink
5a4d11e445 Upon an attempt to write to a stream that can't be written to, set errno
to EBADF.
1997-05-03 09:01:48 +00:00
lukem
c3e5a4fdb6 use lstat() instead of stat() when checking for existance.
from Keith Bostic <bostic@bostic.com>
1997-04-08 06:14:39 +00:00
kleink
f87eccf5b4 RCSid police 1997-04-02 12:50:23 +00:00
lukem
0607611785 * clarify that tempnam and tmpnam still have problems
* advise mkstemp() over mktemp(), tmpnam(), tempnam(), and indicate
  link-time warning if latter 3 are used
* minor cleanups
1997-03-24 11:39:10 +00:00
lukem
15d4b08009 explain why mktemp() should generally be avoided in favour of mkstemp() 1997-03-24 09:22:15 +00:00
lukem
1960b7137d add warn_refs for mktemp(), tempnam(), and tmpnam() since most code
use these incorrectly. mkstemp() is ok however. inspired by openbsd
1997-03-16 05:00:38 +00:00
mouse
ff44468136 alternate -> alternative, per PR 2643 1997-03-08 13:36:38 +00:00
mrg
9cd5492c02 - convert unsafe strcpy(), strcat() and sprintf() to the `n' versions.
- some KNF.
1997-01-23 14:01:45 +00:00
mikel
37ee5d07f0 xref lseek(2) instead of seek(2); PR lib/2750
also note fpos_t/off_t discrepancy.
1997-01-23 08:10:04 +00:00
perry
49f0a0ae54 fix pr-2664, second param to fgets is int not size_t, from SAITOH Masanobu 1997-01-17 02:38:19 +00:00
cgd
316aac5b98 pull in local.h for prototypes. first arg to __sflags() is const char * 1996-12-20 20:26:00 +00:00
mouse
b88c4afb8d Apply PR 2751 - writefn's second arg is const char *, not char *. 1996-11-07 09:23:10 +00:00
explorer
5b3a9aad8d Cute little bug with operator precedence in our stdio code. It appears
that flushing wasn't done right when input buffers were refilled, due
to a check like
	if (foo == _A | _B) which, since _A and _B are both != 0, always
evaluates to true.

Found by proven@cygnus.com
1996-08-13 07:54:00 +00:00
pk
204be49cb4 typo: DV -> Dv 1996-05-05 19:21:20 +00:00