Commit Graph

8769 Commits

Author SHA1 Message Date
dds
95de53b08b Bring the description for login_getclassbyname in sync with the function's
arguments.  The function has as a second argument a struct passwd * pointer,
not a directory name.

MFC after:	2 weeks
2004-05-11 11:05:26 +00:00
dds
9498b96a34 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
2004-05-10 17:12:52 +00:00
bde
34afa157e8 Fixed style bugs in previous commit (bogus forward declaration and
inconsistent capitalization in comments).
2004-05-10 09:36:26 +00:00
tjr
a8117b04ca Use a binary search to find the range containing a character in
RuneRange arrays. This is much faster when there are hundreds of
ranges (as is the case in UTF-8 locales) and was inspired by a
similar change made by Apple in Darwin.
2004-05-09 13:04:49 +00:00
brueffer
0b4230fd70 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
2004-05-09 11:11:21 +00:00
peadar
ea85333e1c 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@)
2004-05-08 15:09:02 +00:00
stefanf
2a0970f8ce Add an implementation of copysignl(), a long double version of copysign().
Approved by:	das (mentor)
2004-05-07 18:56:31 +00:00
stefanf
65ef3a8ab7 Add an MLINK for fabsl().
Approved by:	das (mentor)
2004-05-07 17:55:07 +00:00
stefanf
5cf96830e0 The prototypes for cabs() and cabsf() are in <complex.h>. Fix their arguments'
types and describe them briefly.

Reviewed by:	ru, bde
Approved by:	das (mentor)
2004-05-06 13:11:18 +00:00
kientzle
48b874ba98 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.
2004-05-05 06:33:00 +00:00
kientzle
cc0587e382 Consistify: #define gets 1 tab character afterwards
Pointed out by: Simon Nielsen
2004-05-03 01:40:34 +00:00
obrien
08cf798f1d Remove bogus FBSDID. 2004-05-02 20:13:29 +00:00
obrien
c9b83bd8c1 Fix damaged FBSDID. 2004-05-02 20:09:14 +00:00
das
0342c52a18 Merge vfscanf.c, v1.37:
- s/#ifdef FLOATING_POINT/#ifndef NO_FLOATING_POINT/
2004-05-02 10:56:26 +00:00
das
370a72c150 Merge vfprintf.c, v1.65:
- s/#ifdef FLOATING_POINT/#ifndef NO_FLOATING_POINT/
- Remove HEXFLOAT
2004-05-02 10:56:17 +00:00
das
603ccc870f Add option NO_FP_LIBC, which disables floating-point support in
*printf() and *scanf().  Currently, this reduces the size of libc.so
by 9K on i386.  But the real savings are for static binaries that use
*printf() or *scanf() but not strtod(); with an FP-disabled libc,
these binaries will not depend on the gdtoa routines, making each
binary about 22K smaller.
2004-05-02 10:55:07 +00:00
das
94b1a9eeaf - To make it easier to compile *printf() and *scanf() without
floating-point support, remove default definition of FLOATING_POINT
  from the source, and change the compile-time option to
  NO_FLOATING_POINT.
- Remove the HEXFLOAT option.  It saves an insignificant amount of
  space (<0.1% of the size of libc on i386) and complicates vfprintf()
  and checkfmt().
