Commit Graph

8533 Commits

Author SHA1 Message Date
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
ru
d87ca81459 mdoc(7) cleanup. 2004-01-27 19:24:53 +00:00
ru
26ad0b6df6 Fixed memory leak in NgSendAsciiMsg(). 2004-01-27 18:38:22 +00:00
nyan
422254efa2 Fixed pc98 partition type. 2004-01-27 15:25:33 +00:00
des
29a404af3f Implement pam_sm_close_session().
PR:		bin/61657
Submitted by:	Joe R. Doupnik <jrd@cc.usu.edu>
2004-01-26 19:28:37 +00:00
eivind
c14c8c8ce5 Xref kqueue and poll 2004-01-26 15:20:16 +00:00
eivind
27242ca021 Xref kqueue 2004-01-26 15:19:54 +00:00