Commit Graph

2932 Commits

Author SHA1 Message Date
Alfred Perlstein
4e957fe63c Fix reference to aio_read, should be aio_write 2001-10-16 00:49:19 +00:00
Bruce Evans
18ca70d12d Fixed style bugs in previous commit. 2001-10-15 04:29:06 +00:00
Dima Dorfman
c49c01757a link(2) may fail with EPERM if name1 is immutable or append-only.
PR:		31025
Submitted by:	Tim Singletary <tsingle@vetinsite.com>
2001-10-14 22:40:19 +00:00
Doug Rabson
a387081c63 Make this compile on ia64. 2001-10-14 13:45:33 +00:00
Matthew Dillon
418fff7e8f Add warning about zeroing-out the socket structure before populating it. 2001-10-13 17:20:51 +00:00
Mike Barcroft
43e13bf58f Note that strncmp() will not compare characters after a NUL character.
Add a missing word.  Bump document date.

Inspired by:	IEEE Std 1003.1-200x (Draft 7)
MFC after:	3 days
2001-10-11 17:02:44 +00:00
Mike Barcroft
a9227c40eb Clarify that strnstr() will stop searching after in encounters a NUL
character.  Bump document date.  Add a missing comma.
2001-10-11 15:49:06 +00:00
Ruslan Ermilov
506d9c18e9 - Bump document date for eaccess(2) addition.
- Mention ``eaccess'' in the NAME section.
- Use intro(2) terminology.
- Markup fixes.

Reviewed by:	rwatson
2001-10-11 15:27:53 +00:00
Michael Reifenberger
91a701cd13 Fix SysV Semaphore Handling.
Updated by peter following KSE and Giant pushdown.
I've running with this patch for two week with no ill side effects.

PR:		kern/12014: Fix SysV Semaphore handling
Submitted by:	Peter Jeremy <peter.jeremy@alcatel.com.au>
2001-10-11 08:15:14 +00:00
Bruce Evans
6eabd84580 Compensate for "Compensate for header dethreading" by backing it out. 2001-10-10 17:48:44 +00:00
Ruslan Ermilov
943873e722 getnetbyaddr() should be serviced by the "networks" database. 2001-10-10 12:49:53 +00:00
Doug Rabson
d9ed7b41fe Adjust so that we don't use relocations which can't exist in a shared
library.
2001-10-10 10:35:01 +00:00
Doug Rabson
d7ed89186f Shorter versions of the byte swapping code. 2001-10-10 10:34:08 +00:00
Andrey A. Chernov
89503316a0 Implement strcasestr() which many others (f.e. Linux) already have. 2001-10-10 02:17:35 +00:00
Mike Barcroft
7ec7a350c5 Document the fact that the strnstr(3) function is not portable.
Requested by:	brian, gad
2001-10-09 17:22:02 +00:00
Mike Barcroft
2815c1fd80 Don't mangle vendor ids to put them in __RCSID. Just ifdef all vendor
id cruft.

Submitted by:	bde
2001-10-09 16:40:04 +00:00
Mike Barcroft
41036d782d Add a new libc function, strnstr(3), which allows one to limit the
number of characters that are searched.  This is especially useful
with file operations and non-NUL terminated strings.

Silence from:	-audit, -hackers
MFC after:	5 days
2001-10-09 01:29:56 +00:00
Doug Rabson
a4ddd40c34 Make this work on ia64. I have no idea why it works on alpha - it
shouldn't.
2001-10-06 15:58:54 +00:00
Doug Rabson
3e2c3ee97c Fix a load of dependancy violations. 2001-10-05 18:52:42 +00:00
Bill Paul
e6f9ad0779 Add compatibility functions for the AF_LOCAL RPC transport stuff
that used to live in RPC 4.0. This is needed for yppasswd and
rpc.yppasswdd to work correctly. Patch supplied by Martin Blapp.
2001-10-04 21:03:17 +00:00
David Malone
2bc21ed985 Hopefully improve control message passing over Unix domain sockets.
1) Allow the sending of more than one control message at a time
over a unix domain socket. This should cover the PR 29499.

2) This requires that unp_{ex,in}ternalize and unp_scan understand
mbufs with more than one control message at a time.