2004-05-02 10:55:06 +00:00
das
3640d9db93 When *printf() and *scanf() are compiled without floating-point
support, fmtcheck() should not accept format strings that contain
floating-point formats.
2004-05-02 10:55:05 +00:00
kientzle
d6e4944c5b Include appropriate flag header on Linux. 2004-05-02 00:38:38 +00:00
kientzle
eb83ce39b4 Create missing directories when extracting hardlinks and symlinks. 2004-04-30 01:31:20 +00:00
kientzle
373cf98d01 Implement ARCHIVE_EXTRACT_UNLINK for regular files. This supports the
-U flag to bsdtar.  Essentially, this option breaks existing hard
links.  According to SUSv2, tar is supposed to overwrite existing
files on extract by default which, in particular, preserves
existing hard links.  Note that this is yet another bug in gtar; it
appears to always break existing links.  (Maybe gtar's -U is broken?)

I'm unsure about how to handle this for other file types; the current
code always unlinks first unless the NO_OVERWRITE flag is specified.
I've commented this issue liberally and will come back to it later.
2004-04-29 05:19:42 +00:00
kientzle
4f6d19ce20 Add statistics: track offset in compressed and uncompressed archive,
provide an interface for the client to query this information.
2004-04-28 04:41:27 +00:00
kientzle
d6382fb160 Correct spelling of "shell archive" to match /usr/share/misc/magic. 2004-04-28 04:36:57 +00:00
kientzle
d08c1aef85 Add the libarchive-formats.5 manpage. This summarizes the various
archive formats supported by libarchive, with some information about
the relative strengths and weaknesses of each format and notes about
issues with libarchive's support for those formats.

This page should make it unnecessary to list all of the libarchive
formats in the manpage of each program that uses libarchive.
Such programs can simply refer to libarchive-formats(5).
2004-04-28 04:34:07 +00:00
kientzle
e51180a18e Add read support for four more common cpio variants:
* little-endian old-style binary cpio archives
 * big-endian old-style binary cpio archives
 * SVR4 portable archives without CRC
 * SVR4 portable archives with CRC

Note that I don't yet verify the CRC for the last one, and I'm
not quite certain I'm correctly parsing device numbers.
2004-04-28 03:44:08 +00:00
ru
ba24b2b7e2 - Added rad_demangle() for demangling user-passwords (needed for
MS-CHAPv1 MPPE-keys).
- Added rad_demangle_mppe_key() for demangling mppe-keys (needed
  for MPPE-keys).
- Added some typecasts for avoiding compiler warnings.
- Fix: better handle wrong usage of the lib (if the programmer
  has not called rad_create_request() but rad_put_*(), then a
  weird error message was returned).
- Added a new function for putting the Message-Authenticator.
- Verify the Message-Authenticator, if it was found inside a
  response packet and silently drop the packet, if the validation
  failed.
- Implicitly put the Message-Authenticator, if the EAP-Message
  attribute was added.
- Added some missing defines.

Submitted by:	Michael Bretterklieber
PR:		46555
2004-04-27 15:00:29 +00:00
ru
13a023ef4a Markup nit. 2004-04-27 09:18:49 +00:00
kientzle
736725bcab Update file flag handling.
The new fflags support in archive_entry supports Linux and FreeBSD
file flags and is a bit more gracious about unrecognized flag names
than strtofflags(3).  This involves some minor API breakage.

The default tar format ("restricted pax") now enables pax extensions
when archiving files that have flags.  In particular, copying dir
heirarchies with 'bsdtar cf - -C src . | bsdtar xpf - -C dest' now
preserves file flags.  (Note the "p" on extract!)

While I'm here, fill in some additional explanation in the
archive_entry.3 manpage, fill in some missing MLINKS, mark some
overlooked internal functions 'static', and make a few minor style
fixes.
2004-04-26 23:37:54 +00:00
ache
a7c84134a6 Rewrite split_lines() to operate safely
PR:             62694
Submitted by:   moulin p <moulin.p@calyopea.com>
2004-04-25 19:56:50 +00:00
das
d24349d79f Make sure that symbols are declared in math.h iff the appropriate
namespaces are visible.  Previously, math.h failed to hide some C99-,
XSI-, and BSD-specific symbols in certain compilation environments.

The referenced PR has a nice listing of the appropriate conditions for
making symbols visible in math.h.  The only non-stylistic difference
between the patch in the PR and this commit is that I superfluously
test for __BSD_VISIBLE in a few places to be more explicit about which
symbols have historically been part of the FreeBSD environment.

PR:		65939
Submitted by:	Stefan Farfeleder <stefan@fafoe.narf.at>
2004-04-25 02:35:42 +00:00
das
1e626ef3b4 Remove a stale comment referring to values.h, which has never been
part of FreeBSD.

PR:		65939
2004-04-25 02:32:46 +00:00
mtm
45d8ed5162 Unconditionaly initialize any spin lock passed to pthread_spin_init(). While
makeing sure the spinlock isn't already in use might be a nice feature to
have in theory, it's hard to implement in practice since the passed in
pointer may not be NULL, but still be an invalid value (i.e. 1..2..3.. etc).
2004-04-24 09:38:41 +00:00
kientzle
fd3f8b3142 Make clone more aggressive about copying strings to the new entry.
The original might have pointers to user-specified strings;
copying the string (instead of just the pointer) protects against
the client re-using their own buffers.

I'm trying hard to avoid dumping all of the 'set' string functions
in favor of slower, but more predictable 'copy' semantics.
2004-04-23 17:15:48 +00:00
kientzle
18540c3839 Set the 'dump' flag for shardump format.
Credit Juergen Lock.
Pointy hat to me for deleting this somewhere along the way.
2004-04-23 17:13:40 +00:00
kientzle
52a4248336 Correct spelling of == so that file flags are correctly restored.
Credit to Juergen Lock.
2004-04-23 16:27:37 +00:00
tjr
2d6eafdb97 Use the correct size to allocate, copy and clear argument type tables
after their change from an array of char to an array of enum.
This fixes problems that occurred when using positional arguments in
format strings, particularly with more than STATIC_ARG_TBL_SIZE (8)
of them.

PR:		65841
Submitted by:	Steven Smith (mostly)
2004-04-22 11:35:12 +00:00
grehan
d3c9a3e02a Enable libdisk for powerpc build. 2004-04-21 23:23:05 +00:00
grehan
a76af532c5 PowerPC support.
submitted by:  Suleiman Souhlal <refugee@segfaulted.com>
approved by:   phk, jhb
2004-04-21 23:21:13 +00:00
jon
a23a0292a8 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.
2004-04-21 21:15:08 +00:00
ru
a2a9798706 Unbreak world. 2004-04-21 09:50:52 +00:00
kientzle
bd01158393 More portability improvements, thanks to Juergen Lock.
High-resolution mtime/ctime/atime is not POSIX-standard, so hide
set/get of high-resolution time fields behind easily-mutable macros.
That makes it easier to change how those fields are accessed.
2004-04-21 05:13:42 +00:00
njl
9f92f4fef4 MFdragonfly: resolver fix for timeouts on unqualified hostnames
res_search only incremented got_servfail for h_errno == TRY_AGAIN *AND*
  hp->rcode == SERVFAIL.  However, there are cases such as timeouts where
  rcode is not always set to SERVFAIL.  This leads to inconsistent nameserver
  operation during multi-domain and truncated dot searches, especially during
  booting when portions of the network are being brought up simultanious with
  dns lookups.

  This patch attempts to correct the problem by unconditionally terminating
  the search if TRY_AGAIN is returned (after res_query has gone through all
  retries and name servers) instead of trying other domain elements in the
  domain seach path.

  This patch should fix reported problems (which I can reproduce) with some
  NFS mounts failing during boot.  This occured because mount_nfs thought the
  host name lookup returned a definitive failure using a non-dotted host name
  when, in fact, it timed out on the first part (host.search.domain.name) and
  got a definitive host-not-found response on the second part (host.).

  Generally speaking, search path name server timeouts can exceed 60 seconds
  per element and most machines which consistently timeout on earlier portions
  of a search path are effectively non-operational due to the imposed delays.
  It is more important for DNS lookups to return the proper error code then
  to be able to recover a valid lookup in later portions of the search path
  in these situations.

Obtained from:	DragonFly
MFC after:	3 weeks
2004-04-21 00:56:38 +00:00
cperciva
dddaa5bce9 Add mention of the fact that timeouts are silently limited to 24 hours.
Observed by:	jmg
2004-04-20 21:07:43 +00:00
kientzle
c9ba6f5197 Yucky bug: Don't emit 'mkdir' commands for regular files in shar archives.
While I'm here, add some logic to avoid "mkdir ."

Reported by: Juergen Lock
2004-04-20 20:21:36 +00:00
kientzle
b0a5c34c3e In GNU tar archives, read ctime from ctime field, not atime field.
Credit: Juergen Lock
2004-04-20 20:09:06 +00:00
kientzle
d880d2509a Eliminate some redundant calls to archive_entry_hardlink. 2004-04-20 20:07:30 +00:00
kientzle
281173de4a Optimize ustar header formatting. 2004-04-19 20:16:07 +00:00
cperciva
c8b8f2e516 Document POSIX stupidity: Attempts to mmap zero bytes will succeed (and
have no effect), while attempts to munmap zero bytes will fail.
2004-04-18 23:36:45 +00:00
brueffer
914d5fc9b4 Bring describtion of a sysctl in line with the source:
kern.acct_chkfreq is specified in seconds, not minutes.

Cluebat provided by:	kensmith
2004-04-16 22:53:51 +00:00
brueffer
7ea9992329 Remove unnecessary .Pp macro and bump document date
Submitted by:	ru
2004-04-16 22:38:54 +00:00
brueffer
33bbe12bea List some sysctl variables that influence accounting
PR:		65070
Submitted by:	Marc Silver <marcs@draenor.org>
X-MFC after:	re approval
2004-04-16 20:32:56 +00:00
kientzle
f928512a2b Only enable the ACL restore logic on FreeBSD versions >= 5.0.
Earlier versions of FreeBSD don't support ACLs.

Note that the ACL support code in archive_entry is standalone code and
unaffected by this.  (In particular, it should be possible to
manipulate archives containing ACLs even if the ACLs cannot be
restored on the current system.)
2004-04-16 01:20:58 +00:00
harti
376040b33f Use a MANFILTER to patch the man pages to point to the right path.
Noted by: phk
2004-04-14 16:31:54 +00:00
harti
9baa54d87a Bump the shared library version number for the bsnmp v1.6 import
because of incompatible interface changes.
2004-04-14 16:29:46 +00:00
harti
c9204f6495 Put the name of the module first in the list of all .Nm calls with
argument. This makes the output of calling .Nm without an argument
more senseful later on.
2004-04-14 16:11:05 +00:00
harti
48c5eee60f Compare with 0 if comparing an integer, not with NULL. 2004-04-14 16:09:20 +00:00
harti
7d1905e15b Move the SNMP MIBs and tree definitions from /usr/share/bsnmp to
/usr/share/snmp. This mirrors the use of /usr/local/share/snmp and
makes also more sense when non-bsnmp-specific MIBs go in.
2004-04-14 16:06:19 +00:00
kientzle
5c2c79eafd * Plug a buffer overrun in ACL parsing. (archive_entry.c)
* Re-use a single buffer for shar output formatting rather
   than hammering the heap. (archive_write_set_format_shar.c)
 * Fix a handful of minor memory leaks and clean up some of the
   memory-management code.
2004-04-13 23:45:37 +00:00
tjr
8f8a2ad179 Perform some basic validation of multibyte conversion state objects. 2004-04-12 13:09:18 +00:00
tjr
e26da574d5 Remove a nonsensical remark about byte order markers in UTF-8 streams. 2004-04-12 12:58:41 +00:00
kientzle
444807bb41 More work on ACLs: fix error in archive_entry's ACL parsing code,
try to set ACLs even if fflag restore fails, first cut at reading
  Solaris tar ACLs

Code improvement: merge gnu tar read support into main tar reader;
  this eliminates a lot of duplicate code and generalizes the tar
  reader to handle formats with GNU-like extensions.

Style: Makefile cleanup, eliminate 'dmalloc' references, remove 'tartype'
  from archive_entry (this makes archive_entry more format-agnostic)

Thanks to: David Magda for providing Solaris tar test files
2004-04-12 01:16:16 +00:00
mux
de871a9ba9 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.
2004-04-11 21:36:31 +00:00
tjr
e768e0d54f Document the meaning of the zero return value. 2004-04-11 05:19:19 +00:00
davidxu
289170412b Fix a typo. I was locked out for two days from my machine. 2004-04-10 14:36:57 +00:00
tjr
17077e5ae6 Don't cast away const qualifiers.
Spotted by:	bde
2004-04-10 00:27:52 +00:00
emax
3513d3a4bf Make sure Bluetooth stuff can be compiled on amd64
Submitted by:	ps
2004-04-09 23:01:42 +00:00
tjr
f2bb7f8613 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
2004-04-09 11:32:32 +00:00
deischen
6920f21350 After forking and initializing the library to single-threaded
mode (where the forked thread is the one and only thread and
is marked as system scope), set the system scope flag before
initializing the signal mask.  This prevents trying to use
internal locks that haven't yet been initialized.

Reported by:	Dan Nelson <dnelson at allantgroup.com>
Reviewed by:	davidxu
2004-04-08 23:16:21 +00:00
tjr
0ca2900d48 Update manual pages for change to C99 mbrtowc() semantics. 2004-04-08 09:59:02 +00:00
kientzle
e301066937 Linux still uses 32-bit off_t by default. Ask for 64-bit off_t on
Linux.
2004-04-07 17:47:06 +00:00
tjr
54a18fa1d6 Allow partial multibyte characters to accumulate in conversion state
objects passed to mbrtowc(), mbsrtowcs(), and mbrlen(), as required
by C99.
2004-04-07 10:48:19 +00:00
tjr
1c584f59a5 Prepare to handle trivial state-dependent encodings. Full support for
state-dependent encodings with locking shifts will come later if there
is demand for it.
2004-04-07 09:55:05 +00:00
tjr
226e976dd7 Begin conversions for sgetrune() and sputrune() in the initial
conversion state.
2004-04-07 09:49:10 +00:00
tjr
47b6d3f343 Prepare to handle state-dependent encodings. This mainly involves not
taking shortcuts when it comes to storing and passing around conversion
states.
2004-04-07 09:47:56 +00:00
tjr
c3bbcd6ef6 Begin in the initial shift state in mbstowcs() and wcstombs().
(This change is non-functional since nothing uses states yet.)
2004-04-07 08:33:23 +00:00
kientzle
f66baeffb4 Fix some issues with ACL handling:
* ACL storage is no longer erased before a group of entries are added.
  * ACL text creation no longer tries to skip over non-existent text.
  * UTF8 encoder no longer blows up on invalid wide characters.
  * Fixed ACL state management for default ACLs.
Also, publicize function for obtaining text-format ACL in various
formats.  The interface is now extensible through a "flags" argument
that allows you to select a variant format.
2004-04-06 23:16:50 +00:00
tjr
4212f9711f Prepare to handle state-dependent encodings. This mainly involves not
taking shortcuts when it comes to storing and passing around conversion
states.
2004-04-06 13:14:03 +00:00
pb
3e32cfd0f2 Add a missing "*errp = h_errno" forgotten in rev 1.36. 2004-04-06 09:31:22 +00:00
dfr
082e8506d0 Update .Dd value.
Reminded by: ru
2004-04-06 09:06:45 +00:00
kientzle
775d07093e Overhauled ACL support. This makes us compatible
with 'star' ACL handling, though there's still a
bit more work needed in this area.

Added 'write_open_fd' and 'read_open_fd' to simplify, e.g.,
tar's u and r modes.  Eliminated old 'write_open_file_position'
as a bad idea.  (It required closing/reopening files to
do updates, which led to unpleasant implications.)

Various other minor fixes, API tweaks, etc.
2004-04-05 21:12:29 +00:00
pb
f378d8f9dc Fix _dns_ghbyname() to return NS_TRYAGAIN instead of NS_NOTFOUND
on temporary nameserver failure. This is necessary to get
getipnodebyname(3) to correctly return h_errno=TRY_AGAIN instead
of HOST_NOT_FOUND.

Reviewed by:	green, thomas
MFC after:	1 week
2004-04-05 20:18:48 +00:00
dfr
8bba8e834a Document lgetfh(2). 2004-04-05 10:17:56 +00:00
tjr
5642b0bbf4 Remove support for emulating mbrtowc() and wcrtomb() in terms of the
old rune interface now that it is no longer needed.
2004-04-04 11:31:29 +00:00
tjr
d98eda520c Reimplement the GB18030 encoding method using the new-style (mbrtowc()/
wcrtomb()) interface.
2004-04-04 11:00:42 +00:00
tjr
dd0763020d Reimplement the deprecated UTF2 encoding method using the UTF-8 code
as a base. mbrtowc() and wcrtomb() are now implemented directly
instead of being emulatedi with sgetrune() and sputrune().
2004-04-04 10:49:45 +00:00
deischen
a883ccc958 Unbreak natd.
Reported and submitted by:	Sean McNeil (sean at mcneil.com)
2004-04-02 17:57:57 +00:00
ache
818fd42831 Simplify one condition in prev. commit:
short_too already assumes FLAG_LONGONLY
2004-04-01 22:32:28 +00:00
ache
1545034067 Fix parsing of ambiguous options, whole loop must be processed 2004-04-01 22:09:07 +00:00
nectar
ebdf5cfddd The previous commit changed the behavior of nsdispatch() in the
case where an /etc/nsswitch.conf file was present, but could not
be opened (e.g. due to permissions).  Previously, the open failure
condition was suppressed, and the built-in defaults were used.  In
revision 1.11, however, propagated the open failure causing all
nsdispatch() invocations to return NS_UNAVAIL, and thus many APIs
including getpwnam and gethostbyname unconditionally failed.

This commit restores the previous behavior.

Pointy hat:	nectar  (+1 for obstinance; ache had to use clue bat)
Reported by:	ache
2004-04-01 19:12:45 +00:00
des
38842c29ce Raise WARNS level to 2. 2004-03-31 21:33:55 +00:00
des
2209468b0e Deal with aliasing warnings.
Reviewed by:	ru
Approved by:	silence on the lists
2004-03-31 21:32:58 +00:00
bms
723e163490 Merge of libpcap 0.8.3 from tcpdump.org. 2004-03-31 09:15:09 +00:00
peter
aeb757d841 Fix Yet Another 16 byte stack alignment bug. Thankfully, this one is
solved by a simple 'make world'.  The signalcontext function was going
to the trouble of generating an even 16 byte alignment, but in fact it
needed to be odd aligned to simulate the 8-byte return address having
been pushed by the caller.  This fixes yet another group of crashes in
applications using libpthread.  And yet again, it was my fault all along.

While here, rename the duplicate internal ctx_wrapper() functions to
makectx_wrapper() and sigctx_wrapper() so that traces aren't ambiguous.
2004-03-31 07:27:31 +00:00
nectar
7ec3e33301 When a dynamic NSS module is built and linked against a thread
library, it may pull in that thread library at run time.  If the
process started out single-threaded, this could cause attempts to
release locks that do not exist.  Guard against this possibility by
checking __isthreaded before invoking thread primitives.

A similar problem remains if the process is linked against one thread
library, but the NSS module is linked against another.  This can only
be avoided by careful design of the NSS module.

Submitted by:	Sean McNeil <sean@mcneil.com> (mostly; bugs are mine)
2004-03-30 15:56:15 +00:00
nyan
fcbd1c72ce MFi386: WARNS=4 clean. 2004-03-30 12:22:31 +00:00
tjr
1a32baef3b Add cross-references to isideogram(3), isphonogram(3), isrune(3),
isspecial(3) and wctype(3).
2004-03-30 08:11:57 +00:00
tjr
0e393613f2 Add basic manual pages for isideogram(), isphonogram(), isrune()
and isspecial().
2004-03-30 07:23:54 +00:00
tjr
94fd478493 Trim cross-references. 2004-03-30 07:19:35 +00:00
tjr
9d08058845 Document the isnumber() and ishexnumber() functions, and explain how they
differ (at least in theory) from isdigit() and isxdigit().
2004-03-30 07:02:04 +00:00
kuriyama
9b713c0d7f Down to WARNS=2 for a while. 2004-03-30 06:16:41 +00:00
kuriyama
235cde4aca Make libdisk WARNS=4 clean.
Glanced by:	jhb
2004-03-30 01:39:00 +00:00
tjr
8aa9f6fafe Remove duplicate MLINK. 2004-03-29 21:46:52 +00:00
mtm
a9677be93b o Also check that the mutex type is not less than the minimum allowable value.
o Don't check attribute for NULL. It's the callers responsibility.
2004-03-29 13:57:55 +00:00
mtm
f4172a5e78 Make the minimum implementation of pthread_kill conform to the
functionality spelled out in SUSv3.
	o Signal of 0 means do everything except send the signal
	o Check that the signal is not invalid
	o Check that the target thread is not dead/invalid
2004-03-29 13:56:04 +00:00
mtm
1f163908e4 o Don't explicitly check the thread for NULL. That is the caller's
responsibility.
o If a thread is not joinable, the correct return value is EINVAL.
2004-03-29 13:53:43 +00:00
mtm
319c9db836 o If a thread is marked as detached AND on the dead threads list
the correct return value is ESRCH.
o Don't check the attribute for NULL. It's the caller's responsibility.
o Make the bitwise comparison explicit.
2004-03-29 13:51:51 +00:00
mtm
e278045fda If a condition variable is statically initialized don't return
an error. Return successfully without doing anything.
2004-03-29 11:24:02 +00:00
mtm
f48b8920dc The thread suspend function now returns ETIMEDOUT, not EAGAIN. 2004-03-29 09:35:07 +00:00
mtm
e5540ff230 o Remove more references to SIGTHR
o Remove clock resolution information left over from libc_r
2004-03-29 05:45:01 +00:00
mtm
c715901410 Remove the garbage collector thread. All resources are freed
in-line. If the exiting thread cannot release a resource, then
the next thread to exit will release it.
2004-03-28 14:05:28 +00:00
schweikh
9ae4a75423 Fix a warning: compare u_long ps_strings to 0 instead of NULL. 2004-03-28 11:50:54 +00:00
mtm
1368ee7bbe o Since we're not using signals for thread synchronization anymore,
sigprocmask no longer needs to be wrapped.
o raise(3) is applied to the calling thread in a threaded program.
o In the sigaction wrapper reference the correct structure.
o Don't treat SIGTHR especially anymore (infact it won't exist in
  a little while).
