Commit Graph

2686 Commits

Author SHA1 Message Date
Brian Somers
3c321a686f Handle snprintf() returning -1
MFC after:	2 weeks
2001-08-20 12:41:36 +00:00
Brian Somers
a53a9f6906 Handle snrintf() returning -1.
MFC after: 2 weeks
2001-08-20 12:31:13 +00:00
Andrey A. Chernov
c5981656ea Add about rewind+errno, describe ESPIPE, minor formatting. 2001-08-19 08:24:50 +00:00
Dima Dorfman
e6063dd1a6 Implement getpeereid(3), a front-end to the LOCAL_PEERCRED
socket option for the Unix domain.  It's weaker than the
socket option (this only returns the uid and gid, while the
socket opt. can return the entire group list), and is
implemented mostly for compatibility with OpenBSD.
2001-08-17 22:09:15 +00:00
Dima Dorfman
06a4bf789c Xref raise(3). 2001-08-17 21:04:42 +00:00
Ruslan Ermilov
e822b43712 mdoc(7) police: collapse multiple spaces. 2001-08-17 15:25:55 +00:00
Ruslan Ermilov
e1aaa82284 mdoc(7) police: fixed the fatal. 2001-08-17 15:18:49 +00:00
Andrey A. Chernov
98aa5183a2 Simplify overflow calculations a bit 2001-08-17 11:08:56 +00:00
Andrey A. Chernov
4a9f1ee4e5 Remove extra check, already done in upper level caller, i.e. in
_fseeko()
2001-08-17 10:43:03 +00:00
Andrey A. Chernov
5fdaf178ae Mention ftell & ftello in EOVERFLOW section too. 2001-08-17 10:29:09 +00:00
Andrey A. Chernov
b98ba4224b Add more overflow checks in case of fseek() 2001-08-17 10:22:03 +00:00
Andrey A. Chernov
68ce9bfb10 Don't clear "we have offset" flag even if long is overflow for fseek(),
there is no harm to have it, it will reduce next call efforts.
2001-08-17 10:06:46 +00:00
Andrey A. Chernov
71b5a4326d fseek.c:
Resulting fseek() offset must fit in long, required by POSIX (pointed by bde),
so add LONG_MAX and final tests for it.

rewind.c:
1) add missing __sinit() as in fseek() it pretends to be.
2) use clearerr_unlocked() since we already lock stream before _fseeko()
3) don't zero errno at the end, it explicitely required by POSIX as the
only one method to test rewind() error condition.
4) don't clearerr() if error happens in _fseeko()
2001-08-17 09:57:11 +00:00
Ruslan Ermilov
9916c5d299 mdoc(7) police: replace \*(Ba' with a simple |', it's handled specially. 2001-08-16 11:09:00 +00:00
Joseph Koshy
2f46ebcdb7 If the string specifying the allowed options starts with a leading `:',
`getopt(3)' should not print a warning for missing argument values.

PR:		bin/29625
Reviewed by:	mikeh
MFC after:	1 week
2001-08-16 03:27:03 +00:00
Dima Dorfman
7bc6682520 Explain the relation of getchar() to getc() in less words.
Submitted by:	ru
2001-08-16 03:09:33 +00:00
Andrey A. Chernov
74b2772824 Use smarter overflow tests
Suggested by: bde
2001-08-15 20:10:38 +00:00
Andrey A. Chernov
d9e3eff33a 1) Disallow negative seek as POSIX require for fseek{o} (but not for lseek):
"[EINVAL] ... The resulting file-position indicator would be set to a
negative value."

Moreover, in real life negative seek in stdio cause EOF indicator cleared
and not set again forever even if EOF returned.

2) Catch few possible off_t overflows.