3) Internalize and externalize used to work on the mbuf in-place.
This made life quite complicated and the code for sizeof(int) <
sizeof(file *) could end up doing the wrong thing. The patch always
create a new mbuf/cluster now. This resulted in the change of the
prototype for the domain externalise function.

4) You can now send SCM_TIMESTAMP messages.

5) Always use CMSG_DATA(cm) to determine the start where the data
in unp_{ex,in}ternalize. It was using ((struct cmsghdr *)cm + 1)
in some places, which gives the wrong alignment on the alpha.
(NetBSD made this fix some time ago).

This results in an ABI change for discriptor passing and creds
passing on the alpha. (Probably on the IA64 and Spare ports too).

6) Fix userland programs to use CMSG_* macros too.

7) Be more careful about freeing mbufs containing (file *)s.
This is made possible by the prototype change of externalise.

PR:		29499
MFC after:	6 weeks
2001-10-04 13:11:48 +00:00
Mike Barcroft
b5c9f90bf5 Include <string.h> to prototype strcpy(3). While I'm here, make use
of the new RCSID macros.

MFC after:	3 days
2001-10-04 04:42:03 +00:00
Bruce Evans
5843ec1d4c Fixed various type errors in synopsis. 2001-10-03 16:53:59 +00:00
Bruce Evans
db7534cfa2 Fixed bitrot in synopsis. The TI-RPC changes gave mounds of it, mainly
inconsistently weird const poisoning in the man pages relative to the
headers.
2001-10-03 16:47:56 +00:00
Bruce Evans
da838a6546 Fixed missing `const' in synopsis. 2001-10-03 16:29:21 +00:00
Bruce Evans
d2dcbe6238 Fixed return type in synopsis. 2001-10-03 16:25:08 +00:00
Alfred Perlstein
9c2ccf2741 Avoid getting stuck in system(3) when the internal call to wait4()
is interrupted by saving the pid.

The old code would assign the return value to pid which would trash
it, to fix the problem save a copy of the pid to be used as the
paramter to wait4().

Submitted by: Toshihiko ARAI <toshi@jp.FreeBSD.org>
2001-10-03 11:01:39 +00:00
Bruce Evans
0c9467724c Fixed syntax errors in synopsis. The restrict keyword doesn't exist yet.
The corresponding bugs in <wchar.h> have no effect because the function
prototypes there don't have args so the __restrict "keyword" is
misinterpreted as an arg.
2001-10-03 05:19:47 +00:00
Bruce Evans
593126b9d6 Fixed misspelled arg type in synopsis. 2001-10-03 01:45:37 +00:00
Bruce Evans
8bb4f93fa7 Fixed missing include in synopsis. 2001-10-03 00:51:30 +00:00
Hajimu UMEMOTO
1e09a8ab6c - cope with sa_len < sizeof(struct sockaddr).
From: Patrik Lindergren <patrik@datacom.nu>
- delint (pointer cast issue).  from netbsd-current

Obtained from:	KAME
MFC after:	1 week
2001-10-02 13:51:29 +00:00
Ruslan Ermilov
32eef9aeb1 mdoc(7) police: Use the new .In macro for #include statements. 2001-10-01 16:09:29 +00:00
Ruslan Ermilov
2677aa4b68 mdoc(7) police: don't split author names in the AUTHORS section. 2001-10-01 13:50:03 +00:00
Ruslan Ermilov
ae0d2bed3e mdoc(7) police: s/atof/atoi/ 2001-10-01 12:44:24 +00:00
Matthew Dillon
8719c58fef Add __FBSDID()s to libutil 2001-09-30 22:35:07 +00:00
Jeroen Ruigrok van der Werven
54045486e0 Add ERRORS section.
Mention thread safety and async-cancel safety status [not].
Add standards compliancy references.
Note strtol() is preferred over atoi().

MFC after:	2 weeks
2001-09-26 20:22:44 +00:00
Jeroen Ruigrok van der Werven
5578cfa2fa Be explicit about the POSIX version it conforms to [in this case 1990].
Put the error comment under the more appropriate ERRORS section.
2001-09-26 20:10:10 +00:00
Jeroen Ruigrok van der Werven
99e8131545 Change standards compliancy order so that C and POSIX are grouped. 2001-09-26 19:42:39 +00:00
Murray Stokely
2924629c0c - Correct capitalization of a function name.
- Add a missing word to form a complete sentence.

PR:		docs/30626
Submitted by:	Dan Lukes <dan@obluda.cz>, and
		swear@blarg.net (Gary W. Swearingen)
2001-09-24 02:51:43 +00:00
Mike Barcroft
545c943a7b Note that strdup(3) will set errno if memory allocation fails. This
is also required by the forthcoming POSIX.1-200x standard.

Obtained from:	malloc.3
2001-09-23 00:37:42 +00:00
Doug Rabson
1e1a0298ee Fix a whole bunch of dependancy bugs and make it actually work when the
size is not a multiple of eight.
2001-09-22 18:27:01 +00:00
Doug Rabson
f422e65a5d Fix byte swapping - it was totally broken. 2001-09-22 18:22:53 +00:00
Robert Watson
bd10d2560f o Modify access(2) man page to describe eaccess(2), and add a symlink
so man eaccess will return the access(2) man page.

Obtained from:	TrustedBSD Project
2001-09-21 21:35:22 +00:00
Ruslan Ermilov
7d8983a292 Document the FTS_ROOTPARENTLEVEL and FTS_ROOTLEVEL constants. 2001-09-20 12:32:45 +00:00
Andrey A. Chernov
74b6098af4 First appeared in 5.0, not in 4.4 2001-09-17 08:18:45 +00:00
Mike Barcroft
a5aecc7707 style(9)
Silence from:	phantom
2001-09-17 00:23:19 +00:00
Guido van Rooij
fea88e76d7 Typo: s/conatains/contains/
MFC after:	1 week
2001-09-12 17:57:31 +00:00
Ruslan Ermilov
8fc5ce4d99 mdoc(7) police: changed pure POSIX text; added missing markup bits. 2001-09-11 09:39:23 +00:00
Ruslan Ermilov
9cbf4a2152 mdoc(7) police: removed commas from the standard (split) AUTHORS block. 2001-09-11 09:26:38 +00:00
Jeroen Ruigrok van der Werven
49c65386a5 Add more standards which we conform to.
Note our implementation is not thread nor async-cancel safe.
Explicitely note atof() does not check nor report errors.
Note that strtod() should be used instead.
2001-09-09 21:09:53 +00:00
Jeroen Ruigrok van der Werven
e348b8ea25 Detail thread-safe and async-cancel-safe status.
Also add C99 conformity status plus clarification that C99 leaves the
flushing of unwritten data, closure of open streams, and removal of
temporary files to the implementation.
2001-09-09 18:52:00 +00:00
Andrey A. Chernov
1b89a29689 1) If __SAPP stream is not seekable, remove __SAPP flag on first call instead
of repeating unsuccessful lseek call on each write (original stdio bug).

2) Save errno accross _sseek call in _swrite to not touch it in case write
success (original stdio bug).

3) Add _sseek error checking back, but only for __SOPT mode now.
2001-09-07 17:16:02 +00:00
Jeroen Ruigrok van der Werven
8aefde0607 Move to using .In instead of .Fd #include <> for include mark-up.
Inspired by comment from:	dd
2001-09-07 14:46:36 +00:00
Alexey Zelkin
84b4fdf912 reconnect strfmon.c to build list 2001-09-07 13:03:16 +00:00
Jeroen Ruigrok van der Werven
fbded4984e Fix some mdoc nits caused by my knowledge not being too up-to-date on
mdocNG.

Submitted by:	dd
2001-09-07 12:38:10 +00:00
Doug Rabson
8e37b82334 Port to ia64, taking into account the fact that pagesizes may be variable. 2001-09-07 12:32:43 +00:00
Jeroen Ruigrok van der Werven
8c9893a371 Add strfmon.3 to the fray.
This is a first cut, but enough to help people interested in using it
further than before.
More text coming to illustrate use and provide more details.

Based on standards' text.
2001-09-07 09:55:28 +00:00
Andrey A. Chernov
ac206f37a1 For now just back out seek error checking in __SAPP case, it cause problems
with non-seekable streams.  Now here is what here was originally, but it is
ugly, producing unneded seek syscall on each non-seekable stream write.  I'll
think about proper solution later.
2001-09-07 02:13:11 +00:00
Yaroslav Tykhiy
b88d4f49fe Fix all the ambiguous or erroneous statements of the brk(2)
manpage by taking its text from NetBSD and editing it further.
This also improves the page's mdoc(7) markup style.

Reviewed by:	ru
Obtained from:	NetBSD
2001-09-06 12:11:22 +00:00
Alexey Zelkin
f6a9e03fe5 correctly wrap macros with { } 2001-09-06 09:26:28 +00:00
David E. O'Brien
19372e6db7 strfmon(3) is not ready to go live. 2001-09-06 08:58:42 +00:00
Alexey Zelkin
9d430a5991 Add strfmon(3) implementation. It still contains few XXX's because I lost
my last version of this work due to HDD crash, but this version cleanly
passed all POSIX and SuSv2 tests. I am working on testing scripts which
should test this implementation against all locales and surely more fixes
will come soon.

Reviewed by:	ache, silence at -audit & -developers
2001-09-05 18:50:02 +00:00
Ruslan Ermilov
8872ae5340 mdoc(7) police: markup and minor content fixes.
o Removed whitespace at EOL
o Removed hard sentence breaks
o Added cap_size() to the NAME section
o Normalized .Nd descriptions
o Fixed the abuses of .Nm and .Va
o Fixed some DESCRIPTION texts
o Fixed the RETURN VALUES and ERRORS texts to look more traditional

Reviewed by:	tmm
2001-09-05 14:09:08 +00:00
Robert Watson
8d44fade0e Add Thomas Moestl and Chris Faulhaber to the author list for POSIX.1e
support.

Obtained from:	TrustedBSD Project
2001-09-05 03:36:00 +00:00
Andrey A. Chernov
2505b3ed25 Portability fix: use unsigned cast to guaranteed positive part of expression
in case {L}LONG_MAX > abs({L}LONG_MIN).  Non-functional change - we don't
have any such platforms.
2001-09-04 21:28:01 +00:00
Andrey A. Chernov
f8ade0e68e Remove rcsids and unneded include 2001-09-04 17:41:20 +00:00
Andrey A. Chernov
f4fc08f367 'acc' is not initialized in one hypotetical case, fix it 2001-09-04 17:12:15 +00:00
Andrey A. Chernov
4e6b157062 Locale *is* used in strto*l*(), at least for isspace(), so remove
'locale not used' statement from comments and BUGS section of manpage.

strtol(): fix non-portable 'cutoff' calculation using the same method as
in strtoll().

Cleanup 'cutoff' calculation, remove unneded casts. Misc. cleanup to
make all functions looks the same.

Implement EINVAL reaction per POSIX, document it in manpage, corresponding
POSIX example quotes here:

------------------------------------------------
If the subject sequence is empty or does not have the expected form, no
conversion is performed; the value of str is stored in the object pointed
to by endptr, provided that endptr is not a null pointer.

If no conversion could be performed, 0 shall be returned and errno may be
set to [EINVAL].

[EINVAL] The value of base is not supported.

Since 0, {LONG_MIN} or {LLONG_MIN}, and {LONG_MAX} or {LLONG_MAX} are
returned on error and are also valid returns on success, an application
wishing to check for error situations should set errno to 0, then call
strtol( ) or strtoll ( ), then check errno.
-----------------------------------------------------
2001-09-04 16:39:11 +00:00
Doug Rabson
8dc609a914 Implement _setjmp()/_longjmp().
Obtained from: Intel's EFI toolkit
2001-09-04 08:27:39 +00:00
Dima Dorfman
25814ea7e1 This does not describe sched_{get,set}scheduler.
PR:		26001
Submitted by:	OHSAWA Chitoshi <ohsawa@catv1.ccn-net.ne.jp>
2001-09-03 17:55:08 +00:00
Dima Dorfman
4cecc6ffce Don't capitalize jail(2) in the middle of a sentence.
PR:		25876
Submitted by:	Koizumi Satoru <koizumi@cms.phys.s.u-tokyo.ac.jp>
2001-09-03 17:49:29 +00:00
Murray Stokely
033d275cb0 PT_STEP in ptrace(2) man page is described as 'addr and data fields
are not used'.  This is incorrect, as addr must be passed (caddr_t)1
to do anything useful.  The source for gdb and a short test program
will confirm that this man page was in error.

PR:		docs/27758
Submitted by:	Jiangyi Liu <jyliu@163.net>
2001-09-03 09:42:40 +00:00
Andrey A. Chernov
347a15b2ab When __SOPT is cleared, clear __SOFF too.
NOTE: original stdio bug.
2001-09-03 02:35:10 +00:00
Andrey A. Chernov
5e00917d95 Re-arrange my funopen(3) fix to minimize differences with original stdio code,
no functional changes.

Add fp->_offset optimization in _SAPP+_SOPT case
2001-09-03 02:24:37 +00:00
Robert Watson
3652b4dc72 o Sync up prototypes for cap_size() and cap_copy_ext() with
sys/capability.h--this compiled fine on i386 where (int) and (ssize_t)
  are the same, but broke on Alpha where they differ.

Submitted by:		Mike Barcroft <mike@FreeBSD.org>
Obtained from:	TrustedBSD Project
2001-09-02 23:13:49 +00:00
Andrey A. Chernov
aeb7f4bac4 Internal seeks are overoptimized. They should remember fp->_offset only for
plain regular files, i.e. files with __SOPT flag set. Fix it, so ftell(stdout)
always returns the same as lseek(1, 0, 1) now.

NOTE: this bug was in original stdio code
2001-09-02 21:22:00 +00:00
Andrey A. Chernov
778d840e50 Fix bug in off_t overflow checking: if fp->_offset overflows, just remove
__SOFF flag (i.e. we don't have offset) instead of returning EOVERFLOW.
It allows again continious reading from non-stop stream.
2001-09-02 19:52:09 +00:00
Andrey A. Chernov
1633b4aa85 Remove MLINKS seek.2 to lseek.2, we don't have seek.2 syscall 2001-09-02 19:28:41 +00:00
Andrey A. Chernov
bf351925f7 Typo seek(2) -> lseek(2) 2001-09-02 19:24:07 +00:00
Andrey A. Chernov
924888f977 Move all stdio internal flags processing and setting out of __sread(),
__swrite() and __sseek() to higher level. According to funopen(3) they all
are just wrappers to something like standard read(2), write(2) and
lseek(2), i.e. must not touch stdio internals because they are replaceable
with any other functions knows nothing about stdio internals. See example
of funopen(3) usage in sendmail sources f.e.

NOTE: this is original stdio bug, not result of my range checkin added.
2001-09-02 19:10:10 +00:00
Chris Costello
fd818070c8 Another punctuation fix (missing comma ending preposition). 2001-09-01 21:32:52 +00:00
Chris Costello
d997ce6456 o Mention the fact that specifying a fileid of 0 searches all loaded
modules.
o Properly terminate a preposition.
2001-09-01 21:31:33 +00:00
Andrey A. Chernov
35e1a550de Save errno before function call and restore it on success (because many
internal functions there may fail and set (i.e. overwrite) errno in normal
(not error) situation). In original variant errno testing after call
(as POSIX suggest) is wrong when errno overwrite happens.
2001-09-01 15:28:24 +00:00
Andrey A. Chernov
d911eb4536 Remove even more unneded checks, original code can't overflows in that place 2001-09-01 15:01:37 +00:00
Andrey A. Chernov
4fd8a4cf24 Remove two checks unneeded now (can't happens) 2001-09-01 14:48:45 +00:00
Andrey A. Chernov
45892fd855 Make fseek(... SEEK_CUR) fails if current file-position is unspecified. 2001-09-01 14:40:01 +00:00
Andrey A. Chernov
3c4d9468b0 Note that prev. commit addition is for ftell/ftello 2001-09-01 14:23:30 +00:00
Andrey A. Chernov
2f5eadff6b Describe ESPIPE as result of unspecified file-position indicator value.
Add more to SEE ALSO section.
2001-09-01 14:11:53 +00:00
Andrey A. Chernov
a914951d68 Describe file-position behaviour from POSIX 2001-09-01 14:01:52 +00:00
Andrey A. Chernov
6ff604a73a Strict in the POSIX sence, if file position is unspecified after ungetc() at
0, return that we can't specify it, i.e. error with ESPIPE.
(hint from: "Peter S. Housel" <housel@acm.org>)

Back out sinit() addition, not needed after various code simplifications.
2001-09-01 12:13:33 +00:00
Andrey A. Chernov
6946977c36 If lseek to wrong value sucessfully happens despite all pre-checks, set __SERR
to indicate that stream becomes inconsistent.
2001-09-01 11:21:28 +00:00
Andrey A. Chernov
b13ed88361 If position is underflowed, don't try to hide that fact by recovery, just
return EIO and set __SERR to mark stream as inconsistent.
2001-09-01 11:18:53 +00:00
Andrey A. Chernov
65efd81290 Back out disabling ungetc() at 0, use different solution:
keep negative offset internally, but return 0 externally in ftell*()
I.e. use 0 now as 'unspecified value' per POSIX ungetc() description.
2001-09-01 01:56:54 +00:00
Robert Watson
0e3adf0b58 o Attach cap_cmp.c and cap_copy.c to the build.
o Attach cap_copy_ext.3 and cap_copy_int.3 to the install, and link
  cap_size.3 to cap_copy_ext.3.

Submitted by:		tmm
Obtained from:	TrustedBSD Project
2001-09-01 00:00:50 +00:00
Andrey A. Chernov
aed591bb15 Describe EOVERFLOW I implement per POSIX.
Sort ERRORS section
2001-08-31 23:06:28 +00:00
Andrey A. Chernov
598bb4cb30 Add originally missing __sinit() call. 2001-08-31 20:36:19 +00:00
Andrey A. Chernov
c4b2cc78e3 Simplify offset underflow checks even more 2001-08-31 20:17:32 +00:00
Andrey A. Chernov
711b11769d Describe that we disallow ungetc at offset 0 now. 2001-08-31 20:03:49 +00:00
Andrey A. Chernov
4db40fd143 Disallow ungetc at offset 0 (to prevent negative offset happens), so simplify
checks in ftell.
2001-08-31 19:50:25 +00:00
Andrey A. Chernov
7cf30ace84 Drop buffer first, _then_ ask for real position 2001-08-31 18:54:44 +00:00
Andrey A. Chernov
2ff678f5bb The same big piece of ftell code repeated in 3 places. Simplify things moving
it into one subfunction instead.
Try to use real offset in strange cases.
2001-08-31 18:23:29 +00:00
Andrey A. Chernov
ee75810413 If file offset is smaller than internal buffer character left count, just drop
internal buffer and trust offset, not return error.
2001-08-31 14:11:14 +00:00
Andrey A. Chernov
1dfa423639 Initialize _offset to 0 in fopen(), it helps to optimize fseek/ftell 2001-08-31 13:14:49 +00:00
Andrey A. Chernov
ca934ebcae Detect fp->_offset overflow on read
Use errno to catch negative seek with -1 offset
2001-08-31 12:55:22 +00:00
Ruslan Ermilov
81a3cb97a5 Add manpage for inet_net_ntop(3) and inet_net_pton(3).
Obtained from:	NetBSD
2001-08-31 10:54:44 +00:00
Ruslan Ermilov
d6002fef6f Use ``.Rv -std'' wherever possible.
Submitted by:	yar
2001-08-31 09:57:38 +00:00
Robert Watson
ab2ba9fac8 o Use .Fx to refer to FreeBSD
Submitted by:		tmm
Obtained from:	TrustedBSD Project
2001-08-31 02:12:54 +00:00
Robert Watson
cbc25559e4 o Remove definition of CAP_MAX_BUF_LEN since it is defined in
sys/capability.h now.

Submitted by:		tmm
Obtained from:	TrustedBSD Project
2001-08-31 02:11:59 +00:00
Robert Watson
7bb862d793 Introduce implementations of POSIX.1e non-portable form capability
support functions:
     cap_subset_np()    - Is cap1 a subset of cap2
     cap_equal_np()     - Is cap1 equal to cap2

o Introduce implementations of POSIX.1e capability support functions:
     cap_copy_ext()     - Externalize capability
     cap_copy_int()     - Internalize capability
     cap_size()         - Determine size required for cap_copy_ext()

Submitted by:		tmm
Obtained from:	TrustedBSD Project
2001-08-31 02:07:48 +00:00
Alexander Langer
a102b12e67 Add Xref to make.conf(5). 2001-08-30 21:44:46 +00:00
Andrey A. Chernov
57935eeb3d Try to discard some ungetc data in saved internal buffer checks too,
if offset tends to be negative.
2001-08-30 20:49:47 +00:00
Andrey A. Chernov
77f71bc5ac goto dumb; if can't obtain curoff for whence != SEEK_CUR cases, as supposed 2001-08-30 20:19:45 +00:00
Andrey A. Chernov
e54bc118c1 Add more EOVERFLOW checks.
When file offset tends to be negative due to internal and ungetc buffers
additions counted, try to discard some ungetc data first, then return EBADF.
Later one can happens if lseek(fileno(fd),...) called f.e. POSIX says that
ungetc beyond beginning of the file results are undefined, so we can just
discard some of ungetc data in that case.

Don't rely on gcc cast when checking for overflow, use OFF_MAX.

Cosmetique.
2001-08-30 19:54:04 +00:00
Mike Barcroft
03516cfeb0 o Remove some GCCisms in src/powerpc/include/endian.h.
o Unify <machine/endian.h>'s across all architectures.
o Make bswapXX() functions use a different spelling of u_int16_t and
  friends to reduce namespace pollution.  The bswapXX() functions
  don't actually exist, but we'll probably import these at some
  point.  Atleast one driver (if_de) depends on bswapXX() for big
  endian cases.
o Deprecate byteorder(3) prototypes from <sys/types.h>, these are
  now prototyped indirectly in <arpa/inet.h>.
o Deprecate in_addr_t and in_port_t typedefs in <sys/types.h>, these
  are now typedef'd in <arpa/inet.h>.
o Change byteorder(3) prototypes to use standards compliant uint32_t
  (spelled __uint32_t to reduce namespace pollution).
o Document new preferred headers and standards compliance.

Discussed with:	bde
PR:		29946
Reviewed by:	bmilekic
2001-08-30 00:04:19 +00:00
Robert Watson
fca41b9c6f o src/sys/capability.h provides a number of support macros that are not
documented by POSIX.1e, and understand the opaque capability structures.
  Introduce support in the userland POSIX.1e library for a
  _CAPABILITY_NEEDMACROS define to remove these macros from the normal
  namespace, but allow the libc functions to use them.

Submitted by:	tmm
Obtained from:	TrustedBSD Project
2001-08-29 17:53:45 +00:00
Bruce Evans
1643f03d5f Fixed namespace pollution related to `warn' in libc (but not in other
libraries or for other members of the err() family).

