Commit Graph

1116 Commits

Author SHA1 Message Date
deischen
08158a6ba7 Allow libc's version of sem_trywait() to work for non-pshared mutexes. 2004-02-04 15:37:48 +00:00
deischen
5be959edb7 Modify the implementation of libc semaphores so that they can be
overridden by the threads library to provide a userland version
of non-pshared semaphores and cancellation points.  Also add
a sem_timedwait().

The libc version of semaphores always uses kernel semaphores
regardless of whether pshared is set or not.  When threads are
not present, it is difficult to get sem_wait() or sem_timedwait()
to do the right thing (since pthread_cond_timedwait() and
pthread_cond_wait() are stubs in libc and just return immediately).
2004-02-03 05:47:19 +00:00
das
1f53d67fd6 Discard the first 1024 bytes of output as suggested by
http://citeseer.nj.nec.com/fluhrer01weaknesses.html and
http://citeseer.nj.nec.com/531224.html .

PR:		61126
Submitted by:	Jeff Ito <jeffi@rcn.com>
2004-01-20 04:22:47 +00:00
charnier
30e88bfa38 add missing endusershell() call. Original version was incorrect.
PR: bin/2442
Reviewed by: Friedemann Becker <zxmxy33@mail.uni-tuebingen.de>
2004-01-18 21:33:25 +00:00
davidxu
cfbecaf585 Backout revision 1.6, because some stub functions not in libc, and
non-threaded won't build. The cancellation point support should be
further discussed.
2004-01-17 07:15:06 +00:00
davidxu
f9aac56ad7 Enable cancellation point in sem_wait, it is required by POSIX.
For pshared semaphore, this commit still does not enable cancellation
point, I think there should be a pthread_enter_cancellation_point_np
for libc to implement a safe cancellation point.
2004-01-17 02:45:37 +00:00
ru
5bec276bea Fixed style of previous commit.
Submitted by:	bde
2004-01-15 17:27:28 +00:00
ru
0223333b35 - libc/sys/sem.c was repocopied to libc/gen/sem.c.
- sem_*(3) manpages were repocopied from libc_r.

