Commit Graph

1151 Commits

Author SHA1 Message Date
John Birrell
da8a9b61c7 Include string.h for memcpy function prototype. 1998-01-14 08:14:56 +00:00
Alexander Langer
4d1b2e67ae Consistently reference init as .Xr init 8.
Obtained from:	OpenBSD
1998-01-13 05:09:16 +00:00
Alexander Langer
e3abfc8253 Return type and argument to sleep are unsigned int. 1998-01-13 04:32:00 +00:00
Alexander Langer
26db1da8a9 Dump the constant NGROUPS in favor of the POSIX way:
sysconf(_SC_NGROUPS_MAX).

Submitted by:	bde
1998-01-13 01:30:17 +00:00
Alexander Langer
e4a6f1ad1f Use .Fn for sysconf(_SC_CLOCK_TCK) reference.
Added $Id$.
1998-01-13 01:21:19 +00:00
Alexander Langer
73a8c56ec1 Formatting fix & improved comment for struct timeval.
Obtained from:	OpenBSD
1998-01-11 22:28:56 +00:00
Alexander Langer
d4b1275d66 Fixed brk(2) xref.
Obtained from:	OpenBSD
1998-01-11 22:22:50 +00:00
Alexander Langer
21bcb535ea Added sys/types.h to synopsis as per POSIX.
Obtained from:	OpenBSD
1998-01-11 22:16:11 +00:00
Alexander Langer
7ea0dca625 Replace sys/param.h with sys/types.h as per POSIX.
Document the special case of gidsetlen == 0.

Partially obtained from: OpenBSD
1998-01-11 22:01:20 +00:00
Alexander Langer
6eba99b0db Document that arg max is controllable via sysctl. 1998-01-11 21:43:38 +00:00
Alexander Langer
92d7687ee6 Formatting fix.
Obtained from:	OpenBSD
1998-01-11 17:49:51 +00:00
Alexander Langer
fa70846939 Added EMFILE and ENFILE to errors section.
Obtained from:	OpenBSD
1998-01-11 17:07:20 +00:00
Alexander Langer
5e8b84b628 .Xr sigvec --> sigaction
Obtained from:	OpenBSD
1998-01-11 16:56:01 +00:00
Alexander Langer
a5c3b32774 Add <sys/types.h> to synopsis.
Correct a grammatical error.
Add cross-reference to setrlimit(2).

Obtained from:	OpenBSD
1998-01-11 16:51:49 +00:00
John Birrell
f1d896d117 Make a couple of the stat flags dependent on the sys/stat.h header file
that this source is compiled against. This source is referenced by
install which is needed as a build tool and must be able to compile
against NetBSD headers and libraries if we have a hope of supporting
another architecture.

With this change, that's two working programs down and 3945 (?) to go.
The other one was make, but that didn't need any changes to work under
FreeBSD/Alpha. 8-)
1998-01-09 06:14:59 +00:00
Warner Losh
3c8e19e155 handle long usernames more carefully
Reviewed by:	guido
Obtained from:	OpenBSD (Theo de Raadt)
1998-01-07 00:28:36 +00:00
Philippe Charnier
125c8263d8 Convert to mdoc format. 1998-01-05 07:12:16 +00:00
Andrey A. Chernov
b250f24856 size_t -> unsigned
in arguments length INT_MAX overflow check
Suggested-by: bde
1998-01-04 22:28:47 +00:00
Alexander Langer
e69bcfc3bc Expanded cross references. 1998-01-02 19:22:52 +00:00
Andrey A. Chernov
8c6d2f42e1 1. EOF was returned when the buffer size was larger than INT_MAX. This
case has very little to do with the output size being larger than
   INT_MAX.