This fixes world breakage in bc and rcs/* for NOSHARED worlds.
2001-08-29 13:52:27 +00:00
Dima Dorfman
03c32490dd There shuldn't be whitespace before a question mark. 2001-08-27 09:34:39 +00:00
Ruslan Ermilov
f0200e9cf1 mdoc(7) police: removed whitespace at EOL. 2001-08-27 08:37:35 +00:00
Ruslan Ermilov
ab1adff6a9 mdoc(7) police: markup and spelling fixes. 2001-08-27 08:26:57 +00:00
Ruslan Ermilov
0fa666e5e5 mdoc(7) police: removed whitespace at EOL, sorted SEE ALSO xrefs. 2001-08-27 08:12:37 +00:00
Maxim Sobolev
fee4285612 Remove grammatical bogon. 2001-08-27 08:00:15 +00:00
Andrey A. Chernov
b0eeb07b5b Cosmetique fixes from bde 2001-08-26 10:38:29 +00:00
Robert Watson
4b7e521b26 o s/violate/override/ Capabilities are part of the system policy, not
an exception to it.

Submitted by:	tmm
Obtained from:	TrustedBSD Project
2001-08-25 14:37:01 +00:00
Matthew Dillon
5cb74fd363 Ok, third time is the charm. VM_INHERIT_XXX -> INHERIT_XX (use the same
semantics as PROT_XXX vs VM_PROT_XXX separating user-space defines from
kernel defines).
2001-08-24 19:45:59 +00:00
Matthew Dillon
5ccdd64f42 Oops, minherit() uses VM_INHERIT_XXX as the argument, not MAP_XXX. Properly
document minherit().
2001-08-24 19:43:45 +00:00
Matthew Dillon
dbad546ba7 Update the mmap.2 and minherit.2 manual pages. Add a short explanation and
referal from mmap to minherit for MAP_INHERIT.  Fully document the
minherit.2 manual page (because frankly, my dear, however you think it
currently works is almost certainly wrong!).  I may soon re-implement
MAP_COPY because I believe we can support it properly now, but I will have
to call it something else and that is for a later time.
2001-08-24 19:28:00 +00:00
Andrey A. Chernov
f0e093f298 Fd is macro too, so use \&Fd 2001-08-24 11:12:58 +00:00
Andrey A. Chernov
aa0b534660 Fildes -> Fd too (started from big letter) 2001-08-24 11:05:11 +00:00
Andrey A. Chernov
a5b1af6c71 Change
start means ...
to
.Fa l_start
means ...
2001-08-24 10:59:32 +00:00
Sheldon Hearn
56b38b7bc7 Fix up English from previous 3 revisions.
There is no such argument 'fildes' in the SYNOPSIS.  It's called 'fd'.
2001-08-24 10:36:29 +00:00
Dima Dorfman
dae32f31ab begin executed --> being executed
Obtained from:	NetBSD
2001-08-24 00:18:37 +00:00
David Greenman
dfa902ee24 Killed reference to MAP_INHERIT which is not supported in FreeBSD. 2001-08-23 22:39:52 +00:00
Andrey A. Chernov
471b172744 Now we implement l_len<0 per POSIX, describe it. 2001-08-23 19:00:34 +00:00
Andrey A. Chernov
f0d5097e06 Cosmetique: correct English in comments 2001-08-23 14:49:02 +00:00
Andrey A. Chernov
bb0871a73f Rephrasing prev. commit a bit. 2001-08-23 09:55:10 +00:00
Andrey A. Chernov
21c6d67fad Describe EOVERFLOW, EOPNOTSUPP and reaction to negative l_len 2001-08-23 09:42:30 +00:00
Ruslan Ermilov
265c01df49 mdoc(7) police: Fixed broken xrefs. 2001-08-22 14:16:31 +00:00
Andrey A. Chernov
2d2857f480 Document new EINVAL, EOVERFLOW cases. Sort ERRORS 2001-08-21 21:44:48 +00:00
Dima Dorfman
2c0dd4d134 Use .In, .Ux, and .Rv where appropriate. Also consistently call this
a "function" instead of a "routine".

Submitted by:	ru
2001-08-21 19:32:47 +00:00
Dima Dorfman
ccbe835258 Expand the ?: construct into an if/else.
Submitted by:	nectar
2001-08-21 19:27:07 +00:00
Dima Dorfman
c9fa8f40fe The setprogname() function sets the name of the program to be the last
component of the progname argument.
2001-08-21 18:49:58 +00:00
Dima Dorfman
f7bec57b78 Fix style bug. 2001-08-21 18:46:33 +00:00
Ruslan Ermilov
c45f3b47c8 Fixed warnings. 2001-08-21 17:28:39 +00:00
Jacques Vidrine
80578ef3c9 Pass the pointy hat, please.
Submitted by:	ru
2001-08-21 17:16:32 +00:00
Jacques Vidrine
dbdb228cf7 setprogname() should set __progname to the last component of the given
path.
2001-08-21 16:55:34 +00:00
Kris Kennaway
6dac8ac9e5 Mark some functions as __printflike() and/or taking const char * arguments
instead of char *.

MFC after:	2 weeks
2001-08-20 12:53:36 +00:00
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