History log of /freebsd-10.0-release/lib/libc/gen/
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
259065 07-Dec-2013 gjb

- Copy stable/10 (r259064) to releng/10.0 as part of the
10.0-RELEASE cycle.
- Update __FreeBSD_version [1]
- Set branch name to -RC1

[1] 10.0-CURRENT __FreeBSD_version value ended at '55', so
start releng/10.0 at '100' so the branch is started with
a value ending in zero.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation

257771 07-Nov-2013 pjd

Merge r257633:

- Add manual pages for capability rights (rights(4)), cap_rights_init(3)
family of functions and cap_rights_get(3) function.
- Update remaining Capsicum-related manual pages.

Sponsored by: The FreeBSD Foundation
Reviewed by: bdrewery
Approved by: re (glebius)


257320 29-Oct-2013 glebius

Merge r256537 from head:
Make getutxent(3) more robust against bad utx.log files. Whenever we read
zeroes, don't stop processing the file, but read until its end or valid
data.

In collaboration with: ed

Approved by: re (kib)


256281 10-Oct-2013 gjb

Copy head (r256279) to stable/10 as part of the 10.0-RELEASE cycle.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation


255486 12-Sep-2013 bdrewery

Consistently reference file descriptors as "fd". 55 other manpages
used "fd", while these used "d" and "filedes".

MFC after: 1 week
Approved by: gjb
Approved by: re (delphij)


255171 03-Sep-2013 rwatson

Document SIGLIBRT in signal(3); take a stab at the signal description as
the original committer didn't provide one.

MFC after: 3 days


255108 31-Aug-2013 jilles

libc: Always use our own copy of sys_errlist and sys_nerr (.so only).

This ensures strerror() and friends continue to work correctly even if a
(non-PIE) executable linked against an older libc imports sys_errlist (which
causes sys_errlist to refer to the executable's copy with a size fixed when
that executable was linked).

The executable's use of sys_errlist remains broken because it uses the
current value of sys_nerr and may access past the bounds of the array.

Different from the message "Using sys_errlist from executables is not
ABI-stable" on freebsd-arch, this change does not affect the static library.
There seems no reason to prevent overriding the error messages in the static
library.


254977 27-Aug-2013 jilles

wordexp(): Avoid leaking the pipe file descriptors to a parallel fork/exec.

This uses the new pipe2() system call added on May 1 (r250159).


254627 21-Aug-2013 ken

Expand the use of stat(2) flags to allow storing some Windows/DOS
and CIFS file attributes as BSD stat(2) flags.

This work is intended to be compatible with ZFS, the Solaris CIFS
server's interaction with ZFS, somewhat compatible with MacOS X,
and of course compatible with Windows.

The Windows attributes that are implemented were chosen based on
the attributes that ZFS already supports.

The summary of the flags is as follows:

UF_SYSTEM: Command line name: "system" or "usystem"
ZFS name: XAT_SYSTEM, ZFS_SYSTEM
Windows: FILE_ATTRIBUTE_SYSTEM

This flag means that the file is used by the
operating system. FreeBSD does not enforce any
special handling when this flag is set.

UF_SPARSE: Command line name: "sparse" or "usparse"
ZFS name: XAT_SPARSE, ZFS_SPARSE
Windows: FILE_ATTRIBUTE_SPARSE_FILE

This flag means that the file is sparse. Although
ZFS may modify this in some situations, there is
not generally any special handling for this flag.

UF_OFFLINE: Command line name: "offline" or "uoffline"
ZFS name: XAT_OFFLINE, ZFS_OFFLINE
Windows: FILE_ATTRIBUTE_OFFLINE

This flag means that the file has been moved to
offline storage. FreeBSD does not have any special
handling for this flag.

UF_REPARSE: Command line name: "reparse" or "ureparse"
ZFS name: XAT_REPARSE, ZFS_REPARSE
Windows: FILE_ATTRIBUTE_REPARSE_POINT

This flag means that the file is a Windows reparse
point. ZFS has special handling code for reparse
points, but we don't currently have the other
supporting infrastructure for them.

UF_HIDDEN: Command line name: "hidden" or "uhidden"
ZFS name: XAT_HIDDEN, ZFS_HIDDEN
Windows: FILE_ATTRIBUTE_HIDDEN

This flag means that the file may be excluded from
a directory listing if the application honors it.
FreeBSD has no special handling for this flag.

The name and bit definition for UF_HIDDEN are
identical to the definition in MacOS X.

UF_READONLY: Command line name: "urdonly", "rdonly", "readonly"
ZFS name: XAT_READONLY, ZFS_READONLY
Windows: FILE_ATTRIBUTE_READONLY

This flag means that the file may not written or
appended, but its attributes may be changed.

ZFS currently enforces this flag, but Illumos
developers have discussed disabling enforcement.

The behavior of this flag is different than MacOS X.
MacOS X uses UF_IMMUTABLE to represent the DOS
readonly permission, but that flag has a stronger
meaning than the semantics of DOS readonly permissions.

UF_ARCHIVE: Command line name: "uarch", "uarchive"
ZFS_NAME: XAT_ARCHIVE, ZFS_ARCHIVE
Windows name: FILE_ATTRIBUTE_ARCHIVE

The UF_ARCHIVED flag means that the file has changed and
needs to be archived. The meaning is same as
the Windows FILE_ATTRIBUTE_ARCHIVE attribute, and
the ZFS XAT_ARCHIVE and ZFS_ARCHIVE attribute.

msdosfs and ZFS have special handling for this flag.
i.e. they will set it when the file changes.

sys/param.h: Bump __FreeBSD_version to 1000047 for the
addition of new stat(2) flags.

chflags.1: Document the new command line flag names
(e.g. "system", "hidden") available to the
user.

ls.1: Reference chflags(1) for a list of file flags
and their meanings.

strtofflags.c: Implement the mapping between the new
command line flag names and new stat(2)
flags.

chflags.2: Document all of the new stat(2) flags, and
explain the intended behavior in a little
more detail. Explain how they map to
Windows file attributes.

Different filesystems behave differently
with respect to flags, so warn the
application developer to take care when
using them.

zfs_vnops.c: Add support for getting and setting the
UF_ARCHIVE, UF_READONLY, UF_SYSTEM, UF_HIDDEN,
UF_REPARSE, UF_OFFLINE, and UF_SPARSE flags.

All of these flags are implemented using
attributes that ZFS already supports, so
the on-disk format has not changed.

ZFS currently doesn't allow setting the
UF_REPARSE flag, and we don't really have
the other infrastructure to support reparse
points.

msdosfs_denode.c,
msdosfs_vnops.c: Add support for getting and setting
UF_HIDDEN, UF_SYSTEM and UF_READONLY
in MSDOSFS.

It supported SF_ARCHIVED, but this has been
changed to be UF_ARCHIVE, which has the same
semantics as the DOS archive attribute instead
of inverse semantics like SF_ARCHIVED.

After discussion with Bruce Evans, change
several things in the msdosfs behavior:

Use UF_READONLY to indicate whether a file
is writeable instead of file permissions, but
don't actually enforce it.

Refuse to change attributes on the root
directory, because it is special in FAT
filesystems, but allow most other attribute
changes on directories.

Don't set the archive attribute on a directory
when its modification time is updated.
Windows and DOS don't set the archive attribute
in that scenario, so we are now bug-for-bug
compatible.

smbfs_node.c,
smbfs_vnops.c: Add support for UF_HIDDEN, UF_SYSTEM,
UF_READONLY and UF_ARCHIVE in SMBFS.

This is similar to changes that Apple has
made in their version of SMBFS (as of
smb-583.8, posted on opensource.apple.com),
but not quite the same.

We map SMB_FA_READONLY to UF_READONLY,
because UF_READONLY is intended to match
the semantics of the DOS readonly flag.
The MacOS X code maps both UF_IMMUTABLE
and SF_IMMUTABLE to SMB_FA_READONLY, but
the immutable flags have stronger meaning
than the DOS readonly bit.

stat.h: Add definitions for UF_SYSTEM, UF_SPARSE,
UF_OFFLINE, UF_REPARSE, UF_ARCHIVE, UF_READONLY
and UF_HIDDEN.

The definition of UF_HIDDEN is the same as
the MacOS X definition.

Add commented-out definitions of
UF_COMPRESSED and UF_TRACKED. They are
defined in MacOS X (as of 10.8.2), but we
do not implement them (yet).

ufs_vnops.c: Add support for getting and setting
UF_ARCHIVE, UF_HIDDEN, UF_OFFLINE, UF_READONLY,
UF_REPARSE, UF_SPARSE, and UF_SYSTEM in UFS.
Alphabetize the flags that are supported.

These new flags are only stored, UFS does
not take any action if the flag is set.

Sponsored by: Spectra Logic
Reviewed by: bde (earlier version)


254499 18-Aug-2013 pjd

Implement fdclosedir(3) function, which is equivalent to the closedir(3)
function, but returns directory file descriptor instead of closing it.

Submitted by: Mariusz Zaborski <oshogbo@FreeBSD.org>
Sponsored by: Google Summer of Code 2013


254498 18-Aug-2013 pjd

Remove redundant space.


254488 18-Aug-2013 jilles

dup3(3): Replace copyright notice.

Although I copied dup(2) to create dup3(3), I removed almost all the
non-boilerplate, so dup3(3) is copyright me.

Reported by: bjk


254463 17-Aug-2013 jilles

libc: Access _logname_valid more efficiently.

The variable _logname_valid is not exported via the version script;
therefore, change C and i386/amd64 assembler code to remove indirection
(which allowed interposition). This makes the code slightly smaller and
faster.

Also, remove #define PIC_GOT from i386/amd64 in !PIC mode. Without PIC,
there is no place containing the address of each variable, so there is no
possible definition for PIC_GOT.


254410 16-Aug-2013 jilles

Add man page dup3(3).


254409 16-Aug-2013 jilles

Add dup3(), based on F_DUP2FD and F_DUP2FD_CLOEXEC fcntls.

I removed functionality not proposed for POSIX in Austin group issue #411.
A man page (my own) and test cases will follow in later commits.

PR: 176233
Submitted by: Jukka Ukkonen


254091 08-Aug-2013 ache

According to POSIX \ in the fnmatch(3) pattern should escape
any character including '\0', but our version replace escaped '\0'
with '\\'.
I.e. fnmatch("\\", "\\", 0) should not match while fnmatch("\\", "", 0)
should (Linux and NetBSD does the same). Was vice versa.

PR: 181129
MFC after: 1 week


253662 26-Jul-2013 zont

Remove define and documentation for vm_pageout_algorithm missed in r253587


253581 23-Jul-2013 jilles

wordexp(): Fix syntax validation for backslashes in single-quotes.


253318 13-Jul-2013 hrs

Fix mdoc syntax.

Pointed out by: joeld


253262 12-Jul-2013 hrs

Add a leaf node CTL_NET.PF_ROUTE.0.AF.NET_RT_DUMP.0.FIB. This returns
routing table with the specified FIB number, not td->td_proc->p_fibnum.


252429 30-Jun-2013 jilles

libc: Access _sigintr more efficiently.

The variable _sigintr is not exported via the version script; therefore,
tell the compiler that no indirection (to allow interposition) is needed.


251369 04-Jun-2013 joel

mdoc: convert .Fd to .In, which is much nicer.


251071 28-May-2013 emaste

Remove the advertising clause from the Regents of the University of
California's license, per the letter dated July 22, 1999.


251047 28-May-2013 kib

The getcontext() from the __fillcontextx() call in the
check_deferred_signal() returns twice, since handle_signal() emulates
the return from the normal signal handler by sigreturn(2)ing the
passed context. Second return is performed on the destroyed stack
frame, because __fillcontextx() has already returned. This causes
undefined and bad behaviour, usually the victim thread gets SIGSEGV.

Avoid nested frame and the need to return from it by doing direct call
to getcontext() in the check_deferred_signal() and using a new private
libc helper __fillcontextx2() to complement the context with the
extended CPU state if the deferred signal is still present.

The __fillcontextx() is now unused, but is kept to allow older
libthr.so to be used with the new libc.

Mark __fillcontextx() as returning twice [1].

Reported by: pgj
Pointy hat to: kib
Discussed with: dim
Tested by: pgj, dim
Suggested by: jilles [1]
MFC after: 1 week


250888 21-May-2013 ed

Update manpages for r250887.

Remove the lists of unneeded header files.

Requested by: eadler


250827 20-May-2013 jilles

popen(): Add 'e' mode character to set close-on-exec on the new fd.

If 'e' is used, the kernel must support the recently added pipe2() system
call.

The use of pipe2() with O_CLOEXEC also fixes race conditions between
concurrent popen() calls from different threads, even if the close-on-exec
flag on the fd of the returned FILE is later cleared (because popen() closes
all file descriptors from earlier popen() calls in the child process).
Therefore, this approach should be used in all cases when pipe2() can be
assumed present.

The old version of popen() rejects "re" and "we" but treats "r+e" like "r+".


250554 12-May-2013 pluknet

Typo.


250421 09-May-2013 jilles

posix_spawn_file_actions_adddup2(3): Document difference with dup2().

The ability to clear a file descriptor's close-on-exec flag via
posix_spawn_file_actions_adddup2() is in fact proposed in Austin Group issue
#411.

MFC after: 1 week


250412 09-May-2013 jilles

posix_spawn_file_actions_addopen(3): Correct error for bad file descriptor.

As per POSIX.1-2008, posix_spawn_file_actions_add* return [EBADF] if a file
descriptor is negative, not [EINVAL]. The bug was only in the manual page;
the code is correct.

MFC after: 1 week


250406 09-May-2013 jilles

wordexp(): Simplify code by deferring work to sh.


250250 04-May-2013 pluknet

POSIX 1003.1-2008: add ENOTRECOVERABLE, EOWNERDEAD errnos.


249956 26-Apr-2013 jilles

sysconf(3): Correct the description of _SC_OPEN_MAX.

Reported by: bde
MFC after: 1 week


249802 23-Apr-2013 eadler

- sl_find does not modify 'name'
- make the prototype of sl_find match NetBSD

Reviewed by: jilles
Approved by: cperciva (mentor)
MFC After: 3 days


249801 23-Apr-2013 eadler

Switch from K&R prototypes to modern C

Reviewed by: jilles
Approved by: cperciva (mentor)
MFC After: 3 days


249593 17-Apr-2013 jilles

pututxline: Don't set errno=0 in subfunctions.

The functions utx_active_add(), utx_active_remove(), utx_lastlogin_add() and
utx_log_add() set errno to 0 if they are successful. This not only violates
POSIX if pututxline() is successful, but may also overwrite a valid error
with 0 if, for example, utx_lastlogin_add() fails while utx_log_add()
succeeds.

Reviewed by: ed


249567 16-Apr-2013 joel

mdoc: remove superfluous paragraph macro.


249566 16-Apr-2013 jhb

- Document that sem_wait() can fail with EINTR if it is interrupted by a
signal.
- Fix the old ksem implementation for POSIX semaphores to not restart
sem_wait() or sem_timedwait() if interrupted by a signal.

MFC after: 1 week


249381 11-Apr-2013 emaste

Spelling correction


248987 01-Apr-2013 jilles

wordexp(): Remove wrong IFS usage.

Words in shell script are separated by spaces or tabs independent of the
value of IFS. The value of IFS is only relevant for the result of
substitutions. Therefore, there should be a space between 'wordexp' and the
words to be expanded, not an IFS character.

Paranoia might dictate that the shell ignore IFS from the environment (even
though our sh currently uses it), so do not depend on it in the new test
case.


248302 14-Mar-2013 brooks

Update to the latest (un)vis(3) sources from NetBSD. This adds
multibyte support[0] and the new functions strenvisx and strsenvisx.

Add MLINKS for vis(3) functions add by this and the initial import from
NetBSD[1].

PR: bin/166364, bin/175418
Submitted by: "J.R. Oldroyd" <fbsd@opal.com>[0]
stefanf[1]
Obtained from: NetBSD
MFC after: 2 weeks


248251 13-Mar-2013 pluknet

Link getcontextx(3) to getcontext(3).

Reviewed by: kib
MFC after: 1 week


248250 13-Mar-2013 pluknet

Add the getcontextx prototype to SYNOPSIS.

Reviewed by: kib
MFC after: 1 week


247598 02-Mar-2013 pjd

Provide cap_sandboxed(3) function, which is a wrapper around cap_getmode(2)
system call, which has a nice property - it never fails, so it is a bit
easier to use. If there is no support for capability mode in the kernel
the function will return false (not in a sandbox). If the kernel is compiled
with the support for capability mode, the function will return true or false
depending if the calling process is in the capability mode sandbox or not
respectively.

Sponsored by: The FreeBSD Foundation


247236 24-Feb-2013 jilles

libc/opendir: Improve behaviour of union uniquifier:

* Reopen the directory using openat(fd, ".", ...) instead of opening the
pathname again. This fixes a race condition where the meaning of the
pathname changes and allows a reopen with fdopendir().
* Always reopen the directory for union stacks, not only when DTF_REWIND
is passed. Applications should be able to fchdir(dirfd(dir)) and
*at(dirfd(dir), ...). DTF_REWIND now does nothing.


246894 17-Feb-2013 davidxu

Make more code be protected by internal mutex, and now it is fork-safe, in
error case, the file exclusive lock is now released as soon as possible,
in previous code, child process can still hold the exclusive lock.


246884 16-Feb-2013 pjd

Put one file per line so it is easier to read diffs against those files.


246872 16-Feb-2013 davidxu

Simplify code by using flag O_EXLOCK.

PR: kern/175674


246641 10-Feb-2013 jilles

fts: Use O_DIRECTORY when opening name that might be changed by attacker.

There are uncommon cases where fts_safe_changedir() may be called with a
non-NULL name that is not "..". Do not block or worse if an attacker put (a
(symlink to) a fifo or device where a directory used to be.

MFC after: 1 week


245308 11-Jan-2013 brooks

Add contrib/libc-vis to the include path so we reliably pick up the right
version of vis.h.

Reported by: dim


245305 11-Jan-2013 brooks

In r244401 I accidently moved strunvis and strunvisx from version 1.0 to
1.3 breaking the libc ABI. Revert that change (breaking the ABI again
for users who updated after December 18th).


244568 21-Dec-2012 delphij

- Reduce buffer size from LINE_MAX to PATH_MAX, there is no point to store
path longer than this.
- Fix an unreached case of check against sizeof buf, which in turn leads
to an off-by-one nul byte write on the stack. The original condition
can never be satisfied because the passed boundary is the maximum value
that can be returned, so code was harmless.

MFC after: 1 month


244401 18-Dec-2012 brooks

Replace our implementation of the vis(3) and unvis(3) APIs with
NetBSD's. This output size limited versions of vis and unvis functions
as well as a set of vis variants that allow arbitrary characters to be
specified for encoding.

Finally, MIME Quoted-Printable encoding as described in RFC 2045 is
supported.


244153 12-Dec-2012 pjd

Eliminate redundant variable.


244092 10-Dec-2012 jilles

libc: Make various internal file descriptors close-on-exec.

These are obtained via fopen().


243865 04-Dec-2012 jilles

libc: Use the new 'e' fopen() mode option to simplify fstab.c.

No functional change is intended.


243779 01-Dec-2012 marcel

Protect against DoS attacks, such as being described in CVE-2010-2632.
The changes were derived from what has been committed to NetBSD, with
modifications. These are:
1. Preserve the existsing GLOB_LIMIT behaviour by including the number
of matches to the set of parameters to limit.
2. Change some of the limits to avoid impacting normal use cases:
GLOB_LIMIT_STRING - change from 65536 to ARG_MAX so that glob(3)
can still provide a full command line of expanded names.
GLOB_LIMIT_STAT - change from 128 to 1024 for no other reason than
that 128 feels too low (it's not a limit that impacts the
behaviour of the test program listed in CVE-2010-2632).
GLOB_LIMIT_PATH - change from 1024 to 65536 so that glob(3) can
still provide a fill command line of expanded names.
3. Protect against buffer overruns when we hit the GLOB_LIMIT_STAT or
GLOB_LIMIT_READDIR limits. We append SEP and EOS to pathend in
those cases. Return GLOB_ABORTED instead of GLOB_NOSPACE when we
would otherwise overrun the buffer.

This change also modifies the existing behaviour of glob(3) in case
GLOB_LIMIT is specifies by limiting the *new* matches and not all
matches. This is an important distinction when GLOB_APPEND is set or
when the caller uses a non-zero gl_offs. Previously pre-existing
matches or the value of gl_offs would be counted in the number of
matches even though the man page states that glob(3) would return
GLOB_NOSPACE when gl_matchc or more matches were found.

The limits that cannot be circumvented are GLOB_LIMIT_STRING and
GLOB_LIMIT_PATH all others can be crossed by simply calling glob(3)
again and with GLOB_APPEND set.

The entire description above applies only when GLOB_LIMIT has been
specified of course. No limits apply when this flag isn't set!

Obtained from: Juniper Networks, Inc


243759 01-Dec-2012 marcel

In globextend(), take advantage of the fact that realloc(NULL, size) is
equivalent to malloc(size). This eliminates the conditional expression
used for calling either realloc() or malloc() when realloc() will do
all the time.


243758 01-Dec-2012 marcel

In globextend() when the pathv vector cannot be (re-)allocated, don't
free and clear the gl_pathv pointer in the glob_t structure. Such
breaks the invariant of the glob_t structure, as stated in the comment
right in front of the globextend() function. If gl_pathv was non-NULL,
then gl_pathc was > 0. Making gl_pathv a NULL pointer without also
setting gl_pathc to 0 is wrong.

Since we otherwise don't free the memory associated with a glob_t in
error cases, it's unlikely that this change will cause a memory leak
that wasn't already there to begin with. Callers of glob(3) must
call globfree(3) irrespective of whether glob(3) returned an error
or not.


243146 16-Nov-2012 joel

mdoc: Use the Ev macro for environmental variables.


243116 16-Nov-2012 grog

Complete man page.

MFC after: 2 weeks


242960 13-Nov-2012 kib

Implement the waitid() SUSv4 function using wait6() system call.

PR: standards/170346
Submitted by: "Jukka A. Ukkonen" <jau@iki.fi>
MFC after: 1 month


242894 11-Nov-2012 dim

Add an explanatory comment to lib/libc/gen/isnan.c about the fix to make
static linking with libc and libm work.

Requested by: jilles
MFC after: 1 week
X-MFC-With: 242879


242879 10-Nov-2012 dim

Only define isnan, isnanf, __isnan and __isnanf in libc.so, not in
libc.a and libc_p.a. In addition, define isnan in libm.a and libm_p.a,
but not in libm.so.

This makes it possible to statically link executables using both isnan
and isnanf with libc and libm.

Tested by: kargl
MFC after: 1 week


241731 19-Oct-2012 brooks

Replace our version of the pwcache(3) API with NetBSD's implementation.

This adds two features:
* uid_from_user() and gid_from_group() as the reverse of user_from_uid()
and groups_from_gid().
* pwcache_userdb() and pwcache_groupdb() which allow alternative lookup
functions to be used. For example lookups from passwd and group
databases in a non-standard location.


241441 11-Oct-2012 stefanf

Fix my last commit. Only call strunvis after properly checking the argument is
not NULL.


241440 11-Oct-2012 stefanf

Decode the first two fstab fields with strunvis(3). This allows having spaces
in devices and mount paths, encoded as \s or \040.

PR: bin/117687
Submitted by: Martin Kammerhofer
Discussed on: arch


241439 11-Oct-2012 stefanf

Apply some style. Checked with md5.


241046 29-Sep-2012 jilles

libc: Use O_CLOEXEC for various internal file descriptors.

This fixes a race condition where another thread may fork() before CLOEXEC
is set, unintentionally passing the descriptor to the child process.

This commit only adds O_CLOEXEC flags to open() or openat() calls where no
fcntl(fd, F_SETFD, FD_CLOEXEC) follows. The separate fcntl() call still
leaves a race window so it should be fixed later.


241010 27-Sep-2012 jilles

libc/fts: Use O_CLOEXEC for internal file descriptors.

Because fts keeps internal file descriptors open across calls, making such
descriptors close-on-exec helps not only multi-threaded applications but
also single-threaded applications.

In particular, this prevents passing a temporary file descriptor for saving
the current directory to processes created via find -exec.


240361 11-Sep-2012 des

Add the same warning to rand48(3) as to rand(3) and random(3).

MFC after: 3 days


240176 06-Sep-2012 trhodes

Avoid segfault if name is invalid. Basically, only
check for CTL_USER if the sysctl fails with ENOENT.

PR: 169056
Reviewed by: jhb


239499 21-Aug-2012 joel

Remove trailing whitespace.


239486 21-Aug-2012 davidxu

Add manual pages for clock_getcpuclockid and pthread_getcpuclockid.


239485 21-Aug-2012 davidxu

Fix prototype. Also the function should return error code instead of
-1 on error.


239347 17-Aug-2012 davidxu

Implement syscall clock_getcpuclockid2, so we can get a clock id
for process, thread or others we want to support.
Use the syscall to implement POSIX API clock_getcpuclock and
pthread_getcpuclockid.

PR: 168417


239193 11-Aug-2012 ed

Rename aux.c to auxv.c.

On Windows, AUX is the auxiliary device, usually pointing to COM1.
Therefore it is forbidden to create a file named aux.c. To make it a bit
easier for Windows users to check out our source code, rename this file
to auxv.c.

MFC after: 1 month
Discussed with: kib
Suggested by: Eric van Gyzen <eric vangyzen net>


239160 09-Aug-2012 jilles

nftw(): POSIX says directories causing loops should be silently skipped.

Formerly, loops caused nftw() to abort the traversal with ELOOP.


239156 09-Aug-2012 delphij

Refresh with OpenBSD RCS ID changes to reflect that we now have essentionally
the same file.


239151 09-Aug-2012 jilles

ftw(): Do not check the maxfds argument against OPEN_MAX.

Apart from the fact that nothing should have OPEN_MAX as a limit (as opposed
to RLIMIT_NOFILE from getrlimit() or _SC_OPEN_MAX from sysconf()), POSIX
does not require us to check this. POSIX does have a requirement on the
application that maxfds not exceed {OPEN_MAX}, but does not require the
implementation to check it ("may fail").

PR: 95239


239150 09-Aug-2012 jilles

nftw(): Do not check the maxfds argument against OPEN_MAX.

Apart from the fact that nothing should have OPEN_MAX as a limit (as opposed
to RLIMIT_NOFILE from getrlimit() or _SC_OPEN_MAX from sysconf()), POSIX
does not require us to check this.

PR: 95239
Submitted by: Todd Miller


238963 01-Aug-2012 delphij

Use calloc().


238141 05-Jul-2012 brooks

Document the behavior (from 4.4-lite) that tokens returned by telldir() are
single use.

Sponsored by: DARPA, AFRL
MFC after: 3 days


238118 04-Jul-2012 pjd

Prefer sysctl to open/read/close for obtaining random data.
This method is more sandbox-friendly and also should be faster as only
one syscall is needed instead of three.
In case of an error fall back to the old method.

Reviewed by: simon, gleb
MFC after: 2 weeks


237660 27-Jun-2012 kib

Optimize the handling of SC_NPROCESSORS_CONF, by using auxv AT_NCPU
value if present.

MFC after: 1 week


237523 24-Jun-2012 eadler

Remove the assert added in r237286
The use of assertions in libraries is not widely accepted.

Requested by: bde, scottl
Approved by: cperciva
MFC after: 3 days
X-MFC-With: r237286


237434 22-Jun-2012 kib

Use struct vdso_timehands data to implement fast gettimeofday(2) and
clock_gettime(2) functions if supported. The speedup seen in
microbenchmarks is in range 4x-7x depending on the hardware.

Only amd64 and i386 architectures are supported. Libc uses rdtsc and
kernel data to calculate current time, if enabled by kernel.

Hopefully, this code is going to migrate into vdso in some future.

Discussed with: bde
Reviewed by: jhb
Tested by: flo
MFC after: 1 month


237286 20-Jun-2012 eadler

Don't close an uninitialized descriptor. [1]
Add a sanity check for the validity of the passed fd.

PR: kern/139080 [1]
Submitted by: Andrey Simonenko <simon@comsys.ntu-kpi.kiev.ua> [1]
Reviewed by: pjd (briefly)
Approved by: cperciva
MFC after: 1 week


237160 16-Jun-2012 kib

More style.

MFC after: 3 days


237159 16-Jun-2012 kib

Revert part of the r235740 which changed separate allocation of the
string buffer for each linelist l_line into one large string. Since
linelists parsed out during the previous passes store the pointers to
previously allocated l_lines, the reallocation caused undefined
behaviour on accessing the buffers, and quite deterministic fault on
freeing them (in mountd(8) startup).

This fixes reading of netgroup(5) file which contains more then one
netgroup.

Discussed with: ghelmer
MFC after: 3 days


237156 16-Jun-2012 joel

mandoc fixes.

Obtained from: OpenBSD


237061 14-Jun-2012 kib

Make sure that fstab fd is not leaked on exec.

PR: kern/169023
Submitted by: Jukka Ukkonen <jau iki fi>
MFC after: 1 week


236438 02-Jun-2012 joel

mdoc: minor Bl improvements.


236402 01-Jun-2012 ghelmer

Style(9) improvements: remove unnecessary parenthesis, improve order
of local variable declarations, remove bogus casts, and resolve long
lines.

Reviewed by: bde


235740 21-May-2012 ghelmer

Add checks for memory allocation failures in appropriate places, and
avoid creating bad entries in the grp list as a result of memory allocation
failures while building new entries.

PR: bin/83340
Reviewed by: delphij (prior version of patch)


235739 21-May-2012 ghelmer

Apply style(9) to return and switch/case statements.

Reviewed by: delphij (prior version of the patch)


235649 19-May-2012 gleb

Put my name as copyright owner of lib/libc/gen/dirfd.c added in r235647.

Requested by: kib@


235647 19-May-2012 gleb

Hide DIR definition by making it an opaque struct typedef.

Introduce dirfd() libc exported symbol replacing macro with same name,
preserve _dirfd() macro for internal use.

Replace dirp->dd_fd with dirfd() call. Avoid using dirfd as variable
name to prevent shadowing global symbol.

Sponsored by: Google Summer Of Code 2011


234714 26-Apr-2012 eadler

Use the .Bx macro instead of BSD

Submitted by: ru
Approved by: ru
MFC after: 3 days
X-MFC-With: r234700


234700 26-Apr-2012 eadler

Document the standardization status of err* and warn*

PR: docs/164939
Submitted by: Niclas Zeising <zeising@daemonic.se>
Approved by: bcr
MFC after: 3 days


234569 22-Apr-2012 jasone

Import jemalloc a8f8d7540d66ddee7337db80c92890916e1063ca (dev branch,
prior to 3.0.0 release). This fixes several bugs related to memory
initialization.

Mangle __jemalloc_a0{malloc,calloc,free}() just like all the other
library-internal symbols in jemalloc, and adjust the tls allocation code
in libc to use the mangled names.


234370 17-Apr-2012 jasone

Import jemalloc 9ef7f5dc34ff02f50d401e41c8d9a4a928e7c2aa (dev branch,
prior to 3.0.0 release) as contrib/jemalloc, and integrate it into libc.
The code being imported by this commit diverged from
lib/libc/stdlib/malloc.c in March 2010, which means that a portion of
the jemalloc 1.0.0 ChangeLog entries are relevant, as are the entries
for all subsequent releases.


234057 09-Apr-2012 jilles

sem_open: Make sure to fail an O_CREAT|O_EXCL open, even if that semaphore
is already open in this process.

If the named semaphore is already open, sem_open() only increments a
reference count and did not take the flags into account (which otherwise
happens by passing them to open()). Add an extra check for O_CREAT|O_EXCL.

PR: kern/166706
Reviewed by: davidxu
MFC after: 10 days


233913 05-Apr-2012 davidxu

In sem_post, the field _has_waiters is no longer used, because some
application destroys semaphore after sem_wait returns. Just enter
kernel to wake up sleeping threads, only update _has_waiters if
it is safe. While here, check if the value exceed SEM_VALUE_MAX and
return EOVERFLOW if this is true.


233648 29-Mar-2012 eadler

Remove trailing whitespace per mdoc lint warning

Disussed with: gavin
No objection from: doc
Approved by: joel
MFC after: 3 days


233510 26-Mar-2012 joel

mdoc: terminate quoted strings.

Reviewed by: brueffer


233345 23-Mar-2012 ed

Make utmpx(3) thread safe if we support TLS.

Because the utmpx interface is generally not required to be thread-safe,
but it is nice to have, if easy to do so. Therefore don't make a mess
out of the code and only use it if __NO_TLS is not defined.


233300 22-Mar-2012 pluknet

Fix style. Somehow I managed to lost a space when copy&paste.

Pointed out by: stefanf


233296 22-Mar-2012 pluknet

Prevent fs_file NULL pointer dereference in fixfsfile() uncovered after r1.5
when passing damaged user-supplied fstab file data.

MFC after: 1 week


233263 21-Mar-2012 davidxu

Revert previous change. It is an incomplete change from old branch. :-(


233262 21-Mar-2012 davidxu

Use version 2 of semaphore provided by kernel umtx code, now if there is
no waiters, we still increase and decrease count in user mode without
entering kernel, once there is a waiter, sem_post will enter kernel to
increase count and wake thread up, this is atomicy and allow us to
gracefully destroy semaphore after sem_wait returned.


233132 18-Mar-2012 jilles

fts(3): Mention that FTS_NOCHDIR imposes {PATH_MAX} limits on the returned
pathnames.

With the current API (no *at functions), FTS_NOCHDIR requires that the
fts_accpath start with the original path passed to fts_open(); therefore,
the depth that can be reached is limited by the {PATH_MAX} constraint on
this pathname.

MFC after: 1 week


233130 18-Mar-2012 jilles

fts(3): Document cases where FTS_NOCHDIR is set implicitly.

PR: docs/166091
Submitted by: Matthew Story
MFC after: 1 week


232582 06-Mar-2012 gonzo

- Switch ARM and MIPS to TLS Variant I
- Fix TLS allocation for Variant I: both rtld and libc allocators
assume that tls_static_space includes space for TLS structure.
So increment calculated static size by the size of it.


232393 02-Mar-2012 ru

Removed excessive _seekdir() call in closedir(). This saves one lseek()
syscall. Before r5958, seekdir() was called for its side effect of
freeing memory allocated by opendir() for rewinddir(), but that revision
added _reclaim_telldir() that frees all memory allocated by telldir()
calls, making this call redundant.

This introduces a slight change. If an application duplicated the descriptor
obtained through dirfd(), it can no longer rely on file position to be
reset to the start of file after a call to closedir(). It's believed to
be safe because neither POSIX, nor any other OS I've tested (NetBSD, Linux,
OS X) rewind the file offset pointer on closedir().

Reported by: Igor Sysoev


232392 02-Mar-2012 kib

Belatedly add dl_iterate_phdr(3) to the list of installed manpages.

MFC after: 3 days


232385 02-Mar-2012 ru

Finally removed the stat() and fstat() calls from the opendir() code.
They were made excessive in r205424 by opening with O_DIRECTORY.
Also eliminated the fcntl() call used to set FD_CLOEXEC by opening
with O_CLOEXEC.

(fdopendir() still checks that the passed descriptor is a directory,
and sets FD_CLOEXEC on it.)

Reviewed by: ed


232144 25-Feb-2012 davidxu

In revision 231989, we pass a 16-bit clock ID into kernel, however
according to POSIX document, the clock ID may be dynamically allocated,
it unlikely will be in 64K forever. To make it future compatible, we
pack all timeout information into a new structure called _umtx_time, and
use fourth argument as a size indication, a zero means it is old code
using timespec as timeout value, but the new structure also includes flags
and a clock ID, so the size argument is different than before, and it is
non-zero. With this change, it is possible that a thread can sleep
on any supported clock, though current kernel code does not have such a
POSIX clock driver system.


232007 22-Feb-2012 jilles

libc: Eliminate some relative relocations in fmtmsg().


231945 20-Feb-2012 pjd

Document the fact that getgrouplist(3) returns 0 on success.

MFC after: 3 days


231891 18-Feb-2012 delphij

Use ANSI prototypes.


231873 17-Feb-2012 kib

Fix cross-references.

Submitted by: pluknet
MFC after: 2 weeks


231869 17-Feb-2012 kib

Document dl_iterate_phdr(3).

Man page is based on the OpenBSD version, extended and corrected for
the FreeBSD implementation.

MFC after: 2 weeks


231868 17-Feb-2012 kib

Fetch the aux vector for the static libc, and use the entries to
initialize the cache of the system information as it was done for the
dynamic libc. This removes several sysctls from the static binary
startup.

Use the aux vector to fill the single struct dl_phdr_info describing
the static binary itself, to implement dl_iterate_phdr(3) for the
static binaries. [1]

Based on the submission by: John Marino <draco marino st> [1]
Tested by: flo (sparc64)
MFC after: 2 weeks


231564 12-Feb-2012 ed

Globally replace u_int*_t from (non-contributed) man pages.

The reasoning behind this, is that if we are consistent in our
documentation about the uint*_t stuff, people will be less tempted to
write new code that uses the non-standard types.

I am not going to bump the man page dates, as these changes can be
considered style nits. The meaning of the man pages is unaffected.

MFC after: 1 month


231530 11-Feb-2012 ed

Replace utxrm(8) by utx(8).

At first, I added a utility called utxrm(8) to remove stale entries from
the user accounting database. It seems there are cases in which we need
to perform different operations on the database as well. Simply rename
utxrm(8) to utx(8) and place the old code under the "rm" command.

In addition to "rm", this tool supports "boot" and "shutdown", which are
going to be used by an rc-script which I am going to commit separately.


231514 11-Feb-2012 ed

Set read buffer size to multiple of sizeof(struct futx).

If the utmpx database gets updated while an application is reading it,
there is a chance the reading application processes partially
overwritten entries. To solve this, make sure we always read a multiple
of sizeof(struct futx) at a time.

MFC after: 2 weeks


231505 11-Feb-2012 bz

Introduce a new NET_RT_IFLISTL API to query the address list. It works
on extended and extensible structs if_msghdrl and ifa_msghdrl. This
will allow us to extend both the msghdrl structs and eventually if_data
in the future without breaking the ABI.

Bump __FreeBSD_version to allow ports to more easily detect the new API.

Reviewed by: glebius, brooks
MFC after: 3 days


231299 09-Feb-2012 eadler

More accurately document what happens on error.

PR: docs/127908
Submitted by: Matthew D. Fuller <fullermd@over-yonder.net>
Approved by: cperciva
MFC after: 1 week


230429 21-Jan-2012 kib

Add API for obtaining extended machine context states that cannot be
fit into existing mcontext_t.

On i386 and amd64 do return the extended FPU states using
getcontextx(3). For other architectures, getcontextx(3) returns the
same information as getcontext(2).

Tested by: pho
MFC after: 1 month


230201 16-Jan-2012 davidxu

Insert read memory barriers.


230060 13-Jan-2012 ed

Remove wtmpcvt(1).

The wtmpcvt(1) utility converts wtmp files to the new format used by
utmpx(3). Now that HEAD has been branched to stable/9 and 9.0 is
released, there is no need for it in HEAD.

MFC after: never


229938 10-Jan-2012 ghelmer

Revert unintentional commit of changes to getnetgrent.c.


229937 10-Jan-2012 ghelmer

Add pidfile_fileno() to obtain the file descriptor for an open
pidfile.


229768 07-Jan-2012 kib

Implement fdlopen(3), an rtld interface to load shared object by file
descriptor.

Requested and tested by: des (previous version)
Reviewed by: des, kan (previous version)
MFC after: 2 weeks


229403 03-Jan-2012 ed

Replace index() and rindex() calls with strchr() and strrchr().

The index() and rindex() functions were marked LEGACY in the 2001
revision of POSIX and were subsequently removed from the 2008 revision.
The strchr() and strrchr() functions are part of the C standard.

This makes the source code a lot more consistent, as most of these C
files also call into other str*() routines. In fact, about a dozen
already perform strchr() calls.


229024 30-Dec-2011 dim

Add some additional const poison after r228972. The 'mapping' array in
lib/libc/gen/strtofflags.c became const, but gcc did not warn about
assigning its members to non-const pointers. Clang warned about this
with:

lib/libc/gen/strtofflags.c:98:12: error: assigning to 'char *' from 'const char *' discards qualifiers [-Werror,-Wincompatible-pointer-types]
for (sp = mapping[i].invert ? mapping[i].name :
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Reviewed by: jilles


228972 29-Dec-2011 jilles

libc: Eliminate some relative relocations in file flags table.


228922 27-Dec-2011 jilles

libc: Eliminate some relative relocations in getusershell().


228843 23-Dec-2011 cperciva

Fix a problem whereby a corrupt DNS record can cause named to crash. [11:06]

Add an API for alerting internal libc routines to the presence of
"unsafe" paths post-chroot, and use it in ftpd. [11:07]

Fix a buffer overflow in telnetd. [11:08]

Make pam_ssh ignore unpassphrased keys unless the "nullok" option is
specified. [11:09]

Add sanity checking of service names in pam_start. [11:10]

Approved by: so (cperciva)
Approved by: re (bz)
Security: FreeBSD-SA-11:06.bind
Security: FreeBSD-SA-11:07.chroot
Security: FreeBSD-SA-11:08.telnetd
Security: FreeBSD-SA-11:09.pam_ssh
Security: FreeBSD-SA-11:10.pam


228755 20-Dec-2011 eadler

- Fix style(9) bugs in glob.c

Approved by: jilles


228754 20-Dec-2011 eadler

- Add restrict keyword to glob(3)

PR: kern/161958
Submitted by: Henning Petersen <henning.petersen@t-online.de>
Approved by: jilles
MFC after: 3 days


228492 14-Dec-2011 ru

Clean up includes; the prototype for getosreldate() has moved to
<unistd.h> in r183390.


228193 02-Dec-2011 obrien

Tweak the r137233 fix to r136283 -- Code was making two send() attempts
vs. the comment documented "If we are working with a privileged socket,
then take only one attempt". Make the code match.

Furthermore, critical privileged applications that [over] log a vast amount
can look like a DoS to this code. Given it's unlikely the single reattempted
send() will succeeded, avoid usurping the scheduler in a library API for a
single non-critical facility in critical applications.

Obtained from: Juniper Networks
Discussed with: glebius


228002 26-Nov-2011 theraven

style(9) fix.

Approved by: dim (mentor)


227999 26-Nov-2011 theraven

Return not-implemented from pthread_once and pthread_key_create, rather
than silently failing and returning success.

Without this, code calls pthread_once(), receives a return value of
success, and thinks that the passed function has been called.

Approved by: dim (mentor)


227852 22-Nov-2011 jilles

fdopendir(): Do not close the passed file descriptor on failure.

Reviewed by: delphij


227753 20-Nov-2011 theraven

Implement xlocale APIs from Darwin, mainly for use by libc++. This adds a
load of _l suffixed versions of various standard library functions that use
the global locale, making them take an explicit locale parameter. Also
adds support for per-thread locales. This work was funded by the FreeBSD
Foundation.

Please test any code you have that uses the C standard locale functions!

Reviewed by: das (gdtoa changes)
Approved by: dim (mentor)


227520 15-Nov-2011 das

Further reduce diffs with OpenBSD's arc4random. The main functional
change here is to ensure that when a process forks after arc4random
is seeded, the parent and child don't observe the same random sequence.
OpenBSD's fix introduces some additional overhead in the form of a
getpid() call. This could be improved upon, e.g., by setting a flag
in fork(), if it proves to be a problem.

This was discussed with secteam (simon, csjp, rwatson) in 2008, shortly
prior to my going out of town and forgetting all about it. The conclusion
was that the problem with forks is worrisome, but it doesn't appear to
have introduced an actual vulnerability for any known programs.

The only significant remaining difference between our arc4random and
OpenBSD's is in how we seed the generator in arc4_stir().


227519 15-Nov-2011 das

Sync the style, comments, and variable names of arc4random.c with
OpenBSD's version (r1.22). While some of our style changes were
indeed small improvements, being able to easily track functionality
changes in OpenBSD seems more useful.

Also fix style bugs in the FreeBSD-specific parts of this file.

No functional changes, as verified with md5.


226847 27-Oct-2011 ed

Don't forget to kick the man page date.


226846 27-Oct-2011 ed

Make our utmpx more like System V.

When booting the system, truncate the utx.active file, but do write the
BOOT_TIME record into it afterwards. This allows one to obtain the boot
time of the system as follows:

struct utmpx u1 = { .ut_type = BOOT_TIME }, *u2;

setutxent();
u2 = getutxid(&u1);

Now, the boot time is stored in u2->ut_tv, just like on Linux and other
systems.

We don't open the utx.active file with O_EXLOCK. It's rather unlikely
that other applications use this database at the same time and I want to
prevent the possibility of deadlocks in init(8).

Discussed with: pluknet


226836 27-Oct-2011 pluknet

Fix the manual section number for a cross-reference to open(2) and sort it.

Reviewed by: ed
MFC after: 3 days


226606 21-Oct-2011 das

Replace a proliferation of buggy MD implementations of modf() with a
working MI one. The MI one only needs to be overridden on machines
with non-IEEE754 arithmetic. (The last supported one was the VAX.)
It can also be overridden if someone comes up with a faster one that
actually passes the regression tests -- but this is harder than it sounds.


226436 16-Oct-2011 eadler

- change "is is" to "is" or "it is"
- change "the the" to "the"

Approved by: lstewart
Approved by: sahil (mentor)
MFC after: 3 days


225897 01-Oct-2011 ed

Reimplement ctermid().

Even though POSIX allows us to return simply /dev/tty as a pathname
identifying the controlling terminal of the running process, it is nicer
if this function were actually useful, by returning the actual pathname
of the controlling terminal.

Implement ctermid() by using the kern.devname sysctl to resolve the
actual name of /dev/tty. Don't use devname(3), since it may return bogus
strings like #C:0x123.


225847 28-Sep-2011 ed

Get rid of major/minor number distinction.

As of FreeBSD 6, devices can only be opened through devfs. These device
nodes don't have major and minor numbers anymore. The st_rdev field in
struct stat is simply based a copy of st_ino.

Simply display device numbers as hexadecimal, using "%#jx". This is
allowed by POSIX, since it explicitly states things like the following
(example taken from ls(1)):

"If the file is a character special or block special file, the
size of the file may be replaced with implementation-defined
information associated with the device in question."

This makes the output of these commands more compact. For example, ls(1)
now uses approximately four columns less. While there, simplify the
column length calculation from ls(1) by calling snprintf() with a NULL
buffer.

Don't be afraid; if needed one can still obtain individual major/minor
numbers using stat(1).


223907 10-Jul-2011 jilles

posix_spawn: If an error is detected in the child process, reap the zombie.

Formerly, in this case an error was returned but the pid was also returned
to the application, requiring the application to use unspecified behaviour
(the returned pid in error situations) to avoid zombies.

Now, reap the zombie and do not return the pid.

MFC after: 2 weeks


223576 26-Jun-2011 ed

Fix whitespace inconsistencies in libc in files copyrighted by me.


223216 18-Jun-2011 delphij

Sync with OpenBSD, primarily make the code easier to read, and a license
change to standard OpenBSD ISC license.

Obtained from: OpenBSD
MFC after: 2 weeks


223215 18-Jun-2011 delphij

Sync with OpenBSD (zap rcsid).

MFC after: 2 weeks


223206 17-Jun-2011 jilles

posix_spawn(3): Document r222511 (trying to close already closed fd).

MFC after: 1 week


223136 16-Jun-2011 davidxu

Use size of int to fetch sysctl kern.sched.cpusetsize because it had
switched from long to int type in kernel.

Fixed by: pluknet


222511 30-May-2011 jilles

posix_spawn(): Do not fail when trying to close an fd that is not open.

As noted in Austin Group issue #370 (an interpretation has been issued),
failing posix_spawn() because an fd specified with
posix_spawn_file_actions_addclose() is not open is unnecessarily harsh, and
there are existing implementations that do not fail posix_spawn() for this
reason.

Reviewed by: ed
MFC after: 10 days


222286 25-May-2011 ru

[mdoc] Fixed .Dt call.


220617 14-Apr-2011 pluknet

Remove vestiges of disklabel(5).

Reviewed by: uqs
MFC after: 5 days


220376 05-Apr-2011 jilles

Allow strerror(0) and strerror_r(0, ...).

Of course, strerror_r() may still fail with ERANGE.

Although the POSIX specification said this could fail with EINVAL and
doing this likely indicates invalid use of errno, most other
implementations permitted it, various POSIX testsuites require it to
work (matching the older sys_errlist array) and apparently some
applications depend on it.

PR: standards/151316
MFC after: 1 week


220157 30-Mar-2011 pluknet

Use FD_CLOEXEC explicitly.

MFC after: 3 days


220024 26-Mar-2011 pjd

Don't calculate len too early.


220023 26-Mar-2011 pjd

Follow style(9) in example code and handle opendir(3) error.


219696 16-Mar-2011 pjd

From fts.c comment:

The "FTS_NOSTAT" option can avoid a lot of calls to stat(2) if it knows that a
directory could not possibly have subdirectories. This is decided by looking at
the link count: a subdirectory would increment its parent's link count by
virtue of its own ".." entry. This assumption only holds for UFS-like
filesystems that implement links and directories this way, so we must punt for
others.

It looks like ZFS is a UFS-like file system, as the above also holds for ZFS.
Add ZFS to the list of file systems that allow for such optimization.

MFC after: 1 month


219222 03-Mar-2011 rwatson

Add text string for ECAPMODE to libc.

Discussed with: anderson
Obtained from: Capsicum Project
Sponsored by: Google, Inc.
MFC after: 3 months


219045 25-Feb-2011 ed

Fix style(9) issues in pututxline(3).

Also, make sure to initialize the `ret' variable properly.

Reported by: Cedric Jonas <cedric c84 eu>
Patch by: Garrett Cooper <yanegomi gmail com>


218847 19-Feb-2011 ed

Add a utility, utxrm(8).

Most of the ports I broke when I imported utmpx, were simple management
utilities for the utmp database, allowing you to add/remove entries
manually.

Add a small tool called utxrm(8), which allows you to remove an entry
from the utmpx database by hand. This is useful when a login daemon
crashes or fails to remove the entry during shutdown.


218846 19-Feb-2011 ed

Properly styleify utmpx code and document error codes in man page.

Submitted by: Garrett Cooper


218824 18-Feb-2011 nwhitehorn

Turn off default generation of userland dot symbols on powerpc64 now that
we have a binutils that supports it. Kernel dot symbols remain on to assist
DDB.


218712 15-Feb-2011 ed

Don't forget to bump man page date for r218711.


218711 15-Feb-2011 ed

Remove dead reference to regexp(3). Use regex(3) instead.

PR: docs/149950
Submitted by: arundel@


218645 13-Feb-2011 brucec

Document some more sysconf(3) variables.

MFC after: 1 month


218385 06-Feb-2011 jilles

rfork_thread(3): Mark deprecated in favor of pthread_create(3).


218285 04-Feb-2011 jilles

Make sys_signame upper case.

This matches the constants from <signal.h> with 'SIG' removed, which POSIX
requires kill and trap to accept and 'kill -l' to write.

'kill -l', 'trap', 'trap -l' output is now upper case.

In Turkish locales, signal names with an upper case 'I' are now accepted,
while signal names with a lower case 'i' are no longer accepted, and the
output of 'killall -l' now contains proper capital 'I' without dot instead
of a dotted capital 'I'.


217154 08-Jan-2011 kib

Implement __pthread_map_stacks_exec() callback for libc, to change the
stack protection to allow execution for single-threaded processes.


215310 14-Nov-2010 ed

Always set errno to a sane value when pututxline(3) fails.

For example, it will now return ESRCH when trying to replace a
nonexistent entry with DEAD_PROCESS.


215236 13-Nov-2010 delphij

Sync with OpenBSD, primarily better signal and terminal handling.

Obtained from: OpenBSD
MFC after: 2 weeks


214680 02-Nov-2010 ed

Add a new libc function: cfmakesane(3).

I've noticed various terminal emulators that need to obtain a sane
default termios structure use very complex `hacks'. Even though POSIX
doesn't provide any functionality for this, extend our termios API with
cfmakesane(3), which is similar to the commonly supported cfmakeraw(3),
except that it fills the termios structure with sane defaults.

Change all code in our base system to use this function, instead of
depending on <sys/ttydefaults.h> to provide TTYDEF_*.


214510 29-Oct-2010 davidxu

Add sysctl kern.sched.cpusetsize to export the size of kernel cpuset,
also add sysconf() key _SC_CPUSET_SIZE to get sysctl value.

Submitted by: gcooper


214134 21-Oct-2010 ed

Fix error handling logic of pututxline(3).

Instead of only returning NULL when the entry is invalid and can't be
matched against the current database, also return it when it cannot open
the log files properly.


213573 08-Oct-2010 uqs

mdoc: drop redundant .Pp and .LP calls

They have no effect when coming in pairs, or before .Bl/.Bd


213153 25-Sep-2010 davidxu

To support stack unwinding for cancellation points, add -fexceptions flag
for them, two functions _pthread_cancel_enter and _pthread_cancel_leave
are added to let thread enter and leave a cancellation point, it also
makes it possible that other functions can be cancellation points in
libraries without having to be rewritten in libthr.


211774 24-Aug-2010 imp

Powerpc is special here. powerpc and powerpc64 use different ABIs, so
their implementations aren't in the same files. Introduce LIBC_ARCH
and use that in preference to MACHINE_CPUARCH. Tested by amd64 and
powerpc64 builds (thanks nathanw@)


211725 23-Aug-2010 imp

MFtbemd:

Prefer MACHNE_CPUARCH to MACHINE_ARCH in most contexts where you want
to test of all the CPUs of a given family conform.


211706 23-Aug-2010 kib

On shared object unload, in __cxa_finalize, call and clear all installed
atexit and __cxa_atexit handlers that are either installed by unloaded
dso, or points to the functions provided by the dso.

Use _rtld_addr_phdr to locate segment information from the address of
private variable belonging to the dso, supplied by crtstuff.c. Provide
utility function __elf_phdr_match_addr to do the match of address against
dso executable segment.

Call back into libthr from __cxa_finalize using weak
__pthread_cxa_finalize symbol to remove any atfork handler which
function points into unloaded object.

The rtld needs private __pthread_cxa_finalize symbol to not require
resolution of the weak undefined symbol at initialization time. This
cannot work, since rtld is relocated before sym_zero is set up.

Idea by: kan
Reviewed by: kan (previous version)
MFC after: 3 weeks


211705 23-Aug-2010 kib

Introduce implementation-private rtld interface _rtld_addr_phdr, which
fills struct dl_phdr_info for the shared object that contains the
specified address, if any.

Idea and reviewed by: kan
MFC after: 3 weeks


211416 17-Aug-2010 kib

Use aux vector to get values for SSP canary, pagesize, pagesizes array,
number of host CPUs and osreldate.

This eliminates the last sysctl(2) calls from the dynamically linked image
startup.

No objections from: kan
Tested by: marius (sparc64)
MFC after: 1 month


211397 16-Aug-2010 joel

Fix typos, spelling, formatting and mdoc mistakes found by Nobuyuki while
translating these manual pages. Minor corrections by me.

Submitted by: Nobuyuki Koganemaru <n-kogane@syd.odn.ne.jp>


210772 02-Aug-2010 joel

Spelling fixes.


210323 21-Jul-2010 ed

Also link getutxent.3 to utmpx.3.

If you run `man utmpx', you expect to get some info on it.


209876 10-Jul-2010 nwhitehorn

The 64-bit PowerPC ABI implemented in binutils 2.15 requires some special
quirks for weak-symbol handling. Text symbols require also marking weak
the special dot-symbol associated with the function, and data symbols
require that you not do that. To fix this, provide a hacked
__weak_reference for powerpc64, and define a new __weak_reference_data
for the single weak data symbol in base.

Revert after: binutils 2.17 import
Obtained from: projects/ppc64


209032 11-Jun-2010 uqs

mdoc: stop abusing -column lists and use .Bl -tag instead


208734 02-Jun-2010 uqs

mdoc: spell macros correctly, there's no need for the backslash escape


208291 19-May-2010 uqs

mdoc: consistently spell our email addresses <foo@FreeBSD.org>

Reviewed by: ru


208027 13-May-2010 uqs

mdoc: move CAVEATS, BUGS and SECURITY CONSIDERATIONS sections to the
bottom of the manpages and order them consistently.

GNU groff doesn't care about the ordering, and doesn't even mention
CAVEATS and SECURITY CONSIDERATIONS as common sections and where to put
them.

Found by: mdocml lint run
Reviewed by: ru


207981 12-May-2010 gordon

Fix a bug due to a type conversion from 64 to 32 bits. The side effect of
this type conversion is the high bits which were used to indicate if a
special character was a literal or special were dropped. As a result, all
special character were treated as special, even if they were supposed to
be literals.

Reviewed by: gad@
Approved by: mentor (wes@)


207749 07-May-2010 jilles

raise(3): Note that this sends a signal to the current thread, not process.

This is how it works (with threading libraries loaded) and what POSIX
requires.

MFC after: 1 week


207735 06-May-2010 jilles

Update xrefs from 4.3BSD to modern signal functions in various man pages.

sigvec(2) references have been updated to sigaction(2), sigsetmask(2) and
sigblock(2) to sigprocmask(2), sigpause(2) to sigsuspend(2).

Some legacy man pages still refer to them, that is OK.


207186 25-Apr-2010 jilles

sysctl(3): Update description of various kern.* variables.
Also add xrefs for confstr(3) (as sysconf(3) but for strings) and kvm(3)
(which is a more convenient way to access some of the variables).

PR: 116480
MFC after: 1 week


206760 17-Apr-2010 jilles

getcwd(3): Clarify that EACCES may or may not be checked.

POSIX permits but does not require checking access on the current and parent
directories.

Because various programs do not like it if getcwd(3) fails, it seems best
to avoid checking access as much as possible. There are various reports in
GNATS about this (search for getcwd).

Our getcwd(3) implementation first queries the kernel for the pathname
directly, which does not check any permissions but sometimes fails, and then
falls back to reading all parent directories for the names.

PR: standards/44425
MFC after: 2 weeks


206711 16-Apr-2010 jilles

fnmatch: Fix bad FNM_PERIOD disabling if an asterisk has been seen.

Example: fnmatch("a*b/*", "abbb/.x", FNM_PATHNAME | FNM_PERIOD)

PR: 116074
MFC after: 1 week


206622 14-Apr-2010 uqs

mdoc: order prologue macros consistently by Dd/Dt/Os

Although groff_mdoc(7) gives another impression, this is the ordering
most widely used and also required by mdocml/mandoc.

Reviewed by: ru
Approved by: philip, ed (mentors)


206616 14-Apr-2010 uqs

mdoc: don't abuse Bo/Pc to get what looks like an interval

Be explicit and use the general bracketing form plus symbols which are
to be interpreted mathematically in this case.

Complaint by: mdocml
Reviewed by: ru
Approved by: philip, ed (mentors)


206615 14-Apr-2010 uqs

mdoc: remove .Pp where not needed

This trips up mdocml and can simply go away.

Reviewed by: ru
Approved by: philip, ed (mentors)


205997 31-Mar-2010 delphij

Add prototype for libc internal interfaces.


205996 31-Mar-2010 delphij

Add prototypes for libc private interfaces.

While I'm there, apply __unused whenever appropriate.

Reviewed by: md5(1)


205606 24-Mar-2010 gahr

- Remove const'ness from dlerror(3) prototype, for consistency with POSIX.

Approved by: cognet
MFC after: 1 week


205424 21-Mar-2010 ed

Let opendir() use O_DIRECTORY.

I am not removing the fstat() calls here, since we cannot yet assume
people will always run kernels that respect O_DIRECTORY.


205165 15-Mar-2010 phk

Comment a fine point, so it does not get lost when people borrow code
from FreeBSD for other purposes.


204588 02-Mar-2010 joel

The NetBSD Foundation has granted permission to remove clause 3 and 4 from
their software.

Obtained from: NetBSD


204347 26-Feb-2010 edwin

Split the contributed code from libc/stdtime from lib/libc/stdtime
to contrib/tzcode/stdtime.


204307 25-Feb-2010 kib

Make pause(3) implementation not depended on the legacy sigcompat.c
interfaces. Do not block rt signals during and after pause(3) calls.
Use private libc namespace to call proper methods.

MFC after: 1 week


204172 21-Feb-2010 ed

While there, trim some trailing whitespace.


204170 21-Feb-2010 ed

Add proper const keywords to sysctl(3) parameters.

The `name' and `newp' arguments can be marked const, because the buffers
they refer to are never changed. While there, perform some other
cleanups:

- Remove K&R from sysctl.c.
- Implement sysctlbyname() using sysctlnametomib() to prevent
duplication of an undocumented kernel interface.
- Fix some whitespace nits.

It seems the prototypes are now in sync with NetBSD as well.


203946 16-Feb-2010 marcel

The static TLS size as given by tls_static_space includes TLS_TCB_SIZE
bytes of TCB in variant I.


203439 03-Feb-2010 ed

Also add a cross-reference to NetBSD updlastlogx().


203395 02-Feb-2010 gavin

Bump .Dd, forgotten in r203393

Approved by: ed (mentor, implicit)
MFC after: 1 week


203393 02-Feb-2010 gavin

The multiplicand a = 0x5deece66d = 25214903917, not 0xfdeece66d.
This bug in the man page has gone unnoticed for over 15 years!

PR: docs/143461
Submitted by: Jeremy Huddleston jeremyhu apple.com
Approved by: ed (mentor, implicit)
MFC after: 1 week


203290 31-Jan-2010 ed

Perform some cleanups to devname(3).

- Make sure the mode argument is either a character or a block device.
- Use S_IS*() instead of checking S_IF*-flags by hand.
- Don't use kern.devname when the argument is already NODEV.
- Always call snprintf with the proper amount of arguments corresponding
with the format.
- Perform some whitespace fixes. Tabs instead of 4 spaces, missing space
for return statement.
- Remove unneeded includes.


203068 27-Jan-2010 ed

Remove pseudo-terminals from ttys(5).

When we had utmp(5), we had to list all the psuedo-terminals in ttys(5)
to make ttyslot(3) function properly. Now that pututxline(3) deals with
slot allocation internally (not based on TTY names), we don't need to
list all the TTYs on the system in ttys(5) to make user accounting work
properly.

This patch removes all the entries from the /etc/ttys files, but also
the pts(4) entries that were appended implicitly, which was added in
r154838.


202930 24-Jan-2010 ed

Improve the ttyname(3) manual page.

- Remove unrelated references to tty(5).
- Remove unneeded relation with FILE *.
- Add better cross references.


202893 23-Jan-2010 ed

EMPTY records don't have a timestamp.


202883 23-Jan-2010 antoine

Reapply r201145 to lib/libc/gen/sem.c


202876 23-Jan-2010 ed

Just ignore the timestamps given to pututxline().

I've noticed many applications do a bad job at timekeeping, for several
reasons:

- Applications like screen(1) don't update time records when restoring
the old user login record.
- Many applications only set ut_tv.tv_sec, not ut_tv.tv_usec.

This causes many problems for tools such as ac(8), which require the
timestamps to be properly ordered. This is why I've decided to let the
utmpx code obtain valid timestamps itself.


202780 22-Jan-2010 ed

English nitpicking.

Submitted by: jmallett


202779 22-Jan-2010 ed

Describe why pututxline() doesn't entirely conform to standards.


202778 22-Jan-2010 ed

Remove comments about breaking the specification.

I've discussed this issue with the Austin Group and it will be fixed in
future revisions of the specification. The issue was that ut_line fields
weren't supposed to be valid for LOGIN_PROCESS entries, while
getutxline() would try to match these records anyway.

They also agreed on our way of implementing pututxline() without
getutxid() (which other operating systems also do), but unfortunately
they disagreed with our way of replacing DEAD_PROCESS entries, which is
a pity. The current specification allows the utmpx database to become
infinitely big over time.

See also: http://austingroupbugs.net/view.php?id=213#c378


202693 20-Jan-2010 ache

Style: reword comment.

Submitted by: bde


202691 20-Jan-2010 ache

For alphasort() add reference to strcoll(3)


202679 20-Jan-2010 ache

Style: rename internal function to opendir_compar()

Pointed by: bde


202677 20-Jan-2010 ache

Style: remove extra empty line in the comment.

Pointed by: bde


202661 19-Jan-2010 ed

Revert r202447 by re-exposing the old uname(3) function.

It makes hardly any sense to expose a symbol which should only be
provided for binary compatibility, but it seems we don't have a lot of
choice here. There are many autoconf scripts out there that try to
create a binary that links against the old symbol to see whether
uname(3) is present. These scripts fail to detect uname(3) now.

It should be noted that the behaviour we implement is not against the
standards:

| The following shall be declared as a function and may also be defined
| as a macro:
|
| int uname(struct utsname *);


202572 18-Jan-2010 ache

Double checking my commit I found that comment saying that
POSIX 2008 and XSI 7require strcoll() for opendir() is not true.
I can't find such requirement in POSIX 2008 and XSI 7.

So, back out that part of my commit, returning old strcmp(), and remove
this misleading comment.


202557 18-Jan-2010 davidxu

preserve errno when processing error cases.


202556 18-Jan-2010 ache

a) Use strcoll() in opendir() and alphasort() as POSIX 2008 requires.
It also matches now how our 'ls' works for years.

b) Remove comment expressed 2 fears:
1) One just simple describe how strcoll() works in _any_ context,
not for directories only. Are we plan to remove strcoll() from everything
just because it is little more complex than strcmp()? I doubt, and
directories give nothing different here. Moreover, strcoll() used
in 'ls' for years and nobody complaints yet.

2) Plain wrong statement about undefined strcoll() behaviour. strcoll()
always gives predictable results, falling back to strcmp() on any
trouble, see strcoll(3).

No objections from -current list discussion.


202530 17-Jan-2010 ed

Perform several small cleanups to the utmpx code.

- Massively reduce BSS usage. Let futx_to_utx() dynamically allocate the
structure. There is only a very small amount of applications out there
that needs to use the utmpx database. Wasting 1 KB on unused
structures makes little sense.

- Just let getutxid() search for matching ut_id's for any *PROCESS-type.
This makes the code a bit more future-proof.

- Fix a POSIX-mistake: when reading POSIX and the OpenSolaris
implementation, getutxline() must return USER_PROCESS and
LOGIN_PROCESS records whose ut_lines match. When reading POSIX, it
seems LOGIN_PROCESS should not use ut_line at the first place. I have
reported this issue.


202527 17-Jan-2010 ed

Add forgotten break; keyword to getutxid().

We should not fall through to the ut_id comparison. Only ut_type should
be compared when using OLD_TIME, NEW_TIME, BOOT_TIME or SHUTDOWN_TIME.


202487 17-Jan-2010 ed

Simplify ttyslot(3).

After comparing how other systems deal with utmp/utmpx, I noticed many
systems don't even care about ttyslot(3) anymore, since utmpx doesn't
use TTY slots anyway. We don't provide any tools to access old utmp
files anymore, so there is no use in letting applications write to a
proper offset within the utmp file.

Just let ttyslot(3) always return 0, which seems to be the default
behaviour on operating systems like Linux as well.


202447 16-Jan-2010 ed

Unexpose the old uname(3) function.

Nowadays uname(3) is an inline function around __xuname(3). Prevent
linkage of new binaries against this compatibility function, similar to
what I did with ttyslot(3).


202326 15-Jan-2010 davidxu

Also call sem_module_init in sem_close to initialize mutex
with some attributes.


202301 14-Jan-2010 ed

Add wtmpcvt(1).

This utility allows users to convert their wtmp databases to the new
format. It makes no sense for users to keep their wtmp log files if they
are unable to view them.

It basically copies ut_line into ut_id as well. This makes it possible
for last(1) and ac(8) to match login records with their corresponding
logout record.


202288 14-Jan-2010 ed

Remove ttyslot from Symbol.map anyway.

Requested by: kan


202287 14-Jan-2010 ed

Unbreak pututxline() on 32-bit architectures.

I forgot to cast the size_t's back to off_t before negating them,
causing all sorts of artifacts where the log files would grow to 2^32 -
197 bytes.

Reported by: ume


202279 14-Jan-2010 ed

Revert the change to Symbol.map, made in r202274.

Even though we use __sym_compat(), we should list the symbol in
Symbol.map.

ttyslot() is now listed as follows, which seems to do the right thing:

| Symbol table '.dynsym' contains 2755 entries:
| Num: Value Size Type Bind Vis Ndx Name
| 613: 00000000000477b0 121 FUNC GLOBAL DEFAULT 10 ttyslot@FBSD_1.0

Reported by: kib


202277 14-Jan-2010 ed

Don't use fseeko() to obtain the file offset.

I was a bit confused with lseek(), which returns the new offset. We
should ftello() to obtain it using stdio.


202275 14-Jan-2010 ed

Add two changes that should have gone into commit r202274.

Phase out ttyslot(3).

The ttyslot() function was originally part for SUSv1, marked LEGACY in
SUSv2 and removed later on. This function only makes sense when using
utmp(5), because it was used to determine the offset of the record for
the controlling TTY. It makes little sense to keep it here, because the
new utmpx file format doesn't index based on TTY slots.


202274 14-Jan-2010 ed

Phase out ttyslot(3).

The ttyslot() function was originally part for SUSv1, marked LEGACY in
SUSv2 and removed later on. This function only makes sense when using
utmp(5), because it was used to determine the offset of the record for
the controlling TTY. It makes little sense to keep it here, because the
new utmpx file format doesn't index based on TTY slots.


202188 13-Jan-2010 ed

Implement <utmpx.h>.

The utmpx interface is the standardized interface of the user accounting
database. The standard only defines a subset of the functions that were
present in System V-like systems.

I'd like to highlight some of the traits my implementation has:

- The standard allows the on-disk format to be different than the
in-memory representation (struct utmpx). Most operating systems don't
do this, but we do. This allows us to keep our ABI more stable, while
giving us the opportunity to modify the on-disk format. It also allows
us to use a common file format across different architectures (i.e.
byte ordering).

- Our implementation of pututxline() also updates wtmp and lastlog (now
called utx.log and utx.lastlogin). This means the databases are more
likely to be in sync.

- Care must be taken that our implementation discard any fields that are
not applicable. For example, our DEAD_PROCESS records do not hold a
TTY name. Just a time stamp, a record identifier and a process
identifier. It also guarantees that strings (ut_host, ut_line and
ut_user) are null terminated. ut_id is obviously not null terminated,
because it's not a string.

- The API and its behaviour should be conformant to POSIX, but there may
be things that slightly deviate from the standard. This implementation
uses separate file descriptors when writing to the log files. It also
doesn't use getutxid() to search for a field to overwrite. It uses an
allocation strategy similar to getutxid(), but prevents DEAD_PROCESS
records from accumulating.

Make sure libulog doesn't overwrite the manpages shipped with our C
library. Also keep the symbol list in Symbol.map sorted.

I'll bump __FreeBSD_version later this evening. I first want to convert
everything to <utmpx.h> and get rid of <utmp.h>.


202185 13-Jan-2010 davidxu

Return SEM_FAILED instead of NULL, though there are same, but the
SEM_FAILED is more suitable name.
In function, sem_close(), always set errno on error.


202133 12-Jan-2010 davidxu

Update manuals of sem_open and sem_init.

Submitted by: ru


201884 09-Jan-2010 davidxu

Update manual for sem_init and sem_open, restrictions of shared semaphore
and 14 characters in name length no longer exist.

Reviewed by: deischen@


201750 07-Jan-2010 trasz

Remove BUGS section that no longer applies after recent changes to semaphore
code.

OK-ed by: davidxu


201715 07-Jan-2010 davidxu

Don't forget to use fourth argument if O_CREAT is set in argument oflag.
The fourth specifies initial value for the semaphore.


201604 05-Jan-2010 kib

Do not rely on behaviour undefined by ANSI C, use thunks to adapt
alphasort-like interface to the comparision function required by
qsort() and qsort_r().

For opendir() thunk and alphasort(), comment on why we deviated from
POSIX by using strcmp() instead of strcoll().

Requested and reviewed by: bde
MFC after: 2 weeks


201561 05-Jan-2010 davidxu

More cleanup, remove _libc prefix because libthr no longer has stubs
referencing them.


201555 05-Jan-2010 davidxu

forgot to remove SYM_FBP10. ;-)


201553 05-Jan-2010 davidxu

Remove unused macros.


201547 05-Jan-2010 davidxu

Don't check has_waiters twice, inline some small functions.
performance result on my machine:
mutex Elapsed: 902115 us; per iteration: 90 ns.
semaphore Elapsed: 958780 us; per iteration: 95 ns.


201546 05-Jan-2010 davidxu

Use umtx to implement process sharable semaphore, to make this work,
now type sema_t is a structure which can be put in a shared memory area,
and multiple processes can operate it concurrently.
User can either use mmap(MAP_SHARED) + sem_init(pshared=1) or use sem_open()
to initialize a shared semaphore.
Named semaphore uses file system and is located in /tmp directory, and its
file name is prefixed with 'SEMD', so now it is chroot or jail friendly.
In simplist cases, both for named and un-named semaphore, userland code
does not have to enter kernel to reduce/increase semaphore's count.
The semaphore is designed to be crash-safe, it means even if an application
is crashed in the middle of operating semaphore, the semaphore state is
still safely recovered by later use, there is no waiter counter maintained
by userland code.
The main semaphore code is in libc and libthr only has some necessary stubs,
this makes it possible that a non-threaded application can use semaphore
without linking to thread library.
Old semaphore implementation is kept libc to maintain binary compatibility.
The kernel ksem API is no longer used in the new implemenation.

Discussed on: threads@


201512 04-Jan-2010 kib

Modernize scandir(3) and alphasort(3) interfaces according to the IEEE
Std 1003.1-2008. Both Linux and Solaris conforms to the new definitions,
so we better follow too (older glibc used old BSDish alphasort prototype
and corresponding type of the comparision function for scandir). While
there, change the definitions of the functions to ANSI C and fix several
style issues nearby.

Remove requirement for "sys/types.h" include for functions from manpage.

POSIX also requires that alphasort(3) sorts as if strcoll(3) was used,
but leave the strcmp(3) call in the function for now.

Adapt in-tree callers of scandir(3) to new declaration. The fact that
select_sections() from catman(1) could modify supplied struct dirent is
a bug.

PR: standards/142255
MFC after: 2 weeks


201201 29-Dec-2009 kib

Document CLOCK_SECOND, add cross-reference from time(3) to clock_gettime(2).

Based on submission by: pluknet gmail com
MFC after: 3 days


201194 29-Dec-2009 kib

Use clock_gettime(CLOCK_SECOND) instead of gettimeofday(2) for
implementation of time(3). CLOCK_SECOND is much faster.

No objections from: phk
Submitted by: Valentin Nechayev <netch segfault kiev ua>
MFC after: 1 week


201145 28-Dec-2009 antoine

(S)LIST_HEAD_INITIALIZER takes a (S)LIST_HEAD as an argument.
Fix some wrong usages.
Note: this does not affect generated binaries as this argument is not used.

PR: 137213
Submitted by: Eygene Ryabinkin (initial version)
MFC after: 1 month


200274 08-Dec-2009 jilles

sem_init(3): document process shared semaphores and their restrictions


200150 05-Dec-2009 ed

Fix many "function declaration isn't a prototype" warnings in libc.

I've only fixed code that seems to be written by `us'. There are still
many warnings like this present in resolv/, rpc/, stdtime/ and yp/.


200142 05-Dec-2009 ed

Don't let the C library depend on <utmp.h>.

The maximum length of a username has nothing to do with the size of the
username in the utmp files. Use MAXLOGNAME, which is defined as 17
(UT_USERSIZE + 1).


200136 05-Dec-2009 ed

Remove warnings from exec.c.

The entries in the argv array are not const themselves, but sometimes we
want to fill in const values. Just make the array const and use
__DECONST() to make it const for the execve()-call itself.

Also convert the only K&R prototype to ANSI.


200134 05-Dec-2009 ed

Use ANSI C prototypes inside termios.

While there, add a missing __unused to hide a warning in tcsetbreak().


200133 05-Dec-2009 ed

Remove (hidden) warning about missing prototypes for fdevname(3).


199862 27-Nov-2009 ed

Properly use the envp argument in execvPe().

execvPe() is called by _execvpe(), which we added to implement
posix_spawnp(). We just took execvP() and added the envp argument.
Unfortunately we forgot to change the implementation to use envp over
environ.

This fixes the following piece of code:

| char * const arg[2] = { "env", NULL };
| char * const env[2] = { "FOO=BAR", NULL };
| posix_spawnp(NULL, "/usr/bin/env", NULL, NULL, arg, env);

MFC after: 2 weeks


199844 26-Nov-2009 jh

Reset path name back to original correctly in fts_build() when
FTS_NOCHDIR option is used. fts_build() could strip a trailing slash
from path name in post-order visit if a path pointing to an empty
directory was given for fts_open().

PR: bin/133907, kern/134513
Reviewed by: das
Approved by: trasz (mentor)
MFC after: 1 month


199843 26-Nov-2009 jh

Clarify that the value of the fts_info field is different in post-order.

Discussed with: das
Approved by: trasz (mentor)
MFC after: 1 week


199784 25-Nov-2009 wollman

Eliminate more dead stores.

Found by: Clang static analyzer
MFC after: 7 days


199614 20-Nov-2009 jhb

Revert the previous change to pthread_once() stub in libc. It is actually
a feature that libstdc++ depends on to simulate the behavior of libc's
internal '__isthreaded' variable. One benefit of this is that _libc_once()
is now private to _once_stub.c.

Requested by: kan


199606 20-Nov-2009 jhb

Add an internal _once() method. This works identical to pthread_once(3)
with the additional property that it is safe for routines in libc to use
in both single-threaded and multi-threaded processes. Multi-threaded
processes use the pthread_once() implementation from the threading library
while single-threaded processes use a simplified "stub" version internal
to libc. The libc stub-version of pthread_once() now also uses the
simplified "stub" version as well instead of being a nop.

Reviewed by: deischen, Matthew Fleming @ Isilon
Suggested by: alc
MFC after: 1 week


199405 17-Nov-2009 obrien

Catch up with r130332 which changed the default timezone from GMT to UTC.
Otherwise the tzload() (when called by gmtload()) fails to locate the UTC
file and loads the posixrules.


199046 08-Nov-2009 brueffer

Fix a copy+paste error by checking the correct variable against MM_NULLACT.

PR: 140386
Submitted by: soulcatcher <soulcatcher13@gmail.com
MFC after: 1 week


198788 02-Nov-2009 brueffer

Use our canonical .Dd format.

Submitted by: Ulrich Spoerlein


198538 28-Oct-2009 kib

Move pselect(3) man page to section 2.

Noted by: jhb
MFC after: 1 month


198509 27-Oct-2009 kib

Commit libc files missed in r198508


198508 27-Oct-2009 kib

Current pselect(3) is implemented in usermode and thus vulnerable to
well-known race condition, which elimination was the reason for the
function appearance in first place. If sigmask supplied as argument to
pselect() enables a signal, the signal might be delivered before thread
called select(2), causing lost wakeup. Reimplement pselect() in kernel,
making change of sigmask and sleep atomic.

Since signal shall be delivered to the usermode, but sigmask restored,
set TDP_OLDMASK and save old mask in td_oldsigmask. The TDP_OLDMASK
should be cleared by ast() in case signal was not gelivered during
syscall execution.

Reviewed by: davidxu
Tested by: pho
MFC after: 1 month


198406 23-Oct-2009 jilles

wordexp(3): fix some bugs with signals and long outputs
* retry various system calls on EINTR
* retry the rest after a short read (common if there is more than about 1K
of output)
* block SIGCHLD like system(3) does (note that this does not and cannot
work fully in threaded programs, they will need to be careful with wait
functions)

PR: 90580
MFC after: 1 month


198053 13-Oct-2009 jilles

Make getcwd(3) faster, simpler and more compliant using *at syscalls.

It is no longer necessary to construct long paths consisting of repeated
"../" which may be slow to process and may exceed PATH_MAX.


197841 07-Oct-2009 rwatson

Add a new errno, ENOTCAPABLE, to be returned when a process requests an
operation on a file descriptor that is not authorized by the descriptor's
capability flags.

MFC after: 1 month
Sponsored by: Google


197804 06-Oct-2009 rwatson

Add basename_r(3) to complement basename(3). basename_r(3) which accepts
a caller-allocated buffer of at least MAXPATHLEN, rather than using a
global buffer.

MFC after: 1 month
Sponsored by: Google


197793 05-Oct-2009 delphij

fts_open() requires that the list passed as argument to contain at least
one path. When the list is empty (contain only a NULL pointer), return
EINVAL instead of pretending to succeed, which will cause a NULL pointer
deference in a later fts_read() call.

Noticed by: Christoph Mallon (via rdivacky@)
MFC after: 2 weeks


197681 01-Oct-2009 marcus

Correct the pthread stub prototype for pthread_mutexattr_settype to allow for
the type argument. This is known to fix some pthread_mutexattr_settype()
invocations, especially when it comes to pulseaudio.

Approved by: kib
deischen (threads)
MFC after: 3 days


197394 21-Sep-2009 alc

Correct a section name; specifically, "AUTHOR" should be "AUTHORS". [1]

Turn the "AUTHORS" section into a full sentence.

Pointed out by: ru [1]


197331 19-Sep-2009 alc

Add getpagesizes(3). This functions either the number of supported page
sizes or some number of the sizes themselves. It is functionally
compatible with a function by the same name under Solaris.

Reviewed by: jhb


195827 22-Jul-2009 kensmith

It is believed the last subsystem that limited ID sizes to something
other than the current system-wide size (32-bits) has been updated so
for now just cautiously turn the check off. While here fix the check
for IDs being too large which doesn't work due to type mis-matches.

Reviewed by: jhb (previous version)
Approved by: re (kib)
MFC after: 1 month (type mis-match fixes only)


195745 17-Jul-2009 kib

Implement RTLD_NOLOAD flag for dlopen(3).

Requested and tested by: jkim
Reviewed by: kan
Approved by: re (kensmith)


195656 13-Jul-2009 trasz

Move msg{snd,recv,get,ctl} manual pages from section 3 to 2.

Approved by: re (kib)


195172 29-Jun-2009 kib

Make the structure definitions in the man pages match the real code, and
remove no longer valid caution.

Approved by: re (kensmith)


194910 24-Jun-2009 jhb

Change the ABI of some of the structures used by the SYSV IPC API:
- The uid/cuid members of struct ipc_perm are now uid_t instead of unsigned
short.
- The gid/cgid members of struct ipc_perm are now gid_t instead of unsigned
short.
- The mode member of struct ipc_perm is now mode_t instead of unsigned short
(this is merely a style bug).
- The rather dubious padding fields for ABI compat with SV/I386 have been
removed from struct msqid_ds and struct semid_ds.
- The shm_segsz member of struct shmid_ds is now a size_t instead of an
int. This removes the need for the shm_bsegsz member in struct
shmid_kernel and should allow for complete support of SYSV SHM regions
>= 2GB.
- The shm_nattch member of struct shmid_ds is now an int instead of a
short.
- The shm_internal member of struct shmid_ds is now gone. The internal
VM object pointer for SHM regions has been moved into struct
shmid_kernel.
- The existing __semctl(), msgctl(), and shmctl() system call entries are
now marked COMPAT7 and new versions of those system calls which support
the new ABI are now present.
- The new system calls are assigned to the FBSD-1.1 version in libc. The
FBSD-1.0 symbols in libc now refer to the old COMPAT7 system calls.
- A simplistic framework for tagging system calls with compatibility
symbol versions has been added to libc. Version tags are added to
system calls by adding an appropriate __sym_compat() entry to
src/lib/libc/incldue/compat.h. [1]

PR: kern/16195 kern/113218 bin/129855
Reviewed by: arch@, rwatson
Discussed with: kan, kib [1]


194800 24-Jun-2009 delphij

Use const instead of __const, and merge the license change from NetBSD.

Obtained from: NetBSD


194494 19-Jun-2009 brooks

In preparation for raising NGROUPS and NGROUPS_MAX, change base
system callers of getgroups(), getgrouplist(), and setgroups() to
allocate buffers dynamically. Specifically, allocate a buffer of size
sysconf(_SC_NGROUPS_MAX)+1 (+2 in a few cases to allow for overflow).

This (or similar gymnastics) is required for the code to actually follow
the POSIX.1-2008 specification where {NGROUPS_MAX} may differ at runtime
and where getgroups may return {NGROUPS_MAX}+1 results on systems like
FreeBSD which include the primary group.

In id(1), don't pointlessly add the primary group to the list of all
groups, it is always the first result from getgroups(). In principle
the old code was more portable, but this was only done in one of the two
places where getgroups() was called to the overall effect was pointless.

Document the actual POSIX requirements in the getgroups(2) and
setgroups(2) manpages. We do not yet support a dynamic NGROUPS, but we
may in the future.

MFC after: 2 weeks


192926 27-May-2009 ed

Rename the queue macros I introduced last year.

Last year I added SLIST_REMOVE_NEXT and STAILQ_REMOVE_NEXT, to remove
entries behind an element in the list, using O(1) time. I recently
discovered NetBSD also has a similar macro, called SLIST_REMOVE_AFTER.
In my opinion this approach is a lot better:

- It doesn't have the unused first argument of the list pointer. I added
this, mainly because OpenBSD also had it.

- The _AFTER suffix makes a lot more sense, because it is related to
SLIST_INSERT_AFTER. _NEXT is only used to iterate through the list.

The reason why I want to rename this now, is to make sure we don't
release a major version with the badly named macros.


192129 14-May-2009 delphij

As the comment says, close() frees the variable, record. So we obtain
the length by evaluating the value from the copy, cbuf instead. This
fixes a crash caused by previous commit (use-after-free)

Submitted by: Dimitry Andric <dimitry andric com>
Pointy hat to: delphij


191938 09-May-2009 ed

TTYs don't necessarily use /dev/ttyxx.

Submitted by: csjp


191882 07-May-2009 ed

Add tcsetsid(3).

The entire world seems to use the non-standard TIOCSCTTY ioctl to make a
TTY a controlling terminal of a session. Even though tcsetsid(3) is also
non-standard, I think it's a lot better to use in our own source code,
mainly because it's similar to tcsetpgrp(), tcgetpgrp() and tcgetsid().

I stole the idea from QNX. They do it the other way around; their
TIOCSCTTY is just a wrapper around tcsetsid(). tcsetsid() then calls
into an IPC framework.


191779 04-May-2009 ed

Fix whitespace and sorting in Symbol.map.


190673 03-Apr-2009 kib

Allow the NULL, RTLD_SELF and RTLD_NEXT handles to work with dlfunc(3).
dlfunc() called dlsym() to do the work, and dlsym() determines the dso
that originating the call by the return address. Due to this, dlfunc()
operated as if the caller is always the libc.

To fix this, move the dlfunc() to rtld, where it can call the internal
implementation of dlsym, and still correctly fetch return address.
Provide usual weak stub for the symbol from libc for static binaries.
dlfunc is put to FBSD_1.0 symver namespace in the ld.so export to
override dlfunc@FBSD_1.0 weak symbol, exported by libc.

Reported, analyzed and tested by: Tijl Coosemans <tijl ulyssis org>
PR: standards/133339
Reviewed by: kan


190661 02-Apr-2009 delphij

Properly handle malloc() failures.

PR: bin/83338


190641 02-Apr-2009 jhb

Properly update the shm_open/shm_unlink symbol versioning metadata after
these functions were moved into the kernel:
- Move the version entries from gen/ to sys/. Since the ABI of the actual
routines did not change, I'm still exporting them as FBSD 1.0 on purpose.
- Add FBSD-private versions for the _ and __sys_ variants.


190624 01-Apr-2009 kib

Document RTLD_NODELETE, -z nodelete and -z origin support.


189348 04-Mar-2009 das

Fix a file descriptor leak in fts_child().

Obtained from: NetBSD


189328 04-Mar-2009 delphij

Sync license changes.

Obtained from: NetBSD


188536 12-Feb-2009 ed

Properly invalidate highest pts number when calling setttyent().

When calling setttyent() after calling endttyent(), pts_valid will never
be set to 1, because the readdir()-loop will likely never vind a pts
that has a higher number than before.

Simplify the code by removing pts_valid. We'll just set maxpts to -1
when we don't have a valid count yet.


188534 12-Feb-2009 ed

Make ttyslot(3) work with pts(4) devices.

It seems ttyslot() calls rindex(), to strip the device name to the last
slash, but this is obviously invalid. /dev/pts/0 should be stripped
until pts/0. Because /etc/ttys only supports TTY names in /dev/, just
strip this piece of the pathname.


188497 11-Feb-2009 ed

Add two new routines: fdevname() and fdevname_r().

A more elegant way of obtaining a name of a character device by its file
descriptor on FreeBSD, is to use the FIODGNAME ioctl. Because a valid
file descriptor implies a file descriptor is visible in /dev, it will
always resolve a valid device name.

I'm adding a more friendly wrapper for this ioctl, called fdevname(). It
is a lot easier to use than devname() and also has better error
handling. When a device name cannot be resolved, it will just return
NULL instead of a generated device name that makes no sense.

Discussed with: kib


187824 28-Jan-2009 trhodes

Update the description of KERN_PROC.

PR: 100242
Reviewed by: jhb


185519 01-Dec-2008 keramida

The times(3) function returns the number of CLK_TCKs since the
startup time of FreeBSD, not since the UNIX Epoch.

PR: docs/122359
Submitted by: Viktor &#352;tujber
MFC after: 1 week


185369 27-Nov-2008 kib

Add two rtld exported symbols, _rtld_atfork_pre and _rtld_atfork_post.
Threading library calls _pre before the fork, allowing the rtld to
lock itself to ensure that other threads of the process are out of
dynamic linker. _post releases the locks.

This allows the rtld to have consistent state in the child. Although
child may legitimately call only async-safe functions, the call may
need plt relocation resolution, and this requires working rtld.

Reported and debugging help by: rink
Reviewed by: kan, davidxu
MFC after: 1 month (anyway, not before 7.1 is out)


185029 17-Nov-2008 pjd

Update ZFS from version 6 to 13 and bring some FreeBSD-specific changes.

This bring huge amount of changes, I'll enumerate only user-visible changes:

- Delegated Administration

Allows regular users to perform ZFS operations, like file system
creation, snapshot creation, etc.

- L2ARC

Level 2 cache for ZFS - allows to use additional disks for cache.
Huge performance improvements mostly for random read of mostly
static content.

- slog

Allow to use additional disks for ZFS Intent Log to speed up
operations like fsync(2).

- vfs.zfs.super_owner

Allows regular users to perform privileged operations on files stored
on ZFS file systems owned by him. Very careful with this one.

- chflags(2)

Not all the flags are supported. This still needs work.

- ZFSBoot

Support to boot off of ZFS pool. Not finished, AFAIK.

Submitted by: dfr

- Snapshot properties

- New failure modes

Before if write requested failed, system paniced. Now one
can select from one of three failure modes:
- panic - panic on write error
- wait - wait for disk to reappear
- continue - serve read requests if possible, block write requests

- Refquota, refreservation properties

Just quota and reservation properties, but don't count space consumed
by children file systems, clones and snapshots.

- Sparse volumes

ZVOLs that don't reserve space in the pool.

- External attributes

Compatible with extattr(2).

- NFSv4-ACLs

Not sure about the status, might not be complete yet.

Submitted by: trasz

- Creation-time properties

- Regression tests for zpool(8) command.

Obtained from: OpenSolaris


184578 03-Nov-2008 delphij

Sync with OpenBSD's dirname(3) - license change, avoid strcpy() over
string constant, use memcpy() instead of strncpy() and improve code
readibility. No functional change.


184511 31-Oct-2008 rwatson

In example use of err(3) and errx(3), use sysexits(3) constants.

MFC after: 3 days
Submitted by: Bruce Cran <bruce at cran dot org dot uk>


184203 23-Oct-2008 rdivacky

Fix a typo.

Approved by: kib (mentor)


184185 22-Oct-2008 kib

Fix a typo. q is already a pointer.

Reported by: ache
Pointy hat to: kib


184177 22-Oct-2008 kib

Remove doubtful structure definition with variable array members.
I believe this is not a valid C99 construct. Use directly calculated
offsets into the supplied buffer, using specified members length,
to fill appropriate structure.

Either use sysctl, or copy the value of the UNAME_x environment
variable, instead of unconditionally doing sysctl, and then
overriding a returned value with user-specified one.

Noted and tested by: rdivacky


183495 30-Sep-2008 kib

Add unistd.h to the getosreldate(3) manpage.
Update referenced example to include unistd.h per manpage.
Update example to be more style(9)-ish, silence warnings and add
FreeBSD id to the source file.


183217 20-Sep-2008 rodrigc

<osreldate.h> does not have a forward declration of getosreldate(), so
remove it from this man page.

MFC after: 3 days


182886 09-Sep-2008 ache

Return two fixes from previous backout which does not require
review by secteam@ for the reasons mentioned below.

1) Rename /dev/urandom to /dev/random since urandom marked as
XXX Deprecated
alias in /sys/dev/random/randomdev.c
(this is our naming convention and no review by secteam@ required)

2) Set rs_stired flag after forced initialization to prevent
double stearing.
(this is already in OpenBSD, i.e. they don't have double stearing.
It means that this change matches their code path and no additional
secteam@ review required)

Submitted by: Thorsten Glaser <tg@mirbsd.de> (2)


181280 04-Aug-2008 cperciva

Set "max" to a reasonable value if BLOCKSIZE has a bogus unit. Prior
to this commit, "env BLOCKSIZE=4X df" prints not only "4X: unknown
blocksize" as expected, but sometimes also "maximum blocksize is 1G"
and "minimum blocksize is 512" depending on what happened to be on
the stack.

Found by: LLVM/Clang Static Checker


181261 03-Aug-2008 ache

Restored from previous backing out (because that is OpenBSD way, so
assumed to be reviewd by them):
Stir directly from the kernel PRNG, without taking less random pid & time
bytes too (when it is possible).

The difference with OpenBSD code is that they have KERN_ARND sysctl for
that task, while we need to read /dev/random


181154 02-Aug-2008 das

Teach fmtcheck() about wint_t, intmax_t, char *, intmax_t *, and
wide string arguments.

Also simplify the code that handles length modifiers and make it
more conservative. For instance, be explicit about the modifiers
allowed for %d, rather than assuming that anything other than L,
q, t, or z implies an int argument.


180963 29-Jul-2008 ed

Convert popen()'s `pidlist' to a SLIST, for consistency.

I guess the original author of the popen() code didn't want to use our
<sys/queue.h> macro's, because the single linked list macro's didn't
offer O(1) deletion. Because I introduced SLIST_REMOVE_NEXT() some time
ago, we can now use the macro's here.

By converting the code to an SLIST, it is more consistent with other
parts of the C library and the operating system.

Reviewed by: csjp
Approved by: philip (mentor, implicit)


180876 28-Jul-2008 ed

Fix the email address formats in some posix_spawn(3) manpages.

It seems I made a small bug when writing some of the posix_spawn(3)
manpages. Remove the redundant "Ed Schouten", which broke the AUTHORS
section.

Approved by: philip (mentor, implicit)


180867 28-Jul-2008 davidxu

Add manual pages for posix_spawn() functions.

PR: standards/122051


180804 25-Jul-2008 ache

Per rwatson's request:
"If you don't get a review within a day or two, I would firmly recommend
backing out the changes"

back out all my changes, i.e. not comes from merging from OpenBSD as
unreviewed by secteam@ yet.
(OpenBSD changes stays in assumption they are reviewd by OpenBSD)

Yes, it means some old bugs returned, like not setted rs_stired = 1 in
arc4random_stir(3) causing double stirring.


180713 22-Jul-2008 ache

Fixes based on bde's feedback.
1) Unindent and sort variables.
2) Indent struct members.
3) Remove _packed, use guaranteed >128 bytes size and only first 128
bytes from the structure.
4) Reword comment.

Obtained from: bde


180700 22-Jul-2008 ache

Change /dev/urandom to /dev/random since urandom marked as
XXX Deprecated
alias in /sys/dev/random/randomdev.c


180690 22-Jul-2008 ache

In arc4random_uniform() detect simple "power of two" case and
return just (arc4random() % upper_bound)


180688 22-Jul-2008 ache

Add arc4random_uniform() function (to avoid "modulo bias")

Obtained from: OpenBSD


180687 22-Jul-2008 ache

Increase initially dropped bytes from 512 to 768 (768 is also
suggested in the Ilya Mironov's article). 768 taken from another
research where it treats as default for RC4-drop(768):
http://www.users.zetnet.co.uk/hopwood/crypto/scan/cs.html#RC4-drop

Minor style tweak.


180677 21-Jul-2008 jhb

Add feature_present(3) to the FBSD 1.1 symbol map.


180676 21-Jul-2008 ache

1) Use __packed attr on rdat structure to make it exact 128 bytes.
2) Use gettimeofday() and getpid() only if reading from /dev/urandom
fails or impossible.
3) Discard N bytes on very first initialization only (i.e. don't
discard on re-stir).
4) Reduce N from 1024 to 512 as really suggested in the
"(Not So) Random Shuffles of RC4" paper:
http://research.microsoft.com/users/mironov/papers/rc4full.pdf


180672 21-Jul-2008 ache

1) Update copyright notice.
2) Eliminate "struct arc4_stream *as" arg since only single arg is
possible.
3) Set rs.j = rs.i after arc4random key schedule to be more like arc4
stream cipher.

Obtained from: OpenBSD


180665 21-Jul-2008 ache

Add arc4random_buf to FBSD_1.1 space


180659 21-Jul-2008 ache

Add arc4random_buf.3 to MLINKS


180657 21-Jul-2008 ache

Implement arc4random_buf() function

Obtained from: OpenBSD


180656 21-Jul-2008 ache

Decrease arc4_count only when needed and with proper bytes amount.

Obtained from: OpenBSD


180655 21-Jul-2008 ache

1) Set stired flag after forced initialization.
2) Increase arc4_count to the limit OpenBSD use.

Submitted by: Thorsten Glaser <tg@mirbsd.de> (1)
Obtained from: OpenBSD (2)


180578 17-Jul-2008 simon

Make it more clear what it means that SA_RESTART is set for signal
handlers added with signal(3).

Submitted by: gnn (slightly modified by me)
MFC after: 1 week


180021 26-Jun-2008 mtm

Gcc barfs in glob.c when run with -O3. To fix this make g_strchr() work on
and return (const Char *) pointers instead of just (Char *) and get rid of
all the type casting.

PR: kern/124334


179947 23-Jun-2008 ed

Turn execvpe() into an internal libc routine.

Adding exevpe() has caused some ports to break. Even though execvpe() is
a useful routine, it does not conform to any standards.

This patch is a little bit different from the patch sent to the mailing
list. I forgot to remove execvpe from the Symbol.map (which does not
seem to miscompile libc, though).

Reviewed by: davidxu
Approved by: philip


179866 19-Jun-2008 davidxu

Process spawn attributes in POSIX document order.


179841 17-Jun-2008 davidxu

Style fix.


179840 17-Jun-2008 ed

Change my email address to the one from the FreeBSD project.

Approved by: philip (mentor, implicit), davidxu


179838 17-Jun-2008 davidxu

Add POSIX routines called posix_spawn() and posix_spawnp(), which
can be used as replacements for exec/fork in a lot of cases. This
change also added execvpe() which allows environment variable
PATH to be used for searching executable file, it is used for
implementing posix_spawnp().

PR: standards/122051


178772 05-May-2008 kib

Do not read away the target directory entry when encountering deleted
files after a seekdir().

The seekdir shall set the position for the next readdir operation.
When the _readdir_unlocked() encounters deleted entry, dd_loc is
already advanced. Continuing the loop leads to premature read of
the target entry.

Submitted by: Marc Balmer <mbalmer at openbsd org>
Obtained from: OpenBSD
MFC after: 2 weeks


178684 29-Apr-2008 gonzo

o Add MIPS to the list of architectures with defined TLS_TCB_ALIGN
o Stick with TLS Variant II for MIPS for the moment.

Approved by: imp


178256 16-Apr-2008 delphij

Implement fdopendir(3) by splitting __opendir2() into two parts, the upper part
deals with the usual __opendir2() calls, and the rest part with an interface
translator to expose fdopendir(3) functionality. Manual page was obtained from
kib@'s work for *at(2) system calls.


178253 16-Apr-2008 delphij

Style fixes to opendir.c:
- Use /*- for copyright block;
- ANSIfy.


178219 15-Apr-2008 davidxu

Implement POSIX function tcgetsid() which returns session id.

PR: stand/107561


177893 03-Apr-2008 imp

Minor style(9) nit: move to using ANSI definition of functions.


177882 03-Apr-2008 ru

Fix descriptions of "struct msqid_ds and "struct ipc_perm" to match
harsh reality.


177710 29-Mar-2008 das

Document modff() and modfl(). Technically, modff() and modfl()
live in libm, while modf() lives in libc due to historical
mistakes. I'm claiming in the manpage that they all live in libm,
since programmers should not rely on the mistake.


177652 26-Mar-2008 ru

Removed no longer existing CTL_MACHDEP defines.

Inspired by: phk


177633 26-Mar-2008 dfr

Add the new kernel-mode NFS Lock Manager. To use it instead of the
user-mode lock manager, build a kernel with the NFSLOCKD option and
add '-k' to 'rpc_lockd_flags' in rc.conf.

Highlights include:

* Thread-safe kernel RPC client - many threads can use the same RPC
client handle safely with replies being de-multiplexed at the socket
upcall (typically driven directly by the NIC interrupt) and handed
off to whichever thread matches the reply. For UDP sockets, many RPC
clients can share the same socket. This allows the use of a single
privileged UDP port number to talk to an arbitrary number of remote
hosts.

* Single-threaded kernel RPC server. Adding support for multi-threaded
server would be relatively straightforward and would follow
approximately the Solaris KPI. A single thread should be sufficient
for the NLM since it should rarely block in normal operation.

* Kernel mode NLM server supporting cancel requests and granted
callbacks. I've tested the NLM server reasonably extensively - it
passes both my own tests and the NFS Connectathon locking tests
running on Solaris, Mac OS X and Ubuntu Linux.

* Userland NLM client supported. While the NLM server doesn't have
support for the local NFS client's locking needs, it does have to
field async replies and granted callbacks from remote NLMs that the
local client has contacted. We relay these replies to the userland
rpc.lockd over a local domain RPC socket.

* Robust deadlock detection for the local lock manager. In particular
it will detect deadlocks caused by a lock request that covers more
than one blocking request. As required by the NLM protocol, all
deadlock detection happens synchronously - a user is guaranteed that
if a lock request isn't rejected immediately, the lock will
eventually be granted. The old system allowed for a 'deferred
deadlock' condition where a blocked lock request could wake up and
find that some other deadlock-causing lock owner had beaten them to
the lock.

* Since both local and remote locks are managed by the same kernel
locking code, local and remote processes can safely use file locks
for mutual exclusion. Local processes have no fairness advantage
compared to remote processes when contending to lock a region that
has just been unlocked - the local lock manager enforces a strict
first-come first-served model for both local and remote lockers.

Sponsored by: Isilon Systems
PR: 95247 107555 115524 116679
MFC after: 2 weeks


177273 16-Mar-2008 das

scandir(3) previously used st_size to obtain an initial estimate
of the array length needed to store all the directory entries.
Although BSD has historically guaranteed that st_size is the size
of the directory file, POSIX does not, and more to the point, some
recent filesystems such as ZFS use st_size to mean something else.

The fix is to not stat the directory at all, set the initial
array size to 32 entries, and realloc it in powers of 2 if that
proves insufficient.

PR: 113668


177141 13-Mar-2008 ru

Remove trailing whitespace.


177140 13-Mar-2008 ru

Add missing section number.


177133 13-Mar-2008 davidxu

In file sem_timewait.3, remove reference to SYSV semphore in SEE ALSO
section, sync it with sem_wait.3.


177078 12-Mar-2008 davidxu

Add missing comma.


177077 12-Mar-2008 davidxu

Add manual for function sem_timedwait().

Reviewed by: ru, deischen


176618 27-Feb-2008 wollman

stdio is currently limited to file descriptors not greater than
{SHRT_MAX}, so {STREAM_MAX} should be no greater than that. (This
does not exactly meet the letter of POSIX but comes reasonably close
to it in spirit.)

MFC after: 14 days


175688 26-Jan-2008 yar

Our fts(3) API, as inherited from 4.4BSD, suffers from integer
fields in FTS and FTSENT structs being too narrow. In addition,
the narrow types creep from there into fts.c. As a result, fts(3)
consumers, e.g., find(1) or rm(1), can't handle file trees an ordinary
user can create, which can have security implications.

To fix the historic implementation of fts(3), OpenBSD and NetBSD
have already changed <fts.h> in somewhat incompatible ways, so we
are free to do so, too. This change is a superset of changes from
the other BSDs with a few more improvements. It doesn't touch
fts(3) functionality; it just extends integer types used by it to
match modern reality and the C standard.

Here are its points:

o For C object sizes, use size_t unless it's 100% certain that
the object will be really small. (Note that fts(3) can construct
pathnames _much_ longer than PATH_MAX for its consumers.)

o Avoid the short types because on modern platforms using them
results in larger and slower code. Change shorts to ints as
follows:

- For variables than count simple, limited things like states,
use plain vanilla `int' as it's the type of choice in C.

- For a limited number of bit flags use `unsigned' because signed
bit-wise operations are implementation-defined, i.e., unportable,
in C.

o For things that should be at least 64 bits wide, use long long
and not int64_t, as the latter is an optional type. See
FTSENT.fts_number aka FTS.fts_bignum. Extending fts_number `to
satisfy future needs' is pointless because there is fts_pointer,
which can be used to link to arbitrary data from an FTSENT.
However, there already are fts(3) consumers that require fts_number,
or fts_bignum, have at least 64 bits in it, so we must allow for them.

o For the tree depth, use `long'. This is a trade-off between making
this field too wide and allowing for 64-bit inode numbers and/or
chain-mounted filesystems. On the one hand, `long' is almost
enough for 32-bit filesystems on a 32-bit platform (our ino_t is
uint32_t now). On the other hand, platforms with a 64-bit (or
wider) `long' will be ready for 64-bit inode numbers, as well as
for several 32-bit filesystems mounted one under another. Note
that fts_level has to be signed because -1 is a magic value for it,
FTS_ROOTPARENTLEVEL.

o For the `nlinks' local var in fts_build(), use `long'. The logic
in fts_build() requires that `nlinks' be signed, but our nlink_t
currently is uint16_t. Therefore let's make the signed var wide
enough to be able to represent 2^16-1 in pure C99, and even 2^32-1
on a 64-bit platform. Perhaps the logic should be changed just
to use nlink_t, but it can be done later w/o breaking fts(3) ABI
any more because `nlinks' is just a local var.

This commit also inludes supporting stuff for the fts change:

o Preserve the old versions of fts(3) functions through libc symbol
versioning because the old versions appeared in all our former releases.

o Bump __FreeBSD_version just in case. There is a small chance that
some ill-written 3-rd party apps may fail to build or work correctly
if compiled after this change.

o Update the fts(3) manpage accordingly. In particular, remove
references to fts_bignum, which was a FreeBSD-specific hack to work
around the too narrow types of FTSENT members. Now fts_number is
at least 64 bits wide (long long) and fts_bignum is an undocumented
alias for fts_number kept around for compatibility reasons. According
to Google Code Search, the only big consumers of fts_bignum are in
our own source tree, so they can be fixed easily to use fts_number.

o Mention the change in src/UPDATING.

PR: bin/104458
Approved by: re (quite a while ago)
Discussed with: deischen (the symbol versioning part)
Reviewed by: -arch (mostly silence); das (generally OK, but we didn't
agree on some types used; assuming that no objections on
-arch let me to stick to my opinion)


175345 15-Jan-2008 das

In getttyent(3), if /etc/ttys doesn't end in a newline, don't
freak out and keep trying to expand the buffer until realloc()
fails.

PR: 114398


175220 10-Jan-2008 jhb

Add a feature_present(3) function which checks to see if a named kernel
feature is present by checking the kern.features sysctl MIB.

MFC after: 1 week


175164 08-Jan-2008 jhb

Add a new file descriptor type for IPC shared memory objects and use it to
implement shm_open(2) and shm_unlink(2) in the kernel:
- Each shared memory file descriptor is associated with a swap-backed vm
object which provides the backing store. Each descriptor starts off with
a size of zero, but the size can be altered via ftruncate(2). The shared
memory file descriptors also support fstat(2). read(2), write(2),
ioctl(2), select(2), poll(2), and kevent(2) are not supported on shared
memory file descriptors.
- shm_open(2) and shm_unlink(2) are now implemented as system calls that
manage shared memory file descriptors. The virtual namespace that maps
pathnames to shared memory file descriptors is implemented as a hash
table where the hash key is generated via the 32-bit Fowler/Noll/Vo hash
of the pathname.
- As an extension, the constant 'SHM_ANON' may be specified in place of the
path argument to shm_open(2). In this case, an unnamed shared memory
file descriptor will be created similar to the IPC_PRIVATE key for
shmget(2). Note that the shared memory object can still be shared among
processes by sharing the file descriptor via fork(2) or sendmsg(2), but
it is unnamed. This effectively serves to implement the getmemfd() idea
bandied about the lists several times over the years.
- The backing store for shared memory file descriptors are garbage
collected when they are not referenced by any open file descriptors or
the shm_open(2) virtual namespace.

Submitted by: dillon, peter (previous versions)
Submitted by: rwatson (I based this on his version)
Reviewed by: alc (suggested converting getmemfd() to shm_open())


174945 27-Dec-2007 jhb

Fix a typo in regards to the ENOENT error.

PR: docs/118929
Submitted by: mymtom of hotmail
MFC after: 3 days


174547 12-Dec-2007 bushman

Implementing 'fallback' nsswitch source. 'fallback' source is used
when particular function can't be found in nsswitch-module. For
example, getgrouplist(3) will use module-supplied 'getgroupmembership'
function (which can work in an optimal way for such source as LDAP) and
will fall back to the stanard iterate-through-all-groups implementation
otherwise.

PR: ports/114655
Submitted by: Michael Hanselmann <freebsd AT hansmi DOT ch>
Reviewed by: brooks (mentor)


174221 03-Dec-2007 des

Since jb@ fixed the type of dd_lock in <dirent.h>, these casts are no
longer required.


173986 27-Nov-2007 jasone

Add _pthread_mutex_init_calloc_cb to libc's map, for which malloc defines
a stub.


173757 19-Nov-2007 cognet

Change the casts from (pthread_mutex_t *) to (void *) to keep gcc quiet.
Anybody with a cleaner solution feel free to change it.


173182 30-Oct-2007 keramida

Remove extraneous .Ef request.

MFC after: 3 days


172699 16-Oct-2007 ru

VM_METER is long deprecated.


172698 16-Oct-2007 ru

Rescue parts of the sensorsd commit that are still relevant:

- HW_FLOATINGPOINT renamed to HW_FLOATINGPT.
- Documented HW_REALMEM.
- Sorted as per <sys/sysctl.h>.


172674 15-Oct-2007 netchild

Backout sensors framework.

Requested by: phk
Discussed on: cvs-all


172646 14-Oct-2007 ru

Fix mdoc in last commit.


172631 14-Oct-2007 netchild

Import OpenBSD's sysctl hardware sensors framework.

This commit includes the following core components:

* sample configuration file for sensorsd
* rc(8) script and glue code for sensorsd(8)
* sysctl(3) doc fixes for CTL_HW tree
* sysctl(3) documentation for hardware sensors
* sysctl(8) documentation for hardware sensors
* support for the sensor structure for sysctl(8)
* rc.conf(5) documentation for starting sensorsd(8)
* sensor_attach(9) et al documentation
* /sys/kern/kern_sensors.c
o sensor_attach(9) API for drivers to register ksensors
o sensor_task_register(9) API for the update task
o sysctl(3) glue code
o hw.sensors shadow tree for sysctl(8) internal magic
* <sys/sensors.h>
* HW_SENSORS definition for <sys/sysctl.h>
* sensors display for systat(1), including documentation
* sensorsd(8) and all applicable documentation

The userland part of the framework is entirely source-code
compatible with OpenBSD 4.1, 4.2 and -current as of today.

All sensor readings can be viewed with `sysctl hw.sensors`,
monitored in semi-realtime with `systat -sensors` and also
logged with `sensorsd`.

Submitted by: Constantine A. Murenin <cnst@FreeBSD.org>
Sponsored by: Google Summer of Code 2007 (GSoC2007/cnst-sensors)
Mentored by: syrinx
Tested by: many
OKed by: kensmith
Obtained from: OpenBSD (parts)


172359 28-Sep-2007 scf

Add fts_set_clientptr(3), fts_get_clientptr(3) and fts_get_stream(3) man
page links to fts(3).

Approved by: wes
Approved by: re (hrs)
MFC after: 5 days


171219 04-Jul-2007 peter

Change the C wrappers for mmap/lseek/pread/pwrite/truncate/ftruncate to
call the pad-less versions of the corresponding syscalls if the running
kernel supports it. Check kern.osreldate once per program and cache the
result to select the appropriate syscall. This maintains userland
compatability with kernel.old's from quite a while back.

Approved by: re (kensmith)


170154 31-May-2007 deischen

Some libc symbol map cleanups.

net: endhostdnsent is named _endhostdnsent and is
private to netdb family of functions.

posix1e: acl_size.c has been never compiled in,
so there's no "acl_size".

rpc: "getnetid" is a static function.

stdtime: "gtime" is #ifdef'ed out in the source.

some symbols are specific only to some architectures,
e.g., ___tls_get_addr is only defined on i386.

__htonl, __htons, __ntohl and __ntohs are no longer
functions, they are now (internal) defines in
<machine/endian.h>.

Submitted by: ru


169981 25-May-2007 delphij

ANSIfy function definitions, reduces diff against OpenBSD.


169092 29-Apr-2007 deischen

Use C comments since we now preprocess these files with CPP.


168718 14-Apr-2007 pjd

Cleanup sysconf(3) a bit. sysconf(3) assumes in some places it operates
on int, but in fact it should operate on long.
- Introduce 'lvalue' variable, which is long.
- Fix _SC_XOPEN_SHM for 64bit archs.
- Fix _SC_PHYS_PAGES for 64bit archs.
Reported by: simokawa
- Use lvalue for pathconf(3), as it returns long.
- Cast value explicitly to long on return.


168579 10-Apr-2007 ru

Expand the description of the host's UUID.

OK'ed by: pjd


168556 09-Apr-2007 kan

Clean-ip TLS symbol versions. [_]__tls_get_addr function is part of
the platform ABI and as such does not belong in FBSDprivate.

__libc_tls_* functions do not have to be visible to outside world
at all.


168551 09-Apr-2007 pjd

Document KERN_HOSTUUID.

Reminded by: ru


168398 05-Apr-2007 pjd

Bump date.


168396 05-Apr-2007 pjd

Add security.jail.mount_allowed sysctl, which allows to mount and
unmount jail-friendly file systems from within a jail.
Precisely it grants PRIV_VFS_MOUNT, PRIV_VFS_UNMOUNT and
PRIV_VFS_MOUNT_NONUSER privileges for a jailed super-user.
It is turned off by default.

A jail-friendly file system is a file system which driver registers
itself with VFCF_JAIL flag via VFS_SET(9) API.
The lsvfs(1) command can be used to see which file systems are
jail-friendly ones.

There currently no jail-friendly file systems, ZFS will be the first one.
In the future we may consider marking file systems like nullfs as
jail-friendly.

Reviewed by: rwatson


168316 03-Apr-2007 kan

Add entry for dl_iterate_phdr.


168314 03-Apr-2007 kan

Add stub for dl_iterate_phdr.


168001 28-Mar-2007 jasone

Change macro in order to refer to FreeBSD 7.0 instead of 7.0BSD.

Reported by: Michal Mertl <mime@traveller.cz>


167968 28-Mar-2007 jasone

Remove some stray roff formatting that caused incorrect rendering.


166995 25-Feb-2007 kientzle

Don't assert() the TLS allocation requested is big enough; just
fix the argument.

In particular, this is a step towards breaking crt1's dependence on stdio.


166652 11-Feb-2007 maxim

o s/cgetseq/cgetset/

Obtained from: DragonFly


166242 25-Jan-2007 peter

Remove getobjformat() from libc's symbol map. It probably should have been
in the private area anyway. Nothing in FreeBSD uses it any more anyway.


166239 25-Jan-2007 peter

Retire more remnants of a.out support, as threatened in 2002.

Laughed-at-by: kris


166134 20-Jan-2007 maxim

o Remove duplicate includes.

Obtained from: Slava Semushin via NetBSD


165968 12-Jan-2007 imp

Remove 3rd clause, renumber, ok per email


165903 09-Jan-2007 imp

Per Regents of the University of Calfornia letter, remove advertising
clause.

# If I've done so improperly on a file, please let me know.


165232 14-Dec-2006 imp

band-aide until _SC_PHYS_PAGES actually is defined


165212 14-Dec-2006 pjd

Add support for _SC_PHYS_PAGES, which is not standard, but can be found in
Solaris and Linux.


165211 14-Dec-2006 pjd

Document _SC_PAGESIZE. There are still 85 undocumented variables.

Obtained from: NetBSD


164857 03-Dec-2006 dds

Minor clarification.


164847 03-Dec-2006 maxim

o As POSIX requires confstr(3) returns zero on errors, not -1.

PR: misc/106234
Submitted by: Guy Harris
MFC after: 1 week


163271 12-Oct-2006 ru

More accurately document the implementation details of internal storage.

PR: docs/82508


163266 12-Oct-2006 ru

Document what "msgsz" argument really denotes. [1]

Don't say that "msgsz" can be less than 0, it cannot
as it's unsigned (POSIX has the same bug).

PR: docs/101145 [1]
MFC after: 3 days


163118 08-Oct-2006 kmacy

Fix TLS on sparc64 for statically and dynamically linked binaries
Approved by: rwatson (mentor)
Reviewed by: jmg and marcel


163108 07-Oct-2006 trhodes

getenv.3: Put "is" on a line with other words
getobjformat.3: "takes precedence over" is not an envrionment variable.

PR: 75545
Submitted by: n-kogane@syd.odn.ne.jp
MFC after: 3 days


162995 04-Oct-2006 ache

Automatically re-stir every 400000 calls

Obtained from: OpenBSD


162827 29-Sep-2006 ru

Markup nit.


162391 18-Sep-2006 maxim

o Don't fseek() on closed file.

Submitted by: pgollucci@p6m7g8.com, Mark Costlow
MFC after: 3 weeks


162385 17-Sep-2006 ru

Markup fixes.


161827 01-Sep-2006 marcel

Fix style(9) in code copied from rtld.


161800 01-Sep-2006 marcel

Fix the variant I allocation for KSE: Allow a larger TCB and assume
that the documented TCB is at the tail of the extended TCB. In other
words, the base of the TCB has a negative offset from the TLS.


161126 09-Aug-2006 maxim

o It speaks about struct msqid_ds not struct shmid_ds.

PR: docs/101314
Submitted by: Vasil Dimov
MFC after: 1 week


161053 07-Aug-2006 phk

Return length from fwopen() file callback instead of zero.

The symptom is that syslog() fails to log anything but the "ident"
string if LOG_PERROR is specified to openlog(3) and the extensible
printf is in action.

For unclear, likely quaint historical reasons, syslog uses fwopen()
on a stack buffer, rather than using the more straightforward
and faster snprintf().

Along the way, fflush(3) is called, and since the callback writer
function returns zero instead of the length "written", __SERR
naturally gets set on the filedescriptor.

The extensible printf, in difference from the normal printf refuses
to output anything to an __SERR marked filedescriptor, and thus
the actual syslog message is supressed.

MFC: after 2 weeks


160711 26-Jul-2006 imp

Remove stale comment about arm


160355 14-Jul-2006 maxim

o compat_group() and files_group() are more complicated than I thought
in rev. 1.34. Mainly I missed the fact that the buffer is used for two
purposes:

1) storing a group line from the group file;

2) __gr_parse_entry() parses the buffer and tries to put the group
members to the remaining part of the buffer and can fail if there
is no enough room for them.

Re-arrange the buffer size checks to account the latter case.

Submitted by: Kirk R Webb
MFC after: 2 weeks


159294 05-Jun-2006 delphij

- ANSIfy.
- Remove two unnecessary casts.

These changes would help gcc4 compile.


159144 01-Jun-2006 maxim

o Record a file offset for a last successfully parsed group file line.
If the initial buffer size (1KB) for the given group line is not big
enough, reset the offset. It helps to do not miss this line when
getrg() reallocates the larger buffer and tries to parse the line again.

PR: bin/52433, kern/55031, bin/83696, misc/97640, misc/98111
Submitted by: bsw71@mail.ru, Philip M. Gollucci, Justin Erenkrantz
Glanced at: nectar
MFC after: 1 month


158971 27-May-2006 ru

Fix the output.

Noticed by: rodrigc


158818 22-May-2006 ache

Reflect int -> size_t changes in glob.h


158812 22-May-2006 ache

Reflect size_t changes in glob.h

Obtained from: NetBSD (mostly)


158807 22-May-2006 ache

Remove the kludge, as asked in the Makefile:
# If you bump SHLIB_MAJOR, remove the kluge from gen/gethostname.c.

Reviewed by: ume


158426 11-May-2006 davidxu

Save errno before calling pthread_mutex_lock because pthread_mutex_lock
may change errno unexpectly.


158115 28-Apr-2006 ume

- Extend the nsswitch to support Services, Protocols and Rpc
databases.
- Make nsswitch support caching.

Submitted by: Michael Bushkov <bushman__at__rsu.ru>
Sponsored by: Google Summer of Code 2005


157852 18-Apr-2006 ceri

Correct usage example.

PR: docs/95059
Submitted by: Jos Backus
MFC after: 4 days


157608 09-Apr-2006 brueffer

Document that VIS_CSTYLE encodes space (040) as '\s'.

PR: 95546
Submitted by: Jan Schaumann <jschauma@netmeister.org>
MFC after: 3 days


157198 28-Mar-2006 davidxu

Allocate space for thread pointer, this allows thread library to access
its pointer from begin, and simplifies _get_curthread() in libthr.


156614 13-Mar-2006 deischen

Make _spinunlock() point to the spinunlock stub, not the
spinlock stub.


156613 13-Mar-2006 deischen

Add each directory's symbol map file to SYM_MAPS.


156608 13-Mar-2006 deischen

Add symbol maps and initial symbol version definitions to libc.

Reviewed by: davidxu


156319 05-Mar-2006 deischen

Add some more pthread stubs so that librt can use them.
The thread jump table has been resorted, so you need to
keep libc, libpthread, and libthr in sync.

Submitted by: xu


154857 26-Jan-2006 pjd

Remove debug printf.


154838 26-Jan-2006 cognet

Make getttyent() report what the pts ptys as well.


154252 12-Jan-2006 jasone

Use posix_memalign() in valloc() rather than making assumptions about
the alignment of malloc()ed memory.

Approved by: markm (mentor)


153515 18-Dec-2005 kan

Implement ELF symbol versioning using GNU semantics. This code aims
to be compatible with symbol versioning support as implemented by
GNU libc and documented by http://people.redhat.com/~drepper/symbol-versioning
and LSB 3.0.

Implement dlvsym() function to allow lookups for a specific version of
a given symbol.


153504 18-Dec-2005 marcel

Make our ELF64 type definitions match standards. In particular this
means:
o Remove Elf64_Quarter,
o Redefine Elf64_Half to be 16-bit,
o Redefine Elf64_Word to be 32-bit,
o Add Elf64_Xword and Elf64_Sxword for 64-bit entities,
o Use Elf_Size in MI code to abstract the difference between
Elf32_Word and Elf64_Word.
o Add Elf_Ssize as the signed counterpart of Elf_Size.

MFC after: 2 weeks


153041 03-Dec-2005 ambrisko

Switch BUILD_ARCH in Makefile to use uname -p suggested by ru.
Switch strncpy to strlcpy suggested by gad and issue found by pjd.
Add to uname(3) man page describing:
UNAME_s
UNAME_r
UNAME_v
UNAME_m
Add to getosreldate(3) man page describing:
OSVERSION

Submitted by: ru, pjd/gad
Reviewed by: ru (man pages)


153009 02-Dec-2005 ambrisko

Unbreak build when I fluff the clean-up of __FBSDID diff reduction
before commit.

pointyhat++


153002 02-Dec-2005 ambrisko

Add support to easily build FreeBSD unpacked in a chroot of another
FreeBSD machine. To do this add the man 1 uname changes to __xuname.c
so we can override the settings it reports. Add OSVERSION override
to getosreldate. Finally which Makefile.inc1 to use uname -m instead
of sysctl -n hw.machine_arch to get the arch. type.

With these change you can put a complete FreeBSD OS image into a
chroot set:
UNAME_s=FreeBSD
UNAME_r=4.7-RELEASE
UNAME_v="FreeBSD $UNAME_r #1: Fri Jul 22 20:32:52 PDT 2005 fake@fake:/usr/obj/usr/src/sys/FAKE"
UNAME_m=i386
UNAME_p=i386
OSVERSION=470000
on an amd64 or i386 and it just work including building ports and using
pkg_add -r etc. The caveat for this example is that these patches
have to be applied to FreeBSD 4.7 and the uname(1) changes need to
be merged. This also addresses issue with libtool.

This is usefull for when a build machine has been trashed for an
old release and we want to do a build on a new machine that FreeBSD
4.7 won't run on ...


152985 01-Dec-2005 jhb

Add MLINK for execvP(3).

PR: docs/89783
Submitted by: Andreas Kohn andreas at syndrom23 dot de
MFC after: 3 days


152715 23-Nov-2005 ru

Make SYNOPSIS compile after imp@'s changes.


152714 23-Nov-2005 ru

Make SYNOPSIS compile.


152333 12-Nov-2005 deischen

Fix a stub function so that is has the correct number of
arguments. While I'm here, correct a couple of [tab] alignments.

Submitted by: bland


151449 18-Oct-2005 stefanf

Make __sem_timedwait() consistent with the sem_timedwait() prototype.


150297 18-Sep-2005 ache

Just by allocating size*2 bytes we can't be sure that new size will be enough,
so change two
if (size not enough) {
reallocf(size*2);
}
into
while (size not enough) {
reallocf(size*2);
}


150172 15-Sep-2005 ache

Cosmetic fixes to prev. commit.
Change first MAXPATHLEN to more standard PATH_MAX
Change second MAXPATHLEN to 1024 (it is temp buffer not related)
Change comment to reflect that.

Suggested by: bde


150138 14-Sep-2005 ache

Remove any hardcoded assumptions about malloc's way of allocating,
just use MAXPATHLEN. It prevents potential buffer overflow with other
malloc implementations.
(this change based on submitted patch)

PR: 86135
Submitted by: Trevor Blackwell <tlb@tlb.org>


150137 14-Sep-2005 ache

Don't reuse *pl to skip [], it is already used for {} parts in the loop above
(submitted patch slightly modified)

PR: 86038
Submitted by: Gerd Rausch <gerd@juniper.net>


150065 12-Sep-2005 stefanf

Include a couple of headers to ensure consistency between the prototype and
the function definition.


149941 10-Sep-2005 stefanf

Add an MLINK for devname_r().


149313 20-Aug-2005 stefanf

Include <sys/types.h> and <limits.h> ourselves, don't assume they are included
through <pthread.h>.

gen/sem.c: Prerequisite for <_semaphore.h>
net/getprotoent.c: USHRT_MAX
net/getservent.c: USHRT_MAX
stdio/ungetwc.c: MB_LEN_MAX
stdio/vfwscanf.c: MB_LEN_MAX


149004 12-Aug-2005 simon

Add missing links from getgrent_r.3, getgrnam_r.3, and getgrgid_r.3 to
getgrent.3.

Submitted by: Ulf Lilleengen <lulf@kerneled.org>
MFC after: 3 days


148657 03-Aug-2005 deischen

Make syslog() use the internal (non-cancellation point) _usleep().
Prior to this it was calling the cancellable usleep() while holding
a lock.


148656 03-Aug-2005 deischen

Make usleep() overridable by the thread libraries so they can provide
cancellation points.

Noticed by: phk


148401 25-Jul-2005 mdodd

Move initialization above point of first possible reference to
avoid overwriting ty_status values set from the 'type' field.

Previously TTY_DIALUP and TTY_NETWORK flags did not match
specified type.


148317 22-Jul-2005 jon

fix innetgr() returning false positives and negatives when reverse netgroup
matching is used.

PR: 35506
MFC after: 3 days


147952 13-Jul-2005 rwatson

Cross-reference sem_getvalue(3) from several other semaphore-related
functions.

MFC after: 3 days


147402 15-Jun-2005 ru

Assorted markup fixes.

Approved by: re


147368 14-Jun-2005 ru

When IPC_NOWAIT is set and there is no message, msgrcv() fails
with errno set to ENOMSG.

PR: docs/82217
Submitted by: delphij
Approved by: re (blanket)


146455 20-May-2005 ume

reduce strlen() call.


146453 20-May-2005 ume

use reentrant.h and simplify.


146451 20-May-2005 ume

check return value of ttyname_r().


146450 20-May-2005 ume

ttyname_r() didn't pass correct buffer size to devname_r().


146217 14-May-2005 delphij

Revert to old ttyname_r behavior that when _ioctl() returns 0 (SUCCEEDED),
return the buffer immediately. This will permit ssh and/or PAM logins
broken by previous commit.

The (potential) underlying problem is still under investigation.

Point hat to: me


146186 13-May-2005 delphij

Provide more POSIX-complaint ttyname_r(3) interface[1], which is slightly
different from what has been offered in libc_r (the one spotted in the
original PR which is found in libthr has already been removed by David's
commit, which is rev. 1.44 of lib/libthr/thread/thr_private.h):
- Use POSIX standard prototype for ttyname_r, which is,
int ttyname_r(int, char *, size_t);
Instead of:
char *ttyname_r(int, char *, size_t);
This is to conform IEEE Std 1003.1, 2004 Edition [1].
- Since we need to use standard errno for return code, include
errno.h in ttyname.c
- Update ttyname(3) implementation according to reflect the API
change.
- Document new ttyname_r(3) behavior
- Since we already make use of a thread local storage for
ttyname(3), remove the BUGS section.
- Remove conflicting ttyname_r related declarations found in libc_r.

Hopefully this change should not have changed the API/ABI, as the ttyname_r
symbol was never introduced before the last unistd.h change which happens a
couple of days before.

[1] http://www.opengroup.org/onlinepubs/009695399/functions/ttyname.html

Requested by: Tom McLaughlin <tmclaugh sdf lonestar org>
Through PR: threads/76938
Patched by: Craig Rodrigues <rodrigc crodrigues org> (with minor changes)
Prompted by: mezz@


146099 11-May-2005 delphij

Connect MLINKS for ttyname_r(3), and add prototype into unistd.h.


145832 03-May-2005 delphij

Cleanup for getgrouplist(3):
- Use /*- instead of /* for copyright section
- Include unistd.h for prototype of it
- Sort and separate includes as described in style(9)
- ANSIfy the function defination
- Use const for the traversing iterator


145829 03-May-2005 delphij

Include paths.h for prototype of getbootfile(3).


145216 18-Apr-2005 das

Add a sysctl that returns the full path of a process' text file.
This information is needed by things like `gdb -p' and Sun's javac,
and previously it could only be obtained via procfs


144816 08-Apr-2005 stefanf

Remove unused variables and assignments.


144815 08-Apr-2005 stefanf

Use prototypes in the function definitions.


144530 02-Apr-2005 das

Add some missing errnos from POSIX. Nothing in FreeBSD generates
these at the moment, but applications that test for them will now
have a better chance of compiling.

I have intentionally omitted errnos that are only good for STREAMS,
since apps that use STREAMS won't compile anyway. The exception is
EPROTO, which was apparently intended for STREAMS, but worth having
anyway because Linux (mis)uses it for other things.


143921 21-Mar-2005 davidxu

Use __weak_reference macro to define weak symbols.


143905 21-Mar-2005 das

Teach fmtcheck() about the ' (thousands separator) flag.


143305 08-Mar-2005 phk

Have ttyname_r() try to ask DEVFS for the device name.

Document ttyname_r().

Simplify threaded/unthreaded stuff a lot.


143279 08-Mar-2005 phk

Make the returnvalue of times(3) insensitive to changes in wall-clock.

PR: 78537


143229 07-Mar-2005 das

Add manpage links for frexpf, frexpl, ldexpf, and ldexpl.


143228 07-Mar-2005 das

Document frexpl and ldexpl.


142959 01-Mar-2005 davidxu

Fix incorrect comment.


142560 26-Feb-2005 davidxu

Mark _rtld_allocate_tls and _rtld_free_tls as weak symbols for Variant I
tls.

Reviewed by: dfr


142277 23-Feb-2005 trhodes

Add an EXAMPLES section[1], quote Nd, and bump doc date.

PR: 53621 [1]
Submitted by: Faried Nawaz <fn@hungry.com> [1]


141851 13-Feb-2005 ru

Expand contractions.


141846 13-Feb-2005 ru

Expand *n't contractions.


141580 09-Feb-2005 ru

Fixed the misplaced $FreeBSD$.


141379 06-Feb-2005 das

Update my email address.


140890 27-Jan-2005 das

- Move the functions presently described in in ieee(3) to their own
manpages. They are not very related, so separating them makes it
easier to add meaningful cross-references and extend some of the
descriptions.
- Move the part of math(3) that discusses IEEE 754 to the ieee(3)
manpage.


140673 23-Jan-2005 das

- Document ldexpf().
- Although ldexp() is in libc for backwards compatibility, ldexpf() is
in its proper place in libm. Document both as being in libm.
- The ldexp() and ldexpf() functions conform to C99.


140672 23-Jan-2005 das

- Document frexpf().
- Neither frexp() nor frexpf() set errno.
- Although frexp() is in libc for backwards compatibility, frexpf() is
in its proper place in libm. Document both as being in libm.
- The frexp() and frexpf() functions conform to C99.


140607 22-Jan-2005 das

Replace the ldexp() implementation in libc with a renamed copy of the
scalbn() implementation from libm. (The two functions are defined to
be identical, but ldexp() lives in libc for backwards compatibility.)
The old ldexp() implementation...
- was more complicated than this one
- set errno instead of raising FP exceptions
- got some corner cases wrong
(e.g. ldexp(1.0, 2000) in round-to-zero mode)

The new implementation lives in libc/gen instead of
libc/$MACHINE_ARCH/gen, since we don't need N copies of a
machine-independent file. The amd64 and i386 platforms
retain their fast and correct MD implementations and
override this one.


140505 20-Jan-2005 ru

Sort sections.


140287 15-Jan-2005 ru

Markup: convert a display to a list.


140194 13-Jan-2005 jon

remember to reset nextgrp in getnetgrent(), so that subsequent calls to getnetgrent() doesn't return bogus information.

MFC after: 3 days


139860 07-Jan-2005 keramida

The `timep' argument of utime() is not an array of structs.
Make sure we don't confuse the reader by claiming it is.

PR: docs/75615
Submitted by: Nobuyuki Koganemaru <n-kogane@syd.odn.ne.jp>


139838 07-Jan-2005 pjd

Update manual page after adding 'fts_bignum' field.

Submitted by: Peter Jeremy <PeterJeremy@optushome.com.au>
MFC after: 5 days


139811 07-Jan-2005 pjd

Introduce new field 'fts_bignum' which is 64bit long and will allow to
make utilities like du(1) 64bit-clean.
When this field is used, one cannot use 'fts_number' and 'fts_pointer'
fields.

This commit doesn't break API nor ABI.

This work is part of the BigDisk project:

http://www.FreeBSD.org/projects/bigdisk/

Discussed on: arch@
MFC after: 5 days


139440 30-Dec-2004 glebius

Make syslog(3) thread safe.

PR: bin/72394
Submitted by: Dan Nelson
Reviewed by: deischen
MFC after: 2 weeks


139434 30-Dec-2004 krion

Add LOG_NTP facility.

Submitted by: Kurt Jaeger <pi at complx dot LF dot net>
Approved by: ru
MFC after: 3 days


139413 29-Dec-2004 keramida

Mark up SIGSTOP with .Dv and use .Nm in HISTORY for marking up `signal'.

PR: docs/75615
Submitted by: n-kogane@syd.odn.ne.jp


139256 24-Dec-2004 glebius

Restore standard behavior: log to console only when normal logging
failed, not always.

PR: bin/75356
Submitted by: Mark Knight <markk knigma org>
Pointy hat to: glebius
MFC after: 3 days


139224 23-Dec-2004 jkoshy

Better rendering of the prototype for signal(3).

Suggested by: ru


138922 16-Dec-2004 maxim

o The macro versions of sigemptyset(3), sigfillset(3), sigaddset(3),
sigdelset(3) and sigismember(3) were killed about five years ago.

o The functions (specifically sigismember(3)) could return -1 and
set errno.

PR: bin/75156
Obtained from: NetBSD
MFC after: 2 weeks

o Bump the date of the document.


138349 03-Dec-2004 rse

Fix description: the argument to setcontext(3) must have been previously
initialized "by a call to getcontext(3) or makecontext(3)" and not "by a
call to setcontext(3) or makecontext(3)".

MFC after: 3 days


137878 18-Nov-2004 marks

Remove ntp_gettime.c which was a wrapper around sysctlbyname(3).
This is now a native system call.

Reviewed by: imp, phk, njl, peter
Approved by: njl


137675 13-Nov-2004 bz

Add knob NO_NIS (fka NO_YP_LIBC) and make world compileable when set.
If turned on no NIS support and related programs will be built.

Lost parts rediscovered by: Danny Braniss <danny at cs.huji.ac.il>
PR: bin/68303
No objections: des, gshapiro, nectar
Reviewed by: ru
Approved by: rwatson (mentor)
MFC after: 2 weeks


137233 04-Nov-2004 glebius

Protect against local flooder of /var/run/log. Do not loop forever in
syslog(3) if we are a priveleged program (sshd, su, etc.).

- Make syslogd open an additional socket /var/run/logpriv, with 0600
permissions.
- In libc, try to use this socket.
- Do not loop forever if we are using this socket (partial backout of 1.31)

Reviewed by: dwmalone, Andrea Campi <andrea webcom it>
Approved by: julian (mentor)
MFC after: 1 month


136283 08-Oct-2004 glebius

When send()ing to syslogd return ENOBUFS keep trying until success.

This fixes a case, when DoSed syslogd completely loses messages.

PR: bin/72366
Discussed with: dwmalone, millert@OpenBSD.org
Approved by: julian (mentor)
Obtained from: OpenBSD (rev. 1.17, 1.21 by millert)
MFC after: 3 months


136117 04-Oct-2004 jkoshy

Mutually cross-reference sysexits(3) and err(3). Add text to err(3)
recommending that the standard exit codes in sysexits(3) be used.

Reviewed by: ru


135713 24-Sep-2004 das

Remove __isnanl() to avoid conflicting with the same function in libm.
__isnan() and __isnanf() must remain in libc for hysterical raisins.
On the other hand, __isnanl() must live in libm because libm uses it
internally and can't depend on older versions of libc to provide it.
Fortunately, we don't need __isnanl() in both libraries.

Prodded by: ale
PR: 71698
MT5 candidate


135686 23-Sep-2004 cognet

Arbitraly choose the Variant II for arm.


134620 01-Sep-2004 tjr

Septepber -> September

Noticed by: ru


134600 01-Sep-2004 tjr

Back out the previous change. glob() still does use strcmp() to order
pathnames.


134473 29-Aug-2004 tjr

Add cross-reference to ftw(3).


134244 24-Aug-2004 tjr

Replace the current implementations of ftw() and nftw() with the OpenBSD
implementations written by Todd C. Miller. These are cleaner, less buggy
and actively maintained.


134212 23-Aug-2004 dfr

Make sure we allocate at least enough space for the TCB for variant I TLS.

MFC after: 3 days


134208 23-Aug-2004 tjr

Update documentation to match reality: glob() sorts its result according
to the current LC_COLLATE setting, not in "ASCII order".

PR: 54391
MFC after: 1 week


133949 18-Aug-2004 dfr

Always allocate a TLS area even if its empty - libpthread relies on
having a valid %gs when it initialises.

MFC after: 2 days


133754 15-Aug-2004 dfr

Add support for TLS in statically linked programs.


133723 14-Aug-2004 stefanf

Avoid using void pointers in additive expressions.

PR: 56653


133064 03-Aug-2004 dfr

Add stubs for TLS functions. These will be replaced at runtime by the
functional versions in rtld.


133004 02-Aug-2004 stefanf

Remove an implicit int parameter by using prototypes.


133003 02-Aug-2004 stefanf

Don't pass function pointers via a void * parameter.


132849 29-Jul-2004 kan

Use newly added __used attribute to keep static function symbols from being
eliminated by compiler optimizer.


132817 29-Jul-2004 tjr

Add support for multibyte characters.


132816 29-Jul-2004 tjr

Add a paragraph break in the STANDARDS section to improve readability.


132812 29-Jul-2004 tjr

Add support for multibyte characters.


132798 28-Jul-2004 tjr

Document incorrect handling of multibyte characters due to limitations
of sh(1).


132793 28-Jul-2004 des

ANSIfy and constify; this now builds with GCC 3.4.


132632 25-Jul-2004 tjr

Add an nftw(3) link.


132573 23-Jul-2004 das

Remove unused variable.

Noticed by: Todd Miller <Todd.Miller@courtesan.com>


132382 19-Jul-2004 das

Fix two bugs in the signbit() macro, which was implemented last year:

- It was added to libc instead of libm. Hopefully no programs rely
on this mistake.

- It didn't work properly on large long doubles because its argument
was converted to type double, resulting in undefined behavior.


132366 18-Jul-2004 das

Replace seven nominally MD implementations of frexp() that are broken
for subnormals with one implementation that works.


132349 18-Jul-2004 tjr

Remove claim of conformance to IEEE Std. 1003.2. Replace it with a list
of features required by the standard that the current implementation
does not support.

PR: 57911 (related)


132343 18-Jul-2004 tjr

Remove claim of conformance to IEEE Std. 1003.2. Replace it with a list
of features required by the standard that the current implementation
does not support.

PR: 57911


132288 17-Jul-2004 tjr

Fix typo: carat -> caret.


131898 10-Jul-2004 marcel

Unbreak alpha: On alpha a long double is the same as a double and
consequently the exponent is only 11 bits. Testing whether the
exponent equals 32767 in that case only effects to compiler warnings
and thus build breakage.


131859 09-Jul-2004 das

Bump document date for recent changes.

Prodded by: ru


131853 09-Jul-2004 das

Document these functions as being in libm, not libc. Some of them
*are* in libc for historical reasons, but programmers should not rely
on that fact.

Also remove a BUGS section that is not relevant here.


131852 09-Jul-2004 das

Implement the classification macros isfinite(), isinf(), isnan(), and
isnormal() the hard way, rather than relying on fpclassify(). This is
a lose in the sense that we need a total of 12 functions, but it is
necessary for binary compatibility because we have never bumped libm's
major version number. In particular, isinf(), isnan(), and isnanf()
were BSD libc functions before they were C99 macros, so we can't
reimplement them in terms of fpclassify() without adding a dependency
on libc.so.5. I have tried to arrange things so that programs that
could be compiled in FreeBSD 4.X will generate the same external
references when compiled in 5.X. At the same time, the new macros
should remain C99-compliant.

The isinf() and isnan() functions remain in libc for historical
reasons; however, I have moved the functions that implement the macros
isfinite() and isnormal() to libm where they belong. Moreover,
half a dozen MD versions of isinf() and isnan() have been replaced
with MI versions that work equally well.

Prodded by: kris


131757 07-Jul-2004 ru

Fixed markup.


131661 05-Jul-2004 das

Add implementations of ftw(3) and nftw(3) and the corresponding header
ftw.h. This is the implementation written by Joel Baker
<fenton@debian.org> for inclusion in NetBSD, but with several
bugfixes.

Obtained from: Debian


131660 05-Jul-2004 das

Documentation for ftw(3) and nftw(3).

Obtained from: OpenBSD


131635 05-Jul-2004 ru

Fix the NAME section making whatis(1) happy in particular.


131539 03-Jul-2004 ru

Eliminate double whitespace.


131504 02-Jul-2004 ru

Mechanically kill hard sentence breaks.


131472 02-Jul-2004 ru

Removed trailing whitespace.


131465 02-Jul-2004 ru

Markup tidying.


131365 30-Jun-2004 ru

Markup, grammar, and spelling fixes.


131331 30-Jun-2004 tjr

Fix typo: WRDE_DOOFS -> WRDE_DOOFFS.

Noticed by: Stoned Elipot


130867 21-Jun-2004 mpp

Spelling fixes.


130233 08-Jun-2004 das

In fts_build(), if we try to chdir and fail (e.g. due to lack of search
permission), try to continue in FTS_DONTCHDIR mode. Of course this
won't work for long paths, but we can't descend more than one pathname
component beyond the directory anyway if we lack search permission.

Here is a transcript demonstrating the change, where oldls is ls(1)
linked with the old fts(3):

das@VARK:~> mkdir t && touch t/{a,b,c} && chmod u-x t
das@VARK:~> oldls t
a b c
das@VARK:~> oldls -l t
das@VARK:~> \ls t
a b c
das@VARK:~> \ls -l t
ls: a: Permission denied
ls: b: Permission denied
ls: c: Permission denied

I had forgotten about this patch until bde reminded me. He reports
using it without problems for over a year.

PR: 45723


130186 07-Jun-2004 yar

Finally document the option to avoid zombie creation
through ignoring SIGCHLD.


130027 03-Jun-2004 roam

Fix the ordering in the description of the dlsym() lookup procedure to
reflect src/libexec/rtld-elf/rtld.c rev. 1.68 - the globally-loaded
objects (RTLD_GLOBAL) are searched before the local object's DAG's.

PR: 62770
Submitted by: Kimura Fuyuki <fuyuki@nigredo.org>


129926 01-Jun-2004 tjr

Change the signature of ftok from (const char *, char) to (const char *, int)

Obtained from: NetBSD (christos)


129369 17-May-2004 yar

Clarify and extend paragraphs on interoperation
of fcntl(2), flock(2), and lockf(3) advisory locks.
Add such a paragraph to the flock(2) manpage for the
sake of consistency.

Reviewed by: Cyrille Lefevre and Kirk McKusick on -arch
MFC after: 2 weeks


129367 17-May-2004 kientzle

getgrent() and friends should set errno if there is an error.
Also, clarify the manpage description of when errno is set and
explain that clients should set errno=0 first if they want useful
error information.


129349 17-May-2004 kientzle

POSIX prohibits any library function from setting errno to 0.
Correct my previous commit and add a comment to the manpage
indicating that the user must set errno to 0 if they wish to
distinguish "no such user" from "error".

Pointed out by: Jacques Vidrine (nectar@)


129319 17-May-2004 kientzle

If getpwent/getpwuid/getpwnam return NULL, they must also set errno.


129184 13-May-2004 bde

Fixed some minor style bugs.


129161 12-May-2004 peadar

Fix some^Wseveral style bugs from last commit.

Remove "sys/types.h" as "sys/param.h" is already included

Use cast rather than back-pointer to convert from public to private
version of FTS data, and so avoid littering fts.h with any of the
details.

Pointed out By: bde, kientzle


129091 10-May-2004 dds

Remove a trailing newline, to behave as documented in syslog(3):
"A trailing newline is added if none is present."

The code in syslogd, stderr, and console output always adds a newline
at the EOL. However, the existing code never actually removed a
trailing newline, and apparently relied on syslogd to convert it
into a space character. Thus, the existing newline was converted
to a trailing space at the EOL by syslogd, while stderr, and console
output resulted in an empty line.

MFC after: 2 weeks


129081 10-May-2004 bde

Fixed style bugs in previous commit (bogus forward declaration and
inconsistent capitalization in comments).


129064 09-May-2004 brueffer

o fix a sentence to match with the synopsis [1]
o fix grammar nit

PR: 66289 [1]
Submitted by: Michel Lavondès <fox@vader.aacc.cc.md.us>
Obtained from: OpenBSD [1]
MFC after: 3 days


129052 08-May-2004 peadar

The FTS_NOSTAT option is an optimisation that reduces the number
of stat(2) calls by keeping an eye of the number of links a directory
has. It assumes that each subdirectory will have a hard link to its
parent, to represent the ".." node, and stops calling stat(2) when
all links are accounted for in a given directory.

This assumption is really only valid for UNIX-like filesystems: A
concrete example is NTFS. The NTFS "i-node" does contain a link
count, but most/all directories have a link count between 0 and 2
inclusive. The end result is that find on an NTFS volume won't
actually traverse the entire hierarchy of the directories passed
to it. (Those with a link count of two are not traversed at all)

The fix checks the "UFSness" of the filesystem before enabling the
optimisation.

Reviewed By: Tim Kientzle (kientzle@)


128946 05-May-2004 kientzle

A minor refactoring to simplify portability: assign the filename
length to a separate variable so that it will be easier to adapt to
systems that don't have d_namlen in struct dirent.


128818 02-May-2004 das

When *printf() and *scanf() are compiled without floating-point
support, fmtcheck() should not accept format strings that contain
floating-point formats.


128674 27-Apr-2004 ru

Markup nit.


128537 21-Apr-2004 jon

Fix a bug that could result in getpw*() incorrectly returning NULL when NIS
adjunct maps are used. One symtom of this bug is sshd saying:
login_get_lastlog: Cannot find account for uid X
when logging in. The problem here is caused by an incorrect reuse of the rv
variable when previous values are needed later.


128143 11-Apr-2004 mux

Belatedly remove the getvfsent(3) API. All the consumers have been
updated to use getvfsbyname(3) or the vfs.conflist sysctl since a
long time, except mount_smbfs(8) which has just been fixed.


128050 09-Apr-2004 tjr

Terminate execl()'s argument list with a null pointer instead of a
null pointer constant. (The latter may be an integer constant, which
is not correct here.)

Submitted by: Stefan Farfeleder


127401 25-Mar-2004 bms

Document the existence of NET_RT_IFMALIST.

Reviewed by: ru


127400 25-Mar-2004 ru

[troff] removed the unnecessary use of \_ escapes.


127373 24-Mar-2004 green

Add locking so that arc4random(3) functions are all reentrant for
pthreads.

Submitted by: Christian S.J. Peron <maneo@bsdpro.com>


127271 21-Mar-2004 tjr

Document incorrect handling of multibyte characters.


127015 15-Mar-2004 truckman

Document additional reasons that sysctl(3) can return ENOMEM (due to
vslock() failure).


126643 05-Mar-2004 markm

Make NULL a (void*)0 whereever possible, and fix the warnings(-Werror)
that this provokes. "Wherever possible" means "In the kernel OR NOT
C++" (implying C).

There are places where (void *) pointers are not valid, such as for
function pointers, but in the special case of (void *)0, agreement
settles on it being OK.

Most of the fixes were NULL where an integer zero was needed; many
of the fixes were NULL where ascii <nul> ('\0') was needed, and a
few were just "other".

Tested on: i386 sparc64


126180 23-Feb-2004 green

Apply style(9).

Submitted by: "Christian S.J. Peron" <maneo@bsdpro.com>
PR: bin/63283


126164 23-Feb-2004 josef

Add signal numbers to signal(3).

Approved by: simon(mentor)
Reviewed by: ru
Submitted by: Stefan Farfeleder <stefan@fafoe.narf.at>
PR: docs/60044


125667 10-Feb-2004 cperciva

style cleanup: Remove duplicate $FreeBSD$ tags.

These files had tags at the start of the file
(incorrect, removed), and after the copyright
notices (correct).

Approved by: rwatson (mentor)


125521 06-Feb-2004 deischen

Prevent memory leak on sem_destroy() by destroying the semaphore's
internal mutex and CV.


125518 06-Feb-2004 deischen

Only allow the semaphore to be taken when the value is positive.
Don't decrement it twice when it is taken.

Reported by: kris


125509 05-Feb-2004 deischen

Correct check for invalid semaphore on sem_destroy() (s/==/!=/).

Reported by: kris


125502 05-Feb-2004 deischen

Correct the weak reference for sem_unlink.


125446 04-Feb-2004 deischen

Allow libc's version of sem_trywait() to work for non-pshared mutexes.


125372 03-Feb-2004 deischen

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).


124741 20-Jan-2004 das

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>


124690 18-Jan-2004 charnier

add missing endusershell() call. Original version was incorrect.
PR: bin/2442
Reviewed by: Friedemann Becker <zxmxy33@mail.uni-tuebingen.de>


124614 17-Jan-2004 davidxu

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.


124605 17-Jan-2004 davidxu

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.


124568 15-Jan-2004 ru

Fixed style of previous commit.

Submitted by: bde


124530 14-Jan-2004 ru

- 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


124432 12-Jan-2004 nectar

Kill whitespace at end of lines.


124431 12-Jan-2004 nectar

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>


124174 06-Jan-2004 nectar

Remove unused variables and function declarations. Add missing headers.


123861 26-Dec-2003 dfr

Make sure we initialise dirp->dd_size if we aren't reading a unionfs
directory.

Special thanks to: valgrind


123780 23-Dec-2003 trhodes

Back out previous commit due to incorrect content.

Noticed by: wollman


123773 23-Dec-2003 trhodes

Document many of the missing posix.1b options.

PR: 20528
Submitted by: bms (original version)
Requested by: mike (awhile ago)


122899 19-Nov-2003 dds

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


122443 10-Nov-2003 ghelmer

Remove ',' accidentally added after ".Xr fork 2".


122442 10-Nov-2003 ghelmer

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


122155 06-Nov-2003 kientzle

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)


121737 30-Oct-2003 phk

Add '#' to the characters VIS_GLOB encodes. This fixes a bug in mtree.


121728 30-Oct-2003 phk

Add a new flag to vis(3): VIS_GLOB which encodes the glob(3) magic
characters '*', '?' and '['.


121667 29-Oct-2003 tjr

Remove incomplete support for running FreeBSD userland on old NetBSD kernels
lacking the issetugid() and utrace() syscalls.


120010 12-Sep-2003 ru

mdoc(7): Fix common mistakes made in the SEE ALSO section.


119964 10-Sep-2003 ru

mdoc(7): Properly mark C headers.


119893 08-Sep-2003 ru

mdoc(7): Use the new feature of the .In macro.


119654 01-Sep-2003 eivind

Update the kern.osreldate documentation to document the present format
used, and refer to <osreldate.h> to get userland date.

Submitted by: ru


119151 19-Aug-2003 wollman

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


119140 19-Aug-2003 wollman

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)


118684 09-Aug-2003 bms

Add the POSIX 1003.1-2001 posix_madvise() interface.

PR: standards/54634
Reviewed by: das
Approved by: jake (mentor)


118247 31-Jul-2003 das

The upper end of the range of arc4random(3) is 2**32-1, not 2**31-1.


117757 19-Jul-2003 davidxu

Make raise and _raise as weak symbols, so they can be overriden by
thread library.

Reviewed by: deischen


117754 19-Jul-2003 wollman

Rewrite to reflect slight change in semantics for C99, and note a bug
in the standard. Defer to gettimeofday(2) for error indications.


117753 19-Jul-2003 wollman

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


117750 18-Jul-2003 wpaul

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.


117735 18-Jul-2003 wollman

Whitespace after keywords per style(9).


117204 03-Jul-2003 ru

With the latest mdoc(7), we can now fix the synopsis like this.

Desired by: bde


117111 01-Jul-2003 bde

Fixed some style bugs.


117102 01-Jul-2003 alfred

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>


117030 29-Jun-2003 gordon

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@


117014 29-Jun-2003 das

Teach fmtcheck(3) about the flags a, A, F, G, t, and z.


116901 27-Jun-2003 jwd

fix NIS+ YP compat mode

PR: bin/52792
Submitted by: TOMITA Yoshinori <yoshint@flab.fujitsu.co.jp>


116797 24-Jun-2003 ache

Don't statically initialize buf to _PATH_DEV, _PATH_DEV always copied to
it in any case.


116785 24-Jun-2003 yar

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.


116651 21-Jun-2003 phk

ttyname(3) must return absolute pathnames.

Noticed by: kris


116636 20-Jun-2003 phk

Use devname(3) to do the task.

Reviewed by: imp


116610 20-Jun-2003 phk

Add devname_r(3) which takes a buffer as argument.


116537 18-Jun-2003 ru

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


116471 17-Jun-2003 phk

Fix the execle(3) synopsis to include the environment pointer.

Confused: anordby


116025 08-Jun-2003 charnier

The .Fn function


116021 08-Jun-2003 charnier

Add or correct section number in .Xr. Use .Vt or .Fn
instead of .Xr when needed


115881 05-Jun-2003 phk

Recognize the magic NODEV value.
Format other unknown devices consistently in hex.


115641 01-Jun-2003 jmallett

Match style of source and headers.

Submitted by: bde


115631 01-Jun-2003 ru

Assorted mdoc(7) fixes.


115604 01-Jun-2003 jmallett

Make prototype match code with regard to constness of args to the
function pointer passed in.


115401 30-May-2003 kan

Add an stub for _rtld_thread_init. This is a part I missed in
my last commit.

Approved by: re (scottl)


115225 22-May-2003 ru

Assorted mdoc(7) fixes.

Approved by: re (blanket)


115143 18-May-2003 ru

Fixed troff(1) and mdoc(7) warnings.

Approved by: re (blanket)


115047 16-May-2003 tjr

Catch up with the renaming of the "union" filesystem to "unionfs".
Fixes a problem where directory entries could show up twice: once
on the top layer of the union stack, and once on the bottom layer.

Approved by: re (rwatson)


114454 01-May-2003 trhodes

Use the .Dl macro.

Discussed with: mdoc(7) officer ru


114444 01-May-2003 trhodes

State the fact that the range is twice the traditional RAND_MAX.
Add an EXAMPLES section.

PR: 48493
Submitted by: Paul Herman <pherman@frenchfries.net> (original version)


114443 01-May-2003 nectar

Back out the `hiding' of strlcpy and strlcat. Several people
vocally objected to this safety belt.


114256 29-Apr-2003 nectar

`Hide' strlcpy and strlcat (using the namespace.h / __weak_reference
technique) so that we don't wind up calling into an application's
version if the application defines them.

Inspired by: qpopper's interfering and buggy version of strlcpy


114132 27-Apr-2003 robert

Replace the return value of rfork_thread(3) in its manual page
function prototype with `pid_t' to match the declaration in
<unistd.h>.


114021 25-Apr-2003 nectar

When using `compat' mode, be sure to re-dispatch setpwent, endpwent,
setgrent, and endgrent also. (The previous NSS implementation used to
simply twiddle the internal data of the various modules directly.)

A symptom (group list set incorrectly in sshd) was
Reported by: Glenn Johnson <gjohnson@srrc.ars.usda.gov>

Sponsored by: DARPA, Network Associates Laboratories


113992 24-Apr-2003 nectar

In compat mode, we `redispatch' the lookup. It is probably a good
idea to re-initialize `struct passwd', because e.g. pw_class might
get set by one module, but not by another. Add another call to the
internal pwd_init function to accomplish this.

Sponsored by: DARPA, Network Associates Laboratories


113984 24-Apr-2003 nectar

Catch up with nsdispatch.c: nsdispatch(3) is now `hidden' by
namespace.h.

Sponsored by: DARPA, Network Associates Laboratories


113882 22-Apr-2003 nectar

``Strong typing is a crutch for people with weak memories.''

Correct a bug that should have wreaked havoc everywhere, but for
some reason only bit unlucky people who use `-march' optimizations.
The compiler cannot assist one in distinguishing between the two
function calls below.

int nsdispatch(void *, ...);
void *discard;

nsdispatch(&discard, ...); /* correct .. no, really! */
nsdispatch(discard, ...); /* Boom */

Robin provided me with a debugging environment in which I could see
what was going on.

Badness when using CPUTYPE was
Reported by: "Robin P. Blanchard" <Robin.Blanchard@gactr.uga.edu>
Reported by: nork

Sponsored by: DARPA, Network Associates Laboratories


113794 21-Apr-2003 nectar

Don't try to access the NIS `master' maps unless we have superuser
privileges. To do so may cause the NIS server to log spurious and
annoying `access denied' messages.

Reported by: Philip Paeps <philip@paeps.cx>
Sponsored by: DARPA, Network Associates Laboratories


113727 20-Apr-2003 nectar

Repair a bug in which a faulty group entry (one with only 2 colons)
would result in an incorrectly terminated grouplist.

login(1) crashes
Reported by: Morten Rodal <morten@rodal.no>,
Matthias Schuendehuette <msch@snafu.de>


113694 18-Apr-2003 nectar

Follow-up to revision 1.74: Using the result buffer to store our empty
string was an incredibly dumb idea (of course it will be changed by an
NSS module on success!). Use a static empty string instead.

Sponsored by: DARPA, Network Associates Laboratories


113691 18-Apr-2003 nectar

Follow-up to revision 1.73: set _PWF_FILES when `compat' source is used
but user is found in local file.

Reported by: Shizuka Kudo <shizukakudo_99@yahoo.com>
Sponsored by: DARPA, Network Associates Laboratories


113672 18-Apr-2003 nectar

Don't use `memset' to initialize a struct passwd. A module
may not fill in all fields, and in the case of string fields, this could
cause trouble for applications. (The only likely example is `pw_class',
because this field is not used by all modules in all cases.)

Move initialization of struct passwd from module-specific code to the
dispatch code.

The problem of a NULL pw_class was
Noticed by: Philip Paeps <philip@paeps.cx>
and the c^Htrusty ssh(1) command.
Déjà vu by: getpwent.c revision 1.56

Sponsored by: DARPA, Network Associates Laboratories


113670 18-Apr-2003 nectar

Correctly set _PWF_FILES in pw_fields when appropriate.
(_PWF_NIS and _PWF_HESIOD were already being set.)

Reported by: Shizuka Kudo <shizukakudo_99@yahoo.com>
Sponsored by: DARPA, Network Associates Laboratories


113666 18-Apr-2003 nectar

Revert the definitions of _PW_KEY* to their previous values. There is
at least one consumer outside of libc and pwd_mkdb.
Adjust the versioning in libc and pwd_mkdb accordingly.

named was the application affected, and that fact was first
Reported by: Zherdev Anatoly <tolyar@mx.ru>

Sponsored by: DARPA, Network Associates Laboratories


113643 18-Apr-2003 nectar

The default if nsswitch.conf(5) is not present is supposed to be the
hated `compat' source, not `files'.

Reported by: Philip Paeps <philip@paeps.cx>
Sponsored by: DARPA, Network Associates Laboratories


113596 17-Apr-2003 nectar

= Implement thread-safe versions of the getpwent(3) and getgrent(3)
family of functions using the new nsdispatch(3) core. Remove
arbitrary size limits when using the thread-safe versions.

= Re-implement the traditional getpwent(3)/getgrent(3) functions on
top of the thread-safe versions.

= Update the on-disk format of the hashed version of the passwd(5)
databases to allow for versioned entries. The legacy version is
`3'. (Don't ask.)

= Add support for version `4' entries in the passwd(5) database.
Entries in this format are identical to version 3 entries except
that all integers are stored as 32-bit integers in network byte
order (big endian).

= pwd_mkdb is updated to generate both version 3 and version 4
entries.

Sponsored by: DARPA, Network Associates Laboratories


113595 17-Apr-2003 nectar

= Implement name service switch modules (NSS modules). NSS modules
may be built into libc (`static NSS modules') or dynamically loaded
via dlopen (`dynamic NSS modules'). Modules are loaded/initialized
at configuration time (i.e. when nsdispatch is called and nsswitch.conf
is read or re-read).

= Make the nsdispatch(3) core thread-safe.

= New status code for nsdispatch(3) `NS_RETURN', currently used to
signal ERANGE-type issues.

= syslog(3) problems, don't warn/err/abort.

= Try harder to avoid namespace pollution.

= Implement some shims to assist in porting NSS modules written for
the GNU C Library nsswitch interface.

Sponsored by: DARPA, Network Associates Laboratories


113362 11-Apr-2003 tjr

Return "/boot/kernel/kernel" instead of "/kernel" if the sysctl() call
fails. The documentation was incorrectly updated in getbootfile.3 rev. 1.10.


113235 07-Apr-2003 mdodd

Bump the date.


113224 07-Apr-2003 mdodd

Clarify the behavior of PATH_FSTAB with regard to 'tainted' execution.

Requested by: ru


113219 07-Apr-2003 mdodd

- Add setfstab() and getfstab().
- Use the environment variable 'PATH_FSTAB' if set rather than the
hardcoded '/etc/fstab' (fstab.h:_PATH_FSTAB)


112665 26-Mar-2003 jeff

- Define a _spinunlock() function so that threading implementations may do
more complicated things than just setting the lock to 0.
- Implement stubs for this function in libc and the two threading libraries
that are currently in the tree.


112543 24-Mar-2003 charnier

The .Fn function
The ... 2 system call


112542 24-Mar-2003 charnier

The .Fn function. Use .Xr where appropriate.


112407 19-Mar-2003 robert

- Revamp the function _nis_initshells() to make getusershell() backed
by NIS work, like nsswitch.conf(5) promises to be able to.
(These modifications will be fed back to NetBSD, of course)
- In endusershell(), do not set `sl' to NULL if we know it already has
that value.


112404 19-Mar-2003 robert

If realloc(3) fails in copyline(), do not make matters worse by
leaving without deallocating `data' thereby creating a memory leak.


112190 13-Mar-2003 tjr

Document return type of wordfree() (void). Reduce the space between
struct member names and the corresponding comments so the lines don't
wrap on 80-column terminals.


111618 27-Feb-2003 nectar

Eliminate 19 warnings in libc (at level WARNS=2) of the
`implicit declaration of function' variety.


111449 24-Feb-2003 ru

Fixed copyright.
Tidy up the markup.
Only describe the new, post-2.0 behavior.
Added the RETURN VALUES and ERRORS sections.


111447 24-Feb-2003 ru

mdoc(7) police: Scheduled sweep.


111285 23-Feb-2003 ru

mdoc(7) police: markup laundry.


111274 23-Feb-2003 mikeh

More changes from NetBSD:

* use correct error detection of realloc failure
* strtol negative return check
* use strtol to validate string instead of rolling our own
validation code
* terminate the command sequence correctly


111273 23-Feb-2003 mikeh

Grab some changes from NetBSD:

fix const poisoning
add cast to silence warning
pull in unistd.h


111262 22-Feb-2003 zarzycki

Apple PR-2449102: getdomainname() doesn't document that it is NIS/YP specific


111213 21-Feb-2003 phantom

Mention that dlerror() is also applicable to retrieve error message after
dladdr() and dlinfo() functions calls.


111082 18-Feb-2003 nectar

Whack 28 unused variables.


111010 16-Feb-2003 nectar

Eliminate 61 warnings emitted at WARNS=2 (leaving 53 to go).
Only warnings that could be fixed without changing the generated object
code and without restructuring the source code have been handled.

Reviewed by: /sbin/md5


110932 15-Feb-2003 phantom

Add dlinfo(3) manual page to the rank of base system manpages


110931 15-Feb-2003 phantom

Add examples of dlinfo() usage to manual page.


110854 14-Feb-2003 phantom

o Document that dlsym()'s behaviour with new special handle RTLD_SELF

o Add cross reference to dlinfo(3)
o Minor mdoc nits


110853 14-Feb-2003 phantom

Follow Solaris's manual page and describe Link_map structure here


110852 14-Feb-2003 phantom

Add manual page for dlinfo(3). It's still need some work and add
examples, but it's better than nothing already.


110804 13-Feb-2003 kan

Implement dlinfo() function.

Introdice RTLD_SELF special handle and properly process it within
dlsym() and dlinfo() functions.

The intention is to improve our compatibility with Solaris and
to make a Java port easier.

Partially submitted by: phantom


110769 12-Feb-2003 mike

o Implement C99 classification macros isfinite(), isinf(), isnan(),
isnormal(). The current isinf() and isnan() are perserved for
binary compatibility with 5.0, but new programs will use the macros.
o Implement C99 comparison macros isgreater(), isgreaterequal(),
isless(), islessequal(), islessgreater(), isunordered().

Submitted by: David Schultz <dschultz@uclink.Berkeley.EDU>


110739 12-Feb-2003 mike

This manual is called SIGNBIT(3) not FPCLASSIFY(3).


110734 11-Feb-2003 mike

Implement C99's signbit() macro.


110635 10-Feb-2003 alfred

Handle %%m properly in syslog format string. Previously it would expand
the %m into the errno and then vfprintf would expand the % and the first
character of the strerror(3) return causing possible data corruption.


110566 08-Feb-2003 mike

Implement fpclassify():
o Add a MD header private to libc called _fpmath.h; this header
contains bitfield layouts of MD floating-point types.
o Add a MI header private to libc called fpmath.h; this header
contains bitfield layouts of MI floating-point types.
o Add private libc variables to lib/libc/$arch/gen/infinity.c for
storing NaN values.
o Add __double_t and __float_t to <machine/_types.h>, and provide
double_t and float_t typedefs in <math.h>.
o Add some C99 manifest constants (FP_ILOGB0, FP_ILOGBNAN, HUGE_VALF,
HUGE_VALL, INFINITY, NAN, and return values for fpclassify()) to
<math.h> and others (FLT_EVAL_METHOD, DECIMAL_DIG) to <float.h> via
<machine/float.h>.
o Add C99 macro fpclassify() which calls __fpclassify{d,f,l}() based
on the size of its argument. __fpclassifyl() is never called on
alpha because (sizeof(long double) == sizeof(double)), which is good
since __fpclassifyl() can't deal with such a small `long double'.

This was developed by David Schultz and myself with input from bde and
fenner.

PR: 23103
Submitted by: David Schultz <dschultz@uclink.Berkeley.EDU>
(significant portions)
Reviewed by: bde, fenner (earlier versions)


110334 04-Feb-2003 mikeh

Grammer fix.


110122 30-Jan-2003 trhodes

Add getosreldate.3 to the Makefile.


110120 30-Jan-2003 trhodes

Add a manual page for getosreldate.c.

PR: 46365
Submitted by: gioria (original version)
OK'ed by: alfred (older version)


109895 26-Jan-2003 alfred

Add const qualifier to data argument for msgsnd.

PR: standards/45274
Submitted by: Craig Rodrigues <rodrigc@attbi.com>


109508 19-Jan-2003 obrien

Sync with NetBSD -- sl_add() now returns an int.


109297 15-Jan-2003 tjr

Add a missing word.


109275 15-Jan-2003 tjr

Document the named semaphore functions. This could still use a bit
of polishing.


109226 14-Jan-2003 tjr

Back out previous; sharing semaphores between processes only works
in certain special cases.


109222 14-Jan-2003 tjr

Sharing semaphores between processes works now, so remove the stale comments
about it always returning EPERM. Document that ENFILE occurs when the
limit on kernel semaphores is reached.


109220 14-Jan-2003 tjr

Cross reference sem(4) so users know which kernel options are required
to use these semaphore functions.


109219 14-Jan-2003 tjr

Add the newly created semaphore to the named semaphore list in sem_open()
so that multiple opens of the same semaphore without an intervening
sem_close() return the same object, and so that sem_close() does not
segfault while trying to remove the item from the list.


109040 10-Jan-2003 tjr

Avoid a memory leak by using reallocf() instead of realloc().


109039 10-Jan-2003 tjr

Prototype __getcwd() to avoid a warning.


109038 10-Jan-2003 tjr

#include <ctype.h> for prototypes (or macro versions) of
tolower() and isdigit().


108868 07-Jan-2003 tjr

#include "namespace.h" to get a prototype for _err().


108865 07-Jan-2003 tjr

Use hidden names (_close, _dup2, _waitpid, etc.) where appropriate.


108641 04-Jan-2003 tjr

Fix a number of bugs noticed by more extensive testing:
o Call waitpid() if an error occurs after forking the child process
to avoid leaving zombies around.
o Handle the WRDE_DOOFS|WRDE_APPEND combination correctly
o Do not confuse $( substitution with $(( shell arithmetic
(noticed by wollman)
o Handle backslash escaping properly
o Allow $( and ${ to be quoted


108637 04-Jan-2003 tjr

Rename UL_GETSIZE to UL_GETFSIZE and UL_SETSIZE to UL_SETFSIZE; these are
the names required by 1003.1-2001. The old names are retained for
source compatibility with FreeBSD 5.0 and will be removed before 6.0.


108633 04-Jan-2003 tjr

Remove unused variable: sz.


108632 04-Jan-2003 tjr

Remove unused variable: size.


108631 04-Jan-2003 tjr

#include <string.h> for strcmp()'s prototype.


108630 04-Jan-2003 tjr

Remove unused variable: omask.


108629 04-Jan-2003 tjr

#include <sys/linker.h> for kldload()'s prototype.


108628 04-Jan-2003 tjr

#include <string.h> for strlen()'s prototype.


108626 03-Jan-2003 tjr

#include <ctype.h> for isspace()'s prototype (or a macro version).


108621 03-Jan-2003 tjr

Remove an unused variable: `sb' in fts_read().


108620 03-Jan-2003 tjr

Remove an unused variable, `sverrno', which has not been used since 1.11.


108597 03-Jan-2003 tjr

It is no longer necessary to include sys/types.h before wordexp.h.


108582 03-Jan-2003 tjr

popen() is a function, not an argument.


108580 03-Jan-2003 tjr

Protect pidlist with a mutex to avoid a race causing a duplicate free()
when the same pipe FILE is pclosed()'d in different threads, and to avoid
corrupting the linked list when adding or removing items. The symptoms of
the linked list getting corrupted were pclose() either not finding the pipe
on the list, or the list becoming circular and pclose() looping infinitely.


108553 02-Jan-2003 thomas

In cgetmatch(3), return -1 if a NULL or 0-length name parameter is used.
This situation most notably arises in chkprintcap, when a /etc/printcap
entry has an empty rp= attribute. In that case, cgetmatch would enter
an infinite loop if any entry in the file has multiple names.

This causes lpd to hang at boot time on 5.0-DP2 when both conditions
are met (:rp=: and multiple names -- not necessarily on the same entry).

Reviewed by: roberto


108533 01-Jan-2003 schweikh

Correct typos, mostly s/ a / an / where appropriate. Some whitespace cleanup,
especially in troff files.


108470 30-Dec-2002 schweikh

Fix typos, mostly s/ an / a / where appropriate and a few s/an/and/
Add FreeBSD Id tag where missing.


108445 30-Dec-2002 obrien

Back out the s/int */size_t */ commit.
It makes a difference on 64-bit arches, and no one really wants a 2^64
block size [yet].


108419 30-Dec-2002 marcel

Fix LP64 architectures and especially ia64. Functions that return
a pointer and lack a prototype will have the return value (assumed
to be an integer) zero-extended to a pointer. On ia64 this is
unconditionally fatal as it zeroes-out the region bits, forming an
invalid pointer. Fix the sigsegv by including <stdlib.h>.

Pointy hat: bbraun


108380 29-Dec-2002 mike

Use `useconds_t' instead of `u_int' or `unsigned int' where appropriate.


108317 27-Dec-2002 schweikh

english(4) police.


108312 27-Dec-2002 alfred

Silence casting away constness warnings.

Make cgetmatch's locals const.
Make cdbget take a const string and copy it into a buffer.


108310 27-Dec-2002 tjr

Fix a small typo.


108299 27-Dec-2002 tjr

Be more consistent with "static".


108288 26-Dec-2002 tjr

Add an implementation of the POSIX wordexp() and wordfree() functions,
which perform shell-style word expansion on strings. This is still a
little rough around the edges.

PR: 13420


108163 21-Dec-2002 bbraun

Reduce libc's memory footprint by lazily allocating memory used internally
by setproctitle().

Reviewed by: jkh


108152 21-Dec-2002 bbraun

Reduce libc.so's memory footprint by lazily allocating memory used internally
by basename() and dirname().
Reviewed by: eric


108087 19-Dec-2002 ru

mdoc(7) police: "The .Fa argument.".


108040 18-Dec-2002 ru

mdoc(7) police: Fixed abuses of the .Ar and .Em macros.


108030 18-Dec-2002 ru

mdoc(7) police: "The .Fn function".


108029 18-Dec-2002 ru

mdoc(7) police: Fixed the .Nm abuse.


107929 16-Dec-2002 maxim

o getsockopt(2) 'level' argument should be 0, not SOCK_STREAM. It
does not hurt anything because uipc_ctloutput() does not check
sopt->sopt_level.

Pointed out by: ru
MFC after: 1 week


107895 15-Dec-2002 maxim

o Fix bogus getsockopt(2) call: swap SOCK_STREAM and LOCAL_PEERCRED.
The bug does not affect anything because SOCK_STREAM == LOCAL_PEERCRED == 0x1.

PR: bin/46165
Submitted by: Alain Thivillon <at@rominet.net>
Reviewed by: dd
MFC after: 1 week


107788 12-Dec-2002 ru

Uniformly refer to a file system as "file system".

Approved by: re


107631 05-Dec-2002 ru

Capitalize ASCII code names.

Approved by: re


107619 04-Dec-2002 ru

Consistently mark std(in|out|err) with .Dv, because that's how they
are marked up in stdio(3), and because they are defined expressions
of type "FILE *".

Approved by: re


107592 04-Dec-2002 ru

mdoc(7) police: overhaul.

Approved by: re


107387 29-Nov-2002 ru

mdoc(7) police: formatting nits.

Approved by: re


107052 18-Nov-2002 ru

libc_r wasn't so tied to libc for 22 months.


107000 17-Nov-2002 dougb

goto break; != break;

I've no idea if this is the right behavior for the library, but this
at least fixes the build, and matches what seems to be alfred's intent
in the commit message for 1.19.


106998 17-Nov-2002 alfred

Rework the sysconf(3) interaction with aio:

sysconf.c:
Use 'break' rather than 'goto yesno' in sysconf.c so that we report a '0'
return value from the kernel sysctl.

vfs_aio.c:
Make aio reset its configuration parameters to -1 after unloading
instead of 0.

posix4_mib.c:
Initialize the aio configuration parameters to -1
to indicate that it is not loaded.
Add a facility (p31b_iscfg()) to determine if a posix4 facility has been
initialized to avoid having to re-order the SYSINITs.
Use p31b_iscfg() to determine if aio has had a chance to run yet which
is likely if it is compiled into the kernel and avoid spamming its
values.
Introduce a macro P31B_VALID() instead of doing the same comparison over
and over.

posix4.h:
Prototype p31b_iscfg().


106976 16-Nov-2002 alfred

Provide more correct default values for sysconf(3) reporting of the AIO
subsystems capabilities:

_SC_AIO_LISTIO_MAX returns the default of _POSIX_AIO_LISTIO_MAX
_SC_AIO_MAX returns the default _POSIX_AIO_MAX
_SC_AIO_PRIO_DELTA_MAX returns the default of 0

Without these adjustments the values returned are -1 even when the
aio side of the kernel returns '0' for them which is incorrect.

Noticed by: Craig Rodrigues <rodrigc@attbi.com>


106911 14-Nov-2002 ru

Reset LogTag to NULL in closelog(3). This fixes mysterious crashes
caused by dynamic PAM modules that call openlog(3) and closelog(3),
e.g. ports/security/pam_pwdfile.

What happened here is that the module first registered its "ident"
with openlog(3), then PAM library unloaded module with dlclose(3),
and the next call to syslog(3) resulted in SIGSEGV.

MFC after: 3 days


106880 13-Nov-2002 deischen

Argh, change declaration of two-dimensional array so that it actually
builds.


106866 13-Nov-2002 deischen

Use a jump table (a la Solaris) for pthread routines with default
entries in the table being stubs. While I'm here, add macros to
auto-generate the stubs. A conforming threads library can override
the stub routines by filling in the jump table.

Add some entries to namespace.h and sync un-namespace.h to it.
Also add a comment to remind folks to update un-namespace.h
when changing namespace.h.


106288 01-Nov-2002 dfr

* Add stubs for pthread_cond_broadcast.
* Fix typos in rwlock stubs.
* Add pthread_XXX counterparts to the _pthread_XXX stubs which libraries
like libX11 can use to ensure thread-safety without requiring the use
of a thread library.

Submitted by: Terry Lambert (pthread_cond_broadcast)
Reviewed by: deischen


106065 28-Oct-2002 wollman

Create a small library function, check_utility_compat(3), to determine
whether a named utility should behave in FreeBSD 4.x-compatible mode
or in a standard mode (default standard). The configuration is done
malloc(3)-style, with either an environment variable or a symlink.

Update expr(1) to use this new interface.


106055 27-Oct-2002 wollman

Update limits and configuration parameters for 1003.1/TC1/D6.
Implement new sysconf keys. Change the implenentation of
_SC_ASYNCHRONOUS_IO in preparation for the next set of changes.

Move some limits which had been in <sys/syslimits.h> to <limits.h> where
they belong. They had only ever been in syslimits.h to provide for the
kernel implementation of the CTL_USER MIB branch, which went away with
newsysctl years ago. (There is a #error in <sys/syslimits.h> which I
will downgrade in the next commit.)


105797 23-Oct-2002 markm

Make the first argument of getbsize a size_t* instead of an int*, as this is what the quantity actually is. Fix an easy const while I'm here.


105446 19-Oct-2002 tjr

The ftok() function has not been in libcompat for quite a while.


105406 18-Oct-2002 markm

Oops. Also provide a lint-compatible unused argument warning killer.


105405 18-Oct-2002 markm

ISOfy functions, sort headers and mark unused arguments.


105205 16-Oct-2002 tjr

Add a Bugs section and note that fmtcheck() is out of sync with printf();
it does not recognise any of the conversions or modifiers added in C99.


104989 12-Oct-2002 mike

Add restrict type-qualifier.


104891 11-Oct-2002 maxim

Do not allow empty GIDs for non-NIS entries.

MFC after: 2 weeks


104704 09-Oct-2002 peter

Drop almost 3k from /bin/sync by moving errno to a seperate file
to avoid all syscalls pulling in sys_errlst[].

Noted by: bde


104492 04-Oct-2002 mike

Add restrict type-qualifier to sem_getvalue().


104348 02-Oct-2002 maxim

Too strict error checking in rev. 1.22 broke pwd_mkdb(8) in NIS
environment. An empty UID and GID are valid there.

Spotted by: rwatson


103958 25-Sep-2002 maxim

Disqualify UID/GID with non-numeric character.

PR: bin/41721
Reviewed by: tjr, silence on -audit
MFC after: 2 weeks


103730 21-Sep-2002 wollman

Initiate deorbit burn sequence for sysctl CTL_USER MIB branch.
Use the correct constants directly from sysconf() rather than calling
sysctl() to tell us the (still compiled-in) value. Leave the CTL_POSIX1B
stuff alone for now (but I'd like to see this replaced with a single
structure returning all of the relevant information).

Implement all of the keys from 1003.1-2001 that we can. Ensure that
the build will break if someone redefines an option constant to zero
without implementing the necessary presence-detection logic here.

(4 of 5)


103726 21-Sep-2002 wollman

Make the threatened fts(3) ABI fix. FTSENT now avoids the use of the struct
hack, thereby allowing future extensions to the structure (e.g., for extended
attributes) without rebreaking the ABI. FTSENT now contains a pointer to the
parent stream, which fts_compar() can then take advantage of, avoiding the
undefined behavior previously warned about. As a consequence of this change,
the prototype of the comparison function passed to fts_open() has changed
to reflect the required amount of constness for its use. All callers in the
tree are updated to use the correct prototype.

Comparison functions can now make use of the new parent pointer to access
the new stream-specific private data pointer, which is intended to assist
creation of reentrant library routines which use fts(3) internally.

Not objected to in spirit by: -arch


103666 20-Sep-2002 mini

Don't peek into MD structures from MI code. The getcontext(3) and
setcontext(3) functions check the validify of the mcontext_t structs.


103593 19-Sep-2002 wollman

Return the correct environment name for 64-bit platforms in the
_CS_POSIX_V6_WIDTH_RESTRICTED_ENVS case.


103578 19-Sep-2002 alfred

Welcome the sem_ API to libc!


103576 19-Sep-2002 alfred

add a stub for pthread_cond_destroy.


103460 17-Sep-2002 peter

Bandaid to stop failing on non-i386 platforms.
Add a big ugly #warning as a reminder.


103436 17-Sep-2002 peter

Initiate deorbit burn for the i386-only a.out related support. Moves are
under way to move the remnants of the a.out toolchain to ports. As the
comment in src/Makefile said, this stuff is deprecated and one should not
expect this to remain beyond 4.0-REL. It has already lasted WAY beyond
that.

Notable exceptions:
gcc - I have not touched the a.out generation stuff there.
ldd/ldconfig - still have some code to interface with a.out rtld.
old as/ld/etc - I have not removed these yet, pending their move to ports.
some includes - necessary for ldd/ldconfig for now.

Tested on: i386 (extensively), alpha


103405 16-Sep-2002 mini

Add signalcontext(), which lays down a signal frame onto a ucontext_t.

Reviewed by: deischen, julian
Approved by: -arch


103239 11-Sep-2002 archie

Add man pages for getcontext()/setcontext(), makecontext()/swapcontext(),
and ucontext_t.

Reviewed by: mini
MFC after: 3 days


103213 11-Sep-2002 mike

Add `restrict' type-qualifier.


103090 08-Sep-2002 wollman

Fix a syntax error which causes an annoying warning.


103066 07-Sep-2002 jmallett

Two arrays were born from the same seeds, both grew into complementary sets
of pointers to strings. These two arrays were fixed to the same size, but one
had an implicit zeroed trailer element, which was unused because the size was
used up by the ones before said zeroed trailer element. So the unused limb was
chopped off the over-sized-but-not-over-sized array, and everyone lived happily
ever after.


103012 06-Sep-2002 tjr

Style: One space between "restrict" qualifier and "*".


102750 01-Sep-2002 mike

Fix a memory leak.


102340 24-Aug-2002 mike

Note that <sys/types.h> in no longer a prerequisite for <utime.h> and
<sys/mman.h>.


102229 21-Aug-2002 phk

s/EDOFUS/EDOOFUS/

Persuaded by: Google


102117 19-Aug-2002 jmallett

s/trailing NULL/trailing NUL/


101993 16-Aug-2002 bmilekic

Fix libc build breakage by defining FSTYPENAMES before including
disklabel.h; broken originally by 1.87 of sys/disklabel.h, which
made the split between DKTYPENAMES and FSTYPENAMES.
Someone who knows disklabel.c: do we still need DKTYPENAMES to be
defined here now?


101810 13-Aug-2002 ru

can not -> cannot.


101695 11-Aug-2002 dwmalone

Add a missing copyright for Doug. There are other files missing this
copyright in -stable.

PR: 41397
Submitted by: dfr


101677 11-Aug-2002 schweikh

Fix typos; each file has at least one s/seperat/separat/
(I skipped those in contrib/, gnu/ and crypto/)
While I was at it, fixed a lot more found by ispell that I
could identify with certainty to be errors. All of these
were in comments or text, not in actual code.

Suggested by: bde
MFC after: 3 days


101651 10-Aug-2002 mux

- Introduce a new struct xvfsconf, the userland version of struct vfsconf.
- Make getvfsbyname() take a struct xvfsconf *.
- Convert several consumers of getvfsbyname() to use struct xvfsconf.
- Correct the getvfsbyname.3 manpage.
- Create a new vfs.conflist sysctl to dump all the struct xvfsconf in the
kernel, and rewrite getvfsbyname() to use this instead of the weird
existing API.
- Convert some {set,get,end}vfsent() consumers to use the new vfs.conflist
sysctl.
- Convert a vfsload() call in nfsiod.c to kldload() and remove the useless
vfsisloadable() and endvfsent() calls.
- Add a warning printf() in vfs_sysctl() to tell people they are using
an old userland.

After these changes, it's possible to modify struct vfsconf without
breaking the binary compatibility. Please note that these changes don't
break this compatibility either.

When bp will have updated mount_smbfs(8) with the patch I sent him, there
will be no more consumers of the {set,get,end}vfsent(), vfsisloadable()
and vfsload() API, and I will promptly delete it.


101574 09-Aug-2002 ru

mdoc(7) police: laundry.


101567 09-Aug-2002 phk

Introduce a new error return code:
#define EDOFUS 88 /* Programming error */
This can be used to signal error situations which indicate that the
program logic or assumptions is deficient.


101497 08-Aug-2002 mike

Implement POSIX.1-2001 (XSI)'s ulimit(3).

Submitted by: Kyle Martin <mkm@ieee.org>


101403 05-Aug-2002 mike

o Fix a memory leak.
o Rewrite validmsgverb() so that it works (I'm not sure how it escaped
my original testing).
o Document nextcomp().


101353 05-Aug-2002 mike

Implement POSIX.1-2001 (XSI)'s fmtmsg(3).


100217 17-Jul-2002 mikeh

Update glob(3) to add all the POSIX required options, specifically:

- add GLOB_NOMATCH return value and use it when we don't get a match
- rename GLOB_ABEND to GLOB_ABORTED and use it instead of returning 1
in some places
- add GLOB_NOESCAPE flag and retire GLOB_QUOTE to compatibility
section

Suggestions/advice on correct usage of POSIX defines: wollman


100196 16-Jul-2002 wollman

Don't ask me how I consistently turned struct statvfs into struct vfsconf....


100150 15-Jul-2002 wollman

Assume that my bug report against 1003.1-2001 will be resolved my way,
and make 64-bit architectures use the LP64_OFF64 environment instead
of the LPBIG_OFFBIG one.


100149 15-Jul-2002 wollman

Support POSIX/SUS ``programming environment'' mistake in confstr().


100146 15-Jul-2002 wollman

All of the things that confstr() returns are compile-time constants.
It's silly to call sysctl() to get the value of _PATH_STDPATH from
<paths.h> when we can just use it directly. This greatly simplifies
the implementation. (This is also part of my grand scheme to get
rid of sysctl's `user' category, which should never have been created.)

Use strlcpy() instead of strncpy() as it has the exact semantics we want.


100142 15-Jul-2002 wollman

Don't bother asking the kernel about _SC_FSYNC; it's not optional.


99924 13-Jul-2002 wollman

Fix a few bugs in the ERRORS section.


99922 13-Jul-2002 wollman

Add statvfs(3) to the build.

Tested by: Steve Kargl


99921 13-Jul-2002 wollman

Well, it's not quite strxfrm(3) but at least it's honest.


99843 12-Jul-2002 keramida

Various typo fixes.

PR: docs/39395
Submitted by: Rich Neswold <rneswold@ameritech.net>


99836 11-Jul-2002 wollman

A simple implementation of statvfs(3) (one step above the trivial one).
Not yet connected to the build (awaiting documentation).


99359 03-Jul-2002 chris

Move appropriate information out of `DESCRIPTION' and into `SECURITY
CONSIDERATIONS'.

Sponsored by: DARPA, NAI Labs


98909 27-Jun-2002 deischen

Remove pselect from application namespace and instead use a weak reference
to the actual implementation. This is to allow libc_r to override
pselect() making it a cancellation point.

Prompted by: wollman


98908 27-Jun-2002 deischen

Remove improper use of <namespace.h>.
Remove fmtcheck from application name space (fix the weak reference).


98315 17-Jun-2002 wollman

Actually document pselect(3) so that Bruce can mention it in the release
notes. :-)


98273 15-Jun-2002 wollman

Add pselect(3) to the build. Need to figure out the most appropriate
way to document this interface.


97509 29-May-2002 wollman

Since POSIX gives us plenary authority to define _t types, change
__dlfunc_t to dlfunc_t to match what I have proposed to the Austin
Group. (This also makes it easier for applications to store these
values before they decide what to do with them, e.g., in a wrapper
function.)


97490 29-May-2002 wollman

Add link dlopen(3) -> dlfunc(3).

Reminded by: mike


97475 29-May-2002 wollman

Reorganize dlfcn.h slightly to separate out XSI and BSD interfaces.
Add new dlfunc() interface, which is a version of dlsym() with a
return type that can be cast to a function pointer without turning
your computer into a frog.

Reviewed by: freebsd-standards


97407 28-May-2002 alfred

Assume __STDC__, remove non-__STDC__ code.

Submitted by: keramida


97207 24-May-2002 jake

These files are no longer used.


97191 23-May-2002 jake

Generate the normal asm stubs for all sysv system calls. Use these instead
of C wrappers for the *sys indirect system calls. The indirect system calls
are horribly broken on sparc64.

Submitted by: tmm


96475 12-May-2002 phk

Retire the bogus uses of the disklabel field d_sbsize and begin to
initialize it to zero so we don't have to have everbody and their
aunt including FFS specific header files.

Sponsored by: DARPA & NAI Labs.


96247 09-May-2002 joe

Replace /kernel with /boot/kernel/kernel.

PR: docs/37757
Submitted by: Hiten Pandya <hiten@uk.FreeBSD.org>


96186 07-May-2002 des

Fix bug that causes passwd and friends to fail when the user has a '+' in
their passwd file for NIS because _PWF_SOURCE is not set.

Submitted by: amigus (perforce change 10969)


95459 25-Apr-2002 des

#include <string.h> instead of <strings.h>


94831 16-Apr-2002 joe

Support the snapshot file flag, so that tools like 'ls -ol' work
as expected on snapshot files.

PR: bin/37038
Submitted by: Joshua Goodall <joshua@roughtrade.net>


94700 15-Apr-2002 des

Missed a spot in previous commit.

Sponsored by: DARPA, NAI Labs


94688 14-Apr-2002 des

(ab)use unused bits in the pw_fields member of struct passwd to record
the source of the data contained in the structure.

Sponsored by: DARPA, NAI Labs


94276 09-Apr-2002 ru

No longer needed to #ifdef __FBSDID, this is now handled by Makefile.inc1.


94181 08-Apr-2002 phk

Catch up with const'ification of <sys/disklabel.h> and quelch warnings.


93723 03-Apr-2002 phk

Initial deorbit burn for the undocumented and unused d_boot[01]
fields of struct disklabel.

Sponsored by: DARPA and NAI Labs.


93399 29-Mar-2002 markm

Do not use __progname directly (except in [gs]etprogname(3)).
Also, make an internal _getprogname() that is used only inside
libc. For libc, getprogname(3) is a weak symbol in case a
function of the same name is defined in userland.


93189 26-Mar-2002 bde

Fixed some style bugs in the removal of __P(()). Some function parameter
lists were outdented to column 0.


93082 24-Mar-2002 dd

A break after a return is useless.


93081 24-Mar-2002 dd

Fix braino.


93032 23-Mar-2002 imp

Breath deep and take __P out of the system include files.

# This appears to not break X11, but I'm having problems compiling the
# glide part of the server with or without this patch, so I can't tell
# for sure.


92991 22-Mar-2002 obrien

Fix the style of the SCM ID's.
I believe have made all of libc .h's as consistent as possible.


92986 22-Mar-2002 obrien

Fix the style of the SCM ID's.
I believe have made all of libc .c's as consistent as possible.


92941 22-Mar-2002 obrien

Remove multi-line __P() usage.


92925 22-Mar-2002 imp

const poison just like NetBSD.


92924 22-Mar-2002 imp

Make user_from_uid and group_from_gid return const char *, just like
NetBSD. Update man page to reflect this.


92905 21-Mar-2002 obrien

Remove __P() usage.


92862 21-Mar-2002 peter

Move swapcontext.c to the ${MACHINE_ARCH}/gen/Makefile.inc area, otherwise
it causes undefined references to getcontext() and setcontext() on
platforms other than i386 and alpha.


92531 18-Mar-2002 dd

mdoc(7) police: bump document date to the date of the last interface
change (revision 1.2 of devname.c on 1999/07/18), don't put quotes
around a path, and use .Dv where appropriate.


92530 18-Mar-2002 dd

Update to reflect reality; devname(3) hasn't returned NULL on failure
since revision 1.2 of devname.c (1999/07/18). While I'm here, note,
in the BUGS section, that the returned pointer is to a static buffer.


92350 15-Mar-2002 ru

Come on guys, you can't just take OpenBSD manpage and commit it
over someone else's fixes; this is at least offensive. If you
have problems doing a proper merge, we are here, your fellow
committers. :-(

Reapply markup fixes from revision 1.2 and fix some more. Also
fix the $OpenBSD$ tag.


91940 09-Mar-2002 dwmalone

If syslog fails to talk to syslogd, then it tries to write a message
to the console in a final attempt to log something. Make this final
attempt non-blocking so that a blocking console doesn't end up
blocking process which attempt to syslog something.

In particular, this means you should be able to su and fix the
problem if the console becomes blocking.

MFC after: 3 weeks


91930 09-Mar-2002 dd

This API will appear in FreeBSD 4.6.


91925 09-Mar-2002 dd

Bring a comment in line with the code, and fix some spelling errors
while I'm here.

PR: 35394
Submitted by: andrew@ugh.net.au


91922 09-Mar-2002 green

Fix build. I commented out getpass() in readpassphrase.c because the
implementation did not match our manpage description (i.e., it could
return NULL). I mistakenly thought we were still using getpass.c
because, for some reason, CVS never removed it from the tree.

Pointy hat received from: alfred
Kick in the groin to: CVS


91913 08-Mar-2002 green

Update readpassphrase(3)to the latest revisions. Changes are mainly due
to return value constraints now changing as well as more intelligent
handling of signals.

Obtained from: OpenBSD


91814 07-Mar-2002 green

Add new errno ``ENOATTR''.


91354 27-Feb-2002 dd

Introduce a version field to `struct xucred' in place of one of the
spares (the size of the field was changed from u_short to u_int to
reflect what it really ends up being). Accordingly, change users of
xucred to set and check this field as appropriate. In the kernel,
this is being done inside the new cru2x() routine which takes a
`struct ucred' and fills out a `struct xucred' according to the
former. This also has the pleasant sideaffect of removing some
duplicate code.

Reviewed by: rwatson


91330 26-Feb-2002 alfred

use _GENERIC_DIRSIZ(dp) to avoid copying too much of the dirent over
the user supplied buffer. this can be a problem when the user doesn't
supply a full dirent and we corrupt their memory.


91245 25-Feb-2002 sobomax

Per POSIX <grp.h> doesn't require <sys/types.h>.

Submitted by: ache


90878 19-Feb-2002 imp

Fixed divots that I created when I moved prototypes of group_from_gid
and user_from_uid to grp.h and pwd.h. Update the man pages.

Submitted by: David Malone
Pointy hat to: imp


90605 13-Feb-2002 imp

Use new-style function declations.


90393 08-Feb-2002 ru

FreeBSD 4.1 bootstrapping aid (__FBSDID is not there).


90172 04-Feb-2002 sobomax

Allow ldd(1) be used on shared libraries in addition to executables.


90096 01-Feb-2002 bde

Fixed tab lossage in vendor id and nearby style bugs in previous commit.


90095 01-Feb-2002 bde

Fixed syntax error in previous commit. It was non-fatal because it was
in conditional code that happens not to be compiled, and because gcc
doesn't complain garbage after #endif by default.

Fixed some style bugs in previous commit, 1.8 and 1.1.


90050 01-Feb-2002 obrien

Fixed slipage in editor.


90049 01-Feb-2002 obrien

Cut-n-paste in `list' mode considered harmful.


90045 01-Feb-2002 obrien

* Remove __P and convert to ANSI prototypes.
* Remove 'register'. (some functions had 7+ register functions...)
* Fix SCM ID's.


90041 01-Feb-2002 obrien

* Remove 'register'. (some functions had 7+ register functions...)
* Fix SCM ID's.


90039 01-Feb-2002 obrien

Fix SCM ID's.


90030 31-Jan-2002 obrien

Fix minor style nit.


90016 31-Jan-2002 bde

Fixed world breakage due to missing include of <sys/cdefs.h> in previous
commit.

Fixed related style bugs:
basename.c: misplaced '#if 0'
dirname.c: misplaced '#if 0'
getgrent.c: missing '#if 0', and tab lossage in vendor id (the previous
commit fixed the complete corruption of the vendor id but
lost a tab)
getpwent.c: missing '#if 0'


89999 30-Jan-2002 obrien

Fix FreeBSD IDs.


89805 25-Jan-2002 dwmalone

Use ctime_r to build the timestamp for syslog, so that we don't
clobber a ctime buffer which is passed in.

PR: 34022
Submitted by: Hartmut Brandt <brandt@fokus.gmd.de>
MFC after: 2 weeks


89700 23-Jan-2002 ru

The sixth argument to the NET_RT_IFLIST sysctl is actually 0 for
all interfaces, and ifnet.if_index value for a single interface.


89663 22-Jan-2002 markm

Use the proper type (gid_t) for (group)->gr_gid to be orthogonal
with uid_t usage and (user)->pw_uid.

PR: 3242


89428 16-Jan-2002 ru

mdoc(7) police: tidy up OpenBSD fixes.


89362 14-Jan-2002 ru

yp(4) -> yp(8).

PR: docs/30797


89323 14-Jan-2002 cjc

Merge some updates and markup fixes from OpenBSD. This is mainly
motivated by the new "CAVEATS" section.

Inspired by: alfred noting NetBSD's merging OpenBSD's changes
Obtained from: OpenBSD


89269 11-Jan-2002 deischen

Include <stddef.h> to fix build problem when namespace pollution
by <signal.h> (including <time.h> so that NULL is accidentally defined)
is removed.

Style nits.

Submitted by: bde


89264 11-Jan-2002 bde

Fixed missing backslash in previous commit.


89262 11-Jan-2002 bde

Fixed accumulated unsorting and some other style bugs (long lines).


89177 10-Jan-2002 deischen

Add getcontext, setcontext, makecontext, and swapcontext. These
functions are defined in SUSv2 and the latest POSIX spec.

Thanks to Bernd Walter <ticso@cicely8.cicely.de> for helping debug my
alpha assembly.

Approved by: -arch


87794 13-Dec-2001 ru

If the OID is missing, sysctl(3) returns ENOENT, not EOPNOTSUPP.

PR: docs/32793
Submitted by: Hartmut Brandt <brandt@fokus.gmd.de>


87533 08-Dec-2001 ru

Start using .St macro for POSIX.1-2001.


87348 04-Dec-2001 des

Correct some egregious style bugs.


87347 04-Dec-2001 des

Add a missing error check. This fixes a bug that would cause pwd_mkdb to
dump core if invoked with an input file that looks like a password file
but isn't (e.g. /etc/group).

PR: 32378
Submitted by: Maxim Konovalov <maxim@macomnet.ru>
MFC after: 1 week


87245 02-Dec-2001 tobez

Fix typos getpeerid -> getpeereid.

PR: docs/32442
Reviewed by: dd


87161 01-Dec-2001 jkoshy

Add support for sysconf(_SC_NPROCESSORS_CONF) and sysconf(_SC_NPROCESSORS_ONLN).
This API is supported in SVR4.0MP, Solaris, Linux, AIX and Tru64 Unix.

PR: bin/27489
Submitted by: Arun Sharma <arun@sharma-home.net>
Reviewed by: bde (prior version)


87054 28-Nov-2001 tobez

Do not write warning messages on stderr - a caller is expected to check
the return code and errno instead. Those warnings did not do any good
for daemonized users of initgroups(3), and confused cvs clients that
communicated with non-root cvs pserver.

The committed fix differs from the one suggested in the PR, and was
submitted by ru.

PR: 15421
Approved by: markm
Discussed on: -stable, -current at various times


86771 22-Nov-2001 ru

mdoc(7) police: markup cleanup.


86768 22-Nov-2001 ru

mdoc(7) police: add missing comma.


86750 21-Nov-2001 fjoe

fix compilation (include -> #include)


86733 21-Nov-2001 green

Should also include namespace.h

Submitted by: ru


86732 21-Nov-2001 green

Change certain syscalls from x to _x.

Prodded by: bde


86669 20-Nov-2001 green

Introduce readpassphrase(3), a superset of getpass(3). This
comes originally from Todd Miller.

Obtained from: OpenBSD


86655 20-Nov-2001 ru

mdoc(7) police: remove whitespace at EOL.


86457 16-Nov-2001 dd

Create link from directory.3 to readdir_r.3.

PR: 32028
Submitted by: andrew@ugh.net.au


86250 11-Nov-2001 bde

Fixed namespace pollution related to `err' in libc in the same way as for
`warn'. Now a whole 2 members of the err() family don't cause pollution.

This fixes world breakage in awk for NOSHARED worlds. contrib/awk/msg.c
has had its own version of err() for a long time, but this somehow
didn't cause problems until the update to awk-3.1.0.


86107 05-Nov-2001 dwmalone

Add a note explaining why CLOCKS_PER_SEC isn't 1000000.
While I'm here, "of a second" does not belong to CLOCKS_PER_SEC.

PR: 30297
Submitted by: Bernd Luevelsmeyer <bdluevel@heitec.net>


85868 02-Nov-2001 phk

Add notice about early use from malloc.c forbidding malloc use from
this function.


85671 29-Oct-2001 mike

Make the output from assert() look more like the example in the C99
standard.

Requested by: bde


85607 27-Oct-2001 mike

Only provide function information in compile environments that support
the C99 variable __func__ and never for C++. Provide a more meaningful
example in the assert(3) manual.

Reviewed by: asmodai, bde


85605 27-Oct-2001 mike

Restore K&R prototype. Fix other style bugs.

Reviewed by: asmodai, bde


85572 27-Oct-2001 peter

Explicitly use int32_t for on-disk records for pw_change and pw_expire,
since that is what we use now and this insulates us from any time_t
tweaks here. We can define a record format that uses 64 bit times if/when
we need to.


85422 24-Oct-2001 asmodai

Add __FBSDID.
Change __assert() function to print failing function name.
#if 0 the sccsid block.
This makes us C99 conforming.


84768 10-Oct-2001 bde

Compensate for "Compensate for header dethreading" by backing it out.


84306 01-Oct-2001 ru

mdoc(7) police: Use the new .In macro for #include statements.


83722 20-Sep-2001 ru

Document the FTS_ROOTPARENTLEVEL and FTS_ROOTLEVEL constants.


82642 31-Aug-2001 ru

Use ``.Rv -std'' wherever possible.

Submitted by: yar


82496 29-Aug-2001 bde

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.


82252 24-Aug-2001 dd

begin executed --> being executed

Obtained from: NetBSD


82090 21-Aug-2001 dd

Use .In, .Ux, and .Rv where appropriate. Also consistently call this
a "function" instead of a "routine".

Submitted by: ru


82089 21-Aug-2001 dd

Expand the ?: construct into an if/else.

Submitted by: nectar


82087 21-Aug-2001 dd

The setprogname() function sets the name of the program to be the last
component of the progname argument.


82086 21-Aug-2001 dd

Fix style bug.


82081 21-Aug-2001 ru

Fixed warnings.


82077 21-Aug-2001 nectar

Pass the pointy hat, please.

Submitted by: ru


82075 21-Aug-2001 nectar

setprogname() should set __progname to the last component of the given
path.


81861 17-Aug-2001 dd

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.


81629 14-Aug-2001 yar

Use the ".Rv" mdoc(7) macro where appropriate.

Reviewed by: ru


81622 14-Aug-2001 ru

mdoc(7) police: s/BSD/.Bx/ where appropriate.


81591 13-Aug-2001 ru

mdoc(7) police: s;BSD/OS;.Bsx; where appropriate.


81590 13-Aug-2001 ru

mdoc(7) police: s/NetBSD/.Nx/ where appropriate.


81588 13-Aug-2001 ru

Spell "FreeBSD" with "F" and "BSD" in uppercase.


81586 13-Aug-2001 ru

Removed duplicate VCS ID tags, as per style(9).


81462 10-Aug-2001 ru

mdoc(7) police: join split punctuation to macro calls.


81458 10-Aug-2001 ru

mdoc(7) police: fixed the "new sentence" bogons.


81449 10-Aug-2001 ru

mdoc(7) police: protect trailing full stops of abbreviations
with a trailing zero-width space: `e.g.\&'.


81359 09-Aug-2001 sobomax

Fix xrefs.

times.3: gettimeofday(3) --> gettimeofday(2)
rc.conf.5: isndn(8) --> isdnd(8)
idsnd(8) --> isdnd(8)

MFC after: 2 weeks


81352 09-Aug-2001 yar

Use the ``.Rv -std'' mdoc(7) macro in appropriate cases.

Reviewed by: ru


81326 09-Aug-2001 mikeh

typo: patched->matched


81285 08-Aug-2001 ru

mdoc(7) police: expand plain text xrefs.


81251 07-Aug-2001 ru

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.


81233 07-Aug-2001 ru

mdoc(7) police: markup nits.


81149 05-Aug-2001 dd

varargs -> stdarg


80898 01-Aug-2001 sheldonh

MFS: in HISTORY section, fix release number of first appearance


80895 01-Aug-2001 sheldonh

Fix broken Fn calls; Fn doesn't take a manual page section as an
argument.

Terminate the last sentence with a period.


80743 31-Jul-2001 mp

Only pull in the MD files if they exist. This allows for progressive
implementation and compilation when bringing up a new architecture.


80671 30-Jul-2001 asmodai

FreeBSD now also defines EIDRM and uses it.

Inspired by PR: 22470
Which was submitted by: Bjorn Tornqvist <bjorn@west.se>
MFC after: 1 week


80669 30-Jul-2001 asmodai

Remove bogus BUGS section.

FreeBSD _does_ define ENOMSG as per SVID when IPC_NOWAIT is set.

PR: 22470
Submitted by: Bjorn Tornqvist <bjorn@west.se>
MFC after: 1 week


80552 29-Jul-2001 tmm

Correct the old length argument passed to sysctlbyname to be a pointer
to a size_t (not to an int).

MFC after: 2 days


80525 29-Jul-2001 mikeh

Rename the GLOB_MAXPATH flag of glob(3) to GLOB_LIMIT to be compatible
with NetBSD and OpenBSD. glob(3) will now return GLOB_NOSPACE with
errno set to 0 instead of GLOB_LIMIT when we match more than `gl_matchc'
patterns. GLOB_MAXPATH has been left as an alias of GLOB_LIMIT to
maintain backwards compatibility.

Reviewed by: sheldonh, assar
Obtained from: NetBSD/OpenBSD


80276 24-Jul-2001 sheldonh

The previous delta duplicated a significant amount of information
already found in the sigaction(2) manual.

As discussed with the committer of that delta, cross-reference the list
in sigaction(2) instead of duplicating the list of functions that are
safe for use within signal handlers.


80254 24-Jul-2001 kris

Add the list of signal-handler safe functions here too, so people can
find it more easily

Obtained from: OpenBSD
MFC After: 1 week


79869 18-Jul-2001 ru

mdoc(7) police: fix markup.


79779 16-Jul-2001 kris

Remove unnecessary #include <stdlib.h>

Obtained from: NetBSD
MFC After: 1 week


79754 15-Jul-2001 dd

Remove whitespace at EOL.


79531 10-Jul-2001 ru

mdoc(7) police: removed HISTORY info from the .Os call.


79502 10-Jul-2001 obrien

MFS: add the FreeBSD history.


79499 10-Jul-2001 obrien

Give the FreeBSD history also.


79454 09-Jul-2001 dd

mdoc(7) police: remove extraneous .Pp before and/or after .Sh.


79193 04-Jul-2001 ru

mdoc(7) police: compact VFCF_ list.


79157 03-Jul-2001 dd

mdoc(7) police: fix spacing issue

Submitted by: ru


78936 28-Jun-2001 dd

Fix a one-byte overrun.

PR: 28472
Submitted by: David Xu <davidx@viasoft.com.cn>
Obtained from: OpenBSD


78932 28-Jun-2001 dd

getcwd(3) is defined by POSIX, not ISO C.

Approved by: bde


78919 28-Jun-2001 dd

Document the existing vfc_flags.

PR: 25837
Submitted by: Tony Finch <dot@dotat.at>


78686 24-Jun-2001 dd

Remove duplicate words.


78517 20-Jun-2001 dd

Fix a grammar bogon.


78443 18-Jun-2001 wollman

Fix spelling of `errno' and add cross-references.


78442 18-Jun-2001 wollman

Document _SC_IOV_MAX. Add cross-references to pathconf(2), confstr(3), and
getconf(1). This document still needs to be sorted and to have other missing
parameters described.


78431 18-Jun-2001 wollman

After one too many PRs on the subject, bite the bullet and define IOV_MAX
and its associated constants. Implement _SC_IOV_MAX in the usual way.
Be a bit sloppy about the namespace question; this should get cleared up
in time for 5.0.

MFC after: 1 month


78418 18-Jun-2001 dwmalone

If the username we are trying to look up in the db files won't fit into
the buffer then act like it doesn't exist. The buffer is always big enough
for any valid username.

PR: 27860
Reviewed by: nectar


78169 13-Jun-2001 ru

Complete prototype for fts_compar.


78117 11-Jun-2001 iedowse

Make the non-threaded stub for pthread_sigmask() a no-op instead
of calling sigprocmask(). This matches the behaviour of thr_sigsetmask()
on Solaris; _pthread_sigmask_stub was added purely for compatibility
with Solaris (for TI-RPC), so it might as well do the same thing.

This fixes the problem where client RPC calls ignored all signals
for the complete duration of the RPC. This behaviour is currently
necessary in the threaded case due to locking issues, but was never
intended to occur in non-threaded programs.

Reviewed by: deischen


77926 08-Jun-2001 dd

Xref dladdr(3).

Requested by: -hackers


77599 01-Jun-2001 kris

Fix another unprotected instance of chdir() by extending the
fts_safe_changedir() function and using that instead for both of the
chdir()s.

Partially submitted by: Todd Miller <millert@OpenBSD.org>, bde


77497 30-May-2001 kris

When doing the chdir("..") in the !FTS_NOCHDIR case, stat() after we get
there and compare the inode and device numbers to the values we remember,
to guard against the directory having been moved around in the meantime.

Reported by: Nick Cleaton <nick@cleaton.net>


77200 25-May-2001 eric

Add warnings about trusting user-supplied data.

Reviewed by: ru
Approved by: murray
Obtained from: OpenBSD


77039 23-May-2001 ru

Fix the range of the returned value.

PR: docs/27446
Submitted by: Tadayuki OKADA <tadayuki@mediaone.net>


76748 17-May-2001 ru

Suppress compiler warning by adding a type cast.


76653 15-May-2001 dd

Introduce getprogname(3) and setprogname(3) library calls. These get
and set __progname, respectively.

Discussed on: -arch (Feb 2001), -audit
Reviewed by: -audit
Approved by: kris
Obtained from: (mostly) NetBSD


76224 02-May-2001 obrien

* include/elf.h has been repo copied to include/elf-hints.h, and it no
longer includes machine/elf.h.
* consumers of elf.h now use the minimalist elf header possible.

This change is motivated by Binutils 2.11.0 and too much clashing over
our base elf headers and the Binutils elf headers.


76178 01-May-2001 markm

Compensate for header dethreading.


75860 23-Apr-2001 joerg

Fix directory reads of MNT_UNION mounts, where entries present in both
layers would be displayed twice.

PR: bin/26498
Submitted by: Olliver Fromme <olli@secnetix.de>


75670 18-Apr-2001 ru

mdoc(7) police: normalize .Nd.


75669 18-Apr-2001 ru

mdoc(7) police: fix markup.


75578 17-Apr-2001 kris

Add fmtcheck(), a function for checking consistency of format string
arguments where the format string is obtained from user data, or
otherwise difficult to verify statically.

Example usage:

printf(fmtcheck(user_format, standard_format), arg1, arg2);

checks the format string user_format for consistency (same number/order/
type of format operators) with standard_format. If they differ,
standard_format is used instead to avoid potential crashes or security
violations.

Obtained from: NetBSD
Reviewed by: -arch


75368 10-Apr-2001 deischen

To be consistent, use the __weak_reference macro from <sys/cdefs.h>
instead of #pragma weak to create weak definitions. This macro is
improperly named, though, since a weak definition is not the same
thing as a weak reference.

Suggested by: bde


75158 04-Apr-2001 ru

mdoc(7) police: add missing .Pa call.


74963 28-Mar-2001 peter

Mostly pick up OpenBSD's rev 1.14 by deraadt@ and millert@.
I've left out a couple of unused args between internal functions.
Use MAXPATHLEN, not MAXPATHLEN + 1 in a couple of places.
Pass a pointer to the end of the target filename space.


74921 28-Mar-2001 peter

OpenBSD's g_Ctoc() returned a false error when the target buffer was
exactly the right size. Do it differently - pass a length rather than an
end-of-string+1 pointer as this is more convenient anyway. Get rid of
the bogus +1's.


74918 28-Mar-2001 peter

Fix g_Ctoc() interface, approximately based on OpenBSD's recent changes.
Also, set gl_pathv to NULL after we free it, especially when dealing
with realloc failures.

Obtained from: OpenBSD


74875 27-Mar-2001 cwt

Document LOG_CONSOLE.


74870 27-Mar-2001 ru

MAN[1-9] -> MAN.


74844 27-Mar-2001 alfred

give the "netgrent" functions a home in netdb.h


74729 24-Mar-2001 peter

This is kind of a hack, but it should work. Currently, world is broken
because libc/rpc/key_call.c references uname(), and ps/print.c also
defines uname(), and ps is linked statically. This leads to a symbol
clash. The userland uname(3) kinda sucked anyway as the hostname
etc was too short. And since the libc rpc interface now uses
the utsname.nodename which gets truncated, I was tempted into doing
something about it. Create a new userland uname function, called
__xuname() which takes an extra argument that allows you to change
the size of the fields. uname() becomes a static inline function
in sys/utsname.h that passes the extra argument in. struct utsname
has its field members expanded by default now in userland.
We still provide a 'uname' externally linkable function for things
that either think that they ``know'' the utsname format and assume
32 character strings and bypass the include file, or objects that
are linked against old libcs. ie: just about every plausible
case that I can think of is covered. Should we ever change the
default lengths again, a libc major bump should not be required
as the size is now passed to the function.

XXX the uname(2) in the kernel is for FreeBSD 1.1 binary compatability!
All the uname(3) functions that are exported to userland are actually
implemented in libc with sysctl. uname(1) uses sysctl directly and
does not call uname(3).

PR: bin/4688


74469 19-Mar-2001 jlemon

Introduce the GLOB_MAXPATH flag, which allows the user to limit the
number of paths which glob(3) will return. Remove the hardcoded limit
from the last commit, which restores the previous unbounded behavior.

Document the new flag in the manual page.


74462 19-Mar-2001 alfred

Bring in a hybrid of SunSoft's transport-independent RPC (TI-RPC) and
associated changes that had to happen to make this possible as well as
bugs fixed along the way.

Bring in required TLI library routines to support this.

Since we don't support TLI we've essentially copied what NetBSD
has done, adding a thin layer to emulate direct the TLI calls
into BSD socket calls.

This is mostly from Sun's tirpc release that was made in 1994,
however some fixes were backported from the 1999 release (supposedly
only made available after this porting effort was underway).

The submitter has agreed to continue on and bring us up to the
1999 release.

Several key features are introduced with this update:
Client calls are thread safe. (1999 code has server side thread
safe)
Updated, a more modern interface.

Many userland updates were done to bring the code up to par with
the recent RPC API.

There is an update to the pthreads library, a function
pthread_main_np() was added to emulate a function of Sun's threads
library.

While we're at it, bring in NetBSD's lockd, it's been far too
long of a wait.

New rpcbind(8) replaces portmap(8) (supporting communication over
an authenticated Unix-domain socket, and by default only allowing
set and unset requests over that channel). It's much more secure
than the old portmapper.

Umount(8), mountd(8), mount_nfs(8), nfsd(8) have also been upgraded
to support TI-RPC and to support IPV6.

Umount(8) is also fixed to unmount pathnames longer than 80 chars,
which are currently truncated by the Kernel statfs structure.

Submitted by: Martin Blapp <mb@imp.ch>
Manpage review: ru
Secure RPC implemented by: wpaul


74357 16-Mar-2001 jlemon

Bump MAX_GLOBENTRIES up to 16384, so it is a power of two. Add
some comments explaining that this is an arbitrary limit.

Requested by: jkh


74307 15-Mar-2001 jlemon

Limit the number of paths that glob can return to MAX_GLOBENTRIES, which
is currently set to 10000. This is intended to prevent glob from running
amok when a highly recursive path is provided (such as "../*/../*/../*/...")

Reviewed by: Diane Bruce <db@db.net>, jhb


74289 15-Mar-2001 brian

Mention that MAXHOSTNAMELEN includes space for the NUL.


73725 05-Mar-2001 dwmalone

Use the right format string for printing ULONG_MAX.


73634 05-Mar-2001 obrien

Fix style breakage in rev 1.3


73632 05-Mar-2001 obrien

Fix style bug that was introduced.


73099 26-Feb-2001 ru

Use ``.St -p1003.[12]''.


73093 26-Feb-2001 ru

Use ``.St -p1003.1-96''.


73090 26-Feb-2001 ru

``.St -p1003.1b'' -> ``.St -p1003.1b-93''.


73088 26-Feb-2001 ru

.St -ansiC -> .St -isoC


73080 26-Feb-2001 ru

mdoc(7) police: use .Vt macro.


73077 26-Feb-2001 ru

Prepare for mdocNG.


72640 18-Feb-2001 asmodai

Preceed/preceeding are not english words. Use precede or preceding.


72373 11-Feb-2001 deischen

libc MT-safety, part 2.

Add a lock to FILE. flockfile and friends are now implemented
(for the most part) in libc. flockfile_debug is implemented in
libc_r; I suppose it's about time to kill it but will do it in
a future commit.

Fix a potential deadlock in _fwalk in a threaded environment.
A file flag (__SIGN) was added to stdio.h that, when set, tells
_fwalk to ignore it in its walk. This seemed to be needed in
refill.c because each file needs to be locked when flushing.

Add a stub for pthread_self in libc. This is needed by flockfile
which is allowed by POSIX to be recursive.

Make fgetpos() error return value (-1) match man page.

Remove recursive calls to locked functions (stdio); I think I've
got them all, but I may have missed a couple.

A few K&R -> ANSI conversions along with removal of a few instances
of "register".

$Id$ -> $FreeBSD$ in libc/stdio/rget.c

Not objected to: -arch, a few months ago


72126 07-Feb-2001 ru

mdoc(7) police: Change -filled displays (which just happen
to be the same as -ragged in the current implementation) to
-ragged. With mdocNG, -filled displays produce the correct
output, formatted and justified to both margins.


72044 05-Feb-2001 bde

Don't install links for crypt.3 here. There is no crypt.3 here...

Forgotten in: rev.1.58, which was not Submitted by: bde (I requested
untangling parts of the crypto mess).


71895 01-Feb-2001 ru

mdoc(7) police: split punctuation characters + misc fixes.


71579 24-Jan-2001 deischen

Remove _THREAD_SAFE and make libc thread-safe by default by
adding (weak definitions to) stubs for some of the pthread
functions. If the threads library is linked in, the real
pthread functions will pulled in.

Use the following convention for system calls wrapped by the
threads library:
__sys_foo - actual system call
_foo - weak definition to __sys_foo
foo - weak definition to __sys_foo

Change all libc uses of system calls wrapped by the threads
library from foo to _foo. In order to define the prototypes
for _foo(), we introduce namespace.h and un-namespace.h
(suggested by bde). All files that need to reference these
system calls, should include namespace.h before any standard
includes, then include un-namespace.h after the standard
includes and before any local includes. <db.h> is an exception
and shouldn't be included in between namespace.h and
un-namespace.h namespace.h will define foo to _foo, and
un-namespace.h will undefine foo.

Try to eliminate some of the recursive calls to MT-safe
functions in libc/stdio in preparation for adding a mutex
to FILE. We have recursive mutexes, but would like to avoid
using them if possible.

Remove uneeded includes of <errno.h> from a few files.

Add $FreeBSD$ to a few files in order to pass commitprep.

Approved by: -arch


71438 23-Jan-2001 wollman

I made a last-minute change before the last commit which broke
the errno semantics. Get it (closer to) right this time.


71416 23-Jan-2001 ru

mdoc(7) police: replaced empty line with .Pp, updated document date.


71414 23-Jan-2001 wollman

Add a couple of new library interfaces (will be activated when the
relavant header file changes are committed) for POSIX support.


71409 23-Jan-2001 mckusick

Add the function sysctlnametomib to libc. Details on the semantics
and use of this function have been added to the sysctl.3 manual page.


71129 16-Jan-2001 ben

SIGABRT is *not* the same as calling abort(), so don't claim that it is.
(abort() flushes all open stdio streams for one thing.)

PR: 24249
Submitted by: Edwin Groothuis <mavetju@chello.nl>


71097 16-Jan-2001 ru

Prepare for mdoc(7)NG.


70974 12-Jan-2001 ru

mdoc(7) police: Ft/Vt now accept punctuation-type arguments.


70557 01-Jan-2001 deischen

Change the interface of getlogin_r to return an int. The former
interface was based on a draft version of POSIX whereas the final
(1996) version of POSIX specified that the error is returned.

While I'm here, fix getlogin_r so that it works for more than just
the first time it's called.

Reviewed by: wes, wollman (man page)


70481 29-Dec-2000 ru

Prepare for mdoc(7)NG.


70412 27-Dec-2000 ben

Link stringlist.3 to sl_{add,find,free,init}.3


70128 17-Dec-2000 nectar

Fix mostly harmless typo:

if (data);
free(data);

Discovered by: emacs cc-mode


69968 13-Dec-2000 obrien

#endif should not have a non-comment token after it.
GCC 2.97 (snapshot) complains about this.


69857 11-Dec-2000 ru

mdoc(7) police: use canonical form of .Dd macro.


69841 11-Dec-2000 deischen

Move telldir position recording type definitions and prototypes
to "telldir.h" in order to prevent namespace pollution in
<dirent.h> (which was including <sys/queue.h>).

Add $FreeBSD$ to rewinddir.c and seekdir.c.


69759 08-Dec-2000 alex

strunvis(3) and unvis(3) are the same files.


69756 08-Dec-2000 alex

There are four types of encoding now, not three. Most of them use the
backslash as a special char, but not all.


69662 06-Dec-2000 ru

Back this out, we apparently have the ipfw(4).


69661 06-Dec-2000 ru

ipfw(4) -> ipfw(8).


69656 06-Dec-2000 deischen

Cleanup XXXdir functions to eliminate global hash table of
telldir positions. This will allow (future) locking on a
per-DIR basis (for MT-safety). For now, this change does
the following:

o Remove the hash table from telldir.c. Recode to use queue
macros.

o Remove 'const' from 'telldir(const DIR *)'.

o Remove 'register' variables as suggested in a recent
thread.

No response from: -current


69637 05-Dec-2000 jhb

Move the ipfw(4) xref to the description of LOG_SECURITY instead of
LOG_UUCP.

PR: docs/23302
Submitted by: cshumway


69560 04-Dec-2000 jdp

When recording the original arguments, stop short if we encounter
a NULL argument. Some programs change the contents of the argv
array, typically to remove some special arguments. They shorten
argv by storing a NULL where an argument pointer used to be. Such
programs core dumped if they called setproctitle(), because it
would try to apply strlen() to a NULL pointer.


69558 04-Dec-2000 jdp

When recording the original arguments, don't (ab)use "nargc" for
iterating over the arguments. Doing so wipes out the value which
is about to be stored into the ps_strings structure.


69502 02-Dec-2000 gad

Fix some error-handling logic so that ferror is called before fclose,
instead of immediately after the fclose. The previous logic did work
on freebsd, but is somewhat risky practice (and causes trouble when
porting to other OS's).

PR: bin/22965
Reviewed by: Garrett Wollman


69235 26-Nov-2000 obrien

Note that the `fmt' parameter is a printf()-like string.


69051 22-Nov-2000 ru

mdoc(7) police: Er macro usage cleanup.


69026 22-Nov-2000 ru

log


68959 20-Nov-2000 sheldonh

Fix hard sentence break introduced in rev 1.7.


68958 20-Nov-2000 sheldonh

Add a period missing from rev 1.13.


68957 20-Nov-2000 sheldonh

Remove blank line introduced in rev 1.13.


68946 20-Nov-2000 ru

mdoc(7) police: Nm -> Fn where appropriate.


68945 20-Nov-2000 ru

mdoc(7) police: use the new features of the Nm macro.


68854 17-Nov-2000 ru

mdoc(7) police: use certified section headers wherever possible.


68751 15-Nov-2000 ben

Remove fullstops from the end of .Xr lines in SEE ALSO section.


68716 14-Nov-2000 ru

Use Fx macro wherever possible.


68710 14-Nov-2000 sheldonh

Change [Ii]t's to "It is" and "its" as appropriate.


68709 14-Nov-2000 sheldonh

Whitespace only: remove hard sentence breaks introduced in previous
commit and use a paragraph marker (Pp) instead of a blank line.


68691 13-Nov-2000 nectar

Fix bug introduced in previous commit: users obtained via compat mode
had uid, gid set to 0 if not otherwise specified!

Submitted by: eivind


68608 11-Nov-2000 abial

Correct description of KERN_PROC. Add description of KERN_PROC_ARGS.


68577 10-Nov-2000 nectar

Fix passwd entry `prototypes' in compat mode. I broke this in revision
1.55 when importing nsswitch from NetBSD.

Reported by: Naoki Kobayashi <shibata@geo.titech.ac.jp>


68575 10-Nov-2000 ru

Avoid use of direct troff requests in mdoc(7) manual pages.


67968 30-Oct-2000 asmodai

Correct incorrect information about the PATH used for exec*() calls.

PR: 21990
Partially submitted by: Gerhard Sittig <Gerhard.Sittig@gmx.net>


67967 30-Oct-2000 asmodai

Whitespace only change: trim trailing whitespace.


67802 28-Oct-2000 mpp

Style & grammar fixes.

PR: docs/22374, docs/13020


67725 27-Oct-2000 nectar

Explicitly initialize _pw_passwd.


66057 19-Sep-2000 jdp

Document RTLD_DEFAULT and the search algorithm used for resolving
undefined symbols.


66054 19-Sep-2000 jdp

Make a somewhat unsatisfactory attempt to describe the effects of
the RTLD_GLOBAL and RTLD_LOCAL flags which can be passed to dlopen().


65955 16-Sep-2000 phk

Pickup SPECNAMELEN from <sys/param.h> and use it.

A missing _PATH_DEVDB ("/var/run/dev.db") is not cause for a warning
anymore, the file is effectively optional these days.


65632 09-Sep-2000 phk

Add code to devname(3) so it can find the names of devices which
were not present when dev_mkdb(8) was run.

First the dev_mkdb(8) database is searched, this caters for non-DEVFS
cases where people have renamed a device.

If that fails we ask the kernel using sysctl kern.devname if the device
driver has put a name in the dev_t. This covers DEVFS cloned devices.

If that also fails we format a string which isn't entirely useless.


65532 06-Sep-2000 nectar

Add nsswitch support. By creating an /etc/nsswitch.conf file, you can
configure FreeBSD so that various databases such as passwd and group can be
looked up using flat files, NIS, or Hesiod.

= Hesiod has been added to libc (see hesiod(3)).

= A library routine for parsing nsswitch.conf and invoking callback
functions as specified has been added to libc (see nsdispatch(3)).

= The following C library functions have been modified to use nsdispatch:
. getgrent, getgrnam, getgrgid
. getpwent, getpwnam, getpwuid
. getusershell
. getaddrinfo
. gethostbyname, gethostbyname2, gethostbyaddr
. getnetbyname, getnetbyaddr
. getipnodebyname, getipnodebyaddr, getnodebyname, getnodebyaddr

= host.conf has been removed from src/etc. rc.network has been modified
to warn that host.conf is no longer used at boot time. In addition, if
there is a host.conf but no nsswitch.conf, the latter is created at boot
time from the former.

Obtained from: NetBSD


65468 05-Sep-2000 peter

Remove the SIGSYS handler and wrapper around the __getcwd() syscall.
It was kinda silly since the sigaction() syscall that it used to setup
the handler is more recent than __getcwd(), therefore it was useless
as the wrapper would have died before even getting as far as __getcwd(2).

Reminded by: bde


65356 02-Sep-2000 brian

setproctitle() requires unistd.h and not libutil.h/-lutil


65353 02-Sep-2000 brian

Move setproctitle() from libutil to libc (after a repo-copy)
and bump __FreeBSD_version to 500012 to mark the occasion.

setproctitle() is prototyped in unistd.h as opposed to stdlib.h
where OpenBSD and NetBSD have it.

Reviewed by: peter


65294 31-Aug-2000 des

Import XPG4-compliant basename(3) and dirname(3) from OpenBSD.
The man pages need some adjustments.

PR: 12960, 12962
Submitted by: James Howard <howardjp@wam.umd.edu>
Obtained from: OpenBSD


64740 16-Aug-2000 green

Fix style bugs (including ones introduced from OpenBSD).


64236 04-Aug-2000 kris

sprintf -> snprintf paranoia


64111 01-Aug-2000 jasone

Make sem_post() safe to call from within a signal handler, as required by
POSIX/SUSv2.


64094 01-Aug-2000 ps

If the format string passed to setproctitle begins with a '-'
character, skip the program name when setting the process title.
Ansified with extreme prejudice.

Reviewed by: peter


64006 29-Jul-2000 peter

Add a skeleton rfork_thread(3) man page.


63757 22-Jul-2000 sheldonh

Remove the reference to KERN_UPDATEINTERVAL and syncer(4), since
KERN_UPDATEINTERVAL can't be used to control sched_sync(). In
fact, there's no easy way to control the syncer with sysctls.

Reported by: bde


63498 19-Jul-2000 sheldonh

Update stale references to update(4) with references to the new
syncer(4) manual page.


63364 18-Jul-2000 jasone

Change my email address in the copyright notices for the sake of consistency
(jasone@canonware.com --> jasone@freebsd.org).


63352 17-Jul-2000 jasone

Reshuffle the SEE ALSO section.

Prompted by: sheldonh


62802 08-Jul-2000 jdp

Change the dllockinit() interface from "experimental" to
"deprecated" and warn that it will disappear eventually.


62446 03-Jul-2000 sheldonh

Remove trailing whitespace only.


62445 03-Jul-2000 sheldonh

Fix overlong line and trailing whitespace introduced in rev 1.8.


62444 03-Jul-2000 sheldonh

Add to the SEE ALSO section, a reference to the RFC mentioned in
text introduced in the previous commit.


62430 03-Jul-2000 green

Re-pair the MLINKS of unvis.3 with strunvisx.3. This undoubtedly was a
world breakage.


62424 02-Jul-2000 alex

Add strunvisx.3 MLINK.


62423 02-Jul-2000 alex

Document VIS_HTTPSTYLE:
VIS_HTTPSTYLE is a new encoding style for use in vis(), strvis() and
strvisx() that escapes characters according to RFC 1808 (URI encoding).

Since decoding of these require different detection of start-points of
escaped characters, VIS_HTTPSTYLE can be given as flag to unvis().
unvis() will then properly decode URIs.

A new function appeared, strunvisx(): strunvisx() behaves similar as
strunvis(), with one exception: It has an additional flag parameter,
which is passed to unvis() to archive the effect I described above.


62357 01-Jul-2000 dan

Style fixes.


62356 01-Jul-2000 dan

Add URI encoding to the vis/unvis routines courtesy of VIS_HTTPSTYLE.
Since alex is a -doc committer, he can update his own manpage. :-)

Also add $FreeBSD$ while I'm here.

Submitted by: alex


62197 28-Jun-2000 jasone

Fix typo in SEE ALSO section.


61803 18-Jun-2000 joe

Remove the setflags/getflags routines. Their functionality has
been replaced with the library calls fflagstostr and strtofflags.


61747 17-Jun-2000 joe

Add strtofflags and fflagstostr to libc.


61746 17-Jun-2000 joe

Modify strtofflags so that it returns a malloced string instead of a
pointer to a static buffer.


61738 17-Jun-2000 joe

The "def" arg for fflagstostr is too specialized for ls. The caller
can easily translate from "" to whatever it wants to print if no
flags are set. (ls prints "-" and mtree prints "none".)

Suggested by: bde


61737 17-Jun-2000 joe

Return of the evil file flags! The {s|g}etflags functions were
renamed to {s|g}etflagsbyname, which received objections. They're
now called strtofflags (string to file flags) and fflagstostr (file
flags to string).

Suggested by: bde


61193 03-Jun-2000 kris

#include <string.h> for memcpy() prototype

Obtained from: OpenBSD


60832 23-May-2000 ghelmer

Describe errx/warnx in comparison to errc/warnc/err/warn.
Use .Fa instead of .Va for function arguments.

Reviewed by: sheldonh


60747 21-May-2000 hoek

Fix a memory leak in getent() that occurred when the requested entry
could not be found.

PR: bin/17084


60078 06-May-2000 phantom

Use `Er' variable to define first column width in ERRORS section.


60077 06-May-2000 phantom

mdoc related cleanup:
. use construction ".Aq Pa filename" instead of ".Pa <filename>"
. replace Section Heading macro (.Sh) with Subsection (.Ss) macro for
subsections


60076 06-May-2000 phantom

Use suggested by mdoc(7) style section name (ERROR -> ERRORS)


60015 05-May-2000 mpp

Minor mdoc cleanup.

PR: docs/13218


59666 26-Apr-2000 jasone

Remove cancellation point propagation.


59551 23-Apr-2000 wollman

Spell MAP_NOSYNC correctly.

Submitted by: allenc@verinet.com


59527 23-Apr-2000 wollman

.Lb-ify


59516 22-Apr-2000 phantom

Introduce .Lb macro to libutil manpages
Sort .Nm values in some manpages
Remove explicit note about compiling with -lutil, it's implicitly
declared by .Lb macro now.


59501 22-Apr-2000 phantom

Introduce .Lb macro to libc_r manpages.


59497 22-Apr-2000 wollman

Add shm_open(3) and shm_unlink(3). The documentation could use a good
bit of work (and is stylistically probably the worst manual page
I've ever written).


59460 21-Apr-2000 phantom

Introduce ".Lb" macro to libc manpages.

More libraries manpages updates following.


58126 16-Mar-2000 jasone

Take care to avoid having "strong" and "weak" symbols of the same name in
libc_r.


57868 09-Mar-2000 paul

Fix various unsigned vs signed errors that caused problems with uids
and gids bigger than 16 bits. Added checks for uids and gids that are
bigger than 32 bits.

Approved by: jkh (partly, this fix is bigger than I first intended)


57695 02-Mar-2000 sheldonh

Remove more single-space hard sentence breaks.


57686 02-Mar-2000 sheldonh

Remove single-space hard sentence breaks. These degrade the quality
of the typeset output, tend to make diffs harder to read and provide
bad examples for new-comers to mdoc.


57666 01-Mar-2000 nik

Fix errors in .Xr usage.

PR: docs/17057
Submitted by: Submitted by: Udo Erdelhoff <ue@nathan.ruhr.de>


57389 22-Feb-2000 ru

Restore `[no]{s|u}unlnk' and `[no]opaque' support.
Broken in src/bin/ls/stat_flags.c,v 1.12.

PR: 16885
Approved by: jkh


57260 16-Feb-2000 jasone

Add man pages for the sem_*() functions.

Approved by: jkh


57102 10-Feb-2000 chris

Replace the existing documentation for ``KERN_QUANTUM'' with a more
descriptive (and generally more useful) explanation.


57003 05-Feb-2000 joe

Revert part of the last commit, remove {g|s}etflags from the libc
interface, and statically link them to the programs using them.
These functions, upon reflection and discussion, are too generically
named for a library interface with such specific functionality.
Also the api that they use, whilst ok for private use, isn't good
enough for a libc function.

Additionally there were complications with the build/install-world
process. It depends heavily upon xinstall, which got broken by
the change in api, and caused bootstrap problems and general mayhem.

There is work in progress to address future problems that may be
caused by changes in install-chain tools, and better names for
{g|s}etflags can be derived when some future program requires them.
For now the code has been left in src/lib/libc/gen (it started off
in src/bin/ls).

It's important to provide library functions for manipulating file
flag strings if we ever want this interface to be adopted outside
of the source tree, but now isn't necessarily the right moment
with 4.0-release just around the corner.

Approved: jkh


56781 29-Jan-2000 jdp

Revive the warning that dllockinit() is experimental and subject to
change.


56726 28-Jan-2000 bde

Install setflags.3 and its link to getflags.3.


56698 27-Jan-2000 jasone

Simplify sytem call renaming. Instead of _foo() <-- _libc_foo <-- foo(),
just use _foo() <-- foo(). In the case of a libpthread that doesn't do
call conversion (such as linuxthreads and our upcoming libpthread), this
is adequate. In the case of libc_r, we still need three names, which are
now _thread_sys_foo() <-- _foo() <-- foo().

Convert all internal libc usage of: aio_suspend(), close(), fsync(), msync(),
nanosleep(), open(), fcntl(), read(), and write() to _foo() instead of foo().

Remove all internal libc usage of: creat(), pause(), sleep(), system(),
tcdrain(), wait(), and waitpid().

Make thread cancellation fully POSIX-compliant.

Suggested by: deischen


56692 27-Jan-2000 joe

Historically file flags (schg, uschg, etc) have been converted from
string to u_long and back using two functions, flags_to_string and
string_to_flags, which co-existed with 'ls'. As time has progressed
more and more other tools have used these private functions to
manipulate the file flags.

Recently I moved these functions from /usr/src/bin/ls to libutil,
but after some discussion with bde it's been decided that they
really ought to go in libc.

There are two already existing libc functions for manipulating file
modes: setmode and getmode. In keeping with these flags_to_string
has been renamed getflags and string_to_flags to setflags.

The manual page could probably be improved upon ;)


56268 19-Jan-2000 chris

Document KERN_QUANTUM under CTL_KERN

PR: 15637
Submitted by: jhs


56266 19-Jan-2000 chris

Document isnanf() for checking if a float is NaN (``Not-a-Number'') and
create a link from isnanf.3 to isinf.3.

PR: 13878


56252 18-Jan-2000 markm

This man page is not needed; it just gets jumped on later when libcrypt
is installed.
Submitted by: bde


55915 13-Jan-2000 asmodai

Correct placement of $FreeBSD$ CVS identifier.


55914 13-Jan-2000 asmodai

Change ``from'' to ``to''.

PR: 15729
Submitted by: Kim Toms


55837 12-Jan-2000 jasone

Add three-tier symbol naming in support of POSIX thread cancellation
points. For library functions, the pattern is __sleep() <--
_libc_sleep() <-- sleep(). The arrows represent weak aliases. For
system calls, the pattern is _read() <-- _libc_read() <-- read().


55685 09-Jan-2000 jdp

Remove the warning that this interface shouldn't be used yet. Fix
a typo. Clarify a sentence.


55502 06-Jan-2000 itojun

remove most of PF_INET6 description. add references only.

Suggested by: Ruslan Ermilov <ru@FreeBSD.org>


55493 06-Jan-2000 itojun

bring in description for KAME IPv6 changes.
XXX it looks that sysctl.3 lacks most of PF_INET items.
Reviewed by: shin
Obtained from: KAME (netbsd-current)


55475 05-Jan-2000 bde

Fixed the type of dllockinit() (const unpoisoning).

Use long lines instead of lines split with backslash-newline in synopsis.
My synopsis checker doesn't understand backslash-newline.


55165 28-Dec-1999 jdp

Work around an assert failure in the dynamic linker's default thread
locking functions. If an application loads a shared object with
dlopen() and the shared object has an init function which requires
lazy binding, then _rtld_bind is called when the thread is already
inside the dynamic linker. This leads to a recursive acquisition
of the lock, which I was not expecting -- hence the assert failure.

This work-around makes the default locking functions handle recursive
locking. It is NOT the correct fix -- that should be implemented
at the generic locking level rather than in the default locking
functions. I will implement the correct fix in a future commit.

Since the dllockinit() interface will likely need to change, warn
about that in both the man page and the header file.


55122 27-Dec-1999 jdp

Add a new function dllockinit() for registering thread locking
functions to be used by the dynamic linker. This can be called by
threads packages at start-up time. I will add the call to libc_r
soon.

Also add a default locking method that is used up until dllockinit()
is called. The default method works by blocking SIGVTALRM, SIGPROF,
and SIGALRM in critical sections. It is based on the observation
that most user-space threads packages implement thread preemption
with one of these signals (usually SIGVTALRM).

The dynamic linker has never been reentrant, but it became less
reentrant in revision 1.34 of "src/libexec/rtld-elf/rtld.c".
Starting with that revision, multiple threads each doing lazy
binding could interfere with each other. The usual symptom was
that a symbol was falsely reported as undefined at start-up time.
It was rare but not unseen. This commit fixes it.


55037 23-Dec-1999 bde

Fixed missing installation of a link to ctermid_r.3.


55035 23-Dec-1999 bde

Fixed wrong prototype and missing include for strsignal(3). strsignal()
takes an int arg and is prototyped in <string.h>. It has the opposite
interface botches to psignal(3) which takes a bogus unsigned arg but is
prototyped in the right place.

This is not the last of the interface problems for strsignal(). We
obtained it from NetBSD, but NetBSD has moved its prototype to
<unistd.h>. strsignal() should return const char *, but it returns
char * for historical reasons. NetBSD declares it as returning
__aconst char, where __aconst is normally empty but can be set to
`const' to give better error checking. glibc-2.1.1 prototypes
strsignal() in <string.h>.


55028 23-Dec-1999 peter

Fix the fixfsfile() so that it works for both block and character devices
as root. This could fix the "filesystem still dirty after fsck" problem.

Submitted by: bde


54948 21-Dec-1999 roberto

Fix a bug where a pointer would be one character too far after putting
a '\0' at the end of a string.

Submitted by: Martin Birgmeier <Martin.Birgmeier@aon.at>


54827 19-Dec-1999 roberto

Rewriting of flags_to_string() and string_to_flags() to use an array.

PR: bin/3648
Submitted by: Martin Birgmeier <mbirg@austria.ds.philips.com>


54772 18-Dec-1999 obrien

Initialize a var to quiet -Wall.


54770 18-Dec-1999 green

Switch over to the OpenBSD fts.c, fixing lots of things.

Obtained from: OpenBSD


54034 02-Dec-1999 sheldonh

Replace the -q option to pwd_mkdb with a test for PW_SCAN_BIG_IDS in
the environment. This allows big ID warnings to be suppressed for
vipw and chpass as well.

Since the environment variable test is only performed for callers
of pw_scan() that do not set pw_big_ids_warning, the test can still
be overriden. Currently, chpass and pwd_mkdb are the only users
of pw_scan() and neither of them overrides the environment variable
test.


53977 01-Dec-1999 green

Separate some common sysctl code into sysctl_find_oid() and calling
thereof. Also, make the errno returns _correct_, and add a new one
which is more appropriate.


53892 29-Nov-1999 alfred

style fixes, remove extra braces.

readdir_r is not POSIX according to POSIX_SOURCE, bruce says:
> readdir_r() is in the _POSIX_SOURCE section, but is not a POSIX.1-1990
> function. It's POSIX.1-1996 so it should be under a different feature
> test which we don't support yet.

make sure errno is saved so that its contents are cleared unless
necessary.

Submitted by: bde


53872 29-Nov-1999 wes

Provide a man page for Alfreds lovely readdir_r function. Also
fixed a minor indentation nit and added a few {}s to make readdir_r
easier on old eyes.


53863 28-Nov-1999 wes

Provide and document ctermid_r function.


53859 28-Nov-1999 wes

Provide the getlogin_r function.


53812 28-Nov-1999 alfred

add pthread_cancel, obtained from OpenBSD.

eischen (Daniel Eischen) added wrappers to protect against cancled
threads orphaning internal resources.

the cancelability code is still a bit fuzzy but works for test
programs of my own, OpenBSD's and some examples from ORA's books.

add readdir_r to both libc and libc_r

add some 'const' attributes to function parameters

Reviewed by: eischen, jasone


53581 22-Nov-1999 eivind

Allow empty UIDs if we are processing NIS records. I am not entirely
happy with how this end up and will re-visit the entire empty field
problem, but this patch solves the NIS problem for now.

Submitted by: Dan Nelson <dan@emsphone.com>
PR: 14865,14984


53297 17-Nov-1999 brian

Make setproctitle(NULL) restore all of the original arguments
(if it's able).


53239 16-Nov-1999 phk

Introduce commandline caching in the kernel.

This fixes some nasty procfs problems for SMP, makes ps(1) run much faster,
and makes ps(1) even less dependent on /proc which will aid chroot and
jails alike.

To disable this facility and revert to previous behaviour:
sysctl -w kern.ps_arg_cache_limit=0

For full details see the current@FreeBSD.org mail-archives.


53183 15-Nov-1999 sheldonh

Add to pwd_mkdb a -q option to silence warnings about large IDs. Add a
suitably ominous warning in the manual page.

The diff applied is not the one provided in the attributed PR.

PR: 13344
Reviewed by: bde


53169 15-Nov-1999 kris

fts_pathlen and fts_namelen are u_short, not short

Obtained from: OpenBSD


53040 09-Nov-1999 phantom

Remove useless section.

PR: docs/14764
Submitted by: David Malone <dwmalone@maths.tcd.ie>


52921 06-Nov-1999 eivind

Flag empty UID entries as errors (to stop typos from turning into
alternate root accounts).


52862 04-Nov-1999 ache

Add unsigned char cast to isdigit


52856 04-Nov-1999 ache

Add unsigned char cast to isspace arg


52802 02-Nov-1999 joerg

It is no longer necessary to prepend underscores to external symbols under
ELF.

Submitted by: A.Leidinger@WJPServer.CS.Uni-SB.de (Alexander Leidinger)


52671 30-Oct-1999 phantom

mdoc(7)'fy


52474 25-Oct-1999 obrien

"S" comes before "U"...

Alphabet taught to Green by: obrien


52310 16-Oct-1999 ache

YP/NIS code: remove unnecessary endgrent() calls which can cause fail on
next try over chroot (descriptor closed). getgrnam() used already handles
endgrent() properly and honors _gr_stayopen. Automatically call
setgroupent(1) when _pw_stayopen is set (for YP/NIS code).


52306 16-Oct-1999 ache

Fix longstanding bug "unused stayopen" introduced in rev1.11

PR: 14201


51872 02-Oct-1999 marcel

o Add $FreeBSD$ as a rcsid instead of in a comment
o Remove bitrotted #undef directives
o Actually set errno now and order the functions

Submitted by: bde


51794 29-Sep-1999 marcel

sigset_t change (part 5 of 5)
-----------------------------

Most of the userland changes are in libc. For both the alpha
and the i386 setjmp has been changed to accomodate for the
new sigset_t. Internally, libc is mostly rewritten to use the
new syscalls. The exception is in compat-43/sigcompat.c

The POSIX thread library has also been rewritten to use the
new sigset_t. Except, that it currently only handles NSIG
signals instead of the maximum _SIG_MAXSIG. This should not
be a problem because current applications don't use any
signals higher than NSIG.

There are version bumps for the following libraries:
libdialog
libreadline
libc
libc_r
libedit
libftpio
libss

These libraries either a) have one of the modified structures
visible in the interface, or b) use sigset_t internally and
may cause breakage if new binaries are used against libraries
that don't have the sigset_t change. This not an immediate
issue, but will be as soon as applications start using the
new range to its fullest.

NOTE: libncurses already had an version bump and has not been
given one now.

NOTE: doscmd is a real casualty and has been disconnected for
the moment. Reconnection will eventually happen after
doscmd has been fixed. I'm aware that being the last one
to touch it, I'm automaticly promoted to being maintainer.
According to good taste this means that I will receive a
badge which either will be glued or mechanically stapled,
drilled or otherwise violently forced onto me :-)

NOTE: pcvt/vttest cannot be compiled with -traditional. The
change cause sys/types to be included along the way which
contains the const and volatile modifiers. I don't consider
this a solution, but more a workaround.


51758 28-Sep-1999 marcel

Explicitly use sigemptyset to clear a sigset_t. Explicit
initialization of sa_flags allows us to lose the bzero.

$FreeBSD$ tag added.


51605 23-Sep-1999 phantom

Nuke dlopen.3 -> dlversion.3 link.
This function was removed by jdp in rev.1.5 of dlopen.3

Forgoten by: jdp


51571 22-Sep-1999 phantom

Add links for errc.3, verrc.3, warnc.3, vwarnc.3.

PR: docs/13222
Submitted by: Ben Smithurst <ben@scientia.demos.co.uk>


51549 22-Sep-1999 ru

If `who' was not specified, set the appropriate bits as the chmod(1)
manual page states. `chmod +s foo' and `chmod +t foodir' now work.

PR: 13889


51518 21-Sep-1999 phantom

mdoc(7)'fy

Reviewed by: mpp


51457 20-Sep-1999 phantom

Correct spelling : ascii -> ASCII

PR: docs/13702
Submitted by: Stephen J. Roznowski <sjr@home.com>
Reviewed by: mpp


51023 06-Sep-1999 ru

- add reference to siginterrupt(3)
- mdoc(7) fixes


51003 06-Sep-1999 des

Don't forget to reset _pw_stepping_yp to 0 before returning. Fixes a bug
where getpwent() would ignore wildcard entries that followed a netgroup
entry.

PR: misc/12999
Submitted by: David Hedley <david@inty.net>


50790 02-Sep-1999 imp

Fix the root cause of the fts buffer overflow. This is a temporary
patch to stop the core dumps while others come up with a better
reviewed patch which may also fix other problems. We do illegal
pointer arithmetic, but it should be OK since FreeBSD only supports
machines with flat address spaces.

Submitted by: bde


50700 31-Aug-1999 sheldonh

Back out previous commit. I mistook passing commentary from bde for
review.

Requested by: bde


50644 30-Aug-1999 sheldonh

Only issue a warning for the first occurrence of a UID > USHRT_MAX and
the first occurrence of a GID > USHRT_MAX.

PR: 13344
Reviewed by: bde


50488 28-Aug-1999 peter

$Header$ -> $FreeBSD$


50479 28-Aug-1999 peter

$Id$ -> $FreeBSD$


50476 28-Aug-1999 peter

$Id$ -> $FreeBSD$


50471 27-Aug-1999 peter

$Id$ -> $FreeBSD$


50126 21-Aug-1999 green

This is the addition of a syslog(3) security.* top-level category. This
should be used from now on for anything security but not auth-related.
Included are updates for all relevant manpages and also to /etc files,
creating a new /var/log/security. Nothing in the system logs to
/var/log/security yet as of the time of this commit.

Reviewed by: rgrimes, imp, chris


49851 15-Aug-1999 pho

Reverted to revision 1.8 as previous fix causes fts_open with with a
path name argument with a trailing '/' to fail.

Reviewed by: phk


49828 15-Aug-1999 mpp

Various man page cleanup:

- Sort xrefs
- FreeBSD.ORG -> FreeBSD.org
- Be consistent with section names as outlines in mdoc(7)
- Other misc mdoc cleanup.

PR: doc/13144
Submitted by: Alexy M. Zelkin <phantom@cris.net>


49772 14-Aug-1999 pho

Reviewed by: phk
When fts_open is used with option FTS_NOCHDIR the full
path entry of type FTS_DP is returned with a trailing
'/' if the final directory is empty.
This fix coresponds to netbsd's __fts13.c v. 1.16


49748 14-Aug-1999 chris

Bad reference of sysctl(1) changed to sysctl(8)


49741 14-Aug-1999 chris

Fix some bad references:
fopen(2) -> fopen(3)
fclose(2) -> fclose(3)


49266 30-Jul-1999 mpp

Use the .At macro when referencing versions of AT&T UNIX.

Note: you need to install the current groff tmac macros for these
man pages to format correctly. Specifically, rev 1.21 of
contrib_groff/tmac/doc-syms in -current, or rev 1.17.24 for 3.2-stable


49113 26-Jul-1999 sheldonh

Add missing cause for an EINVAL return (msgtype < 1).

PR: 12783
Submitted by: Kevin Day <toasty@dragondata.com>


49044 24-Jul-1999 bde

Backed out previous commit. devname.3 and devname.c were broken in Lite1
(devname() returned "??" when the lookup failed, but callers expected it
to return NULL). This was fixed in Lite2, but until recently the changes
were only merged into devname.3. A day or two after devname.c was fixed,
devname.3 was made inconsistent again by backing out most of the Lite2
changes.


48943 20-Jul-1999 nik

Correct the information about the return value when no device matches
(or no information is available).

PR: docs/12707
Submitted by: Chris Costello <chris@calldei.com>


48882 18-Jul-1999 phk

Make devname(3) return something more intelligent than NULL if it doesn't
find anything in the database.


48794 12-Jul-1999 nik

Add $Id$, to make it simpler for members of the translation teams to
track.

The $Id$ line is normally at the bottom of the main comment block in the
man page, separated from the rest of the manpage by an empty comment,
like so;

.\" $Id$
.\"

If the immediately preceding comment is a @(#) format ID marker than the
the $Id$ will line up underneath it with no intervening blank lines.
Otherwise, an additional blank line is inserted.

Approved by: bde


47810 07-Jun-1999 steve

Spell isinf(3) correctly.

PR: 11974


47721 04-Jun-1999 wpaul

Apply patch for PR #12008: remember to reset _yp_enabled flag in
endpwent() so we don't trip over a NULL db pointer later.

PR: 12008
Submitted by: Valentin Netchayev <netch@lucky.net>


47367 21-May-1999 jmz

Chflags was clearing all flags supplied on the command line after a
clearing flag like dump or noschg, etc.

PR: bin/10071
Submitted by: Andreas Klussmann <andreas@infosys.heitec.net>


47320 19-May-1999 bde

Fixed disordering and duplication of MLINKS in previous commit to
libc/string/Makefile.inc. psignal.3 doesn't live in libc/string.


47289 18-May-1999 peter

Add a strsignal(3) (like strerror(3)) for libc compatability with other
systems. NetBSD, Linux, SVR4 etc all have it.


46800 09-May-1999 kris

More typos.


46798 09-May-1999 kris

Typo.

Obtained from: OpenBSD


46018 24-Apr-1999 phk

Add missing strings.

PR: 11285
Submitted by: Chris Costello <chris@calldei.com>
Reviewed by: phk


45929 22-Apr-1999 jdp

Back out my change from 6 April PDT that added a new dlversion()
function. It was an ill-considered feature. It didn't solve the
problem I wanted it to solve. And it added Yet Another Version
Number that would have to be maintained at every release point.
I'm nuking it now before anybody grows too fond of it.


45878 20-Apr-1999 ghelmer

Revise for KLD's.

Prompted-By: Nathan Ahlstrom <nrahlstr@winternet.com>


45824 19-Apr-1999 peter

vfsload maps into kldload only now, no more fork/exec of modload(8).


45401 07-Apr-1999 jdp

Add manpage link for dlversion(3).


45398 07-Apr-1999 jdp

Add a new function dlversion() which returns the version number of
the dynamic linker in the same form as __FreeBSD_version. This is
mainly intended for checking the dynamic linker version during a make
world.


45066 27-Mar-1999 des

Partial fix for the forking problem: if we can't access the master maps,
try again with the unrestricted map.

PR: bin/10821


44984 24-Mar-1999 peter

Fix a (relatively harmless) braino. I confused myself over the for() loop
that counted the number of elements in argv. The counter is incremented
in the next-iteration section of the loop, not the body, so at termination
it's already "counted" the element that failed the continuation test - in
this case the NULL argv terminator.

Noted by: bde


44974 23-Mar-1999 peter

Remove last remaining references to malloc/realloc and functions that
call them. All the execX() libc functions should be vfork() safe now.
Specifically:
- execlp() does the argument count-and-build into a vector from alloca
(like the others) - buildargv() is no longer used (and gone).
- execvp() uses alloca/strcpy rather than strdup().
- the ENOEXEC handler uses alloca rather than malloc.
- a couple of free() calls removed - alloca works on the local stack and
the allocations are freed on function exit (which is why buildargv
wasn't useful - it's alloca() context would disappear on return).
Along the way:
- If alloca() fails (can it?), set errno = ENOMEM explicitly.
- The ENOEXEC recovery routine that trys again with /bin/sh appeared to
not be terminating the new argv[] array for /bin/sh, allowing it to
walk off the end of the list.

I dithered a bit about using alloca() even more as it's most commonly
associated with gcc. However, standalone portable (using malloc) and
machine-specific assembler alloca implementations appear to be available
on just about all the architectures we're likely to want to port to.
alloca will be the least of our problems if ever going to another compiler.


44961 23-Mar-1999 jkoshy

Typo fix.

PR: docs/10733
Submitted by: Steve Coltrin <spcoltri@io.com>


44921 21-Mar-1999 imp

Don't be so selective about which errors cause us to continue and
which ones cause us to fail. Now all open errors on the databse file
will cause the next file in the list to be tried.

Submitted by: Arne Henrik Juul <arnej@math.ntnu.no>
PR: 4585


44761 15-Mar-1999 alex

EACESS -> EACCES


44485 05-Mar-1999 bde

Don't bogotify the synopsis by attempting to describe err_set_file() there.

Fixed some disorder.


44477 05-Mar-1999 phk

Use sysctlbyname() instead of sysctl().


44095 17-Feb-1999 jkoshy

Add a note about ELF executables requiring to be linked with -export-dynamic
for dlsym() searches inside the executable to work.


42780 18-Jan-1999 des

Use the correct type for uid and gid in struct passwd. Document it.


42353 06-Jan-1999 des

Make the implementation and documentation agree. Specifically:

- document that sysctl() and sysctlbyname() return 0 on success

- if the provided buffer is too small, set errno to ENOMEM and return -1
instead of returning ENOMEM.


42232 01-Jan-1999 bde

Ignore the fs_spec entry for "/" in /etc/fstab if the device which
is actually mounted on "/" can be determined using statfs() and is
in /dev. This fixes fsck operating on the wrong device when the
fs_spec entry is only an alias. The aliased case became more
dangerous when the ROOTSLICE_HUNT hack was committed in mount(8).
ROOTSLICE_HUNT may be unnecessary now.


41898 17-Dec-1998 eivind

Restore old semantics (broken in rev 1.47's buffer overflow fix).


41875 16-Dec-1998 bde

Adjust for kern.ps_strings and PS_STRINGS not being a pointer. This is
an unimprovement here. I thought it would be an improvement, as in libkvm,
but here we can access the strings directly.

Use sysctlbyname() instead of sysctl() and trust it to give a nonzero
address if it succeeds.


41841 16-Dec-1998 imp

Add reminder to return memory allocated by this call.

Obtained from: OpenBSD


41714 13-Dec-1998 dillon

PR: docs/9050

Add reference to required include file #include <stdlib.h> for
getloadavg(3) function call.


41581 07-Dec-1998 bde

Removed unused include of <kvm.h>. It was alarming for libc to apparently
depend on libkvm.

Removed obsolete `#define _NEW_VFSCONF'.


41025 09-Nov-1998 jkoshy

Fix a .Nm -> .Fn fix that was missed in the previous commit.

Pointed-out-by: Bruce Evans


40952 06-Nov-1998 jkoshy

Update manual page to reflect changes in rev 1.12 of
"src/lib/libc/gen/popen.c" --- popen() in the child
now closes any copies of popen()'ed descriptors in the parent.


40863 03-Nov-1998 peter

A feeble attempt at kld compatability. The mount_* programs assume that
they cannot mount a filesystem that they cannot see in getvfsbyname().
Part 1 of this is a hack, make vfsisloadable() always return true - the
ultimate decider of whether it's loadable or not is kldload() or mount().
Part 2 of this is to have vfsload() call kldload(2) and return success if
it works. This means that we will use a viable kld module in preference
to an LKM!
Ultimately, the thing to do is remove the hacks to do a vfsload in all the
mount_* commands and let the kernel do it by itself in mount(2).


40742 29-Oct-1998 msmith

Prevent buffer overflow in getpwnam()

PR: bin/8176
Submitted by: Archie Cobbs <archie@whistle.com>


40738 29-Oct-1998 rnordier

Clarify processing of the string argument by psignal().


40727 29-Oct-1998 rnordier

The man page implies that the string argument to psignal() may be
NULL, in line with perror(3). However, the code presently checks only
for a zero-length string. Check for both.


40688 28-Oct-1998 jdp

Handle ELF symbols better. This fixes "vmstat -i" for the case
where "/var/db/kvm_kernel.db" doesn't exist.


40667 26-Oct-1998 fenner

(`'): and (`'); -> (`:') and (`;')


40641 25-Oct-1998 obrien

Slight style police.
Add some content from objformat(1).


40396 15-Oct-1998 des

Fix style issues in execl(), and make execle() vfork()-safe.

Reviewed by: bde
Approved by: jkh


40367 15-Oct-1998 msmith

Conform to POSIX and close any copies of popen() descriptors inherited by a
popen()ed child.

PR: misc/7810
Submitted by: Wayne Scott <wscott@ichips.intel.com>


40357 14-Oct-1998 des

Correct braino in previous commit. I get the pointy hat again.


40356 14-Oct-1998 des

Make execl() vfork()-safe. This should fix potential bugs in rcp,
telnet and tip, and probably a few other apps.

Reviewed by: bde
Approved by: jkh


40219 11-Oct-1998 peter

Avoid the need for calling functions that malloc after a vfork().


40191 10-Oct-1998 bde

vfork -> fork. The child calls execl() which calls malloc(), so
vfork() can't be used. We could use alloca() in execl() so that
it can be called between vfork() and execve(), but a "portable"
popen() shouldn't depend on this. Calling execle() instead of
execl() should be fairly safe, since execle() is supposed to be
callable from signal handlers and signal handlers can't call
malloc(). However, execle() is broken.


40013 07-Oct-1998 julian

Fix a memory leak
PR: 7923
Submitted by: Archie Cobbs <archie@whistle.com>

The scandir() function returns -1 if it fails.
In many cases when this happens, it does not free
the memory that it allocated, resulting in a memory
leak, or close the directory opened with opendir().
BAD DOG, BAD!


39750 29-Sep-1998 jkoshy

`kern.maxproc' is not changeable from sysctl(8).

Reminded by: Bruce Evans <bde@zeta.org.au>


39684 26-Sep-1998 dfr

Don't cast int pointers to long pointers when reading labels from
/etc/disktab.


39334 16-Sep-1998 jkoshy

Sort table and descriptions.

Pointed out by: bde


39327 16-Sep-1998 imp

Replace memory leaking instances of realloc with non-leaking reallocf.
In some cases replace if (a == null) a = malloc(x); else a =
realloc(a, x); with simple reallocf(a, x). Per ANSI-C, this is
guaranteed to be the same thing.

I've been running these on my system here w/o ill effects for some
time. However, the CTM-express is at part 6 of 34 for the CAM
changes, so I've not been able to do a build world with the CAM in the
tree with these changes. Shouldn't impact anything, but...


39283 15-Sep-1998 dt

Don't initialize NIS until it is really necessary. Now, in case of network
or NIS server problems, local user can login without a pause.

Also, -Wsomething cleanup.


39267 15-Sep-1998 jkoshy

Turn off replies to ICMP echo requests for broadcast and multicast
addresses by default.

Add a knob "icmp_bmcastecho" to "rc.network" to allow this
behaviour to be controlled from "rc.conf".

Document the controlling sysctl variable "net.inet.icmp.bmcastecho"
in sysctl(3).

Reviewed by: dg, jkh
Reminded on -hackers by: Steinar Haug <sthaug@nethelp.no>


39202 15-Sep-1998 wollman

Replace accidentally-deleted `x' which caused warnx() to misbehave.


39201 15-Sep-1998 jkoshy

Correct a typo that I noticed.


39112 12-Sep-1998 wollman

A small last-minute iitem for 3.0:

- Fix some style errors I made back in 1995.

- Add a new flavor of the err(3) family, which takes an explicit
errno argument rather than implicitly examining errno. This
will make it easier to use these functions in conjunction with
modern library interfaces that return an errno value explicitly.


39022 09-Sep-1998 ghelmer

Document a number of VM sysctl variables with help from old emails
written by John Dyson.


38960 09-Sep-1998 jdp

Add a new library function getobjformat(). It checks all the
standard places ("/etc/objformat", ${OBJFORMAT}, argv) for an
indication of the user's preferred object file format. This
consolidates some code that was starting to be duplicated in more
and more places.

Use the new function in ldconfig.

Note: I don't think that gcc should use getobjformat(), even though
it could. The compiler should limit itself to functions that are
widespread, to ease porting and cross-compilation.


38938 08-Sep-1998 ache

restore rev 1.23 to give clear SIGALRM handling example, 68 years
are too long to affect real code


38878 06-Sep-1998 dillon

Reviewed by: Andrey A. Chernov <ache@nagual.pp.ru>, Doug Rabson <dfr@nlsystems.com>

Rewrote sleep() to remove int/long typing assumptions between the argument
to the function and the timespec structure.


38847 05-Sep-1998 jb

Use INT_MAX instead of LONG_MAX since the variable being compared
is an int, not a long.


38702 31-Aug-1998 wosch

Sort cross references.


38391 17-Aug-1998 dfr

Update to use the new elf headers.


38054 03-Aug-1998 bde

isnetworktty -> isnettty. ttyent.h has already gone through 3
revisions to match the confusing spelling in getttyent.c (1 to
break it to match the man page and 1 in each of 2 branches to fix
it). This function seems to be orphaned and unused.


38020 02-Aug-1998 bde

Fixed printf format errors.


37515 08-Jul-1998 dt

Add lockf().


37513 08-Jul-1998 dt

Make this look more FreeBSDish.


37511 08-Jul-1998 dt

This commit was generated by cvs2svn to compensate for changes in r37510,
which included commits to RCS files with non-trunk default branches.


37349 03-Jul-1998 phk

fts_close calls free(sp), the ISSET(FTS_NOCHDIR) which is a macro that
references sp. The free needs to follow ISSET

PR: 7148
Reviewed by: phk
Submitted by: Ken Mayer <kmayer@freegate.com>


37319 30-Jun-1998 eivind

Cross-reference to sysconf(3).


37301 30-Jun-1998 bde

Fixed printf format errors.


36919 12-Jun-1998 peter

Make nlist() understand elf unconditionally


36859 10-Jun-1998 jdp

Move ftok() from libcompat to libc, so that it can be closer to its
friend shmget().

PR: closes misc/6763


36836 10-Jun-1998 jdp

This is a null commit to log the fact that I have done a repository
copy to bring these files into libc from libcompat. I will enable
them and kill off the libcompat versions on the main branch soon.

PR: step one toward closing misc/6763


36805 09-Jun-1998 jb

Implement compile time debug mode for thread locks.


36706 06-Jun-1998 steve

Fix this so that it compiles in the !__STDC__ case.
Also be consistent about usage of #if ...

Pointed out by: bde


36664 05-Jun-1998 jkoshy

Mention that tftpd(8) also uses syslog(3).


36603 03-Jun-1998 jkoshy

Correct wrong claim about `telldir()' cookie lifetimes.

PR: 4043
Submitted by: Joe Orthoefer <j_orthoefer@tia.net>


36577 01-Jun-1998 msmith

Add a trivial mechanism for returning a useful default value if one is
available and the kernel MIB setting is zero.

Return the result from getpagesize() if the p1003_1b.pagesize MIB
value is zero.

Suggested by: Joerg Schilling <schilling@fokus.gmd.de>


36482 31-May-1998 steve

Several sources including Unix98 say that semctl's fourth
parameter is optional except where:
cmd == {IPC_SET || IPC_STAT || GETALL || SETVAL || SETALL}

PR: 2448
Reviewed by: bde
Submitted by: Tim Singletary <tsingle@sunland.gsfc.nasa.gov>
Minor tweaks by: steve


36474 30-May-1998 steve

Remove references to getvfsbytype. Also remove getvfsbyname
as it has its own manpage.

Discussed with: bde


36388 26-May-1998 steve

Remove a couple style bugs from the code snippet that
slipped in on the previous commit.

Submitted by: bde


36381 25-May-1998 steve

Update code example to reflect current practice.


36060 15-May-1998 jb

NetBSD doesn't have a __getcwd syscall, so set have__getcwd to `no'
when building libc with NetBSD syscalls.


35760 05-May-1998 jb

Remove extern int errno and #include <errno.h> to get the proper definition.


35607 01-May-1998 brian

Go back to version 1.16 - it was correct the way it was.
Pointed out by: bde


35570 01-May-1998 brian

connect() returns -1 on error - not 0.


35500 29-Apr-1998 jb

Stubs are required in libc so that it can be used with libpthread
(and kernel threads), but weak symbols and non-weak symbols of the
same name built into libc_r result in unpredictable linking.


35491 28-Apr-1998 dg

Oops, revert part of a diff that wasn't supposed to have been committed.


35490 28-Apr-1998 dg

Cache the results of the ps_strings sysctl so that it doesn't have to be
redone for every call of setproctitle().


35392 22-Apr-1998 rnordier

Improve description.
Submitted by: Arne Henrik Juul <arnej@imf.unit.no>


35241 17-Apr-1998 brian

Typo police


35026 04-Apr-1998 jb

Change in name of the static initializer define.


34925 28-Mar-1998 dufault

Finish _POSIX_PRIORITY_SCHEDULING. Needs P1003_1B and
_KPOSIX_PRIORITY_SCHEDULING options to work. Changes:

Change all "posix4" to "p1003_1b". Misnamed files are left
as "posix4" until I'm told if I can simply delete them and add
new ones;

Add _POSIX_PRIORITY_SCHEDULING system calls for FreeBSD and Linux;

Add man pages for _POSIX_PRIORITY_SCHEDULING system calls;

Add options to LINT;

Minor fixes to P1003_1B code during testing.


34816 23-Mar-1998 bde

Fixed bitrot in synopsis. Didn't fix bitrot elsewhere.


34669 19-Mar-1998 charnier

.Sh AUTHOR -> .Sh AUTHORS. Use .An/.Aq


34379 09-Mar-1998 jb

Change MACHINE to MACHINE_ARCH.

Add _spinlock.c (stubs) to sources.

Nuke tahoe and vax.


34378 09-Mar-1998 jb

Stub functions for thread locking with weak symbols so that they are
only linked when not linking an application against libc_r or libpthread.


34360 09-Mar-1998 jb

NetBSD implements semctl using a __semctl syscall instead of the
semsys syscall that FreeBSD kernels use. Grumble. So make the call
dependent on if __NETBSD_SYSCALLS is defined.


34359 09-Mar-1998 jb

getvfsbyname() doesn't existing NetBSD, so return ENOSYS if compiled
into a library with __NETBSD_SYSCALLS defined.


34358 09-Mar-1998 jb

Change a variable to type size_t to suit the sysctl prototype.

Add #include <string.h> to get prototypes.


34357 09-Mar-1998 jb

Cast pointer to a long instead of an int to keep a 64-bit compiler
happy. The code works either way, but I like a clean compile.


34319 08-Mar-1998 dufault

Reviewed by: bde

Changes to support building with _POSIX_SOURCE set to 199309L:

1. Add sys/_posix.h to handle those preprocessor defs that POSIX
says have effects when defined before including any header files;

2. Change POSIX4_VISIBLE back to _POSIX4_VISIBLE

3. Add _POSIX4_VISIBLE_HISTORICALLY for pre-existing BSD features now
defined in POSIX. These show up when:

_POSIX_SOURCE and _POSIX_C_SOURCE are not set or
_POSIX_C_SOURCE is set >= 199309L

and vanish when:

_POSIX_SOURCE is set or _POSIX_C_SOURCE is < 199309L.

4. Explain these in man 9 posix4;

5. Include _posix.h and conditionalize on new feature test.


34196 07-Mar-1998 jdp

Add support for ELF.

Switch to ANSI-style function definitions.


34075 06-Mar-1998 brian

We don't need to NUL terminate our sun_path.
Pointed out by: Garrett Wollman <wollman@khavrinen.lcs.mit.edu>


34072 06-Mar-1998 brian

Nul terminate sockaddr_un::sun_path
Suggested by: Theo de Raadt <deraadt@openbsd.org>


34059 05-Mar-1998 brian

Make SyslogAddr a sockaddr_un rather than a sockaddr.
This wasn't a problem in practice as PATH_LOG and PATH_OLDLOG
are both < sizeof sockaddr::sa_data.


34030 04-Mar-1998 dufault

Reviewed by: msmith, bde long ago
POSIX.4 headers and sysctl variables. Nothing should change
unless POSIX4 is defined or _POSIX_VERSION is set to 199309.


33950 01-Mar-1998 steve

Replace previous commit with a check disallowing ptr from running
off the end of the list variable.

PR: 5345, 5610
Submitted by: nagao@cs.titech.ac.jp


33926 28-Feb-1998 jraynard

Strings are terminated by NUL, not NULL.


33899 28-Feb-1998 steve

Remove the config_* routines with permission from Poul-Henning Kamp,
the original author.

PR: 5834
Discussed with: phk, jkh


33666 20-Feb-1998 jb

The NetBSD getlogin syscall has a different name.


33665 20-Feb-1998 jb

Fix a bogus cast for a bogus pointer check. This only checks if the
pointer is 4-byte aligned. On a 64-bit machine it probably should
check that the pointer is 8-byte aligned (eh, Bruce?) 8-)


33664 20-Feb-1998 jb

NetBSD kernels don't have issetugid(), so #ifdef this out when
building FreeBSD's libc to run with a NetBSD kernel. We'll get to
the alpha kernel later, I promise. 8-)


33578 18-Feb-1998 steve

Need to #include <unistd.h> for nice(3).

PR: 5782
Submitted by: David Malone <dwmalone@maths.tcd.ie>


33527 18-Feb-1998 julian

Submitted by: Jeremy Allison (jallison@whistle.com)
fix a slight confusion about which draft of threads we are supporting.
this allows something as big and ugly as samba to be compiled with libc_r
and still work! our user-level pthreads seems amazingly robust!


33482 17-Feb-1998 jkh

Mention when bidirectional features first appeared.


33357 15-Feb-1998 jb

signal() returns SIG_ERR, not just -1. The sys/signal.h header file
provides the cast from -1 to the signal() return type, so no further
casting by programmers should be required.

Pointed out by: bde (of course).


33303 13-Feb-1998 bde

Describe signal handling. Don't describe the old implementation. Don't
define `microsecond'. Cleaned up English.

Obtained from: mostly from sleep.3


33299 13-Feb-1998 bde

Describe signal handling. Don't describe the old implementation. Cleaned
up English.

Obtained from: mostly from NetBSD


33287 12-Feb-1998 bde

Fixed disordering of MLINKS in previous commit. Fixed old disorder in
MLINKS.


33278 12-Feb-1998 wpaul

Fix _listmatch() again so that it works with group lists containing only
one group. Thanks to Dirk Froemberg for supplying a patch for this. I will
be closing out the PR and moving this to the 2.2.5 branch later: my login
sessions to freefall from Columbia are ridiculously spotty today.

PR: 5610
Submitted by: Dirk Froemberg <ibex@physik.TU-Berlin.DE>


33225 10-Feb-1998 guido

Do signal handlig he Posix way
Obtained from: NetBSD (after complains from Bruce)


33180 09-Feb-1998 jdp

Move the trampolines for dlopen and related functions from crt0.o
into libc. This reduces the size of every dynamically linked
executable by 248 bytes, and it reduces the size of static executables
by a lesser amount. It also eliminates some global namespace
pollution.

With this change in place, the source for dlfcn.h should probably
be moved to "/usr/src/include". I'll save that for another day.

Compatibility note: Programs which use dlopen, if compiled on
systems with this change, will not run on systems with a libc from
prior to this change. Very few programs use dlopen, so I think
that is OK.


33107 04-Feb-1998 jlemon

Document the fpgetprec/fpsetprec functions in their man page.
Add cross-references to the elusive fpsetmask() function to various other
man pages.
Reviewed by: bde


32984 01-Feb-1998 steve

Cleanup the manpage now that setpwent has a void return type.


32962 01-Feb-1998 steve

XOpen says the void setpwent(void) is correct. Also call setpassent(0)
instead of duplicating code, albeit trivial (inspired by NetBSD).

PR: 5524


32743 24-Jan-1998 jb

Fix a cast from a pointer to a long instead of an int which was enough
to ruin a 64-bit day.


32687 21-Jan-1998 imp

Eliminate sprintf
Obtained from:OpenBSD (theo de raadt)


32643 20-Jan-1998 bde

Moved most of the (source-level) compatibility hacks for the vfsconf
interface from sys/mount.h to libc/getvfsent.c The new interface is
now the default.


32594 17-Jan-1998 bde

Started getting rid of the compatibility cruft for the Lite1 mount()
and the pre-Lite2 vfsconf interfaces.

For getvfsent.c, just define _OLD_VFSCONF. This will give the
current default macro hacks in <sys/mount.h> when the default is
reversed. This is an intermediate step.


32562 16-Jan-1998 bde

Fixed missing return type in a prototype.


32530 15-Jan-1998 mckay

Return the correct errno from getcwd() even if free() or closedir()
overwrites it. This actually showed up when running under an old
kernel when free() called the madvise() stub which set errno, causing
getcwd() to return EOPNOTSUPP instead of ERANGE.


32493 13-Jan-1998 alex

Return type and argument to sleep are unsigned int.


32361 09-Jan-1998 jb

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-)


31370 23-Nov-1997 bde

Fixed spelling of EACCES.


31340 21-Nov-1997 jraynard

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)


31310 20-Nov-1997 bde

Don't check for the unlikely case of useconds == 0 here. The kernel
checks it.

Fixed a style bug.


31309 20-Nov-1997 bde

stat() the correct file in execvp() so that the fine tuned errno handling
actually works.


31180 16-Nov-1997 wpaul

Close PR #4867: improve _listmatch() to avoid returning false positives.

PR: 4867


30713 26-Oct-1997 jdp

Change L_SET to SEEK_SET for POSIX compliance.

Submitted by: Dean Gaudet <dgaudet@arctic.org>


30649 22-Oct-1997 ache

Back out part of OpenGroup specs about limiting max arg since it may break
compatibility.


30648 22-Oct-1997 ache

Reflect usleep code changes:
Limit max arg
Change return type to int


30646 22-Oct-1997 ache

Changes in spirit of OpenGroup Singe Unix specs:
1) Limit max allowed argument to 1000000
2) Change return type from void to int to indicate premature termination
(by signal)


30624 21-Oct-1997 bde

Sorted lists.


30511 17-Oct-1997 ache

Add $Id


30510 17-Oct-1997 ache

Fix LONG_MAX overflowing
Return seconds if errno other than EINTR
Add $Id
Submitted by: bde with minor optimization by me


30493 16-Oct-1997 ache

Copy time_to_sleep to time_remaining since it can be left
uninitialized if nanosleep returns early with agr error


30480 16-Oct-1997 ache

Reflect current sleep/usleep implementations state


30479 16-Oct-1997 ache

Cleanup #includes


30447 15-Oct-1997 bde

Removed the subdirectory paths from the definitions of MAN[1-9]. They
were a workaround for limitations in bsd.man.mk that were fixed about
2 years ago.


30443 15-Oct-1997 peter

Remove old SIGALRM absorbing back-compat code. It wasn't working at all
for the entire time that it was there, so obviously nothing needs it
anymore.

Note, unix98/single-unix spec v2 says that usleep() returns an int rather
than a void, to indicate whether the entire time period elapsed (0) or an
error (eg: signal handler) interrupted it (returns -1, errno = EINTR)
It is probably useful to make this change but I'll test it locally first
to see if this will break userland programs [much]...

Reviewed by: ache, bde


30442 15-Oct-1997 peter

Give up on the "try and compensate for broken programs" cruft and revert
back to the original single nanosleep() implementation. This is POSIX and
Unix98 (aka single-unix spec v2) compliant behavior. If a program sets
alarm(2) or an interval timer (setitimer(2)) without a SIGALRM handler
being active, sleep(3) will no longer absorb it, and the program will get
what it asked for..... :-]

The original reason for this in the first place (apache) doesn't seem to
need it anymore, according to Andrey.

Reviewed by: ache, bde


30400 14-Oct-1997 bde

Moved `SRCS+= frexp.c' to the correct Makefile.inc.


30399 14-Oct-1997 bde

Fixed searching of $PATH in execvp(). Do what sh(1) should do according
to POSIX.2. In particular:

- don't retry for ETXTBSY. This matches what sh(1) does. The retry code
was broken anyway. It only slept for several seconds for the first few
retries. Then it retried without sleeping.
- don't abort the search for errors related to the path prefix, in
particular for ENAMETOOLONG, ENOTDIR, ELOOP. This fixes PR1487. sh(1)
gets this wrong in the opposite direction by never aborting the search.
- don't confuse EACCES for errors related to the path prefix with EACCES
for errors related to the file. sh(1) gets this wrong.
- don't return a stale errno when the search terminates normally without
finding anything. The errno for the last unsuccessful execve() was
usually returned. This gave too much precedence to pathologies in the
last component of $PATH. This bug is irrelevant for sh(1).

The implementation still uses the optimization/race-inhibitor of trying
to execve() things first. POSIX.2 seems to require looking at file
permissions using stat(). We now use stat() after execve() if execve()
fails with an ambiguous error. Trying execve() first may actually be a
pessimization, since failing execve()s are fundamentally a little slower
than stat(), and are significantly slower when a file is found but has
unsuitable permissions or points to an unsuitable interpreter.

PR: 1487


30390 13-Oct-1997 wpaul

Improve the innetgr() NIS+ compat kludge. We should only fail over to the
'slow' lookup if we get a YPERR_MAP (no such map in server's domain) error
instead of failing over on any error. In the latter case, if the 'fast'
search fails legitimately (i.e. the user or host really isn't a member
of the specified netgroup) then we end up doing the 'slow' search and
failing all over again. The result is still correct, but cycles are
consumed for no good reason.

Also removed the #ifdef CHARITABLE since the compat kludge is no longer
optional.


30288 11-Oct-1997 wpaul

NIS+ compatibility kludge. A long time ago, I set up innetgr() so
that if searching through the special netgroup.byhost or netgroup.byuser
maps didn't work, we would roll over to the 'slow' method of grovelling
though the netgroup map and working out the dependencies on the fly.
But I left this option hidden inside an #ifdef CHARITABLE since I
didn't think I'd ever need it.

Well, the Sun rpc.nisd NIS+ server in YP compat mode doesn't support
the .byhost and .byuser reverse maps, so the failover is necessary
in order to be compatible. *sigh*

This closes PR #3891, and should be merged into RELENG_2_2.


30260 10-Oct-1997 charnier

Staticize usage(). Cosmetics.


29988 29-Sep-1997 wosch

Sort cross refereces in section SEE ALSO.


29941 28-Sep-1997 msmith

Revert the previous prototype un-typo. Add a brief comment warning that
"fixing" it is not a good idea.


29907 28-Sep-1997 msmith

Fix typo in signal() prototype


29718 22-Sep-1997 peter

Apply fts() fix from PR#4593

Submitted by: Dmitrij Tejblum <dima@tejblum.dnttm.rssi.ru>


29574 18-Sep-1997 phk

Many places in the code NULL is used in integer context, where
plain 0 should be used. This happens to work because we #define
NULL to 0, but is stylistically wrong and can cause problems
for people trying to port bits of code to other environments.

PR: 2752
Submitted by: Arne Henrik Juul <arnej@imf.unit.no>


29487 16-Sep-1997 peter

Put a system call not present checking wrapper around the call to
__getcwd(). I've got this libc code running on one of my machines
at the moment without the __getcwd() syscall being present.


29479 15-Sep-1997 wosch

Fix yet a minor stylistic nit from Bruce.
(`cvs diff -ib' print one new char ;-).


29476 15-Sep-1997 phk

Fix yet a minor stylistic nit from Bruce (Doesn't he have more
important things to do ?? :-)

Prepare for the likely case of a change in kernel algorithm.


29462 15-Sep-1997 phk

Fix a buglet and a couple of stylistic nits from Bruce.


29396 14-Sep-1997 wosch

Potential bufferflow in getpwent(), getpwnam() and getpwuid()

PR: bin/4134
Submitted by: nick@foobar.org


29392 14-Sep-1997 phk

Add __getcwd() syscall, and have getcwd() take a shot at it.
If your kernel doesn't support __getcwd() or if __getcwd() cannot
deliver because of cache expiry, it does the canonical thing.


29049 03-Sep-1997 bde

Fixed synopsis. The envp arg for execle() can't be given in the prototype.
Fortunately, the man page doesn't refer to "envp" so just deleting it is OK.


28970 31-Aug-1997 bde

Fixed inclomplete function type in synopsis.


28947 31-Aug-1997 peter

Initial elf nlist support, mostly stolen from OpenBSD (they use standard
#defines that are compatable with ours). I made some some minor tweaks
to the leading '_' tests.

Again, this is off by default for the moment. This probably should be
split into seperate files (like some of our other libc files that could
do with some splitting).

Obtained from: OpenBSD (plus some minor tweaks)


28916 30-Aug-1997 kato

Added HW_MACHINE_ARCH.


28913 29-Aug-1997 imp

Merge in the safe chdir changes from Todd Miller's mods to the OpenBSD
tree. Also merge in fix to NetBSD PR #1495. These represent 1.3-1.9 in
the OpenBSD tree. Make minor KNF changes to new code (which is in the
OpenBSD as 1.10). This avoids the symlink race problems.

These patches should go into 2.2.5 before the ship if they don't
break anything in -current.
Reviewed by: Bruce Evans
Obtained from: OpenBSD


28836 27-Aug-1997 ache

Use getpwnam(getlogin()) before getpwuid(getuid())


28820 27-Aug-1997 imp

Don't getenv(HOME) when set[ug]od. This can lead to a buffer overflow and
elevated privs.
Obtained from: OpenBSD


28235 15-Aug-1997 dg

Fixed file descriptor leak that occurs after certain types of failures.

PR: 3516
Submitted by: Matthew Flatt <mflatt@cs.rice.edu>


28209 14-Aug-1997 ache

Describe upper limit based on itimerfix restriction


28201 14-Aug-1997 ache

Oops, fix logic for previous commit


28193 14-Aug-1997 ache

Remove wrong machine-dependent phrase about maximum microseconds
limit. Small cleanup.


28192 14-Aug-1997 ache

Break loop if error != EINTR occurse or it can take forever with
time_remaining unchanged


28174 13-Aug-1997 ache

Note that default behaviour (restarting signals) is only for signal(3)


28173 13-Aug-1997 ache

Handle syscalls error return slightly better


28172 13-Aug-1997 ache

Back out itimerfix hack since nanosleep1 fixed now
Handle syscalls error return slightly better


28128 12-Aug-1997 ache

Rearrange itimerfix loop doing it inside SIGALRM handling section


28127 12-Aug-1997 ache

Solve itimerfix() problem completely by using loop in 100000000 secs chunks


28126 12-Aug-1997 ache

Reflect blocked SIGALRM changes


28125 12-Aug-1997 ache

Back out my installation of SIGALRM handler even if it is blocked
and return to previous Peter's variant.
POSIX says that this place is implementation defined and old variant allows
application block SIGALRM and sleep and not be killed by external SIGALRMs.
BTW, GNU sleep f.e. sleeps forever in blocked SIGALRM :-)


28116 12-Aug-1997 ache

Reflect -current implementations


28111 12-Aug-1997 ache

1) Make usleep() terminateable by alarm (or ualarm) as supposed
historically
2) Fix end of time loop condition: && -> ||


28110 12-Aug-1997 ache

Change to reflect -current sleep implementation reality


28107 12-Aug-1997 ache

Make itimerfix hack better: return the time we can't sleep at once


28033 10-Aug-1997 joerg

Hack^H^H^H^Hworkaround for itimerfix(9) gratuitously limiting the
acceptable range for tv_sec to the magic number 100000000 (which at
least ought to be declared in a header file, and explained in the
non-existing man page, as well as in the existing man pages for
nanosleep(2) & Co.).

PR: bin/4259


27967 07-Aug-1997 steve

Observe precedence set by Phillippe Charnier in adding an
rcsid.


27958 07-Aug-1997 steve

Remove #if(n)def BSD_4_4_LITE cruft and sccsid -> rcsid.


27502 18-Jul-1997 peter

Make sleep() and usleep() "eat" any stray SIGALRM signals during the
lifetime of the call, just like the old implementation did. Previously,
we were only eating them if the application did not call sleep()/usleep()
with SIGALRM masked.

Submitted by: ache


27369 13-Jul-1997 peter

kill the undead


27344 12-Jul-1997 peter

Add a quick description of sysctlbyname() and link sysctl.3 to
sysctlbyname.3


27343 12-Jul-1997 peter

Have sysctlbyname() take a const first arg (the ascii string)


27181 03-Jul-1997 bde

This commit was generated by cvs2svn to compensate for changes in r27180,
which included commits to RCS files with non-trunk default branches.


27039 29-Jun-1997 jkh

_err() -> err().


26925 25-Jun-1997 msmith

Add stringlist functions from NetBSD. (required for the new ftp(1)
Obtained from: NetBSD


26898 24-Jun-1997 jhay

Add tickadj to struct clockinfo, like NetBSD and OpenBSD.


26826 23-Jun-1997 steve

Show the real revision date and not the date that this
manpage is being viewed.


26629 14-Jun-1997 ache

Change u_char which require special include to unsigned char


26628 14-Jun-1997 ache

Add arc4random() functions from OpenBSD. They are almost same as our
srandomdev(), but can be used inside libraries. random() can't be used
inside libraries because it breaks its possible predictable sequence.
arc4random() is true random as designed, so its usage is library-safe.
Obtained from: OpenBSD


26492 07-Jun-1997 ache

Style optimization in newly added POSIX range []] conformance, redo
'for' loop as do...while and remove variable unneded now


26486 06-Jun-1997 ache

Add missing FNM_PERIOD check for '[' range
Don't treat !^ as first characters in the range, just as negate sign
[/] never match if FNM_PATHNAME


26484 06-Jun-1997 ache

1) Now conforms POSIX.2 2.8.3.2 requirements about []] pattern
2) Treat unclosed [ range in pattern as regular characters (bash style)


26385 02-Jun-1997 peter

Re-activate the nanosleep style using code, but with the signal handling
semantics of the old sleep for compatability with a few decades of expected
side effects. Apache breaks if we just use nanosleep() for some reason,
here we use a new signanosleep() syscall which is kinda like a hybrid of
sigsuspend and nanosleep..

Reviewed by: ache (and tested on his apache that was failing when
sleep used plain nanosleep)


26360 02-Jun-1997 julian

Submitted by: Whistle Communications (archie Cobbs)

These changes add the ability to specify that a UFS file/directory
cannot be unlinked. This is basically a scaled back version
of the IMMUTABLE flag. The reason is to allow an administrator
to create a directory hierarchy that a group of users
can arbitrarily add/delete files from, but that the hierarchy
itself is safe from removal by them.
If the NOUNLINK definition is set to 0
then this results in no change to what happens normally.
(and results in identical binary (in the kernel)).
It can be proven that if this bit is never set by the admin,
no new behaviour is introduced..
Several "good idea" comments from reviewers plus one grumble
about creeping featurism.

This code is in production in 2.2 based systems


26338 01-Jun-1997 peter

Update the sleep(3)/usleep(3) code to use signanosleep(2) if compiled with
-DUSE_NANOSLEEP. Also, seperate the code for _THREAD_SAFE so that it uses
the simpler threaded nanosleep() call in libc_r.. We don't go to the same
extremes for emulating traditional sleep semantics (ie: eating any SIGALRM
that might happen) which things like apache seem to depend on.


26285 30-May-1997 phk

sysctlbyname allows acces to sysctl variables by name.

The manpage has been sent to linquistic decontamination and will arrive
when released from the quarantine

Reviewed by: peter


25890 18-May-1997 peter

Update the nanosleep versions to set a SIGALRM handler while sleeping.
This appears to appease Apache, although depending on having sleep(3)
changing the SIGALRM handler is a bit bogus.


25871 17-May-1997 peter

if nanosleep returns too early, loop. usleep() does not have a return
value, it appears as though the semantics of usleep are that it doesn't
return early. (only in the nanosleep code - the setitimer code does this
already)


25870 17-May-1997 peter

round-up non-zero nanoseconds in #ifdef'ed code.


25862 17-May-1997 peter

Allow conditional use (add -DUSE_NANOSLEEP) to CFLAGS of nanosleep() for
the backend of sleep(3) and usleep(3). It's off by default until the
problem is fixed.


25861 17-May-1997 ache

Temporarily restore old (itimer) sleep variant because new one
(nanosleep) breaks Apache httpd badly: his childs died quickly after
number of requests (SIGPIPE). To reproduce this bug start
gdb /usr/local/sbin/httpd
run -X

and make some bunch of concurent requests (load the server pages
from 3 different places f.e.)
After short time httpd dies via SIGPIPE. It never dies with old sleep.c

In real life it looks like lots of broken images on the pages or missing
pages. Lynx says about Network read error, etc.
It seems something wrong in nanosleep signal handling.


25739 12-May-1997 peter

Use nanosleep() in all cases, not just in the reentrant libc (_THREAD_SAFE)
version.


25704 11-May-1997 davidn

Add #include <sys/types.h> in synopsis, now required for libutil.h.


25551 07-May-1997 eivind

Back out all of yesterdays include file changes.


25520 07-May-1997 eivind

Make a lot of include-files self-contained. I excluded the patches changing
int's to gid_t and uid_t - should I commit these, too?

Closes PR misc/2625.

Submitted by: Julian Assange <proff@iq.org>


25401 03-May-1997 jb

Changed all paths to be relative to src/lib instead of src/lib/libc
so that all these makefiles can be used to build libc_r too.

Added .if ${LIB} == "c" tests to restrict man page builds to libc
to avoid needlessly building them with libc_r too.

Split libc Makefile into Makefile and Makefile.inc to allow the
libc_r Makefile to include Makefile.inc too.


25398 03-May-1997 jb

This stub has not been required by libc for a long time. Nuke it.


25269 29-Apr-1997 jdp

Fix a bug that caused some false mismatches when both FNM_PATHNAME
and FNM_LEADING_DIR were specified and the pattern ended with "*".
Example: pattern="src/usr.sbin/w*", string="src/usr.sbin/watch/watch.8,v".
This should match, but did not.


25084 22-Apr-1997 bde

FIxed the cleanup. I forgot to leave stdin alone in the usual (!twoway)
case.


25063 20-Apr-1997 dyson

Clean-up my modification of popen.c for vfork. Bruce's (this) is better.
Submitted by: Bruce Evans <bde@freebsd.org>


25028 19-Apr-1997 bde

Fixed #include and/or prototype bugs in synopsis.


24992 17-Apr-1997 danny

Fix punctuation: "it's" -> "its"


24975 16-Apr-1997 dyson

Fix the problem in popen that makes correct vfork semantics fail.
Specifically, popen modifies a variable "pdes[1]" in the child
in such a way that it breaks code in the parent (due to the address
space sharing.)


24924 14-Apr-1997 bde

Fixed another prototype bug in synopsis.


24899 13-Apr-1997 davidn

Fix typo.


24893 13-Apr-1997 davidn

Implement two new keywords and status flags for entries in /etc/ttys;
TTY_NETWORK (network), TTY_DIALUP (dialup), which determine a basic
connection type. TTY_DIALUP in particular will replace the old out of
date heuristic "tty[dD]*" in login.c (and better than the current
hard-coded method).


24892 13-Apr-1997 davidn

Add MLINKS for isdialuptty(3) & isnetworktty(3).


24876 13-Apr-1997 bde

Fixed #include and/or prototype bugs in synopsis.


24763 09-Apr-1997 mpp

Typo police. Part of PR# 3242.

Submitted by: Philippe Charnier <charnier@xp11.frmug.org>


24633 04-Apr-1997 ache

Speedup in case locale not used


24632 04-Apr-1997 ache

Eliminate some function calls when locale not used


24630 04-Apr-1997 ache

Speedup in case locale not used


24568 03-Apr-1997 mpp

Honor the nouser/nogroup flag when determing if NULL should
be returned if a cached uid/gid does not exist in the password
file.


24536 02-Apr-1997 mpp

The user_from_{uid,gid} routines would return garbage if the
uid/gid in question was in the cache, but did not exist
in the password file. This causes the -nouser and -nogroup
options to find(1) to only print the first file owned by
an unknown user/group in some cases.


24288 26-Mar-1997 davidn

Remove minor warning (for -Wall -Wshadow); clarifies code.


24158 23-Mar-1997 imp

Buffer overflow. Similar, but different, to the fix that Julian A submitted
in PR 2580.

Obtained from: BSDi by way of Keith Bostic

Should be in 2.2 and 2.1.x. I'll merge into 2.2.


24094 21-Mar-1997 mpp

Use the .Tn macro for generic FreeBSD references. Other minor cleanup.


24093 21-Mar-1997 mpp

Mdoc cleanup.


24068 20-Mar-1997 jdp

Add backward compatibility so that static executables built on
modern FreeBSD systems will syslog properly on older systems that
still name the logging socket "/dev/log". This includes pre-2.2
versions of FreeBSD as well as BSD/OS systems. If the connect to
"/var/run/log" fails, the function now tries to connect to
"/dev/log" as a fallback.


24009 19-Mar-1997 bde

FIxed arg types (mostly missing consts) in synopsis.


24008 19-Mar-1997 bde

FIxed arg types (mostly missing consts) in synopsis.


24007 19-Mar-1997 bde

Added missing #include of <stdarg.h> to synopsis. Moved prototypes for
`v' functions after this #include (same organisation as in printf.3 for
printf/vprintf).


24006 19-Mar-1997 bde

Fixed missing function types in synopsis.


24004 19-Mar-1997 bde

Fixed synopsis (put all of the function (return) type info in .Ft and
none in .Fn).


23832 13-Mar-1997 peter

Back out a dubious Lite2 change to "optimise" getcwd() to look at $PWD
because it's potentially dangerous (think: symlink races). Move
realpath() back to it's original location, and remove getcwd_physical()
by renaming it back to getcwd() and zapping the original getcwd wrapper.

Noticed by: bde


23786 12-Mar-1997 mpp

More cleanup - I didn't realize that this was a new man page
and need extra attention :-)


23784 12-Mar-1997 mpp

Mdoc cleanup.


23780 12-Mar-1997 bde

Fixed merging error. Lite2 fixed premature failure and didn't
touch duplicate group suppression, but the merge blew away our
duplicate group suppression.

The merge also blew away the -Wall cleanup in rev.1.5, but that
was misformatted, so I didn't restore it.


23768 12-Mar-1997 bde

Fixed errors in the Lite2 merge. Some style changes were mismerged.
My changes to preserve errno across free() and close() and to report
fstat() errors properly were blown away.

Updated the FreeBSD changes to match the Lite2 style fixes.


23735 11-Mar-1997 bde

Document that popen() uses a bidirectional pipe (in FreeBSD) and not a
socket pair (as in Lite2).


23734 11-Mar-1997 bde

Fixed cleaning up after malloc failure, which was broken by Lite2.

We don't use socketpair(), so don't #include <sys/socket.h>.

Restored some gcc-quieting parentheses that were lost in the Lite2 merge.


23733 11-Mar-1997 bde

Install the Lite2 getvfsbyname.3. The old getvfsbyname() interface is
still available and described in getvfsent.3.


23732 11-Mar-1997 bde

Fixed #include's in synopsis.


23668 11-Mar-1997 peter

Merge from Lite2:
filesystem include updates, duplicate group suppression, cleanups,
filesystem whiteout support (unionfs), bidir popen().


23667 11-Mar-1997 peter

Merge from Lite2: man page updates


23666 11-Mar-1997 peter

Merge from Lite2 (YAMFL2? :-)
Document that popen() can now create bidirectional pipes and handles.
Note that this needs to be updated since we have a native bidirectional
pipe and don't use socketpair() here.


23665 11-Mar-1997 peter

Merge from Lite2 (+realpath.3)


23661 11-Mar-1997 peter

merge from Lite2 - realpath() now shares a lot of code with getcwd()
and is now in the same file.


23659 11-Mar-1997 peter

This commit was generated by cvs2svn to compensate for changes in r23658,
which included commits to RCS files with non-trunk default branches.


23650 11-Mar-1997 peter

Import CSRG 4.4BSD-Lite2 includes onto vendor branch


23608 10-Mar-1997 wpaul

Fix brain-o in SunOS passwd.adjunct stuff: !strstr(s, "##") is a) bad
style and b) the wrong logic. Should be strstr(s, "##") != NULL. (Note
that the passwd.adjunct stuff has not been merged into 2.2 so this bug
is not in that branch.)


23555 09-Mar-1997 mpp

The first argument to fts_set was wrong. Part of PR# 2917.


23554 09-Mar-1997 mpp

Pause() is made obsolete by sigsuspend(2), not sigpause(3).
Part of PR# 2917.


23530 08-Mar-1997 wosch

Allow comments in group database.

The character `#' introduces a comment. Leading spaces and tabs are
ignored: '^[ \t]*#.*\n$'

Count an empty line - only spaces, tabs or newline - also as a comment.
(to be compatibel with password database comments). '^[ \t]*\n$'


23334 03-Mar-1997 bde

Enabled the Lite2 getvfsbyname(). It's actually named new_getvfsbyname()
for now so that we don't lose library compatibility. Applications should
define _NEW_VFSCONF and use getvfsbyname() instead of new_getvfsbyname()
if they want the new vfsconf interface. Parts of the old interface
(enough to load vfs modules, I hope) are still available.


23320 03-Mar-1997 ache

Don't add/subtract 1 to MAXLOGNAME, it is already NUL-terminated


23313 03-Mar-1997 mpp

Change vfc_typenum back to vfc_index in response to bde's
commit to getvfsent.c rev 1.10.


23312 03-Mar-1997 bde

Changed vfc_typenum back to vfc_index. The old vfsconf struct is now
visible again, and the new vfsconf struct didn't match reality.


23292 02-Mar-1997 bde

This commit was generated by cvs2svn to compensate for changes in r23291,
which included commits to RCS files with non-trunk default branches.


23179 28-Feb-1997 mpp

Oops! I accidently commited a change that wasn't ready for prime
time yet. Revert to rev 1.2.


23178 28-Feb-1997 mpp

The struct vfsconf element vfc_index is now vfs_typenum.


23173 28-Feb-1997 mpp

Correct the xref section - it was incorrectly using .Fn instead
of .Xr for the xrefs.


22993 22-Feb-1997 peter

Revert $FreeBSD$ to $Id$


22988 22-Feb-1997 peter

Revert $FreeBSD$ to $Id$


22942 20-Feb-1997 danny

Typogrammatical error 'with' -> 'when'.
This could be put into 2.2.


22812 16-Feb-1997 wosch

Add forgotten man page link fts_set.3 -> fts.3


22734 15-Feb-1997 davidn

Allow commonly-used "insecure" as a valid keyword in /etc/ttys.
This prevents keywords after "insecure" occurs being errnoeously
parsed as comments.


22576 12-Feb-1997 adam

lite2 remame: vfc_index --> vfc_typenum


22315 05-Feb-1997 julian

Submitted by: John Birrell
uthreads update from the author.


22150 31-Jan-1997 mpp

Don't use hardcoded *roff font change requests.


22147 31-Jan-1997 mpp

Very minor mdoc cleanup.


22139 30-Jan-1997 mpp

Update to reflect current include files.


22138 30-Jan-1997 mpp

Dont' mlink getgrent.3 to setgrfile.3, since there is no
setgrfile() function.


21907 20-Jan-1997 wosch

Sort cross references.


21786 16-Jan-1997 alex

Sweep through the tree fixing mmap() usage:

- Use MAP_FAILED instead of the constant -1 to indicate
failure (required by POSIX).
- Removed flag arguments of '0' (required by POSIX).
- Fixed code which expected an error return of 0.
- Fixed code which thought any address with the high bit set
was an error.
- Check for failure where no checks were present.

Discussed with: bde


21673 14-Jan-1997 jkh

Make the long-awaited change from $Id$ to $FreeBSD$

This will make a number of things easier in the future, as well as (finally!)
avoiding the Id-smashing problem which has plagued developers for so long.

Boy, I'm glad we're not using sup anymore. This update would have been
insane otherwise.


21189 02-Jan-1997 davidn

Added group= facility to /etc/ttys for tty grouping for more
more manageable and convenient referencing by login.conf (login
class database) and (e.g.) login.access.

This is the first of a group of commits which implements the login
class capabilities database.


21111 30-Dec-1996 mpp

Spelling/mdoc police.


20957 27-Dec-1996 wpaul

Small yet significant tweaks/cleanups:

- getpwent:
o adjunctbuf should be NUL terminated after copying
o _pw_breakout_yp() needs to know the length of the buffer returned
from YP so it can properly NUL terminate its local buffer.

- getgrent:
o YP buffers should be YPMAXRECORD + 2 bytes long and NUL terminated.
(Previously they were hardcoded to 1024 bytes.)

- getnetgrent:
o YP data should be copied with snprintf(), not sprintf()

These are 2.2 candidates. I will wait a few days to make sure these don't
break anything and then, if there are no objections, move them to the 2.2
branch.


20941 27-Dec-1996 alex

Make a note in the standards section that sysconf isn't completely
POSIX conforming.


20911 25-Dec-1996 wosch

Use dynamic allocated buffers instead static buffers. No member or
line length limit anymore - now 500 members or 5000 members are
possible. For security group lines longer than 256K will be count as
an error. 256K should be enough for 65536 users.

Support comments (lines that begin with a #) if compiled with
option -DGROUP_IGNORE_COMMENTS.

Fortunately it seems that all system utilities which use getgrent()
functions are dynamically linked executables. So you need only
rebuild libc.so.3.0 if you want this change. Note: if you have
an old X server which depend on libc.so.2.* you should rebuild
libc.so.2.* too.

Not a 2.2 candidate.


20784 22-Dec-1996 davidn

Speeling fix.


20756 21-Dec-1996 wpaul

Add a missing #ifdef YP/#endif pair so that this module will
compile without -DYP.

Pointed out by: Wolfram Schneider


20534 15-Dec-1996 mpp

Mention FreeBSD explicitly along with 4.2BSD so that the
reader will know that this information does apply to FreeBSD also.

Closes PR# 1618.

This can go into 2.2.


20486 14-Dec-1996 mpp

Correct some xrefs/mlinks.


20417 14-Dec-1996 steve

Merge Lite2 mods, and -Wall cleaning. undelete(2) cruft
not yet implemented is protected by a define (BSD4_4_LITE)
that should be removed when this call is supported by the
kernel.


20383 12-Dec-1996 joerg

Don't free the line buffer, since getttynam(3) might still reference
it.

Closes PR # bin/2196: Bug in src/libc/gen/gettty...

Submitted by: davidn@blaze.net.au (David Nugent)


20266 09-Dec-1996 mpp

Change another reference to host names to domain names, and restore some
changes that were lost.

Pointed out by: bde


20162 05-Dec-1996 jkh

sethostname() returns int, not long. I could get used to having this
copy of insure++, too bad the runtime only works for BSD/OS. :-(

Maybe they'll be so impressed by my initial 15 entry bug report for it
that they'll take the FreeBSD version more seriously. :-) :-)


20161 05-Dec-1996 jkh

_key is a char array and we don't need to pass its address to _buildkey()
when buildkey is expecting a char *.


20160 05-Dec-1996 jkh

gethostname() returns int, not long. Answered my own question by
RTFM'ing. Either both the header files and the man pages are wrong
or this code is, and I'll take the majority decision. :-)


20119 03-Dec-1996 wpaul

Add support for detecting and hopefully using the passwd.adjunct.byname
NIS map which is present on SunOS NIS servers with the SunOS C2 security
hack^Woption installed. I'm convinced that the C2 security option restricts
access to the passwd.adjunct.byname map in the same way that I restrict
access to the master.passwd.{byname,buid} maps (checking for reserved ports),
which means that we should be able to handle passwd.adjunct.byname map
correctly.

If _havemaster() doesn't find a master.passwd.byname map, it will now
test for a passwd.adjunct.byname map before defaulting back to the
standard non-shadowed passwd.{byname,byuid} maps. If _pw_breakout_yp()
sees that the adjunct map was found and the password from the standard
maps starts with ##, it will try to grab the correct password field
from the adjunct map. As with the master.passwd maps, this only happens
if the caller is root, so the shadowing feature is preserved; non-root
users just get back ##username as the encrypted password.

Note that all we do is grab the second field from the passwd.adjunct.byname
entry, which is designated to be the real encrypted password. There are
other auditing fields in the entry but they aren't of much use to us.

Also switched back to using yp_order() to probe for the maps (instead
of yp_first()). The original problem with yp_order() was that it barfed
with NIS+ servers in YP compat mode since they don't support the
YPPROC_ORDER procedure. This condition is handled a bit more gracefully
in yplib now: we can detect the error and just punt on the probing.


20058 01-Dec-1996 mpp

Update getdomainname(3) to reflect that it operates on
domain names and not host names.

Pointed out by: bde
Obtained from: NetBSD


19852 18-Nov-1996 bde

Fixed execvp() of an empty pathname to fail POSIXly. Previously it
attempted to exec the components of $PATH and it usually set errno
to the wrong value.

Found by: NIST PCTS


19850 18-Nov-1996 bde

Fixed uninitialized variables for the '/'-in-pathname case in execvp().
Garbage in `eacces' caused the wrong errno to be set for non-EACCES errors.
Garbage in `etxtbsy' caused a semi-random retry strategy for ETXTBSY errors.

Found by: NIST-PCTS. gcc -Wall reported the problem, but -Wall is not
enabled for libc.


19635 11-Nov-1996 hsu

Parameters pthread_getspecific() changed.


19390 04-Nov-1996 bde

Document that the `old' count is returned for the ENOMEM case.


19276 31-Oct-1996 ache

collate_range_cmp -> __collate_range_cmp


19199 26-Oct-1996 joerg

Fix an off-by-one error in getvfsent().

Detected by: phkmalloc :)


19132 23-Oct-1996 ache

GNU-style changes:
1) Rename FNM_ICASE to FNM_CASEFOLD
2) Add FNM_LEADING_DIR
Add proper (unsigned char) casts to tolower().
Use 'char' function argument for proper sign extension


19082 21-Oct-1996 joerg

Fix a potential memory leak i've introduced with my recent patch.

Reviewed by: bde


19059 20-Oct-1996 wosch

add flag FNM_ICASE for case insensitve search

Reviewed by: ache


19031 19-Oct-1996 joerg

Remove the arbitrary limit for the line length in /etc/ttys, and make
the buffer dynamic.

Closes PR # misc/1838: getttyent() arbitrary 100...


18971 17-Oct-1996 peter

Corrently null-terminate the path being passed to the opendir() calls,
malloc() does is not defined to return a zeroed buffer leading to
"strange" problems.

Submitted by: Karl Denninger <karl@mcs.com>, PR#1826


18718 05-Oct-1996 wosch

delete doubled words, e.g.: "the the" -> "the"


18563 29-Sep-1996 bde

Made this about as (in)complete as sysctl.8.
- removed references to nonexistent pathconf-related variables.
- document everything in CTL_MACHDEP(more than in sysctl.8) and
80% of the things in CTL_KERN (same as in sysctl.8).


18549 28-Sep-1996 wosch

.Os NetBSD -> .Os FreeBSD.
The pages are not NetBSD specific and FreeBSD is not a child of NetBSD.


18472 23-Sep-1996 alex

Fix typo from previous commit (tsvsec --> tv_sec).


18446 21-Sep-1996 wosch

fix .Xr macro


18414 20-Sep-1996 nate

ts_sec -> tv_sec
ts_nsec -> tv_nsec


18286 14-Sep-1996 bde

Don't use __dead or __pure in user code. They were obfuscations
for gcc >= 2.5 and no-ops for gcc >= 2.6. Converted to use __dead2
or __pure2 where it wasn't already done, except in math.h where use
of __pure was mostly wrong.


18046 05-Sep-1996 wpaul

Apply patch to fix +group YP overrides and prevent SEGV on badly
formatted groups (foo:*).


17798 23-Aug-1996 mpp

Some minor man page cleanup.


17785 23-Aug-1996 mpp

Typo police.


17782 22-Aug-1996 mpp

Correctly use .Fn instead of .Nm to reference function names
in a bunch of man pages.

Use the correct .Bx (BSD UNIX) or .At (AT&T UNIX) macros
instead of explicitly specifying the version in the text
in a bunch of man pages.


17780 22-Aug-1996 mpp

Update a bunch of man pages to use .Fn instead
of .Nm when referencing funciton names.


17763 21-Aug-1996 mpp

Update some more man pages to use the .Fx macro.


17706 20-Aug-1996 julian

Submitted by: John Birrell <cimaxp1!jb@werple.net.au>

Here are the diffs for libc_r to get it one step closer to P1003.1c
These make most of the thread/mutex/condvar structures opaque to the
user. There are three functions which have been renamed with _np
suffixes because they are extensions to P1003.1c (I did them for JAVA,
which needs to suspend/resume threads and also start threads suspended).

I've created a new header (pthread_np.h) for the non-POSIX stuff.

The egrep tags stuff in /usr/src/lib/libc_r/Makefile that I uncommented
doesn't work. I think its best to delete it. I don't think libc_r needs
tags anyway, 'cause most of the source is in libc which does have tags.

also:

Here's the first batch of man pages for the thread functions.
The diff to /usr/src/lib/libc_r/Makefile removes some stuff that was
inherited from /usr/src/lib/libc/Makefile that should only be done with
libc.

also:

I should have sent this diff with the pthread(3) man page.
It allows people to type

make -DWANT_LIBC_R world

to get libc_r built with the rest of the world. I put this in the
pthread(3) man page. The default is still not to build libc_r.


also:
The diff attached adds a pthread(3) man page to /usr/src/share/man/man3.
The idea is that without libc_r installed, this man page will give people
enough info to know that they have to build libc_r.


17617 15-Aug-1996 mpp

Don't claim to be POSIX compliant, since our alarm function isn't.


17552 12-Aug-1996 ache

Convert to newly aded collate compare function


17533 12-Aug-1996 ache

Use collate for alpha character ranges


17531 12-Aug-1996 ache

Remove static collcmp, ise new internal function now


17528 12-Aug-1996 ache

Use collate for alpha character ranges


17344 30-Jul-1996 bde

Fixed description of _SC_CLK_TCK. Both the clock and the units
were wrong.


17286 25-Jul-1996 wollman

Refer to the ASCII character 000 by its proper name, `NUL', and not
`NULL' (which should only be used in reference to null pointers). Also
fix a cross-reference.


17282 25-Jul-1996 wollman

Finish rename of KERN_DOMAINNAME to KERN_NISDOMAINNAME.

Suggested by: Keith Bostic


17226 19-Jul-1996 mpp

The previous change to alarm.3 to improve the wording
was still somewhat confusing and poorly worded. So I took
the alarm.3 man page from NetBSD, which looked much
better all around.

Obtained from: NetBSD


17222 19-Jul-1996 adam

the previous text was absurd, and wrong


17145 12-Jul-1996 wollman

Include the proper header file (<unistd.h>) and declare [gs]etdomainname()
with the correct return type. This does not include the renaming
of KERN_DOMAINNAME to KERN_NISDOMAINNAME.

Pointed-out-by: Keith Bostic


17141 12-Jul-1996 jkh

General -Wall warning cleanup, part I.
Submitted-By: Kent Vander Velden <graphix@iastate.edu>


16936 03-Jul-1996 mpp

Document the "sig" function parameter.

Submitted by: James Raynard


16601 22-Jun-1996 gpalmer

Specify that daemon(3) returns int, and standardise the
phrasing in the ERRORS section a bit, as well as now specifying
the return status.


16552 20-Jun-1996 julian

Submitted by: archie@whistle.com
This program should COMPLAIN about uids > 65K but not abort.. they are after
all legal, and some of us NEED them!


16536 20-Jun-1996 jmacd

I hate to read a man page that almost has useful information
but falls a little short. I added a comment on the null
termination of struct group's gr_mem field.

Reviewed by: jkh


16279 10-Jun-1996 phk

Update man to tell that <sys/types.h> is needed.
Submitted by: "Philippe Charnier" <charnier@lirmm.fr>


16091 03-Jun-1996 joerg

Minor corrections. The second parameter is actually of type int
(though only char will be used), and our implementation is not really
worse than the SysV one, so there's no need to claim so in the BUGS
section.


15968 29-May-1996 wosch

add manpage links:

des_setkey.3 -> crypt.3
des_cipher.3 -> crypt.3
err_set_exit.3 -> err.3
err_set_file.3 -> err.3
strunvis.3 -> unvis.3


15874 23-May-1996 mpp

Fixed various problems: typos, grammer, missing include files
wrong function type declarations, and wrong argument type
declarations.


15839 21-May-1996 wpaul

- Fix _listmatch() to close PR #1207.
Fix submitted by: Alan Cox <alc@cs.rice.edu>

- Nuke yet another free(result) that isn't needed. (This one I found
without phkmalloc's help. :)


15804 17-May-1996 wollman

Fix for vfsload(3):

- Don't allow non-root users to specify LKMDIR.
- Don't allow any users to specify TMPDIR.
- Call /sbin/modload using execl() rather than execlp().


15706 10-May-1996 jdp

Clarify the description of the FNM_PERIOD flag.


15668 07-May-1996 wpaul

Grrrr... yet another variation on Murphy's Law: the best way to find
bugs in your code is to put it in the -stable branch. (Corollary: the
day you discover the bug is the day the Internet decides to route your
telnet session to the repository box via Zimbabwe.)

Remove one bogus free(result) (from _havemaster()) that slipped by me.

Flagged by: phkmalloc
Pointed out to me by: Stefan Esser


15528 02-May-1996 phk

Cache the result of getpagesize() so we only make one syscall.
Use getpagesize instead of CLBYTES.


15488 01-May-1996 bde

Fixed incomplete or wrong lists of prerequisite #includes related to
<sys/types.h>.


15446 29-Apr-1996 wpaul

Very minor tweak:

In __initdb(), a failure to open the local password database is supposed
to result in a warning message being syslog()ed. This warning is only
supposed to be generated as long as the 'warned' flag hasn't been yet;
once the warning is generated, the flag should be set so that the message
is only syslog()ed once. However, while the state of the flag is checked
properly, the flag's state is never changed, so you always get multiple
warnings instead of just one.

Pointed out by: Peter Wemm


15313 19-Apr-1996 bde

Removed bogus includes of <sys/types.h> from synopses.

This commit covers the man pages for most of the ANSI library functions.
A few others such as strtol.3 have to mention <sys/types.h> because they
mix ANSI interfaces with less well designed extensions.


15312 19-Apr-1996 bde

Don't include <sys/types.h> when it isn't used.

This commit covers most of the ANSI library functions. Many others only
need <sys/types.h> because they use u_xxx.


15308 19-Apr-1996 bde

Added `const' to types of sys_siglist and sys_signame.


15267 16-Apr-1996 wpaul

NIS cleanups and fixes, the next generation.

getnetgrent.c:

- Catch one bogon that snuck by: in _listmatch(), check for '\0'
rather than '\n'; strings returned from yp_match() are terminated
with a nul, not a newline.

getpwent.c:

- Rip out all of the +inclusion/-exclusion stuff from before and
replace it with something a little less grotty. The main problem
with the old mechanism was that it wasted many cycles processing
NIS entries even after it already knew they were to be exlcuded
(or not included, depending on your pointof view). The highlights
of these changes include:

o Uses an in-memory hash database table to keep track of all the
-@netgroup, -user, and -@group exclusions.

o Tries harder to duplicate the behavior normally obtained when using
NIS inclusions/exclusions on a flat /etc/passwd file (meaning things
come out in much the same order).

o Uses seperate methods for handling getpwent() and getpwnam()/getpwuid()
operations instead of trying to do everything with one general
function, which didn't work as well as I thought it would.

o Uses both getnetgrent() and innetgr() to try to save time where
possible.

o Use only one special token in the local password database
(_PW_KEYYPBYNUM) instead of seperate tokens to mark + and -
entries (and stop using the counter tokens too). If this new
token doesn't exist, the code will make due with the standard
_PW_KEYBYNUM token in order to support older databases that
won't have the new token in them.

All this is an attempt to make this stuff work better in environments
with large NIS passwd databases.


15264 15-Apr-1996 wpaul

Fix a few NIS-related bogons:

- Clear the _yp_innetgr flag immediately after calling setnetgrent() from
innetgr(). We only need the flag set to temporarily alter setnetgrent()'s
behavior. Previously, it was being cleared too late.

- When in NIS-only mode, innetgr() was wasting time doing unecessary
extra processing after it had already found a match.

- Remember to free memory allocated by the NIS functions during innetgr()
searches.


15135 08-Apr-1996 mpp

Correct some man page xrefs, and some other minor changes to bring some
man pages up to mdoc guidelines and fix some minor formatting glitches.
Also fixed a number of man pages to not abuse the .Xr macro to
display functions and path names and a lot of other junk.


15049 05-Apr-1996 joerg

Xref clocks(7).


15047 05-Apr-1996 jmacd

Added a note about the return value. Its been so long I can't
remember who suggested the 'caveat' section. Sorry.


14910 29-Mar-1996 bde

stat() before open() because opening of special files may be harmful.


14870 28-Mar-1996 ache

Back out one of my previous changes: don't clear PARODD,
so return to absolute minimum of changed flags now


14858 27-Mar-1996 ache

cfmakeraw:
clear PARODD bit too, help user program to set its own
parity via |
Set CREAD bit, it is 99% case


14855 27-Mar-1996 mpp

Added missing section numbers to a bunch of .Xr macros, or
converted them into .Fn macros where appropriate. Also fixed
up some minor formatting problems.


14814 25-Mar-1996 ache

Convert int to uchar range for ctype


14699 19-Mar-1996 bde

alarm -> ualarm.


14698 19-Mar-1996 bde

Updated a type to match Lite2's fixed-width type changes.

Added $Id$.

Obtained from: 4.4BSD-Lite2


14517 11-Mar-1996 hsu

From Lite2: rename fs to vfs.


14516 11-Mar-1996 hsu

From Lite2: rename fs to vfs.


14389 05-Mar-1996 dg

Implemented negative caching on uid/gid lookup failures. This won't
matter much on some systems, but on ftp servers (like wcarchive) where
you run with special stripped group and pwd.db files in the anonymous
ftp /etc, this can be a major speedup for ls(1).


14332 02-Mar-1996 peter

If the send() to the AF_UNIX socket to the syslogd fails, attempt to
reconnect once using the saved openlog() parameters.

This helps one of the system startup race conditions. If syslogd takes too
long to get going, some daemons can fail the connection and forever log
to the console even though the syslogd is running. That is ..unfortunate..


14236 24-Feb-1996 peter

If the two recently added sysctl variables exist, use those rather than
the statically compiled PS_STRINGS and USRSTACK variables. This prevents
programs using setproctitle from coredumping if the kernel VM is increased,
and stops libkvm users (w, ps, etc) from needing to be recompiled if only
the VM layout changes.


14136 18-Feb-1996 wosch

man page links

fts_open.3 -> fts.3
fts_read.3 -> fts.3
fts_children.3 -> fts.3
fts_close.3 -> fts.3


14103 15-Feb-1996 jdp

Corrected a couple of errors in the fts(3) manual page. The prototype
for "fts_open" was wrong. Also, the "fts_info" field of the FTSENT
structure was misleadingly described as containing "flags". Actually, it
contains a single integer value.


14101 15-Feb-1996 mpp

Fixed a bunch of man page cross references that were
in the main text of various man pages.

Thanks to Warner Losh for adding an option to manck to allow
it to scan the entire man page looking for bogus xrefs, instead
of just checking the SEE ALSO section.


14054 12-Feb-1996 mpp

Correct the xref for msgctl: msgctl(2) -> msgctl(3)


14053 12-Feb-1996 mpp

Added man pages for msgctl(3), msgget(3), msgrcv(3) and msgsnd(3).

Obtained from: NetBSD


14045 12-Feb-1996 mpp

Another round of man page cleanups.

Down to only about 100 items left to cleanup! :-)


14038 11-Feb-1996 mpp

Correct a bunch of man page cross references and generally
try and silence "manck".

ncurses, rpc, and some of the gnu stuff are still a big mess, however.


13987 09-Feb-1996 mpp

Added some missing MLINKS for section 3 man pages.
Also corrected a few minor formatting errors, file location and cross
references in some of the section 3 man pages.

This shuts up a lot of the output from "manck" for section 3.


13754 30-Jan-1996 mpp

Another round of spelling fixes.


13750 30-Jan-1996 mpp

Fix even more spelling errors in some more man pages.


13717 29-Jan-1996 mpp

Getpwent() and getservent() can wind up calling free() with
an invalid pointer if a call to yp_first() fails. Closes PR # 964,
and possibly # 952.


13561 22-Jan-1996 mpp

Changed the description of SIGSYS to better reflect what
it means when that signal is received. Closes PR# 686.


13549 22-Jan-1996 julian

Obtained from: uthreads package


13545 22-Jan-1996 julian

Reviewed by: julian and (hsu?)
Submitted by: John Birrel(L?)

changes for threadsafe operations


13137 01-Jan-1996 peter

Bump libutil revision after recent addition of setproctitle().

Install (optional) libutil.h with prototypes for the functions and
document this in the man page.

minor cleanups to the various routines, include the prototype file, declare
return codes etc.


13131 31-Dec-1995 joerg

Finally complete my fix for the behaviour of getpass(3) upon receipt
of signals. Signals are now properly caught, tty state is being
restored, and the previous sigaction triggered. Upon receipt of a
sigcont, echo is turned off again.

SIGTSTP causes a buffer flush, the man page mentions this. (Although
i rather think of it as a feature than a bug.)

This is likely to be my last FreeBSD action for 1995, xearth shows
me that our .au guys must already write 1996. :-)


13123 30-Dec-1995 peter

This commit was generated by cvs2svn to compensate for changes in r13122,
which included commits to RCS files with non-trunk default branches.


13067 27-Dec-1995 joerg

Don't block SIGINT in getpass(3); this doesn't make sense.


13039 26-Dec-1995 peter

Bring in an initial version of setproctitle().. This is intended to
replace the dozen other various hacks in the code that do all sorts
of crude things including spamming the envrionment strings with the new
argv string.

This version is mainly inspired by the sendmail version, with a couple of
ideas taken from the NetBSD implementation as well.


12674 08-Dec-1995 dg

Include sys/time.h, not sys/user.h.

Submitted by: "Marc G. Fournier" <scrappy@hub.org>


12585 02-Dec-1995 wpaul

Small tweak: don't try closing /etc/netgroup if we haven't opened it yet.


11874 28-Oct-1995 phk

Add #include <sys/user.h>.


11825 26-Oct-1995 ache

Remove unneded ctype.h


11742 23-Oct-1995 ache

Fix it for chars with 8bit set


11677 22-Oct-1995 bde

Fixed lint from cc -Wall.
Cleaned up includes.


11659 22-Oct-1995 phk

Minor cleanup, mostly unused vars and missing #includes.


11606 21-Oct-1995 peter

Add $Id$ since this version of the file has diverged from the BSD base a
fair bit. I forgot to add it when I made the fixes some time ago.


11436 11-Oct-1995 wpaul

Another tweak/speedup pass:

- Fix buffer overflow problem once and for all: do away with the buffer
copies to 'user' prior to calling _scancaches() and just pass a pointer
to the buffer returned by yp_match()/yp_first()/yp_next()/whatever.
(We turn the first ':' to a NUL first so strcmp() works, then change it
back later. Submitted by Bill Fenner <fenner@parc.xerox.com> and
tweaked slightly by me.

- Give _pw_breakout_yp() the 'more elegant solution' I promised way back when.
Eliminate several copies to static buffers and replace them with just
one copy. (The buffer returned by the NIS functions is at most
YPMAXRECORD bytes long, so we should only need one static buffer of
the same length (plus 2 for paranoia's sake).)

- Also in _pw_breakout_yp(): always set pw.pw_passwd to the username
obtained via NIS regardless of what pw_fields says: usernames cannot
be overridden so we have no choice but to use the name returned by
NIS.

- _Again_ in _pw_breakout_yp(): before doing anything else, check that
the first character of the NIS-returned buffer is not a '+' or '-'.
If it is, drop the entry. (#define EXTRA_PARANOIA 1 :)

- Probe for the master.passwd.* maps once during __initdb() instead
of doing it each time _getyppass() or _nextyppass() is called.

- Don't copy the NIS data buffers to static memory in _getyppass()
and _nextyppass(): this is done in _pw_breakout_yp() now.

- Test against phkmalloc and phkmalloc/2 (TNG!) to make sure we're
free()ing the yp buffers sanely.

- Put _havemaster(), _getyppass() and nextyppass() prototypes under
#ifdef YP. (Somehow they ended up on the wrong side of the #endif.)

- Remove unused variable ___yp_only.


11286 06-Oct-1995 wpaul

Some NIS bug stomping:

- In some cases, we don't properly resolve _all_ possible group memberships.
If a user is a member of both local and NIS groups, we sometimes lose some
of the membership info from NIS. (Reported by: Thorsten Kukuk
<kukuk@uni-paderborn.de>)

- Make NIS +groupname overrides actually work the way the SunOS group(5)
man page says they should (make them work for all cases: getgrent(),
getgrnam() and getgrgid()).

- When not compiled with -DYP, grscan() should ignore entries that
begin with a '+'. When compiled _with_ -DYP, grscan() should ignore
+groupname entries that don't refer to real NIS groups.

- Remove redundant redeclaration of fgets(), strsep() and index() inside
grscan(). We already #include all the right header files for these.

Note: -groupname exclusion as specified in the Sun documentation still
isn't supported. This'll be a 2.2 addition. Right now I just want this
stuff to work.


11192 05-Oct-1995 peter

Fix the problem that I aroused with the last commit..

What was happening, is if syslogd was not running, syslog() would do
a strcat("\r\n") on a non-null-terminated buffer, and write it to the console.

This meant that sometimes extra characters could be written to the console
during boot, depending on the stack contents.

This totally avoids the potential problem by using writev() like the rest
of the does, and avoid modifying the buffer after the trouble we've gone to
to carefully protect it.

This is actually a trivial fix, in spite of the long commit message.. :-)
It only appeared during boot and shutdown with syslogd stopped.


10954 22-Sep-1995 peter

Make ttyname() use posix-style tcgetattr() to check to see that it's
running on a tty. (Same as isatty()) The old-style TIOCGETP ioctl
wouldn't fly if the kernel didn't have COMPAT_43.
Submitted by: Carl Fongheiser <cmf@netins.net>


10794 15-Sep-1995 peter

Fix security bugs with a "new approach", using stdio's powerful buffer
control hooks.
It is similar to an unrolled multi-part snprintf(), in that a "FILE *" is
attached to a string buffer. There is also an optimisation for the case
where the syslog format string does not contain %m, which should improve
performance of "informational" logging, like from ftpd.


10565 05-Sep-1995 wpaul

getgrent.c: adjust _nextypgroup() slightly so that it continues processing
the group map after encountering a badly formatted entry.

getpwent.c: same as above for _nextyppass(), and also turn a couple of
sprintf()s into snprintf()s to avoid potential buffer overruns. (The
other day I nearly went mad because of a username in my NIS database
that's actually 9 characters long instead of 8. Stuffing a 9-character
username into an 8-character buffer can do some strange things.)

(This reminds me: I hope somebody's planning to fix the buffer overrun
security hole in syslog(3) before 2.1 ships.)


10521 02-Sep-1995 wpaul

getpwent.c: turn the code that checks the override caches into a
seperate function to avoid duplication. Also fix getpwent() a
small bit to properly handle the case where the magic NIS '+'
entry appears before the end of the password file.

getgrent.c: be a little more SunOS-ish. Make it look like the NIS
group map is 'inserted' at the the point(s) where the magic NIS '+'
entry/entries appear.

getgrent: fix a file descriptor leak: remember to close the netgroup
file after we determine that we're using NIS-only innetgr() lookups.


10414 29-Aug-1995 ache

National date/time representation in syslog logfiles looks ugly,
change strftime to ctime. Logfiles must have default (english) date/time
representation for access/view from various places.


9998 08-Aug-1995 wpaul

Fix _listmatch() so that it doesn't fall off the end of the list string.


9978 07-Aug-1995 wpaul

Just when you thought it was safe...

- getnetgrent.c: address some NIS compatibility problems. We really need
to use the netgroup.byuser and netgroup.byhost maps to speed up innetgr()
when using NIS. Also, change the NIS interaction in the following way:

If /etc/netgroup does not exist or is empty (or contains only the
NIS '+' token), we now use NIS exclusively. This lets us use the
'reverse netgroup' maps and is more or less the behavior of other
platforms.

If /etc/netgroup exists and contains local netgroup data (but no '+').
we use only lthe local stuff and ignore NIS.

If /etc/netgroup exists and contains both local data and the '+',
we use the local data nd the netgroup map as a single combined
database (which, unfortunately, can be slow when the netgroup
database is large). This is what we have been doing up until now.

Head off a potential NULL pointer dereference in the old innetgr()
matching code.

Also fix the way the NIS netgroup map is incorporated into things:
adding the '+' is supposed to make it seem as though the netgroup
database is 'inserted' wherever the '+' is placed. We didn't quite
do it that way before.

(The NetBSD people apparently use a real, honest-to-gosh, netgroup.db
database that works just like the password database. This is
actually a neat idea since netgroups is the sort of thing that
can really benefit from having multi-key search capability,
particularly since reverse lookups require more than a trivial
amount of processing. Should we do something like this too?)

- netgroup.5: document all this stuff.

- rcmd.c: some sleuthing with some test programs linked with my own
version of innetgr() has revealed that SunOS always passes the NIS
domain name to innetgr() in the 'domain' argument. We might as well
do the same (if YP is defined).

- ether_addr.c: also fix the NIS interaction so that placing the
'+' token in the /etc/ethers file makes it seem like the NIS
ethers data is 'inserted' at that point. (Chances are nobody will
notice the effect of this change, which is just te way I like it. :)


9935 05-Aug-1995 wollman

Don't depend on bogusly-installed <tzfile.h>.


9817 31-Jul-1995 mpp

Null terminate all strings returned by the dummy uname() routine,
and make sure that the version string is somewhat sane. This
closes out PR#462.

Reviewed by: Bruce Evans


9536 16-Jul-1995 bde

Fix the synopsis of signal() again. Now it is uglier but correct.
(Declarations of signal that don't use typedefs can't be formatted
in the standard man page form.)


9332 26-Jun-1995 wpaul

Do the same sanity checking in _pw_breakout_yp() that we do in
_gr_breakout_yp(): if we encounter a NULL pointer generated as the
result of a badly formatted NIS passwd entry (e.g. missing fields),
we punt and return an error code, thereby silently skipping the
bad entry.


9331 26-Jun-1995 wpaul

Fix for a potential problem reported by a user I bumped into on IRC
last night:

_gr_breakout_yp() doesn't check for badly formatted NIS group entries.
For example, a bogus entry like this:

bootp::user1,user2,user3

will lead to a null pointer dereference and a SEGV (note that the GID
field is missing -- this results in one of the strsep(&result, ":")
returning NULL). The symtpom of this problem is programs dumping
core left and right the moment you add a + entry to /etc/group.
Note that while this is similar to an earlier bug, it's caused by a
different set of circumstances.

The fix is to check for the NULL pointers and have _gr_breakout_yp()
punt and return a failure code if it catches one. This is more or
less the behavior of SunOS: if a bad NIS group entry is encountered,
it's silently ignored. I don't think our standard (non-NIS) group
parsing code behaves the same way. It doesn't crash though, so I'm
citing the 'it ain't broken, don't fix it' rule and leaving it alone.

I'll probably have to add similar checks to _pw_breakout_yp() in
getpwent.c to ward off the same problems. It's rare that bad NIS
map entries like this occur, but we should handle them gracefully
when they do.


9287 23-Jun-1995 wpaul

Fixes for PR #508 and #509 ('botched 'Bad netgroup' error message' and
'cycle in netgroup check too greedy').

PR #508 is apparently due to an inconsistency in the way the 4.4BSD
netgroup code deals with bad netgroups. When 4.4BSD code encounters
a badly formed netgroup entry (e.g. (somehost,-somedomain), which,
because of the missing comma between the '-' and 'somedomain,' has
only 2 fields instead of 3), it generates an error message and
then bails out without doing any more processing on the netgroup
containing the bad entry. Conversely, every other *NIX in the world
that usees netgroups just tries to parse the entry as best it can
and then silently continues on its way.

The result is that two bad things happen: 1) we ignore other valid entries
within the netgroup containing the bogus entry, which prevents
us from interoperating with other systems that don't behave this way,
and 2) by printing an error to stderr from inside libc, we hose certain
programs, in this case rlogind. In the problem report, Bill Fenner
noted that the 'B' from 'Bad' was missing, and that rlogind exited
immediately after generating the error. The missing 'B' is apparently
not caused by any problem in getnetgrent.c; more likely it's getting
swallowed up by rlogind somehow, and the error message itself causes
rlogind to become confused. I was able to duplicate this problem and
discovered that running a simple test program on my FreeBSD system
resulted in a properly formatted (if confusing) error, whereas triggering
the error by trying to rlogin to the machine yielded the missing 'B'
problem.

Anyway, the fixes for this are as follows:

- The error message has been reformatted so that it prints out more useful
information (e.g. Bad entry (somehost,-somedomain) in netgroup "foo").
We check for NULL entries so that we don't print '(null)' anymore too. :)

- Rearranged things in parse_netgrp() so that we make a best guess at
what bad entries are supposed to look like and then continue processing
instead of bailing out.

- Even though the error message has been cleaned up, it's wrapped inside
a #ifdef DEBUG. This way we match the behavior of other systems. Since we
now handle the error condition better anyway, this error message becomes
less important.

PR #507 is another case of inconsistency. The code that handles
duplicate/circular netgroup entries isn't really 'too greedy; -- it's
just too noisy. If you have a netgroup containing duplicate entries,
the code actually does the right thing, but it also generates an error
message. As with the 'Bad netgroup' message, spewing this out from
inside libc can also hose certain programs (like rlogind). Again, no
other system generates an error message in this case.

The only change here is to hide the error message inside an #ifdef DEBUG.
Like the other message, it's largely superfluous since the code handles
the condition correctly.

Note that PR #510 (+@netgroup host matching in /etc/hosts.equiv) is still
being investigated. I haven't been able to duplicate it myself, and I
strongly suspect it to be a configuration problem of some kind. However,
I'm leaving all three PRs open until I get 510 resolved just for the
sake of paranoia.


9272 20-Jun-1995 hsu

Don't cast void functions to void.
Obtained from: NetBSD commit by jtc on June 16, 1995.


9250 17-Jun-1995 wpaul

Make _havemaster() use yp_first() (again) instead of yp_order() to
ward off possible NIS+ evil. (I might be overly paranoid with this,
but it doesn't hurt, so...)


9202 11-Jun-1995 rgrimes

Merge RELENG_2_0_5 into HEAD


8870 30-May-1995 rgrimes

Remove trailing whitespace.


8857 30-May-1995 rgrimes

Remove trailing whitespace.


8522 14-May-1995 ache

Parse ^? now, our termcap use it and some termcaps from other
systems use it too


8226 02-May-1995 ache

Fix bracket error for LogMask
Submitted by: Ruslan Belkin <rus@home2.UA.net>


8198 01-May-1995 joerg

Added function and man page for ftok(3), used in conjunction with
the so-called "System V IPC".

Submitted by: jbeukema@HK.Super.Net (John Beukema)
Obtained from: Th. Lockert <tholo@sigmasoft.com>, via NetBSD


8172 29-Apr-1995 wpaul

Small fix for the following problems:

- If you take the wheel entry out of /etc/group and turn on NIS,
the '+:*::' line is incorrectly flagged as the entry for wheel (the
empty gid section is translated to 0), hence getgrgid() returns '+'
as the name of the group instead of 'wheel.'

- Using just '+:' as the 'turn on NIS' switch in /etc/group makes
getgrgid() dump core because of a null pointer dereference. (Last
time I was in here, I foolishly assumed that fixing the core dump
problems with getgrnam() and getgrent() would fix getgrgid() too.
Silly me.)


8002 22-Apr-1995 wpaul

in _freecaches(): strdup() allocates us memory -- remember to free it.


7978 21-Apr-1995 bde

Fix bugs in opendir():
- it succeeded on non-directories (see POSIX 5.1.2.4).
- it hung on (non-open) named pipes.
- it leaked memory if the second malloc() failed.
- it didn't preserve errno across errors in close().


7834 15-Apr-1995 wpaul

Head off potential core dump in _havemaster() (we don't need to free any
memory here: the underlying YP routines handle this one for us).


7815 14-Apr-1995 wpaul

Better conformance to SunOS behavior: if we can't match a user to one
of the plus or minus lists at all, reject him. This lets you create
a +@netgroup list of users that you want to admit and reject everybody
else. If you end your +@netgroup list with the wildcard line
(+:::::::::) then you'll have a +@netgroup list that remaps the
specified people but leaves people not in any netgroup unaffected.


7803 13-Apr-1995 wollman

Add err_set_file() and err_set_exit() functions to make it possible for
programs which use err(3) to work nicely in a wider range of environments
(e.g., dialog).


7690 09-Apr-1995 ache

Add missing header reference


7638 05-Apr-1995 joerg

The man page setmode(3) declares `void setmode' when it should be
declared `void *setmode'.

Submitted by: kargl@troutmask.apl.washington.edu


7615 04-Apr-1995 wpaul

getpwent.c: fix problem with emacs dumping core when NIS is enabled. Also
add #includes for YP headers when compiling with -DYP to avoid some implicit
declarations.

getgrent.c & getnetgrent.c: add some #includes to avoid implicit declarations
of YP functions.


7471 29-Mar-1995 ache

Clear IGNPAR in cfmakeraw() instead of set it.


7422 27-Mar-1995 wpaul

Use yp_order() instead of yp_first() in _havemaster() to check for the
presence of the master.passwd.byname map, and remember to free the
returned order value before exiting.


7349 25-Mar-1995 phk

scandir(3) didn't transfer d_type, and d_ino is called d_fileno now.


7340 25-Mar-1995 wpaul

Add calls to endgrent() and endnetgrent() to the end of _createcaches().


7336 24-Mar-1995 wpaul

Make sanity checks saner: don't let setnetgrent() or innetgr() swallow
any bogus arguments.


7327 24-Mar-1995 ache

Change strtok() to strsep(), using strtok() can cause memory corruption
if user program use it too in the same time.


7322 24-Mar-1995 wpaul

Yikes! Fix stupid mistake I made in last commit that made getpwent() ignore
local password entries when YP was enabled. (How the heck did that
get by me!?)


7319 24-Mar-1995 wpaul

As per Justin T. Gibbs's request, agument the +@netgroup/-@netgroup
remapping mechanism in the following manner: if given an entry +@foo
and there is no netgroup named 'foo,' try searching for a regular
user group called 'foo' and build the cache using the members of
group 'foo' instead. If both a netgroup 'foo' and a user group 'foo'
exist, the 'foo' netgroup takes precedence, since we're primarily
interested in netgroup matching anyway.

This allows access control schemes based on ordinary user groups
(which are also available via NIS) rather than netgroups, since
netgroups on some systems are limited in really brain-damaged ways.


7289 23-Mar-1995 wpaul

Don't let setnetgrent() operate on a null or empty group name: it can
tickle a bug in ypserv and make a serious mess of things.


7288 23-Mar-1995 wpaul

Very important sanity checks: today I clobbered all four NIS servers on
my network because setnetgrent() was trying to do a lookup on group "".
It seems that an attempt to do a yp_match() (and possible yp_next())
on a null or empty key causes Sun's ypserv in SunOS 4.1.3 to exit
suddenly (and without warning). Our ypserv behaves badly in this
situation too, thoush it doesn't appear to crash. In any event, getpwent,
getnetgrent and yp_match() and yp_next() are now extra careful not to
accidentally pass on null or empty arguments.

Also made a small change to getpwent.c to allow +::::::::: wildcarding,
which I had disabled previously.


7278 23-Mar-1995 wpaul

Lots of fixes/improvements in the +user substitution handling:

- Have the +@netgroup/-@netgroup caches handle the +user/-user cases too.
- Clean up getpwent() to take advantage of the improved +user/-user handling.


7262 23-Mar-1995 wpaul

Small cleanups:
- Prepend a '_' to a couple of things
- Make sure YP is enabled in _createcaches()
- Remove a couple of unused/uneeded variables from _createcaches()


7258 23-Mar-1995 wpaul

Phew! Done at last: getpwent now understands +@netgroup/-@netgroup directives
in addition to the existing NIS substitutions. I may tweak this a bit in
the future, but the important stuff is all here.


7223 21-Mar-1995 wpaul

Use better/stronger/faster NIS lookup code: by using yp_match() instead of
the yp_first()/yp_next() combo, we let the database code in ypserv do some
of the work for us.


7175 19-Mar-1995 wpaul

Whoops: expanding netgroups that reference multiple netgroups doesn't
work because parse_netgrp() doesn't recurse properly. Fixed by
changing

if (parse_netgrp(spos))
return(1);
to

if (parse_netgrp(spos))
continue;

inside parse_netgrp(). (Lucky for me I happen to have a fairly complex
'live' netgroup database to test this stuff with.)


7149 19-Mar-1995 wpaul

Two major changes:

- Added support for reading netgroups from NIS/YP in addition to the
local /etc/netgroups file. (Note that SunOS and many other systems only
support reading netgroups via NIS, which is a bit odd.)

- Fix Evil Null Pointer Dereferences From Hell (tm) that caused
parse_netgrp() to SEGV when expanding netgroups that include
references to other netgroups. Funny how nobody else noticed this.

This is the first step in implimenting +@netgroup substitution in
getpwent.c and any other places that could use it and don't already
support it (which is probably everywhere).


7124 18-Mar-1995 wpaul

Fix 'putting +: in /etc/group causes many programs to dump core' bug
by heading off possible null pointer dereferences in grscan(). Also
change getgrnam() slightly to properly handle the change: if grscan()
returns an rval of 1 and leaves a '+' in the gr_name field and YP is
enabled, poll the YP group.byname map before giving up. This should
insure that we make every effort to find a match in the local and
YP group databases before bailing out.


6966 09-Mar-1995 ache

stdio.h --> unistd.h


6693 25-Feb-1995 phk

Explain the full story, and make it understandable too.


6681 24-Feb-1995 phk

fix the synopsis to show

| void
| *signal(int sig, void (*func)(int))

instead of

| void
| *signal(sig, func())
|
| void
| (*func)()


6677 24-Feb-1995 ache

Add missing #include <time.h> with time() prototype


6536 17-Feb-1995 se

Bruce pointed out, that a misleading warning would be issued
in an (unlikely) border case (maxgroups==1 and the user is on
an /etc/group line for the same group and that group only ...).

Now this case is dealt with as before ...


6530 17-Feb-1995 se

Protect against duplicate gids in group list (as could be the
result of being a member of some group in both /etc/group and YP).


6227 07-Feb-1995 dg

Backed out Keith Bostic's getcwd/$PWD hack. It is causing things to break
all over the place.


6203 05-Feb-1995 phk

Document the getenv(PWD) feature.


6190 05-Feb-1995 wpaul

Collapsed _masterpw_breakout_yp() and _pw_breakout_yp() into a
single function.


6182 04-Feb-1995 phk

A cute hack to speed up things by Keith: if getenv("PWD") is the same
inode as ".", then just return that. I added a check so it must start with
a '/'.

Reviewed by: phk
Submitted by: bostic@cs.berkeley.edu (Keith Bostic)


6171 03-Feb-1995 bde

Include <time.h> instead of <sys/time.h> to get CLK_TCK. Including
<sys/time.h> works because <sys/time.h> includes <time.h> if KERNEL
is not defined, but is ugly.


6169 03-Feb-1995 bde

Change CLK_TCK to CLOCKS_PER_SEC.

Add a missing apostrophe that suggests inverting the frequency to get
tick size. It read better before because `CLK_TCK' suggests a tick
size although it is actually a frequency.


6167 03-Feb-1995 bde

Change CLK_TCK to CLOCKS_PER_SEC. (CLK_TCK is a deprecated POSIX feature
and is not necessarily related to the ANSI CLOCKS_PER_SEC).

Parenthesize macro args.


6166 03-Feb-1995 bde

Fix previous change to preserve const'ness.


6145 03-Feb-1995 wpaul

Fixed a rather serious bug that presents itself when FreeBSD is configured
as an NIS client. The pw_breakout_yp routines that are used to populate the
_pw_passwd structire only do anything if the bits in the pw_fields member
_pw_passwd are cleared. Unfortunately, we can get into a state where
pw_fields has garbage in it right before the YP lookup functions are
called, which causes the breakout functions to screw up in a big way.
Here's how to duplicate the problem:

- Configure FreeBSD as an NIS client
- Log in as a user who's password database records reside only in
the NIS passwd maps.
- Type ps -aux

Result: your processes appear to be owned by 'root' or 'deamon.'
/bin/ls can exhibit the same problem.

The reason this happens:

- When ps(1) needs to match a username to a UID, it calls getpwuid().

- root is in the local password file, so getpwuid() calls __hashpw()
and __hashpw() populates the _pw_passwd struct, including the pw_fields
member. This happens before NIS lookups take place because, by coincidence,
ps(1) tends to display processes owned by root before it happens upon
a proccess owned by you.

- When your UID comes up, __hashpw() fails to find your entry in the
local password database, so it bails out, BUT THE BITS IN THE pw_fields
STRUCTURE OF _pw_passwd ARE NEVER CLEARED AND STILL CONTAIN INFORMATION
FROM THE PREVIOUS CALL TO __hash_pw()!!

- If we have NIS enabled, the NIS lookup functions are called.

- The pw_breakout_yp routines see that the pw_fields bits are set and
decline to place the data retrieved from the NIS passwd maps into the
_pw_passwd structure.

- getpwuid() returns the results of the last __hashpw() lookup instead
of the valid NIS data.

- Hijinxs ensue when user_from_uid() caches this bogus information and
starts handing out the wrong usernames.

AAAARRRRRRRRRGGGGGGHHHHHHHHHH!!!

*Please* don't tell me I'm the only person to have noticed this.

Fixed by having __hashpw() check the state of pw_fields just before
bailing out on a failed lookup and clearing away any leftover garbage.
What a fun way to spend an afternoon.


6096 01-Feb-1995 wpaul

Fix for that last fix... pass the hat. :)


6095 01-Feb-1995 wpaul

Small fix to _getyppass(): sometimes we can construct the wrong mapname
when looking for master.passwd.whatever.


6076 31-Jan-1995 wpaul

Some changes for YP password map handling:

- FreeBSD's NIS server can supply a master.passwd map, which has
more fields in it than a standard passwd map, so we need a
_master_pw_breakout() fuction.

- When doing passwd map lookups, look for master.passwd.* by attempting
a _yp_first() on master.passwd.byname. If it exists, we're being served
by a FreeBSD NIS server and we should use this map.

- If we aren't the superuser, retrieve only the standard passwd maps.
If we're being served by a FreeBSD system, then the passwd map has
no passwords in it, and it won't serve us the master.passwd map unless
we're superuser anyway.

There's a small speed hit for the superuser inherent in the check for
the master.passwd map, but this lets us dynamically decide what to do
rather than rely on a non-standard config file somewhere. Since all
of this is bypassed for normal users, they shouldn't notice the
difference.


5964 27-Jan-1995 dg

Be sure to properly fail if there are not enough fields. Problem
reported by MARC Giannoni <marc@cmc.eng.comsat.com>, this fix is by me.


5958 27-Jan-1995 dfr

Reclaim memory used for telldir cookies on closedir.


5714 19-Jan-1995 wollman

Fix unbalanced #endif introduced by yesterday's change.


5703 17-Jan-1995 wollman

Prevent sites from shooting themselves in the foot while enabling/disabling
YP by disallowing `+' entries as logins in all cases. (This handles the
case of a `+' entry in the password file but YP not running, which should
never happen but is easy enough to check for so we'll apply some
prophylaxis.)


5228 25-Dec-1994 bde

Fix the bug reported by Torbjorn Granlund <tege@cygnus.com>:

The documentation for mrand48 and lrand48 is mixed up.
mrand48 returns a full 32 bit number, while lrand48 only returns
31 bits.


5152 18-Dec-1994 guido

Add missing getdomainname manual page.
Reviewed by:
Submitted by:
Obtained from: 1.1.5.1 with a few modifictaions.


5072 12-Dec-1994 bde

Obtained from: 1.1.5

getcwd() has two off-by-one bugs in FreeBSD-2.0:

1. getcwd(buf, size) fails when the size is just large enough.
2. getcwd(buf + 1, 1) incorrectly succeeds when the current directory
is "/". buf[0] and buf[2] are clobbered.

(I modified Bruce's original patch to return the proper error code
[ERANGE] in the case of #2, but otherwise... -DG)

This program demonstrates the bug:

---
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <unistd.h>

int main(void)
{
char buf[5];
int errors;

errors = 0;
if (chdir("/tmp") != 0) {
perror("chdir");
abort();
}
if (getcwd(buf, 5) == NULL) {
perror("oops, getcwd failed for buffer size = size required");
++errors;
}
if (chdir("/") != 0) {
perror("chdir");
abort();
}
buf[0] = 0;
buf[2] = 1;
if (getcwd(buf + 1, 1) != NULL) {
fprintf(stderr,
"oops, getcwd succeeded for buffer size = one too small\n");
++errors;
}
if (buf[0] != 0) {
fprintf(stderr,
"oops, getcwd scribbled on memory before start of buffer\n");
++errors;
}
if (buf[2] != 1) {
fprintf(stderr,
"oops, getcwd scribbled on memory after end of buffer\n");
++errors;
}
exit(errors == 0 ? 0 : 1);
}


5070 12-Dec-1994 bde

Fix execl[e]. Multiple execle's failed because of bogus caching of the
pointer returned by realloc(). All callers free the pointer if the
execve fails. Nuke the caching. This essentially restores buildargv()
to the 1.1.5 version. Also fix a memory leak if realloc() fails. Also
nuke similar but non-broken caching in execvp(). malloc() should be
efficient enough.


4441 13-Nov-1994 phk

Added routines to read the canonical UNIX configuration file. This will
later be applied to a number of programs (inetd for instance) to clean
out the bogus code doing the same thing, modulus all the bugs.

If you need to read a '#'-is-a-comment-file, please use these routines.

I realize that the shlib# should be bumped (for the non-US world:
increased by something), but will defer this until something significant
happens.


3850 25-Oct-1994 bde

Nuke sigsetjmp.c. sigsetjmp() can't be implemented as a C function
that calls setjmp(), since returning from the function usually
clobbers the saved environment.


3799 22-Oct-1994 ache

cfmakeraw(): set IGNBRK, clear IXOFF, INPCK per Bruce suggestion
Set IGNPAR, clear NOFLSH, PENDIN, TOSTOP, ECHOE, ECHOK


3760 22-Oct-1994 ache

makeraw(): forget to clear IMAXBEL, set VMIN/VTIME


3682 18-Oct-1994 ache

Remove CPU_COLORDISP, GIO_COLOR now exists


3667 17-Oct-1994 ache

Add new machdep variables


3565 13-Oct-1994 wollman

sysctl(3) can return an error (setting errno to ENOMEM) when the
fields in the utsname structure are too small to hold their
corresponding MIB variables. Don't return an error in this case.


3062 25-Sep-1994 wollman

Document getvfsent() and kin.


3061 25-Sep-1994 wollman

Fix so that people who don't have LKMs compiled in their kernels don't
get hosed: vfsisloadable() always returns false if /dev/lkm cannot be
opened for writing.


3044 24-Sep-1994 dg

Added $Id$


3042 24-Sep-1994 wollman

If sysctl() fails, return "/kernel" so as not to screw people who haven't
updated their kernels yet.


3040 23-Sep-1994 wollman

Added getbootfile(3), for an easy C interface to the kern.bootfile MIB
variable. This one's even documented!


3016 23-Sep-1994 wollman

Added *ran48 functions, and put them in the correct place this time.

Obtained from: 1.1.5


3001 22-Sep-1994 wollman

Pass -q and -u flags to modload so that it shuts up and doesn't leave
modules lying around.


2970 22-Sep-1994 wollman

Fix stupid memory-allocation error.


2963 22-Sep-1994 wollman

Added VFS functions: getvfsvbyname, getvfsbytype, getvfsent, setvfsent,
endvfsent, vfsisloadable, vfsload.
Someday these will even be documented.


2937 20-Sep-1994 wollman

Document YP support.


2936 20-Sep-1994 wollman

My implementation of YP group file support, modeled after the
password file support done yesterday.


2935 20-Sep-1994 wollman

Second half of YP security hole fix. Needs updated password
database in order to operate.


2917 20-Sep-1994 wollman

Re-implement YP password file support from scratch. This implementation
correctly handles +user entries and + entries with local overrides.


2916 20-Sep-1994 wollman

Maintain pw_fields, and output same to password database.

!!!!!!!!
NB
!!!!!!!!
You MUST pwd_mkdb /etc/master.passwd before attempting to use the new
libc, or things may go wrong. (I doubt anything actually /will/ go
wrong, but the actual behavior is undefined. YOU HAVE BEEN WARNED.)
The database format is, however, backwards-compatible, so old executables
will still work.


2908 19-Sep-1994 ache

Function in this module bloodly called 'gethostname' and linked
with all pgms, you can imagine results!
Change 'gethostname' -> 'ntp_gettime', I don't know what real name
must be here but try to guess.


2857 18-Sep-1994 wollman

Redo kernel NTP PLL support, user-mode interface.


2741 13-Sep-1994 wollman

Use latest Arthur Olson timezone code rather than that supplied with
4.4. The code is almost identical to the 4.4 versions, but this organization
should make it easier to merge new versions in the future.


2730 13-Sep-1994 dfr

Added SYSV ipc system calls.


2590 08-Sep-1994 csgr

document libcrypt and libcipher.
Submitted by: Geoff


2569 08-Sep-1994 jkh

Make errors in /etc/fstab print the line numbers where they occured.
Also be more tolerant of blank lines and comments in the file.
Submitted by: jkh


2005 10-Aug-1994 wollman

Oops, forgot to cvs add this file.


2004 10-Aug-1994 wollman

Make it easier for programs to figure out what revision of FreeBSD they
are running under. Here's how to bootstrap (order is important):

1) Re-compile gcc (just the driver is all you need).
2) Re-compile libc.
3) Re-compile your kernel. Reboot.
4) cd /usr/src/include; make install

You can now detect the compilation environment with the following code:

#if !defined(__FreeBSD__)
#define __FreeBSD_version 199401
#elif __FreeBSD__ == 1
#define __FreeBSD_version 199405
#else
#include <osreldate.h>
#endif

You can determine the run-time environment by calling the new C library
function getosreldate(), or by examining the MIB variable kern.osreldate.

For the time being, the release date is defined as 199409, which we have
already established as our target.


1950 08-Aug-1994 jkh

Add a missing backslash to get this to work again.
Reviewed by:
Submitted by: jkh


1926 08-Aug-1994 wollman

Added YP domain name getting/setting support, for SunOS/old program
compatibility.


1849 05-Aug-1994 wollman

First crack at making libc work with the new make macros. It compiles on
my machine, and a simple static (genassym) and shared (sysctl) executable
both work. Still to be done: RPCand YP merge.


1794 22-Jul-1994 csgr

Rewrite nlist to mmap the whole a.out file (at Davidg's suggestion).
This means that we don't have to do rounding calculations for page
boundaries. (We do all our accesses via the mmapped area now.)
Reviewed by:


1574 27-May-1994 rgrimes

This commit was generated by cvs2svn to compensate for changes in r1573,
which included commits to RCS files with non-trunk default branches.


1573 27-May-1994 rgrimes

BSD 4.4 Lite Lib Sources


1556 26-May-1994 rgrimes

BSD 4.4 Lite bin Sources


1553 26-May-1994 rgrimes

BSD 4.4 Lite usr.sbin Sources


1539 24-May-1994 rgrimes

BSD 4.4 Lite Include Sources