2. The new #include of <limits.h> was disordered.
3. The new declaration of `on' was disordered (integer types go together).
4. Testing an unsigned value for > 0 was fishy.

Submitted by: bde
1998-01-01 20:15:58 +00:00
Alexander Langer
5a5b9efe70 Drop the use of caddr_t in conjunction with mmap(2). 1997-12-31 03:15:06 +00:00
Alexander Langer
7167d5b04c Convert caddr_t --> void * for sys/mman.h functions.
mlock, mmap, mprotect, msync, munlock, and munmap are defined by
POSIX as taking void *.  The const modifier has been added to
mlock, munlock, and mprotect as the standard dictates.

minherit comes from OpenBSD and has been updated to conform with
their recent change to void *.

madvise and mincore are not defined by POSIX, but their arguments
have been modified to be consistent with the POSIX-defined functions.
mincore takes a const pointer, but madvise does not due to the
MADV_FREE case.

Discussed with:	bde
1997-12-31 01:22:01 +00:00
Alexander Langer
1948b335ba Fixed formatting of the MADV_FREE flag description.
Pointed out by:	bde
1997-12-30 05:17:33 +00:00
Alexander Langer
22d0a78532 Typo fix. 1997-12-30 04:05:47 +00:00
Alexander Langer
fd630dd1cc Document MS_SYNC. 1997-12-30 03:26:15 +00:00
Wolfram Schneider
de635b0683 The terminating character in strings is NUL', not NULL'. 1997-12-28 12:06:29 +00:00
Tim Vanderhoek
02e6c12b3c fork() checks RLIMIT_NPROC, not RLIMIT_NOFILE.
pr:		docs/5260
submitted-by:	Niall Smart [3]njs3@doc.ic.ac.uk
1997-12-26 16:11:49 +00:00
Alexander Langer
3b7c07b1f2 Removed unnecessary initialization of hp in gethostbyaddr_r. 1997-12-25 04:21:08 +00:00
Andrey A. Chernov
92e88f87b9 Add overflow checks: if output size becomes bigger than INT_MAX,
just return EOF
1997-12-25 00:32:17 +00:00
Andrey A. Chernov
fb25537fb8 Correct type of stored argument place (from previous fix) 1997-12-24 23:54:19 +00:00
Andrey A. Chernov
947d101171 1) Restore back comment about snprintf()
2) Optimize string buffer copy to call memcpy() and update pointers
only for count > 0, it makes snprintf(NULL, 0, ...) more efficient
1997-12-24 23:23:18 +00:00
Andrey A. Chernov
6e690ad4ca Return back to BSD snprintf semantics which recent C9x standard adopts
instead of Singe Unix, thanx Bruce for explaining, I am not realize
standards war was there.

But now, fix n == 0 case to not return error and fix check for too
big n.

Things left to do: check for overflow in arguments.
1997-12-24 23:02:47 +00:00
Andrey A. Chernov
e0b123f6d0 1) Oops! Insert again if (n == 0) return 0.
Final word is Bruce's quote:

C9x specifies the BSD4.4-Lite behaviour:

       [#3] ...   Thus,  the
       null-terminated  output  has  been completely written if and
       only if the returned value is less than n.

It means that if we not have any null-terminated output as for n == 0
we can't return value less than n, so we forced to return value
equal to n i.e. 0

The next good thing is glibc compatibility, of course.

2) Do check for too big n in machine-independent way.
3) Minor optimization assuming EOF is < 0
1997-12-24 20:24:08 +00:00
Andrey A. Chernov
5ebfa8de69 Back out part related to "return 0 if n == 0" and return EOF as before.
The main argument is that it is impossible to determine if %n evaluated or not
when snprintf return 0, because it can happens for both n == 0 and n == 1.
Although EOF here is good indication of the end of process, if n is
decreased in the loop...
Since it is already supposed in many places that EOF *is* negative, f.e.
from Single Unix specs for snprintf
"return ... a negative value if an output error was encountered"
this not makes situation worse.
1997-12-24 14:32:40 +00:00
Andrey A. Chernov
97adcd5ba1 Fix snprintf(...%n...)
to pass not more than buffer size to %n agrument, old variant
always assume infinite buffer.
%n is for actually transmitted characters, not for planned ones.
1997-12-24 13:47:13 +00:00
Andrey A. Chernov
a65a537cb1 Remove wrong comment about snprintf:
"return the number of bytes needed, rather the number used"

According to Single Unix specs:

Upon successful completion, these functions return the number of bytes
transmitted excluding the terminating null
1997-12-24 13:17:13 +00:00
Andrey A. Chernov
4ecaf22055 snprintf return value fixes to conform Single Unix specs:
1) if buffer size is smaller than arguments size, return buffer
size, not arguments size as before.

2) if buffer size is 0, return 0, not EOF as before.
(now it is compatible with Linux and Apache implementations too).

NOTE: Single Unix specs says:

If the value of n {buffer size} is zero on a call to snprintf(), an
unspecified value less than 1 is returned.

It means we can't return EOF since EOF can take *any* value in general
not especially < 1. Better variant will be return -1 (it is less then
1 and different with n == 1 case) but -1 value is already occuped by
EOF in our implementation, so we can't distinguish true IO error
in that case. So 0 here is only possible case still conforming
to Single Unix specs.
1997-12-24 12:31:32 +00:00
Bruce Evans
6a93659f24 Comment that long double is poorly implemented, not that it is unimplemented. 1997-12-19 21:59:22 +00:00
Bruce Evans
b86be9d1f7 Put the .PATH statement first as in all other libc Makefile.inc's. 1997-12-19 21:56:38 +00:00
Bruce Evans
b0e2424631 Format the MLINKS statement the same as in most other libc Makefile.inc's. 1997-12-19 21:53:35 +00:00
John Birrell
d5bc59bb81 Fix recursion problem which occurs when a signal is received during
a malloc. The signal handler creates a thread which requires a malloc...
For now, the only thing to do is to block signals. When we move user
pthreads to use the kernel threads, mutexes will be implemented in kernel
space and then malloc can revert.
1997-12-15 02:12:42 +00:00
Bruce Evans
22301c4b46 Fixed spelling of EACCES. 1997-11-23 17:58:55 +00:00
Bruce Evans
8fddd06099 Fixed long double formats. They were mostly not implemented except
on systems where long doubles are just doubles.  FreeBSD hasn't
been such a system since it started using gcc-2.5 many years ago.
The fix is of low quality.  It loses precision.

scanf() of long doubles doesn't seem to be used much, but gdb-4.16
uses %Lg format in its expression parser if it thinks that the
system supports printf'ing of long doubles.  The symptom was that
floating point literals were usually interpreted to be 0.0.
1997-11-23 06:02:47 +00:00
James Raynard
46eba3e8b7 Fix bit-twiddling in sigismember(3).
Note this ONLY affects the function version - the macro version is always
used unless for some reason you put #undef sigismember in your code before
calling it.
PR:		3615
Submitted by:	Nanbor Wang <nw1@cs.wustl.edu> (slightly amended patch)
1997-11-21 23:18:05 +00:00
Bruce Evans
362f4dce74 Don't check for the unlikely case of useconds == 0 here. The kernel
checks it.

Fixed a style bug.
1997-11-20 15:13:20 +00:00
Bruce Evans
70df31a627 stat() the correct file in execvp() so that the fine tuned errno handling
actually works.
1997-11-20 15:09:38 +00:00
John Polstra
3359c58c41 Add cross-references to rfork(2). 1997-11-18 03:59:30 +00:00
Bill Paul
d9cc92f584 Close PR #4867: improve _listmatch() to avoid returning false positives.
PR: 4867
1997-11-16 03:02:39 +00:00
Julian Elischer
52bf64c787 Reviewed by: hackers@freebsd.org in general
Obtained from: Whistle Communications tree

Add an option to the way UFS works dependent on the SUID bit of directories
This changes makes things a whole lot simpler on systems running as
fileservers for PCs and MACS. to enable the new code you must
1/ enable option SUIDDIR on the kernel.
2/ mount the filesystem with option suiddir.
hopefully this makes it difficult enough for people to
do this accidentally.
see the new chmod(2) man page for detailed info.
1997-11-13 00:28:51 +00:00
Julian Elischer
b1f4a44b03 Reviewed by: various.
Ever since I first say the way the mount flags were used I've hated the
fact that modes, and events, internal and exported, and short-term
and long term flags are all thrown together. Finally it's annoyed me enough..
This patch to the entire FreeBSD tree adds a second mount flag word
to the mount struct. it is not exported to userspace. I have moved
some of the non exported flags over to this word. this means that we now
have 8 free bits in the mount flags. There are another two that might
well move over, but which I'm not sure about.
The only user visible change would have been in pstat -v, except
that davidg has disabled it anyhow.
I'd still like to move the state flags and the 'command' flags
apart from each other.. e.g. MNT_FORCE really doesn't have the
same semantics as MNT_RDONLY, but that's left  for another day.
1997-11-12 05:42:33 +00:00