2004-03-27 15:05:28 +00:00
mtm
9481d0539d Stop using signals for synchronizing threads. The performance penalty
was too much.
2004-03-27 14:39:21 +00:00
tjr
9b0a927d71 Recognize the "rune" character class in wctype(). 2004-03-27 08:59:21 +00:00
mtm
194cc11a54 o The mutex locking functions aren't normally cancellation points. But,
we still have to DTRT when an asynchronously cancellable thread is
  cancelled while waiting for a mutex.
o While dequeueing a waiting mutex don't skip a thread if it has
  a cancel pending. Only skip it if it is also async cancellable.
2004-03-26 14:47:54 +00:00
mtm
8d2a2db80c o Initialize a local variable before referencing it. This was not
the cause of any bugs because it is *always* indirectly set
  in the for...loop, but better to be explicit about it.
o Check the magic number of the passed in thread only after it has
  been found in the active thread list. Otherwise, if the check is done
  at the very beginning we may end up pointing to garbage if the
  thread was once a valid thread, but has now been destroyed.
2004-03-26 14:45:35 +00:00
ru
6320e86ac0 Document that kvm_open(3) also accepts "/dev/null" as a special
"corefile" argument, to access the running system via sysctl(3)
if possible, thus not requring special setgid privileges.
2004-03-26 08:05:39 +00:00
ru
b8af1b3b30 Document that libkvm also uses /dev/kmem, to access KVM. 2004-03-26 08:03:53 +00:00
bms
6fa18a5397 Document the existence of NET_RT_IFMALIST.
Reviewed by:	ru
2004-03-25 10:08:46 +00:00
ru
9e6098efd7 [troff] removed the unnecessary use of \_ escapes. 2004-03-25 09:25:24 +00:00
green
4927c84b48 Add locking so that arc4random(3) functions are all reentrant for
pthreads.

