Commit Graph

8739 Commits

Author SHA1 Message Date
das
e7c093a4d0 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
3ea6259039 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
d802a8b4c3 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
089808213b 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
af43d264b6 Correct spelling of == so that file flags are correctly restored.
Credit to Juergen Lock.
2004-04-23 16:27:37 +00:00
tjr
216b4a51d1 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
a87a9bae44 Enable libdisk for powerpc build. 2004-04-21 23:23:05 +00:00
grehan
b08ab3ee11 PowerPC support.
submitted by:  Suleiman Souhlal <refugee@segfaulted.com>
approved by:   phk, jhb
2004-04-21 23:21:13 +00:00
jon
eabb1158e0 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
6a2d71f930 Unbreak world. 2004-04-21 09:50:52 +00:00
kientzle
82ac6716b7 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
854e31c5df 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
78b8f124fe 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
980e839017 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
0039160d22 In GNU tar archives, read ctime from ctime field, not atime field.
Credit: Juergen Lock
2004-04-20 20:09:06 +00:00
kientzle
aa567357e7 Eliminate some redundant calls to archive_entry_hardlink. 2004-04-20 20:07:30 +00:00
kientzle
9163fc54bf Optimize ustar header formatting. 2004-04-19 20:16:07 +00:00
cperciva
ae156771d6 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
ef47baa9fb 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
e769b37f40 Remove unnecessary .Pp macro and bump document date
Submitted by:	ru
2004-04-16 22:38:54 +00:00
brueffer
b1c12d2158 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
4836a395ca 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
19b40f8d6f 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
486eb15cdb 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
456eb4bccf 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
3de9067328 Compare with 0 if comparing an integer, not with NULL. 2004-04-14 16:09:20 +00:00
harti
d118fb2a86 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
26ef2c45c1 * 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
a0dcfbc296 Perform some basic validation of multibyte conversion state objects. 2004-04-12 13:09:18 +00:00
tjr
9dc0e81495 Remove a nonsensical remark about byte order markers in UTF-8 streams. 2004-04-12 12:58:41 +00:00
kientzle
2789997419 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
0cd4d27003 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
0058102b2d Document the meaning of the zero return value. 2004-04-11 05:19:19 +00:00
davidxu
83be4fcddd Fix a typo. I was locked out for two days from my machine. 2004-04-10 14:36:57 +00:00
tjr
c29bd99207 Don't cast away const qualifiers.
Spotted by:	bde
2004-04-10 00:27:52 +00:00
emax
6f0f3b3fa7 Make sure Bluetooth stuff can be compiled on amd64
Submitted by:	ps
2004-04-09 23:01:42 +00:00
tjr
f4b3cc2cea 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
2fba20f0d1 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
5eea6226ab Update manual pages for change to C99 mbrtowc() semantics. 2004-04-08 09:59:02 +00:00
kientzle
8881673f41 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
dc1e42aa23 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
c62549d93e 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
8dc503ed37 Begin conversions for sgetrune() and sputrune() in the initial
conversion state.
2004-04-07 09:49:10 +00:00
tjr
a1c21ea40b 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
4cf47be978 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
500e933b1b 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
43d5b14825 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
c2281f92ca Add a missing "*errp = h_errno" forgotten in rev 1.36. 2004-04-06 09:31:22 +00:00
dfr
e30e38c174 Update .Dd value.
Reminded by: ru
2004-04-06 09:06:45 +00:00
kientzle
9f6817f183 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
9e3d168bf7 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
a44b0c1e0b Document lgetfh(2). 2004-04-05 10:17:56 +00:00
tjr
40b832e1a2 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
db1c6c90ce Reimplement the GB18030 encoding method using the new-style (mbrtowc()/
wcrtomb()) interface.
2004-04-04 11:00:42 +00:00
tjr
6be517ebf8 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
61ab102676 Unbreak natd.
Reported and submitted by:	Sean McNeil (sean at mcneil.com)
2004-04-02 17:57:57 +00:00
ache
bc125771e6 Simplify one condition in prev. commit:
short_too already assumes FLAG_LONGONLY
2004-04-01 22:32:28 +00:00
ache
036d9d909a Fix parsing of ambiguous options, whole loop must be processed 2004-04-01 22:09:07 +00:00
nectar
efd90c9e4c 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
8d3d71f5e8 Raise WARNS level to 2. 2004-03-31 21:33:55 +00:00
des
579b9b6cf3 Deal with aliasing warnings.
Reviewed by:	ru
Approved by:	silence on the lists
2004-03-31 21:32:58 +00:00
bms
725699816c Merge of libpcap 0.8.3 from tcpdump.org. 2004-03-31 09:15:09 +00:00
peter
9654ad1295 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
3c19db1378 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
3fc3417456 MFi386: WARNS=4 clean. 2004-03-30 12:22:31 +00:00
tjr
f9b9ab8e04 Add cross-references to isideogram(3), isphonogram(3), isrune(3),
isspecial(3) and wctype(3).
2004-03-30 08:11:57 +00:00
tjr
325652b413 Add basic manual pages for isideogram(), isphonogram(), isrune()
and isspecial().
2004-03-30 07:23:54 +00:00
tjr
ecb3908393 Trim cross-references. 2004-03-30 07:19:35 +00:00
tjr
6f6c3e153e 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
d3d3b4e1ea Down to WARNS=2 for a while. 2004-03-30 06:16:41 +00:00
kuriyama
f11d16970f Make libdisk WARNS=4 clean.
Glanced by:	jhb
2004-03-30 01:39:00 +00:00
tjr
6d325bc510 Remove duplicate MLINK. 2004-03-29 21:46:52 +00:00
mtm
4f6d01c449 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
1e599449cf 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
7d2c70ccb6 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
52f07c29e0 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
6d71eef98a 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
ead3007bca The thread suspend function now returns ETIMEDOUT, not EAGAIN. 2004-03-29 09:35:07 +00:00
mtm
8164c38f75 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
400b090c8e 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
bb8276d569 Fix a warning: compare u_long ps_strings to 0 instead of NULL. 2004-03-28 11:50:54 +00:00
mtm
7f48da04b6 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
484c640d2f Stop using signals for synchronizing threads. The performance penalty
was too much.
2004-03-27 14:39:21 +00:00
tjr
42adaba408 Recognize the "rune" character class in wctype(). 2004-03-27 08:59:21 +00:00
mtm
b412a09105 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
720c884d71 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
9b9294a9b5 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
5e56128063 Document that libkvm also uses /dev/kmem, to access KVM. 2004-03-26 08:03:53 +00:00
bms
ab1792c4b3 Document the existence of NET_RT_IFMALIST.
Reviewed by:	ru
2004-03-25 10:08:46 +00:00
ru
b901b3c33c [troff] removed the unnecessary use of \_ escapes. 2004-03-25 09:25:24 +00:00
green
ce17e5d8b2 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
b239f0a9c0 mdoc fixes 2004-03-23 03:14:01 +00:00
kientzle
335709752a Just use autoconf-compatible feature macros; don't try to be clever. 2004-03-22 05:17:23 +00:00
tjr
32bf402537 Document incorrect handling of multibyte characters. 2004-03-21 11:31:37 +00:00
peter
30b570c120 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
425a0609b4 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
ee17ac0f9b Mention that funopen() uses fpos_t incorrectly in the BUGS section. 2004-03-20 08:41:12 +00:00
tjr
d413aab5c5 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
eb220de95b 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
eea617c9d3 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
153ffda795 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
d4bcc39215 Update list of macros defined in <stdio.h>. 2004-03-17 12:54:06 +00:00
tjr
10405d5b20 Re-add description of putc() macro (back out rev. 1.13.) 2004-03-17 12:46:17 +00:00
tjr
3ca65d030e Re-add text that says getc() is a macro (back out rev. 1.16.) 2004-03-17 12:37:28 +00:00
davidxu
93f8864874 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
9469c7e168 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
4ade42e16f 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
0d955ee84b Use unions to avoid violating C99 strict aliasing rules. 2004-03-16 20:42:02 +00:00
jhb
3222ae5e24 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
410b921430 Refer to "wide characters" instead of "wide-characters". 2004-03-16 13:30:11 +00:00
tjr
3ffd4d7751 Sort MLINKS.
Noticed by:	ru
2004-03-16 11:06:31 +00:00
tjr
ea3f1c3a47 Add fairly minimal documentation for the nmount() syscall. 2004-03-16 09:45:38 +00:00
des
eea98c633e 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
fed0eb2e79 Add -DDEBUG to DEBUG_FLAGS if PAM_DEBUG is defined. 2004-03-15 13:23:20 +00:00
truckman
7985cffaa8 Document additional reasons that sysctl(3) can return ENOMEM (due to
vslock() failure).
2004-03-15 10:32:37 +00:00
des
40683569ab 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
96807628b1 Whitespace nits. 2004-03-15 08:03:10 +00:00
bde
3f5635b295 Fixed a misspelling of 0 as NULL. 2004-03-14 05:27:26 +00:00
bde
6ef6df415f Fixed a misspelling of 0 as NULL. Removed a spelling of NULL as 0. 2004-03-14 05:19:38 +00:00
bde
7210351b43 Fixed misspellings of '\0' as NULL. 2004-03-14 05:14:00 +00:00
bde
9a2e791566 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
a5d9f9bae9 Fixed misspellings of 0 as NULL. 2004-03-11 09:56:04 +00:00
tjr
c59bea1876 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
68f5f72ba2 Remove duplicate check for EOF from ungetc(); __ungetc() already checks. 2004-03-10 11:13:23 +00:00
tjr
6069adb3e6 Call __sputc() directly in fputc() instead of taking an expensive
detour through putc().
2004-03-10 10:49:45 +00:00
tjr
4076198b51 Call __sgetc() directly in getchar() instead of taking an expensive
detour through getc().
2004-03-10 10:24:15 +00:00
tjr
3a070959c7 Set the stream orientation explicitly in fgetln() instead of relying on
__srefill() to do it.
2004-03-10 09:28:38 +00:00
tjr
5aabbf018c Set stream orientation in puts(). 2004-03-10 09:15:38 +00:00
phk
45d399f174 Put libypclnt behind NO_YP_LIBC 2004-03-10 08:58:06 +00:00
jhb
6e4b5cc488 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
86f738a316 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
d30916507d Backout the previous revision due to objections. 2004-03-09 04:51:58 +00:00
jb
a48fe5fbdb 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
85ab7b833f 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
f1248f7192 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
6831859e63 Add manpages for the gctl API.
Submitted by:	le
Tweaks by:	phk
2004-03-07 16:07:57 +00:00
kientzle
aefb19004b 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
e76a2d5e16 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
c53e3b1fa9 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
246b53c707 Fix typo, was 'W'; instead of `W;' 2004-03-06 14:47:49 +00:00
ache
546f0cc387 Make GNU-compatible following case:
single '-' in command line and '-' (non-first) in options
2004-03-06 14:24:10 +00:00
kientzle
eb1faadf12 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
065c0d9d32 Remove last evidence of a long-dead function. 2004-03-06 01:06:49 +00:00
kientzle
4a051cce65 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
a5593bba62 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
f1849df8d1 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
933ffc135a 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
ff204edfe7 Document missing EFAULT errno value.
MFC after:	2 weeks
2004-03-03 14:51:11 +00:00
ache
250148ab3b Make return code in noarg case GNU-compatible 2004-03-03 08:29:00 +00:00
ache
786bb14072 Be more GNU-compatible in diagnostics 2004-03-03 03:05:21 +00:00
jkh
81ef9840ce 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
5e77457def Hook libthr to the build for PowerPC 2004-03-02 06:26:37 +00:00
grehan
c0c7dd7588 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
a2ee49ca76 makecontext lib call.
Submitted by: Suleiman Souhlal <refugee@segfaulted.com>
2004-03-02 06:22:24 +00:00
ache
33d3fa7194 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
1729eb7f02 Comment out things related to getopt() replacement we not use 2004-03-01 10:59:23 +00:00
ache
41902040df 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
0064b303ca 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
37d27b4b2f 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
ce624f04a6 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
136710b3ff Add the clean_environment call to libutil.h also.
MFC after: 2 weeks
2004-02-26 22:44:11 +00:00
kientzle
eb8d6a8fea 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
e4b8fda8aa 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
b96a4383a7 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
fafcdc5a49 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
85a51de0ec 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
7692a0759c No reason to disable this test on powerpc. 2004-02-25 00:53:06 +00:00
grehan
da601973cb 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
e6d8427dea 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
239f7283a3 Apply style(9).
Submitted by:	"Christian S.J. Peron" <maneo@bsdpro.com>
PR:		bin/63283
2004-02-23 20:42:03 +00:00
johan
098f1720d0 style.Makefile:
Use WARNS?= instead of WARNS=.
2004-02-23 20:07:47 +00:00
josef
47868a2dab 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
7f13fd94bd Add optarg, optind, opterr, optopt, optreset to SYNOPSYS 2004-02-23 05:07:11 +00:00
ache
1d889689c5 POSIX clearly states that getsubopt() should be declared in <stdlib.h>
not in <unistd.h>
2004-02-23 03:32:10 +00:00
ache
a523e1e45b Remove unneccessary <unistd.h> 2004-02-23 03:30:02 +00:00
deischen
7e389d7da6 Update man page to reflect additional flag to allow selection of threads. 2004-02-22 18:12:56 +00:00
deischen
a74ce4ffed Teach kvm_getprocs() to recognize a sysctl flag for including threads. 2004-02-22 17:57:10 +00:00
peter
025be3a06b 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
2d049ae1d6 Fix a couple of potential buffer overflows.
Submitted by:	christer.oberg@texonet.com
2004-02-21 16:29:10 +00:00
phk
b3acd67aa2 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
0048baa46a 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
cd02b63290 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
86fc5ce7eb Unbreak the upgrade path from 4.9 after removal of GNU getopt and
<gnuregex.h>.
2004-02-20 11:55:14 +00:00
green
714207efaa Document dependence of mktemp(3) on the non-reentrant arc4random(3). 2004-02-20 04:08:28 +00:00
marcel
4eb7a1796d Moving forward, there's no reason to exclude libpthread on sparc64. 2004-02-20 03:42:34 +00:00
mtm
c52ee98646 Implement PThreads barriers and barrier attributes. 2004-02-19 13:51:52 +00:00
mtm
0367bb023a 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
a4ad7ecaa8 Remove thr_getschedparam.c since it's contents have been moved into
thr_setschedparam.c
2004-02-18 15:59:54 +00:00
mtm
b6f281da64 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
68e65f5c5e 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
b7e0ff02b3 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
0aba94f26a 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
f9502d3f74 Move the initialization of thread priority to a common function. 2004-02-18 15:05:56 +00:00
mtm
bcd03f50c5 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
0d430f11eb 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
d23fcab17b Fix a typo in the !__GNUC__ case and remove an obsolete comment. 2004-02-16 10:02:51 +00:00
das
e119526a51 Fix some aliasing problems. 2004-02-16 10:02:40 +00:00
kientzle
4300a1695e 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
3fb0410576 Connect libarchive to the build. 2004-02-12 16:41:33 +00:00
grehan
1f93dddd31 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
93f40548a7 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
d1a792dae7 Do not cast dval.
Make global _usage_page unsigned.

Reviewed by:	imp (mentor)
2004-02-11 21:09:13 +00:00
des
c407dd7263 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
836fe68f4b 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
d85eae8358 Re-wrap some comments. 2004-02-11 09:23:35 +00:00
bms
20570d493e 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
d2e2105c36 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
1401a97d0e 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
c41f9f2104 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
414cbb0580 Fix numerous constness and aliasing issues. 2004-02-10 10:13:21 +00:00
deischen
29cf79bbd9 Add sem_timedwait to the symbol map, otherwise the libc version will
get used.
2004-02-10 05:36:09 +00:00
kientzle
a297573594 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
ce595dce0f 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
27c8a39f4e 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
275fd2701a Document the SF_NODISKIO flag, and fix a small typo. 2004-02-08 07:38:35 +00:00
ru
2374021931 Unbreak world. 2004-02-07 11:13:47 +00:00
dds
81707a7980 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
45140f3f66 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
34337ec7df Prevent memory leak on sem_destroy() by destroying the semaphore's
internal mutex and CV.
2004-02-06 15:15:44 +00:00
deischen
77a51787da 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
deischen
5641da8c47 Correct check for invalid semaphore on sem_destroy() (s/==/!=/).
Reported by:	kris
2004-02-05 23:32:45 +00:00
ru
4c72afa60b Fixed style of DPADD and LDADD assignments as per style.Makefile(5). 2004-02-05 22:44:25 +00:00
deischen
54eba7ee42 Correct the weak reference for sem_unlink. 2004-02-05 22:36:27 +00:00
davidxu
7a4745aa41 libkse was renamed to libpthread. 2004-02-05 02:55:20 +00:00
deischen
cc11f765d8 Allow libc's version of sem_trywait() to work for non-pshared mutexes. 2004-02-04 15:37:48 +00:00
ru
43f7f3f626 Put libraries in the link order.
Reported by:	lorder(1) (modified to work with libraries)
2004-02-04 10:23:09 +00:00
ru
29d62104b0 Nothing in libypclnt depends on librpcsvc.
Reported by:	lorder(1) (modified to work with libraries)
2004-02-04 09:53:29 +00:00
ru
e99388a305 This module doesn't use libgssapi (and it looks never did). 2004-02-04 09:41:47 +00:00
davidxu
14f2e1b4b5 Add missing file. 2004-02-04 06:32:45 +00:00
davidxu
3120af18e7 Import initial work of libpthread debugging. This is a debugger independent
friend library for libpthread, the library will be used by debugger to
read/write libpthread's internal data structures.
2004-02-04 05:01:15 +00:00
deischen
9a3156bc89 Remove the band-aid (#include <time.h>). 2004-02-03 22:30:01 +00:00
deischen
170c60ccae Add <time.h> -- bandaid to unbreak world in <semaphore.h>. 2004-02-03 15:55:30 +00:00
deischen
eb99c3fe54 Provide a userland version of non-pshared semaphores and add cancellation
points to sem_wait() and sem_timedwait().  Also make sem_post signal-safe.
2004-02-03 05:50:07 +00:00
deischen
5228a2461c Modify the implementation of libc semaphores so that they can be
overridden by the threads library to provide a userland version
of non-pshared semaphores and cancellation points.  Also add
a sem_timedwait().

The libc version of semaphores always uses kernel semaphores
regardless of whether pshared is set or not.  When threads are
not present, it is difficult to get sem_wait() or sem_timedwait()
to do the right thing (since pthread_cond_timedwait() and
pthread_cond_wait() are stubs in libc and just return immediately).
2004-02-03 05:47:19 +00:00
mtm
57f8f4a82a Bump up the maximum number concurrent threads on x86. 2004-02-01 15:33:01 +00:00
das
b8f692b861 Merge vfscanf.c,v 1.35. 2004-01-31 23:18:53 +00:00
das
007fc2338d Fix the handling of negative hexadecimal numbers in integer formats.
Note that this bug is unrelated to recent work in this area; it seems
to have been present since revision 1.1.

Obtained from:	NetBSD
2004-01-31 23:16:09 +00:00
ache
2d108a7cef LC_ALL not always take priority over other LC_*
Obtained from:  NetBSD
PR:             62047
2004-01-31 19:15:32 +00:00
deischen
c25d15d38c Correct the link for the profiling library. 2004-01-31 17:00:04 +00:00
marcel
c60e788b96 Now that libpthread is the default threading library, remove the
compatibility link from libc_r to libpthread (previously a link
from libc_r to libkse).
2004-01-31 05:05:45 +00:00
marcel
eeaf0392a2 In Write_Disk(), fix the non-error case where we returned to the
caller without closing the disk device and freeing allocated
memory. Not closing the disk device prevents GEOM from retasting
after spoiling.

Pointy hat: marcel
2004-01-30 20:52:54 +00:00
deischen
3e27b446fc Change libkse back to libpthread and make it the default
thread library for i386, amd64, and ia64.  For alpha
and sparc64 the library is not changed and remains libkse,
and links are installed so that libpthread -> libc_r.

The gcc -pthread option will be changed in a separate
commit so that it links to -lpthread instead of -lc_r.

Approved by:	re@
2004-01-30 12:13:17 +00:00
mtm
4e00cc9bcb I update the rwlock code in libthr to be more standards compliant and
what do I get for my troubles? libc breaks offcourse!

Reimplement a hack (in libthr) that allows libc to use
rwlocks without initializing them first. The hack was reimplemented
so that only a private libc version of the rwlock locking functions
initializes an uninitialized rwlock. The application version will
correctly fail.
2004-01-29 12:03:17 +00:00
mtm
ef724592b4 When suspending a thread if the timeout was very short or
the system call got interrupted and the absolute timeout is
converted to a relative timeout, it may happen that we get a
negative number. In such a case, simply set the timeout to
zero so that if the event that the thread wants to wait for has
happened it can still return successfully, but if it hasn't
happened then the thread doesn't suspend indefinitely. This should
fix certain applications (including mozilla) that seem to hang
indefinitely sometimes.

Noticed and debugged by: Morten Johansen <root@morten-johansen.net>
2004-01-29 09:44:36 +00:00
ache
39b827dcaa Add reference to environ(7) 2004-01-29 09:27:24 +00:00
marcel
3f02fba784 Fix an uninitialized variable bug that caused write_pmbr() to bogusly
return an error value that made Write_Disk() abort.  While on the
subject, improve the initialization of the error variable in read_gpt()
and update_gpt() even though nothing was broken there.
2004-01-28 03:38:25 +00:00
emax
e67541b55a Add NO_BLUETOOTH knob to the build process
Requested by:	phk
Reviewed by:	imp (mentor), ru
2004-01-28 00:42:51 +00:00
ru
f6f842fa7d Increment WARNS. 2004-01-28 00:11:42 +00:00
emax
a869a9b0d1 The report size is not a local item, so don't clear it when clearing local items.
PR:	misc/58971
Reviewed by:	imp (mentor), mdodd
Obtained from:	NetBSD
2004-01-28 00:05:22 +00:00
ru
18f5ba2753 - Added three new interfaces, NgAllocRecvMsg(), NgAllocRecvAsciiMsg(),
and NgAllocRecvData(), that dynamically allocate buffer for a binary
  message, an ascii message, and a data packet, respectively.  The size
  of the allocated buffer is equal to the socket's receive buffer size
  to guarantee that a message or a data packet is not truncated.

- Get rid of the static size buffer in NgSendAsciiMsg().

OK'ed by:	archie, julian
2004-01-27 20:25:14 +00:00