Reviewed by:	arch discussion
2001-08-15 02:07:47 +00:00
Yaroslav Tykhiy
a2a0a4dc2a Use the ".Rv" mdoc(7) macro where appropriate.
Reviewed by:	ru
2001-08-14 14:20:35 +00:00
Yaroslav Tykhiy
2fa4b9b3d6 Isolate the ERRORS section from the RETURN VALUES one.
Reviewed by:	ru
2001-08-14 14:10:01 +00:00
Ruslan Ermilov
753d686d34 mdoc(7) police: s/BSD/.Bx/ where appropriate. 2001-08-14 10:01:54 +00:00
Peter Wemm
2b618987fe Rip out the old __stdin/out/err stuff. It was completely 100% useless. :-(
It was foiled because of dynamic copy relocations that caused compile-time
space to be reserved in .bss and at run time a blob of data was copied to
that space and everything used the .bss version..  The problem is that
the space is reserved at compile time, not runtime... So we *still* could
not change the size of FILE.  Sigh.  :-(

Replace it with something that does actually work and really does let us
make 'FILE' extendable.  It also happens to be the same as Linux does in
glibc, but has the slight cost of a pointer.  Note that this is the
same cost that 'fp = fopen(), fprintf(fp, ...); fclose(fp);' has.
Fortunately, actual references to stdin/out/err are not all that common
since we have implicit stdin/out/err-using versions of functions
(printf() vs. fprintf()).
2001-08-13 21:48:44 +00:00
Ruslan Ermilov
ed2879a5cf mdoc(7) police: s;BSD/OS;.Bsx; where appropriate. 2001-08-13 17:07:40 +00:00
Ruslan Ermilov
d013e3f544 mdoc(7) police: s/NetBSD/.Nx/ where appropriate. 2001-08-13 17:00:36 +00:00
Ruslan Ermilov
04da392069 mdoc(7) police: s/OpenBSD/.Ox/ where appropriate. 2001-08-13 16:43:02 +00:00
Ruslan Ermilov
c5e7e03a14 Spell "FreeBSD" with "F" and "BSD" in uppercase. 2001-08-13 16:33:00 +00:00
Ruslan Ermilov
8af1452cf8 Removed duplicate VCS ID tags, as per style(9). 2001-08-13 14:06:34 +00:00
Ian Dowse
cd0ada9d94 Cross-reference io(4). 2001-08-12 21:16:41 +00:00
Hajimu UMEMOTO
8e67a60053 Fill _res.sort_list with harmless entry. sortlist for IPv6/IPv4
is stored in _res_ext.sort_list, and sortlist for IPv4 is stored in
_res.sort_list for backward compatibility.  However, both sort_list's
are maintaind by just one index _res.nsort.  So, when IPv6 address is
specified to sortlist, empty entry was created in _res.sort_list.  It
broke sortlist facility of gethostbyname().
Discussed on users@jp.ipv6.org.
2001-08-11 15:01:12 +00:00
Dima Dorfman
7f55e48eb1 Use .Fn, .Fa, and .Dv where appropriate. 2001-08-10 20:49:38 +00:00
Ruslan Ermilov
94ba280c59 mdoc(7) police: join split punctuation to macro calls. 2001-08-10 17:35:21 +00:00
Ruslan Ermilov
c75526d5a0 mdoc(7) police: fixed the "new sentence" bogons. 2001-08-10 15:03:10 +00:00
Ruslan Ermilov
57e4378bf6 mdoc(7) police: protect trailing full stops of abbreviations
with a trailing zero-width space: `e.g.\&'.
2001-08-10 13:45:36 +00:00
Ruslan Ermilov
b3ebbab8d3 Fixed style bugs (dot `.' at the end of error and warning messages).
Noticed by:	bde
2001-08-10 11:46:37 +00:00
Ruslan Ermilov
a9bef12a45 Markup nits: use diagnostic type lists for error and warning messages.
Backout previous revision.  We should not expand plain text xrefs if
they appear in the literal text, e.g. in the error or warning message
of the library function.  (Submitted by: bde)

Moved "out of memory" from warning to errors section.
2001-08-10 11:41:55 +00:00
Ruslan Ermilov
8e42cf1a46 mdoc(7) police: add xref to intro(2). 2001-08-10 10:11:55 +00:00
Mike Barcroft
fcd3401ece o Remove some misleading and incomplete information about search
permissions.
o Add a reference to intro(2) where it is properly documented.

Reviewed by:	bde
MFC after:	3 days
2001-08-09 17:29:46 +00:00
Mike Barcroft
107d3f78b0 o Various mdoc fixes.
o Replace strncpy examples with less confusing ones from
  OpenBSD.  These examples give more detail and also suggest
  using strlcpy(3).

Reviewed by:	des, ru, sheldonh
Obtained from:	OpenBSD
MFC after:	3 days
2001-08-09 17:10:48 +00:00
Maxim Sobolev
5d25d75662 Fix xrefs.
times.3:	gettimeofday(3) --> gettimeofday(2)
rc.conf.5:	isndn(8)	--> isdnd(8)
		idsnd(8)	--> isdnd(8)

MFC after:	2 weeks
2001-08-09 15:46:53 +00:00
Yaroslav Tykhiy
b1250632c5 Use the ``.Rv -std'' mdoc(7) macro in appropriate cases.
Reviewed by:	ru
2001-08-09 13:32:13 +00:00
Mike Heffner
785ead5062 typo: patched->matched 2001-08-09 00:34:57 +00:00
Ruslan Ermilov
6575e6daae mdoc(7) police: expand plain text xrefs. 2001-08-08 11:48:28 +00:00
Ruslan Ermilov
3bc371d25d Urge the reader to start using getaddrinfo(3) and getnameinfo(3)
protocol-independant functions that don't use static memory area.

Suggested by:	nik
Liked by:	ume, brian
2001-08-08 11:05:47 +00:00
Ruslan Ermilov
936c7c034e mdoc(7) police: remove whitespace at EOL. 2001-08-08 10:28:18 +00:00
Ruslan Ermilov
71b67d931a mdoc(7) police: markup nits. 2001-08-08 08:51:03 +00:00
Peter Wemm
20f9910b18 Update ptrace(2) re: PT_READ_U and PT_WRITE_U 2001-08-08 05:28:09 +00:00
Ruslan Ermilov
c4d9468ea0 mdoc(7) police:
Avoid using parenthesis enclosure macros (.Pq and .Po/.Pc) with plain text.
Not only this slows down the mdoc(7) processing significantly, but it also
has an undesired (in this case) effect of disabling hyphenation within the
entire enclosed block.
2001-08-07 15:48:51 +00:00
Ruslan Ermilov
44220250d0 mdoc(7) police: sort xrefs. 2001-08-07 12:33:11 +00:00
Ruslan Ermilov
f61004566c mdoc(7) police: markup nits. 2001-08-07 12:17:32 +00:00
Dima Dorfman
557b792532 varargs -> stdarg 2001-08-05 05:39:16 +00:00