Submitted by:	Christian S.J. Peron <maneo@bsdpro.com>
2004-03-24 14:44:57 +00:00
kientzle
1a06758781 mdoc fixes 2004-03-23 03:14:01 +00:00
kientzle
30025170bd Just use autoconf-compatible feature macros; don't try to be clever. 2004-03-22 05:17:23 +00:00
tjr
f50e5eaa3b Document incorrect handling of multibyte characters. 2004-03-21 11:31:37 +00:00
peter
52b4c49f11 Adjust stack alignment so that when the 'call xxx' functions are
gathered into the middle of the _init and _fini sections, they get
executed with their expected stack alignment.
2004-03-21 01:39:01 +00:00
kientzle
bbabca3fda Bug: Standard C still requires declarations to precede statements. <sigh>
Portability: Eliminate an accidental __unused, accomodate
  systems with non-POSIX strerror_r
2004-03-20 22:35:33 +00:00
tjr
023efa65f4 Mention that funopen() uses fpos_t incorrectly in the BUGS section. 2004-03-20 08:41:12 +00:00
tjr
55f1dd7399 Improve documentation for fgetpos() and fsetpos(), and discourage
users from assuming that fpos_t is an integral type.
2004-03-20 08:38:27 +00:00
kientzle
ef0d6eb598 Many fixes:
* Disabled shared-library building, as some API breakage is
  still likely.  (I didn't realize it was turned on by default.)  If
  you have an existing /usr/lib/libarchive.so.2, I recommend deleting it.
* Pax interchange format now correctly stores and reads UTF8
  for extended attributes.  In particular, pax format can portably
  handle arbitrarily long pathnames containing arbitrary characters.
* Library compiles cleanly at -O2, -O3, and WARNS=6 on all
  FreeBSD-CURRENT platforms.
* Minor portability improvements inspired by Juergen Lock
  and Greg Lewis.  (Less reliance on stdint.h, isolating of
  various portability-challenged constructs.)
* archive_entry transparently converts multi-byte <-> wide character
  strings, allowing clients and format handlers to deal with either
  one, as appropriate.
* Support for reading 'L' and 'K' entries in standard tar archives
  for star compatibility.
* Recognize (but don't yet handle) ACL entries from Solaris tar.
* Pushed format-specific data for format readers down into
  format-specific storage and out of library-global storage.  This
  should make it easier to maintain individual formats without mucking
  with the core library management.
* Documentation updates to track the above changes.
* Updates to tar.5 to correct a few mistakes and add some additional
  information about GNU tar and Solaris tar formats.

Notes:
* The basic 'tar' reader is getting more general; there's not much
  point in keeping the 'gnutar' reader separate.  Merging the two
  would lose a bunch of duplicate code.
* The libc ACL support is looking increasingly inadequate for my needs
  here.  I might need to assemble some fairly significant code for
  parsing and building ACLs. <sigh>
2004-03-19 22:37:06 +00:00
dds
334e1c11e7 Shave-off troff cycles by invoking .Fa only once.
Submitted by:	ru
MFC after:	1 week
2004-03-19 16:04:11 +00:00
tjr
b893e6c496 Do not redundantly set the stream orientation in getc(), putc(), and
related functions - __sgetc() and __sputc() will set it when necessary.
2004-03-19 09:04:56 +00:00
tjr
41709fbe79 Update list of macros defined in <stdio.h>. 2004-03-17 12:54:06 +00:00
tjr
dab1ed1529 Re-add description of putc() macro (back out rev. 1.13.) 2004-03-17 12:46:17 +00:00
tjr
430cbeb954 Re-add text that says getc() is a macro (back out rev. 1.16.) 2004-03-17 12:37:28 +00:00
davidxu
12db4373da Fix a POSIX conformance bug. POSIX says sigwait should return error number
in return value not in errno.
2004-03-17 02:12:19 +00:00
tjr
b4d98c6855 Re-add macro versions of getc(), getchar(), putc(), putchar(), feof(),
ferror(), fileno() and clearerr(), using the value of __isthreaded to
decide between the fast inline single-threaded code and the more
general function equivalent. This gives most of the performance
benefits of the old unsafe macros while preserving thread safety.
2004-03-17 01:43:08 +00:00
des
3cb81148d8 Run through indent(1) so I can read the code without getting a headache.
The result isn't quite knf, but it's knfer than the original, and far
more consistent.
2004-03-16 21:30:41 +00:00
des
ce346529a3 Use unions to avoid violating C99 strict aliasing rules. 2004-03-16 20:42:02 +00:00
jhb
b7e56e9eea Change libdisk and sysinstall to use d_addr_t rather than u_long for disk
addresses.  For arch's with 64-bit longs, this is a nop, but for i386 this
allows sysinstall to properly handle disks and filesystems > 1 TB.

Changes from the original patch include:
- Use d_addr_t rather than inventing a blkcnt type based on int64_t.
- Use strtoimax() rather than strtoull() to parse d_addr_t's from config
  files.
- Use intmax_t casts and %jd rather than %llu to printf d_addr_t values.

Tested on:	i386
Tested by:	kuriyama
Submitted by:	julian
MFC after:	1 month
2004-03-16 17:07:06 +00:00
tjr
feae82b01a Refer to "wide characters" instead of "wide-characters". 2004-03-16 13:30:11 +00:00
tjr
d28b18f4b5 Sort MLINKS.
Noticed by:	ru
2004-03-16 11:06:31 +00:00
tjr
48661b2fa3 Add fairly minimal documentation for the nmount() syscall. 2004-03-16 09:45:38 +00:00
des
a52d3498dd Don't try to pass off a struct sockaddr as a struct sockaddr_in when it
may in fact very well be a struct sockaddr_in6.  Just use plain struct
sockaddr.

This brings us yet another step closer to a clean -O2 build.
2004-03-15 17:08:28 +00:00
des
950b98f1f7 Add -DDEBUG to DEBUG_FLAGS if PAM_DEBUG is defined. 2004-03-15 13:23:20 +00:00
truckman
8cf9e392b9 Document additional reasons that sysctl(3) can return ENOMEM (due to
vslock() failure).
2004-03-15 10:32:37 +00:00
des
2d02e7d4d4 Make this compile with -O2. A proper fix would use a struct to represent
vectors, instead of requiring the caller to keep track of element size
and count and pass them in by reference.
2004-03-15 08:14:35 +00:00
des
243c5ae2b1 Whitespace nits. 2004-03-15 08:03:10 +00:00
bde
1e78a65d3a Fixed a misspelling of 0 as NULL. 2004-03-14 05:27:26 +00:00
bde
76b946302c Fixed a misspelling of 0 as NULL. Removed a spelling of NULL as 0. 2004-03-14 05:19:38 +00:00
bde
84f037f29f Fixed misspellings of '\0' as NULL. 2004-03-14 05:14:00 +00:00
bde
5c7ee701c7 Initial support for C99's (or is it POSIX.1-2001's?) MATH_ERRNO,
MATH_ERREXCEPTION and math_errhandling, so that C99 applications at
least have the possibility of determining that errno is not set for
math functions.  Set math_errhandling to the non-standard-conforming
value of 0 for now to indicate that we don't support either method
of reporting errors.  We intentionally don't support MATH_ERRNO
because errno is a mistake, and we are missing support for
MATH_ERREXCEPTION (<fenv.h>, compiler support for <fenv.h>, and
actually setting the exception flags correctly).
2004-03-12 12:02:03 +00:00
bde
4a50f50816 Fixed misspellings of 0 as NULL. 2004-03-11 09:56:04 +00:00
tjr
00bce96751 Set stream orientation in ungetc() instead of __ungetc(). This avoids
setting it redundantly when called from ungetwc(), vfscanf() etc.,
which already set the orientation.
2004-03-10 12:41:11 +00:00
tjr
76708e58aa Remove duplicate check for EOF from ungetc(); __ungetc() already checks. 2004-03-10 11:13:23 +00:00
tjr
26739bcc23 Call __sputc() directly in fputc() instead of taking an expensive
detour through putc().
2004-03-10 10:49:45 +00:00
tjr
d856ced836 Call __sgetc() directly in getchar() instead of taking an expensive
detour through getc().
2004-03-10 10:24:15 +00:00
tjr
c1542ae485 Set the stream orientation explicitly in fgetln() instead of relying on
__srefill() to do it.
2004-03-10 09:28:38 +00:00
tjr
d27994efb7 Set stream orientation in puts(). 2004-03-10 09:15:38 +00:00
phk
4de4b53ade Put libypclnt behind NO_YP_LIBC 2004-03-10 08:58:06 +00:00
jhb
01eed200f9 Make libgeom usable by C++ programs:
- Add DECL wrappers to libgeom.h.
- Rename structure members in libgeom.h to use a lg_ prefix for member
  names.  This is required because a few structures had members named
  'class' which made g++ very unhappy.
- Catch gstat(8) and gconcat(8) up to these API changes.

Reviewed by:	phk
2004-03-09 21:14:18 +00:00
kientzle
90072dfae0 Many fixes.
Portability: Thanks to Juergen Lock, libarchive now compiles cleanly
on Linux.  Along the way, I cleaned up a lot of error return codes and
reorganized some code to simplify conditional compilation of certain
sections.

Bug fixes:
  * pax format now actually stores filenames that are 101-154
    characters long.
  * pax format now allows newline characters in extended attributes
    (this fixes a long-standing bug in ACL handling)
  * mtime/atime are now restored for directories
  * directory list is now sorted prior to fix-up to permit
    correct restore of non-writable dir heirarchies
2004-03-09 19:50:41 +00:00
jb
c50fc65e96 Backout the previous revision due to objections. 2004-03-09 04:51:58 +00:00
jb
e9062915d3 On 4.X it was possible for an application to initialise a local FILE
structure and call stdio functions. In 5.X this was broken when FILE
locking was introduced into libc.

This change makes most (relevant) stdio functions work again when the
_extra file in FILE isn't initialised (and can't be without a libc
function to do it since the __sFILEX structure is private to libc).
2004-03-09 02:44:59 +00:00
phk
ceb3b7463e String the consumers into the list of the provider they are attached to.
Noticed by:	jhb
2004-03-08 16:37:08 +00:00
phk
a545780c51 Rearrange (centralize) initialization of mallocs internals to always be
done before the first call, even if this is a malloc(0) call.