Reviewed by:	deischen
Repocopy by:	markm
2004-01-14 20:54:16 +00:00
nectar
9a454178d8 Kill whitespace at end of lines. 2004-01-12 13:33:24 +00:00
nectar
6722bb8a10 Fix a bug that could result in a null pointer dereference in
getpwent(3) or getpwuid(3) when using NIS adjunct maps.  The bug was
present in the internal `nis_passwd' function.  The lookup in the
adjunct map used the name passed into `nis_passwd', however no name
was of course supplied by getpwent or getpwuid.  Correctly use the
name from the `struct pwd' that was found instead.

PR:		bin/59962
Submitted by:	Gabriel Gomez <ggomez@fing.edu.uy>
2004-01-12 13:29:54 +00:00
nectar
c281d0e2ea Remove unused variables and function declarations. Add missing headers. 2004-01-06 18:26:15 +00:00
dfr
de5cd0573f Make sure we initialise dirp->dd_size if we aren't reading a unionfs
directory.

Special thanks to: valgrind
2003-12-26 12:00:46 +00:00
trhodes
151da8eaf6 Back out previous commit due to incorrect content.
Noticed by:	wollman
2003-12-23 18:42:55 +00:00
trhodes
de65edfbfd Document many of the missing posix.1b options.
PR:		20528
Submitted by:	bms (original version)
Requested by:	mike (awhile ago)
2003-12-23 17:29:35 +00:00
dds
36934d35fe Fix problem where initgroups would silently truncate groups with
more than NGROUP elements without providing the opportunity to
setgroups to fail and correctly return error and set errno.

MFC after:	2 weeks
2003-11-19 15:51:26 +00:00
ghelmer
c038927dce Remove ',' accidentally added after ".Xr fork 2". 2003-11-10 22:04:51 +00:00
ghelmer
c5fcb1b225 Prevent abnormal termination of a child daemon process when created
by a parent that is a session leader (e.g., login shell) by ignoring
SIGHUP in before calling fork(2) and then restoring SIGHUP's action
after setsid(3).  Based on the patch by Martin Kammerhofer
<mkamm@gmx.net>.

PR:		bin/25462
Reviewed by:	bde, alex.neyman@auriga.ru
2003-11-10 22:01:42 +00:00
kientzle
776db871bd Rephrase .Nd description to contain the key
words "pattern" and "test"; this should make it easier
to find with "man -k"

Approved by: gordon (mentor)
2003-11-06 00:52:37 +00:00
phk
b46a641096 Add '#' to the characters VIS_GLOB encodes. This fixes a bug in mtree. 2003-10-30 12:41:50 +00:00
phk
eae6949d99 Add a new flag to vis(3): VIS_GLOB which encodes the glob(3) magic
characters '*', '?' and '['.
2003-10-30 10:40:49 +00:00
tjr
8366c4708a Remove incomplete support for running FreeBSD userland on old NetBSD kernels
lacking the issetugid() and utrace() syscalls.
2003-10-29 10:45:01 +00:00
ru
db9666a32f mdoc(7): Fix common mistakes made in the SEE ALSO section. 2003-09-12 21:54:11 +00:00
ru
1edcd1b018 mdoc(7): Properly mark C headers. 2003-09-10 19:24:35 +00:00
ru
1c23ef339b mdoc(7): Use the new feature of the .In macro. 2003-09-08 19:57:22 +00:00
eivind
cb6061aa80 Update the kern.osreldate documentation to document the present format
used, and refer to <osreldate.h> to get userland date.

Submitted by:	ru
2003-09-01 14:26:33 +00:00
wollman
6e1b7649c8 Add a kluge suggested by Marcel to paper over the difference between
gethostname()'s old and new signatures without requiring a library
bump.  Note that programs which called gethostname() with a negative
argument were already broken, since the same type conversion was done
by the old implementation.  Add a note in the Makefile so that whoever
next bumps the libc revision will delete the kluge at the same time
(as it will no longer be necessary).  This is only operative on 64-bit
platforms.

Submitted by:	marcel
2003-08-19 23:01:46 +00:00
wollman
f2841dd3a4 Change gethostname() to set errno to ENAMETOOLONG instead of ENOMEM
when the buffer is not long enough to hold the current host name.
POSIX does not standardize error returns for gethostname(), so it
doesn't matter which one we use, but ENAMETOOLONG is at least a little
more intuitive, and mi suggests the existence of prior art.  I've been
running with this change for a while on my home machine with no
effect.  At the same time, I've updated the prototype for
gethostname() to use the correct standard type (size_t) for the
namelen argument.

All of the in-tree callers fall into one of the following categories:
1) Call perror() or equivalent when gethostname() fails.
2) Ignore gethostname()'s return value entirely, potentially resulting
in data corruption if the buffer is too small.
3) Fall back to a (possibly sensible) default value if gethostname()
fails.

Many of the callers I examined shows signs of confusion about the
correct sizing of the host name buffer.  gethostname(3) now has more
information about this, as well as updated standards information.

PR:		48114
Submitted by:	mi (in part)
2003-08-19 20:38:44 +00:00
bms
5b3e496d6a Add the POSIX 1003.1-2001 posix_madvise() interface.
PR:		standards/54634
Reviewed by:	das
Approved by:	jake (mentor)
2003-08-09 03:23:24 +00:00
das
06982489ad The upper end of the range of arc4random(3) is 2**32-1, not 2**31-1. 2003-07-31 06:18:24 +00:00
davidxu
69cd67f2e6 Make raise and _raise as weak symbols, so they can be overriden by
thread library.

Reviewed by: deischen
2003-07-19 05:22:56 +00:00
wollman
51fb04092a Rewrite to reflect slight change in semantics for C99, and note a bug
in the standard.  Defer to gettimeofday(2) for error indications.
2003-07-19 03:19:59 +00:00
wollman
6a270f2499 C99 compliance: time() always sets its return value in both places
(if present), even on error.

Pointed out by: Wojtek Lerch, on the Austin Group mailing-list
2003-07-19 02:53:46 +00:00
wpaul
e3035e2a92 Revert to using yp_order() to probe for master.paswd.by* maps and
don't probe the server at all for passwd.by* maps. This fixes
interoperability with the Services For UNIX NIS server (which is
really a front end to Captive^WActiveDirectory). This server
incorrectly returns success for all YPPROC_MASTER requests,
even for maps that don't exist, which makes it impossible to
(ab)use it to probe for the existence of the master.passwd.by*
maps.

This is a little kludgey, but basically restores the original
behavior of getpwent.c as it is in -stable, and works around both
the lack of YPPROC_ORDER on NIS+ servers as well as the broken
YPPROC_MASTER on Services For UNIX servers.
2003-07-18 23:51:15 +00:00
wollman
cfce6c2d5e Whitespace after keywords per style(9). 2003-07-18 16:04:32 +00:00
ru
87561c3aaf With the latest mdoc(7), we can now fix the synopsis like this.
Desired by:	bde
2003-07-03 18:14:39 +00:00
bde
b060e14e1b Fixed some style bugs. 2003-07-01 12:30:03 +00:00
alfred
503a83a7c1 Don't segfault if setproctitle(3) is called with NULL initially.
The old buffer was not being initialized and a later str*() op on
it would cause a crash if it wasn't initialized by a previous
call to setproctitle(3) with an actual string.

Noticed by: Ashley Penney <ashp@unloved.org>
2003-07-01 09:45:35 +00:00
gordon
4ad1bccf13 Add a libc function execvP that takes the search path as an arguement.
Change execvp to be a wrapper around execvP. This is necessary for some
of the /rescue pieces. It may also be more generally applicable as well.

Submitted by:	Tim Kientzle <kientzle@acm.org>
Approved by:	Silence on arch@
2003-06-29 17:33:34 +00:00
das
71d3f43884 Teach fmtcheck(3) about the flags a, A, F, G, t, and z. 2003-06-29 01:11:31 +00:00
jwd
46397650d3 fix NIS+ YP compat mode
PR:		bin/52792
Submitted by:	TOMITA Yoshinori <yoshint@flab.fujitsu.co.jp>
2003-06-27 03:37:44 +00:00
ache
574e4a52cc Don't statically initialize buf to _PATH_DEV, _PATH_DEV always copied to
it in any case.
2003-06-24 22:20:06 +00:00
yar
ae3f997f52 Supplement the cross-references section with those to sigpending(2)
and sigprocmask(2).  These two syscalls are likely to be accompanied
by a few sigsetops(3) in a typical piece of code.
2003-06-24 15:27:31 +00:00
phk
d6a3dc0a59 ttyname(3) must return absolute pathnames.
Noticed by:	kris
2003-06-21 08:16:12 +00:00
phk
4d6423b947 Use devname(3) to do the task.
Reviewed by:	imp
2003-06-20 22:45:53 +00:00
phk
9dbf18e118 Add devname_r(3) which takes a buffer as argument. 2003-06-20 09:52:27 +00:00
ru
d73da6e66e Make the execle() synopsis look (again) like a normal C prototype.
Also fixed the rest of ell (list) functions prototypes to include
a (commented out) terminating null pointer.

Pointed out by:	bde
Obtained from:	POSIX.1-2001
Glanced at by:	imp
2003-06-18 15:24:21 +00:00
phk
ff88863eba Fix the execle(3) synopsis to include the environment pointer.
Confused:	anordby
2003-06-17 08:57:37 +00:00
charnier
9efd223c5d The .Fn function 2003-06-08 10:13:50 +00:00
charnier
9f754871d1 Add or correct section number in .Xr. Use .Vt or .Fn
instead of .Xr when needed
2003-06-08 10:01:52 +00:00
phk
433d1e778c Recognize the magic NODEV value.
Format other unknown devices consistently in hex.
2003-06-05 21:55:57 +00:00