PR:	62859
2004-03-07 20:41:27 +00:00
phk
ea1893785c Add manpages for the gctl API.
Submitted by:	le
Tweaks by:	phk
2004-03-07 16:07:57 +00:00
kientzle
76c408916b Recognize hardlinks when reading cpio files.
This doesn't yet address the issue of selective restore
of hardlinked files.  With cpio format, it's possible to correctly
restore any linked file; the API doesn't yet fully support this.
(There's no way for the library to inform a client whether or not
there's a file body associated with this entry.  The assumption
right now is that "hardlink" entries have no file body.)
2004-03-07 00:57:43 +00:00
ache
ce8bd08be4 Merge some fixes from NetBSD's getopt.3 v1.31:
cleanup, add more sections, better explanation, declaration
2004-03-06 17:09:10 +00:00
ache
892e165566 Merge some fixes from NetBSD's getopt.c v1.26:
cleanups, handling 'ls -l-', handling '--*'

Note this is in the same time back out of our v1.3
"Don't print an error message if the bad option is '?'"
because it directly violates POSIX.
2004-03-06 17:05:45 +00:00
ache
5993cc3bce Fix typo, was 'W'; instead of `W;' 2004-03-06 14:47:49 +00:00
ache
c94e5bebf5 Make GNU-compatible following case:
single '-' in command line and '-' (non-first) in options
2004-03-06 14:24:10 +00:00
kientzle
f7afdba4b3 Minor API tweak: The format-specific write_header function now sets
the size in the archive_entry object to zero if that format doesn't
store a body for that file type.  This allows the client to determine
whether or not it should feed the file body to the archive.  In
particular, cpio stores the file body for hardlinks, tar and shar
don't.  With this change, bsdtar now correctly archives hardlinks in all
supported formats.

While I'm here, make shar output be more aggressive about creating directories.
Before this, commands such as:
    bsdtar -cv -F shar  some/explicit/path/to/a/file
wouldn't create the directory.  Some simple logic to remember the last
directory creation helps reduce unnecessary mkdirs here.

At this point, I think the only flaw in libarchive's cpio support is
the failure to recognize hardlinks when reading.
2004-03-06 05:44:13 +00:00
kientzle
b2042c11e8 Remove last evidence of a long-dead function. 2004-03-06 01:06:49 +00:00
kientzle
a96c560b59 Add ARCHIVE_EXTRACT_UNLINK option to permit clients to
control how archive_extract handles pre-existing files.
(Not implemented yet, but documented.)
2004-03-06 01:05:32 +00:00
kientzle
eec560a7c3 Correctly read symlinks from cpio files.
While I'm here, fix a bug in reading filenames from
cpio files.  (Copy should count the length of the name,
not the number of bytes available for input.)
2004-03-06 00:59:08 +00:00
markm
0b0ae8e16e 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
2004-03-05 08:10:19 +00:00
kientzle
57d3b7d165 Correctly read SCHILY.nlink from pax-format archives.
In particular, -tv output for pax-format archives now
lists everything that ls -l does.
2004-03-05 00:09:53 +00:00
dds
91b0d17289 Document missing EFAULT errno value.
MFC after:	2 weeks
2004-03-03 14:51:11 +00:00
ache
6ec2ddd536 Make return code in noarg case GNU-compatible 2004-03-03 08:29:00 +00:00
ache
248096d10f Be more GNU-compatible in diagnostics 2004-03-03 03:05:21 +00:00
jkh
5a199c908b If handed a file pointer we can't write to, set errno properly to EBADF
in order to get SUSv2 conformant behavior in higher level calls like
fputs() and puts().

Reviewed by:	bde
2004-03-02 19:43:51 +00:00
grehan
bfc8874821 Hook libthr to the build for PowerPC 2004-03-02 06:26:37 +00:00
grehan
a0da296615 libthr powerpc support.
Submitted by:  Suleiman Souhlal <refugee@segfaulted.com>
Tested with: most libpthread tests, Apache 'worker' MDM
2004-03-02 06:25:20 +00:00
grehan
da9e056b3c makecontext lib call.
Submitted by: Suleiman Souhlal <refugee@segfaulted.com>
2004-03-02 06:22:24 +00:00
ache
7aeda997f8 Improve GNU compatibility in several places, use internal GNU_COMPATIBLE
define for it.
Don't catch POSIXLY_CORRECT env. into static variable, it can be changed
on the fly by program.
Use P1003.2 standartized illoptchar[]
2004-03-01 17:57:05 +00:00
ache
46a9b8739b Comment out things related to getopt() replacement we not use 2004-03-01 10:59:23 +00:00
ache
67499340a7 Change "-"-started options when POSIX_CORRECTLY is set handling
in favour of GNU instead of NetBSD, because configure's use us and
expect GNU.
2004-03-01 10:12:45 +00:00
ache
ce580280f4 Change "-"-started options when POSIX_CORRECTLY is set handling
in favour of GNU instead of NetBSD, because configure's use us and
expect GNU.
2004-03-01 10:03:34 +00:00
kientzle
48517ca7da Back out the "clean_environment()" function from libutil.
Further contemplation has convinced me that this was
not going to really solve the problem of environment-poisoning
without raising serious administrative headaches.  There
must be a better way...
2004-02-29 22:13:28 +00:00
dds
02e13ba2ce Make consistent with the better written wcsrtombs function:
- Fix syntax
- Remove the (slightly wrong) duplicate explanation of the error condition
- Change reference to invalid multibyte character into invalid wide character
2004-02-27 15:03:22 +00:00
kientzle
7aa85c4e5f Add the clean_environment call to libutil.h also.
MFC after: 2 weeks
2004-02-26 22:44:11 +00:00
kientzle
8b8fb9aae5 Add a clean_environment call to libutil.
This function removes all environment variables except
the ones listed on a "whitelist."

The function accepts two whitelist arguments.
If the first is NULL, a built-in default list will be
used.  This allows callers to get a variety of behaviors:
  * Default screening: provide NULL for both lists
  * Custom screening: provide a custom list for the first argument
  * Modified default screening: provide NULL for first arg,
     list of additional variables to preserve in the second arg

Idea from: Jacques Vidrine

MFC after: 2 weeks
2004-02-26 22:41:47 +00:00
emax
58a98b5bd1 Add extra sanity check for SDP packets in libsdp(3)
Fix yet another endianess bug in sdpd(8)
2004-02-26 20:44:55 +00:00
bde
fd2c94bc06 Backed out rev.1.6 and subsequent copying of it (bogus addition of
-static to CFLAGS).  It just turned rev.1.5 into an obfuscated no-op.
As explained in the log for rev.1.5, testing should be done in the
host environment but there is a problem in cross-compilation environments.
As not explained in the log for rev.1.6, there was apparently a practical
problem with cross-compiling (makeworld should have set -static in
LDFLAGS but apparently didn't).  Cross-compilation was especially
complicated because the relevant programs are test programs that were
run at beforeinstall time -- dynamic libraries might or might not exist
depending on the build options.  The complications became moot in
rev.1.8 when beforeinstall was renamed "test".
2004-02-26 07:44:37 +00:00
green
40452493ee Make the resolver(3) and many associated interfaces much more reentrant.
The getaddrinfo(3), getipnodebyname(3) and resolver(3) can coincide now
with what should be totally reentrant, and h_errno values will now
be preserved correctly, but this does not affect interfaces such as
gethostbyname(3) which are still mostly non-reentrant.

In all of these relevant functions, the thread-safety has been pushed
down as far as it seems possible right now.  This means that operations
that are selected via nsdispatch(3) (i.e. files, yp, dns) are protected
still under global locks that getaddrinfo(3) defines, but where possible
the locking is greatly reduced.  The most noticeable improvement is
that multiple DNS lookups can now be run at the same time, and this
shows major improvement in performance of DNS-lookup threaded programs,
and solves the "Mozilla tab serialization" problem.

No single-threaded applications need to be recompiled.  Multi-threaded
applications that reference "_res" to change resolver(3) options will
need to be recompiled, and ones which reference "h_errno" will also
if they desire the correct h_errno values.  If the applications already
understood that _res and h_errno were not thread-safe and had their own
locking, they will see no performance improvement but will not
actually break in any way.

Please note that when NSS modules are used, or when nsdispatch(3)
defaults to adding any lookups of its own to the individual libc
_nsdispatch() calls, those MUST be reentrant as well.
2004-02-25 21:03:46 +00:00
rwatson
09eb839cca Add bsde_add_rule(), which is similar to bsde_set_rule() except that
the caller does not specify the rule number -- instead, the kernel
module is probed for the next available rule, which is then used.

Obtained from:	TrustedBSD Project
Sponsored by:	DARPA, McAfee Research
2004-02-25 03:24:39 +00:00
grehan
20e8d60f64 No reason to disable this test on powerpc. 2004-02-25 00:53:06 +00:00
grehan
a8135829ff Use signed char cast to avoid out-of-range error on PowerPC (which has
unsigned char by default). This is a no-op on all other current arches.

Tested by: md5 sum before/after same on i386
2004-02-25 00:52:14 +00:00
ache
af4255ff22 Add getopt_long_only() from OpenBSD and other OpenBSD cleanups
PR:             63173
Submitted by:   Marius Strobl <marius@alchemy.franken.de>
2004-02-24 08:07:26 +00:00
green
eadc6af144 Apply style(9).
Submitted by:	"Christian S.J. Peron" <maneo@bsdpro.com>
PR:		bin/63283
2004-02-23 20:42:03 +00:00
johan
a1828721c8 style.Makefile:
Use WARNS?= instead of WARNS=.
2004-02-23 20:07:47 +00:00
josef
1c86986e7d Add signal numbers to signal(3).
Approved by:    simon(mentor)
Reviewed by:    ru
Submitted by:   Stefan Farfeleder <stefan@fafoe.narf.at>
PR:             docs/60044
2004-02-23 13:20:03 +00:00
ache
7b23d0ae2e Add optarg, optind, opterr, optopt, optreset to SYNOPSYS 2004-02-23 05:07:11 +00:00
ache
3f44d96bce POSIX clearly states that getsubopt() should be declared in <stdlib.h>
not in <unistd.h>
2004-02-23 03:32:10 +00:00
ache
6d8625c740 Remove unneccessary <unistd.h> 2004-02-23 03:30:02 +00:00
deischen
f0ee20dfcc Update man page to reflect additional flag to allow selection of threads. 2004-02-22 18:12:56 +00:00
deischen
6f8b1a92fb Teach kvm_getprocs() to recognize a sysctl flag for including threads. 2004-02-22 17:57:10 +00:00
peter
6d00d752a2 Change the syscall stub branch orders so that the static branch prediction
will assume that syscalls will succeed rather than fail.
2004-02-22 02:11:39 +00:00
harti
18065b763b Fix a couple of potential buffer overflows.
Submitted by:	christer.oberg@texonet.com
2004-02-21 16:29:10 +00:00
phk
80fe0dbbdf Remove the triplicity in the public functions by vectoring them all
through a realloc like function.

Make the malloc_active variable a local static to this new function.

Don't warn about recursion more than once per base call.

constify malloc_func.
2004-02-21 09:14:38 +00:00
phk
9942edab59 Move the check for sensitive processes to the point where the exception
has been hit, this makes it cover more cases.

Call the message function directly rather than fiddle with flag-saving
when we find an unknown character in our options.

The 'A' flag should not trigger on legal out of memory conditions.
2004-02-21 08:55:38 +00:00
ume
b9b55438a3 add destination address selection support for getipnodebyname(3).
though getipnodebyname(3) is obsoleted api, some major applications
such as Mozilla are still using it.  so, it will help ipv4 users.
2004-02-20 17:59:33 +00:00
ru
2630fc0e1e Unbreak the upgrade path from 4.9 after removal of GNU getopt and
<gnuregex.h>.
2004-02-20 11:55:14 +00:00
green
bf4ea3aa0d Document dependence of mktemp(3) on the non-reentrant arc4random(3). 2004-02-20 04:08:28 +00:00
marcel
0cd09e8718 Moving forward, there's no reason to exclude libpthread on sparc64. 2004-02-20 03:42:34 +00:00
mtm
92fa088800 Implement PThreads barriers and barrier attributes. 2004-02-19 13:51:52 +00:00
mtm
88ba2a7fa4 Don't wake up the thread after the signal handler
has been executed. On return from the signal handler
the call will either be restarted or EINTR will be returned,
but it will not go back to its previous state. So, it is
sufficient to simply change the state to 'running' without
actually trying to wake up the thread.
2004-02-19 13:47:12 +00:00
mtm
8c2ff6c3d5 Remove thr_getschedparam.c since it's contents have been moved into
thr_setschedparam.c
2004-02-18 15:59:54 +00:00
mtm
7e0166bc79 There are consumers of rwlocks, inluding our own libc, that depend on
a PTHREAD_RWLOCK_INITIALIZER to do for rwlocks what
a similarly named symbol does for statically initialized mutexes.
This symbol was dropped in The Open Group Base Specifications Issue 6
and does not exist in IEEE Std 1003.1, 2003, but it should still be
supported for backwards compatibility.

Pointy hat: mtm
2004-02-18 15:30:10 +00:00
mtm
7854649b86 o Catch up with the mutex priority protocol fixes.
o Move pthread_getschedparam() into the same file with it's
  pthread_set* counterpart. Copyright on both files is identical.
2004-02-18 15:26:00 +00:00
mtm
8330d43435 o Style
o Instead of checking both the passed in pointer and its value
  for NULL, only check the latter. Any caller that passes in
  a NULL pointer is obviously wrong.
2004-02-18 15:22:52 +00:00
mtm
5af0285e8f o Refactor and, among other things, get rid of insane nesting levels.
o Fix mutex priority protocols. Keep separate counts of priority
  inheritance and protection mutexes to make things easier.
  This will not have much affect since this is only the
  userland side, and the rest involves kernel scheduling.
2004-02-18 15:16:31 +00:00
mtm
2621f28515 Move the initialization of thread priority to a common function. 2004-02-18 15:05:56 +00:00
mtm
0ebad2cb98 Move the weak references to the top of the file to conform
to the format of other similar files in libthr.
2004-02-18 14:56:20 +00:00
das
d6261f9b0e Remove the code and an associated comment for gcc 1.x compatibility
and fix a typo in the !__GNUC__ case.
2004-02-16 10:03:02 +00:00
das
d7b9eca798 Fix a typo in the !__GNUC__ case and remove an obsolete comment. 2004-02-16 10:02:51 +00:00
das
0a50563417 Fix some aliasing problems. 2004-02-16 10:02:40 +00:00
kientzle
4ddfb50b7d sys/types.h must be included before sys/acl.h,
as clearly documented in the acl manpage.

Thanks to bde for catching this blunder.
2004-02-12 20:35:59 +00:00
kientzle
9ced58b737 Connect libarchive to the build. 2004-02-12 16:41:33 +00:00
grehan
ff5ca19ecd Add forgotten IEEE functions. The Perl 5.8 port now compiles.
Submitted by: Suleiman Souhlal <refugee@segfaulted.com>
Obtained from:  NetBSD
2004-02-12 09:11:06 +00:00
kientzle
4ead4f9e9e libarchive itself is now completely clean at WARNS=10 on all architectures.
Unfortunately, the stock zlib.h is not:
  line 885: 'err' parameter shadows global 'err' definition from <err.h>

Back the WARNS level down to 3 to accomodate borked zlib.h.
2004-02-12 04:11:40 +00:00
emax
6b8ec0360c Do not cast dval.
Make global _usage_page unsigned.

Reviewed by:	imp (mentor)
2004-02-11 21:09:13 +00:00
des
df87448759 Slight tweak to previous commit: don't forget to call _http_seterr() if
we get a genuine 416 reply.
2004-02-11 09:35:27 +00:00
des
33bdcbd9cf When restarting a transfer that has already completed, the server will
reply with a 416 error code (requested range not satisfiable) because
we ask it to start at the end of the file.  Handle this gracefully by
considering a 416 reply a success if the requested offset exactly
matches the length of the file and the requested length is zero.
2004-02-11 09:31:39 +00:00
des
ddda756172 Re-wrap some comments. 2004-02-11 09:23:35 +00:00
bms
9ce9891eda Initial import of RFC 2385 (TCP-MD5) digest support.
This is the second of two commits; bring in the userland support to finish.

Teach libipsec and setkey about the tcp-md5 class of security associations,
thus allowing administrators to add per-host keys to the SADB for use by
the tcpsignature_compute() function.

Document that a single SPI must be used until such time as the code which
adds support to the SPD to specify flows for tcp-md5 treatment is suitable
for production.

Sponsored by:	sentex.net
2004-02-11 04:34:34 +00:00
cperciva
371e76013c style cleanup: Remove duplicate $FreeBSD$ tags.
These files had tags after teh copyright notice,
inside the comment block (incorrect, removed),
and outside the comment block (correct).

Approved by:	rwatson (mentor)
2004-02-10 20:45:28 +00:00
cperciva
81f9b2b83a style cleanup: Remove duplicate $FreeBSD$ tags.
These files had tags after the copyright notice,
inside the comment block (incorrect, removed),
and outside the comment block (correct).

Approved by:	rwatson (mentor)
2004-02-10 20:42:33 +00:00
cperciva
d3296afe56 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)
2004-02-10 20:40:17 +00:00
des
18879fb0df Fix numerous constness and aliasing issues. 2004-02-10 10:13:21 +00:00
deischen
72c7aa83c9 Add sem_timedwait to the symbol map, otherwise the libc version will
get used.
2004-02-10 05:36:09 +00:00
kientzle
af9413b539 Initial import of libarchive.
What it is:
   A library for reading and writing various streaming archive
   formats, especially tar and cpio.  Being a library, it should
   be easy to incorporate into pkg_* tools, sysinstall, and any
   other place that needs to read or write such archives.

Features:
  * Full automatic detection of both compression and archive format.
  * Extensible internal architecture to make it easy to add new formats.
  * Support for "pax interchange format," a new POSIX-standard tar format
    that eliminates essentially all of the restrictions of historic formats.
  * BSD license

Thanks to: jkh for pushing me to start this work, gordon for
  encouraging me to commit it, bde for answering endless style
  questions, and many others for feedback and encouragement.

Status: Pretty good overall, though there are still a few rough edges and
  the library could always use more testing.  Feedback eagerly solicited.
2004-02-09 23:22:54 +00:00
peter
0ee239a780 Rewrite fabs.S to use pure SSE2 operations. I got the clues how to do
this from looking at code generated by gcc.
2004-02-08 21:21:45 +00:00
das
fc7590207e Update the documentation for setpgrp(2) to reflect the access control
checks that the code actually performs.  Judging from the 4.2BSD
release notes, the docs have only been out of date for 20 years.

PR:	29844
2004-02-08 12:38:30 +00:00
silby
3a8a1ad8ce Document the SF_NODISKIO flag, and fix a small typo. 2004-02-08 07:38:35 +00:00
ru
b377ec7a9a Unbreak world. 2004-02-07 11:13:47 +00:00
dds
3ebf28da66 getnetbyname fixes:
Do not choke on malformed network addresses.
Return n_name in static space, not on the function's stack.

MFC after: 1 week
2004-02-07 07:30:02 +00:00
deischen
ba84b16ebb Add cancellation point to sem_wait() and sem_timedwait() for pshared
semaphores.  Also add cancellation cleanup handlers to keep semaphores
in a consistent state.

Submitted in part by:	davidxu
Reviewed by:		davidxu
2004-02-06 15:20:56 +00:00
deischen
eb9a5c0d3b Prevent memory leak on sem_destroy() by destroying the semaphore's
internal mutex and CV.
2004-02-06 15:15:44 +00:00
deischen
f8f3e115d3 Only allow the semaphore to be taken when the value is positive.
Don't decrement it twice when it is taken.

Reported by:	kris
2004-02-06 13:54:38 +00:00