Commit Graph

10744 Commits

Author SHA1 Message Date
Andrey A. Chernov
6843acf8ac Remove code #ifndef'ed in prev. commit to stay in sync with OpenBSD
v1.21 which just do that.
2006-09-22 18:59:03 +00:00
Andrey A. Chernov
f27c7b4713 Be more GNU compatible:
don't be greedy on the GNU "::" extension when arg separated by whitespace
and POSIX_CORRECTLY is set. From POSIX point of view this is unclear
situation, so minimal assumption looks right.
2006-09-22 17:01:38 +00:00
Alexander Kabaev
714b79b953 Do not declare __evOptMonoTime static in one place and extern
in another. GCC4 does not like that.
2006-09-22 01:52:26 +00:00
Alexander Kabaev
500b77c7ed Use correct type in va_arg argument. 2006-09-21 14:40:20 +00:00
David Xu
d31279c4e7 remove thr_getscheduler, thr_setscheduler, thr_setschedparam,
add rtprio_thread.
2006-09-21 04:22:46 +00:00
David Xu
e6747c7ce1 use rtprio_thread system call to get or set thread priority. 2006-09-21 04:21:30 +00:00
Alexander Kabaev
63ed5a7e06 Silence GCC4 warning.
strlen, strcmp live in <string.h> not <string.h>.
2006-09-21 01:30:04 +00:00
Wojciech A. Koszek
6e6dfbf26e Don't forget to set internal error message in kvm_nlist().
Approved by:	cognet (mentor)
2006-09-20 12:09:21 +00:00
Robert Watson
b91c45f25e Hook up au_open.3 man page (and its symlinks), apparently missed during
initial OpenBSM merge.

Obtained from:	TrustedBSD Project
MFC after:	3 days
2006-09-19 08:30:34 +00:00
Maxim Konovalov
0ba6effc8c o Don't fseek() on closed file.
Submitted by:	pgollucci@p6m7g8.com, Mark Costlow
MFC after:	3 weeks
2006-09-18 09:34:48 +00:00
Ruslan Ermilov
a73a3ab56b Markup fixes. 2006-09-17 21:27:35 +00:00
Ruslan Ermilov
b31a663480 Remove more traces of Alpha. 2006-09-17 20:53:30 +00:00
Dag-Erling Smørgrav
f63ebe36f6 Reject user with names that are longer than OPIE is willing to deal with;
otherwise OPIE will happily truncate it.

Spotted by:	ghelmer
MFC after:	2 weeks
2006-09-15 13:42:38 +00:00
Joel Dahl
f832d58dc8 Remove reference to T/TCP.
Reviewed by:	andre
2006-09-13 19:48:00 +00:00
Joel Dahl
cec65ede6c Bump .Dd.
Noticed by:	danger
2006-09-13 18:34:32 +00:00
Joel Dahl
3e1f331553 Remove references to the pam(8) manual page. It does not exist.
Requested by:	novel
Discussed with:	brueffer, simon
2006-09-13 17:46:20 +00:00
Brian Somers
cd0ac75c13 Fix a typo 2006-09-10 20:41:33 +00:00
Martin Blapp
794295bab8 Sync with NetBSD rev. 1.16 + 1.17
Coverity CID 2292: Plug memory leak.
Coverity CID 2291: Move function call before allocating storage to prevent
memory leak on error.

MFC after:    1 month
2006-09-09 22:33:21 +00:00
Martin Blapp
8306b5154c Sync with NetBSD rev. 1.29
Coverity CID 2293: Fix memory leak.

MFC after:	1 month
2006-09-09 22:32:07 +00:00
Martin Blapp
c317a5c2f6 Sync with NetBSD rev. 1.6 + 1.7
Coverity CID 779 + 780: Avoid NULL pointer dereference.

MFC after:    1 month
2006-09-09 22:29:16 +00:00
Martin Blapp
f340bd4070 Sync with NetBSD rev. 1.20 + 1.21
Coverity CID 2284: Fix multiple memory leaks.
Coverity CID 710: Remove unreachable code.

MFC after:    1 month
2006-09-09 22:26:47 +00:00
Martin Blapp
dc9fde8d4f Sync with NetBSD rev. 1.10
Coverity CID 2276: Don't leak memory on error.

MFC after:    1 month
2006-09-09 22:22:39 +00:00
Martin Blapp
b0718451b8 Sync with NetBSD rev. 1.15
Coverity CID 2275: Avoid memory leak on error.

MFC after:    1 month
2006-09-09 22:21:15 +00:00
Martin Blapp
b0eb405d46 Sync part of NetBSD rev. 1.14
Fix unpaired sigblock which possibly leaves the process with all
signals blocked.

MFC after:	2 weeks
2006-09-09 22:18:57 +00:00
Martin Blapp
e0c693387f Sync with NetBSD rev. 1.16 + 1.17
Coverity CID 3651: Don't leak ifaddrs on getaddrinfo failure.
Coverity CID 2283: Don't leak sys_auth on error.

MFC after:    1 month
2006-09-09 22:14:42 +00:00
Jason Evans
820e03699c Change the way base allocation is done for internal malloc data
structures, in order to avoid the possibility of attempted recursive
lock acquisition for chunks_mtx.

Reported by:	Slawa Olhovchenkov <slw@zxy.spb.ru>
2006-09-08 17:52:15 +00:00
David Xu
ddaf6689e3 Use return value of _thr_umutex_lock instead of using zero. 2006-09-08 09:29:14 +00:00
Thomas Quinot
3a1d9c271b Minor comment fix. 2006-09-08 08:14:32 +00:00
David Xu
bddd24cd9c Replace internal usage of struct umtx with umutex which can supports
real-time if we want, no functionality is changed.
2006-09-06 04:04:10 +00:00
Ruslan Ermilov
4d6ff03d50 alloca() cannot check if the allocation is valid; mention the consequences.
Obtained from:	OpenBSD
2006-09-05 16:30:11 +00:00
Ruslan Ermilov
3c03c7095e GC dead code. If we want to stay polite to the foreign compilers,
we can find another way to issue an #error, but using a preprocessed
assembler for that purpose and clobbering libc.a with an empty .o
just for the sake of #error reporting is way too much of a burden.
2006-09-05 16:21:26 +00:00
David Xu
8549079365 Same as pthread_setschedparam, use sizeof(struct sched_param) instead. 2006-09-05 14:39:06 +00:00
David Xu
be0bfdd207 Pass correct parameter size. 2006-09-05 14:37:22 +00:00
Tim Kientzle
c12a9d810e Some minor corrections:
* Expose functions for setting the "skip file" dev/ino information
  * Expose functions for setting/querying the block size on reads
  * Correctly propagate errors out of archive_read_close/archive_write_close
  * Update manpage with information about new functions
2006-09-05 05:59:46 +00:00
Thomas Quinot
71219ddbd1 (pw_copy): Handle the case of a malformed line in master.passwd
(copy it silently, do not dereference NULL pointer).

PR:             bin/102848
Reviewed by:    security-officer (cperciva)
MFC after:      1 week
2006-09-04 15:09:21 +00:00
Marcel Moolenaar
ee35caa0b3 Whitespace fix. 2006-09-02 01:07:21 +00:00
Marcel Moolenaar
4d630a8f11 Stylize:
o  avoid using a global register variable.
o  redefine struct ia64_tp as a union. We don't have to get to the
   fields themselves. We just need it to be of the right size with
   the right alignment.
2006-09-01 21:25:22 +00:00
Marcel Moolenaar
be2f4bda88 Stylize: avoid using a global register variable. 2006-09-01 21:01:11 +00:00
Marcel Moolenaar
ce2dfbd199 Enable TLS on PowerPC. 2006-09-01 19:14:14 +00:00
Marcel Moolenaar
4c91d168a7 The ucontext is 16-byte aligned, which means that struct tcb is
16-byte aligned. Consequently, struct tcb is a multiple of 16
bytes in size. We need to make sure there's no padding after
struct ppc32_tp. We do this by explicitly adding the necessary
padding in front of it.
2006-09-01 19:13:36 +00:00
Marcel Moolenaar
5df93cb787 Stylize. Introduce ppc_{get|set}_tp() and ppc_{get|set}_tcb() to
abstract the magic that happens when deriving one or the other.
2006-09-01 17:52:13 +00:00
Marcel Moolenaar
9d353fbc3f Fix style(9) in code copied from rtld. 2006-09-01 17:35:48 +00:00
Marcel Moolenaar
cc79b334de Rename TLS_TP_OFFSET back to TP_OFFSET. The former clashes with rtld. 2006-09-01 06:36:00 +00:00
Marcel Moolenaar
bc14049e96 Enable TLS on ia64. 2006-09-01 06:18:43 +00:00
Marcel Moolenaar
20b18e870b Implement TLS. 2006-09-01 06:17:16 +00:00
Marcel Moolenaar
8e61dbecfc Stylize. 2006-09-01 06:15:00 +00:00
Marcel Moolenaar
3614156c7d Fix the variant I allocation for KSE: Allow a larger TCB and assume
that the documented TCB is at the tail of the extended TCB. In other
words, the base of the TCB has a negative offset from the TLS.
2006-09-01 06:13:16 +00:00
Robert Watson
b8f3034c1f Remove curdir reference in libbsm build; this is not required as the
include path will already point to the populated include tree.  This
is left over from boot-strapping the build and install of libbsm
during the initial import and merge.

Obtained from:	TrustedBSD Project
Pointed out by:	ru
2006-09-01 05:21:45 +00:00
Marcel Moolenaar
35ca217bf0 Stylize. 2006-08-31 23:31:18 +00:00
Marcel Moolenaar
9f7b8b0d3c TLS fixes:
o  The TLS pointer (r2) points 0x7000 after the *end* of the TCB.
o  _rtld_allocate_tls() gets a pointer to the current TCB, not the
   current TLS pointer.
o  _rtld_free_tls() gets the size of the TCB structure.
2006-08-31 19:16:47 +00:00
Marcel Moolenaar
91705de0c2 Fix harmless bug: sizeof(tcb) equals sizeof(void*) not sizeof(struct tcb).
The argument is (currently) not used by _rtld_free_tls().
2006-08-31 19:06:30 +00:00
Marcel Moolenaar
57c2251d5c o Set TP using inline assembly to avoid dead code elimination.
o  Eliminate _tcb.
2006-08-30 03:31:32 +00:00
Marcel Moolenaar
f3cec68877 Avoid dead code elimination of the assignment to TP by using inline
assembly.
2006-08-30 00:57:35 +00:00
Marcel Moolenaar
7d3f85133a Prevent dead code elimination for the TP assignmient by using inline
assembly.
2006-08-30 00:39:07 +00:00
David Xu
fd2b89c48c Remove unused file. 2006-08-29 13:01:23 +00:00
Tim Kientzle
02a97525ef When skipping data, track the position in the bytestream correctly.
Without this, tar -r breaks badly; new entries overwrite the
middle of the archive instead of being added at the end.

Thanks to: Chris Spiegel
2006-08-29 04:59:25 +00:00
David Xu
215318a7a3 pthread_sigmask is in thr_sig.c, remove this file. 2006-08-28 12:29:54 +00:00
David Xu
6361212beb Kill unused files. 2006-08-28 05:01:31 +00:00
David Xu
8ab9d78b9d Use umutex APIs to implement pthread_mutex, member pp_mutexq is added
into pthread structure to keep track of locked PTHREAD_PRIO_PROTECT mutex,
no real mutex code is changed, the mutex locking and unlocking code should
has same performance as before.
2006-08-28 04:52:50 +00:00
David Xu
cf13ecda6a Add umutex APIs. 2006-08-28 04:47:27 +00:00
Markus Brueffer
5b22d1e648 - Add new service class definitions and a new attribute identifier definition
- Update URL of the Assigned Numbers document for SDP

Approved by:	emax (mentor)
MFC after:	3 days
2006-08-26 23:16:35 +00:00
Ceri Davies
d2b2ccea4c Note that the system only allows a maximum of kern.kq_calloutmax timers.
PR:		docs/102353
Submitted by:	phk
MFC after:	1 week
2006-08-25 15:19:47 +00:00
Ruslan Ermilov
2d05c776ef Remove alpha-specific stuff. 2006-08-23 12:12:56 +00:00
Yaroslav Tykhiy
6599d1e129 Recognize the existence of auth' and auth-type'
capabilities but tell they do nothing in the base system.

This is a late responce to
http://docs.freebsd.org/cgi/mid.cgi?ED759F1DC5ADD74592DD063B1EDEDAF803ACD2B5
.

Obtained from:	OpenBSD (wording; with minor corrections)
2006-08-23 09:54:46 +00:00
Ruslan Ermilov
2b46c64c9c Remove alpha left-overs. 2006-08-22 08:03:01 +00:00
Marcel Moolenaar
e108ac655d Build libsmb and smbutil on ia64. 2006-08-22 03:22:17 +00:00
Olivier Houchard
9a1d419396 If __ARMEB__ is defined, we're already using the network byte order, so
there's no need to to anything in the hton* functions, beside returning
the parameter.

Spotted out by: Oleksandr Tymoshenko <gonzo@freebsd.org>
2006-08-21 14:42:47 +00:00
Wes Peters
25dbf7fe4e Document EAGAIN failure per PR. (Finally!)
PR:		24125
2006-08-16 02:56:51 +00:00
Pawel Jakub Dawidek
225ee44c8a We operate on 'statfs' structures, not on 'fsstat' structures.
MFC after:	3 days
2006-08-15 18:17:03 +00:00
Dima Dorfman
01510e402d Improve the wording. Remove the appositive about strcmp, putting the
first sentence back to the way it was. Add a second sentence that
explains the case when strcmp is called.
2006-08-14 08:21:27 +00:00
Colin Percival
e981a4e863 Correctly handle the case in calloc(num, size) where
(size_t)(num * size) == 0
but both num and size are nonzero.

Reported by:	Ilja van Sprundel
Approved by:	jasone
Security:	Integer overflow; calloc was allocating 1 byte in
		response to a request for a multiple of 2^32 (or 2^64)
		bytes instead of returning NULL.
2006-08-13 21:54:47 +00:00
Dag-Erling Smørgrav
f5e30bd1ff Additional debugging stuff I had in my tree. 2006-08-11 17:03:33 +00:00
Marcel Moolenaar
97a337185f Fix a bug in the size of the PMBR partition. Since the partition starts
at LBA 1, the size is not the mediasize in sectors, but one less.
2006-08-09 20:19:15 +00:00
Marcel Moolenaar
5011eea82f Define NO_TLS on PowerPC.
See also: PR ia64/91846
2006-08-09 19:01:27 +00:00
Maxim Konovalov
edd5ce3102 o It speaks about struct msqid_ds not struct shmid_ds.
PR:		docs/101314
Submitted by:	Vasil Dimov
MFC after:	1 week
2006-08-09 18:05:44 +00:00
David Xu
065dbdc130 Axe unused member field. 2006-08-08 05:04:43 +00:00
David Xu
6b73f08519 Get number of CPUs and ignore spin count on single processor machine. 2006-08-08 04:42:41 +00:00
Poul-Henning Kamp
5b1deb3ce8 Return length from fwopen() file callback instead of zero.
The symptom is that syslog() fails to log anything but the "ident"
string if LOG_PERROR is specified to openlog(3) and the extensible
printf is in action.

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

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

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

MFC:	after 2 weeks
2006-08-07 20:12:18 +00:00
Marcel Moolenaar
fac8eae5bc Build libthread_db on PowerPC. 2006-08-04 17:56:31 +00:00
Marcel Moolenaar
e4e9813eb9 Add stub functions. This allows libthread_db to be built and installed,
which means that we also have <thread_db.h>.
2006-08-04 17:55:55 +00:00
Hajimu UMEMOTO
45c89f1e05 Check if the filedes of kevent is expected one. Though our
old resolver opened just one socket, BIND9's resolver may
open more than one sockets.  And, BIND9's resolver doesn't
close the socket on timeout.  So, we need this check.

Reported by:	freebsd-cvs-src__at__oldach.net (Helge Oldach), bz
Hinted by:	rwatson
2006-08-04 12:26:07 +00:00
Hajimu UMEMOTO
500fe2a19c _close() should be called instead of close() here. 2006-08-04 10:21:11 +00:00
Yaroslav Tykhiy
776fc0e90e Commit the results of the typo hunt by Darren Pilgrim.
This change affects documentation and comments only,
no real code involved.

PR:		misc/101245
Submitted by:	Darren Pilgrim <darren pilgrim bitfreak org>
Tested by:	md5(1)
MFC after:	1 week
2006-08-04 07:56:35 +00:00
Xin LI
da4ab3aa26 In DCE 1.1, the time_low value is defined as an unsigned 32-bit
integer.  Presently, our implementation employs an approach that
converts the value to int64_t, then back to int, unfortunately,
this approach can be problematic when the the difference between
the two time_low is larger than 0x7fffffff, as the value is then
truncated to int.

To quote the test case from the original PR, the following is
true with the current implementation:

865e1a56-b9d9-11d9-ba27-0003476f2e88 < 062ac45c-b9d9-11d9-ba27-0003476f2e88

However, according to the DCE specification, the expected result
should be:

865e1a56-b9d9-11d9-ba27-0003476f2e88 > 062ac45c-b9d9-11d9-ba27-0003476f2e88

This commit adds a new intermediate variable which uses int64_t
to store the result of subtraction between the two time_low values,
which would not introduce different semantic of the MSB found in
time_low value.

PR:		83107
Submitted by:	Steve Sears <sjs at acm dot org>
MFC After:	1 month
2006-08-03 03:34:36 +00:00
Tim Kientzle
225ade520e If skip_file_dev and skip_file_ino haven't been set (are still == 0),
then don't use them for testing for a recursive add.

Thanks to: Spencer Minear
MFC after: 7 days
2006-08-01 05:31:29 +00:00
Yaroslav Tykhiy
594a130b8a Stop enforcing dependencies between MK_* options at Makefile level.
All the dependencies are satisfied now in <bsd.own.mk>.
2006-07-31 13:29:36 +00:00
Simon L. B. Nielsen
78078a569f Pass BN_CTX to internal functions instead of allocating it internally.
This allows msqrt() to only call BN_CTX_new() once intead of many times.

Suggested and reviewed by:	stefanf
2006-07-30 19:29:26 +00:00
Tim Kientzle
4dabd2811a Conditionally include sys/mkdev.h on platforms (such as Solaris) that need it.
Thanks to: VMiklos
2006-07-30 18:33:20 +00:00
Tim Kientzle
693285bc87 Use 'skip' when ignoring data in tar archives. This dramatically
increases performance when extracting a single entry from a large
uncompressed archive, especially on slow devices such as USB hard
drives.

Requires a number of changes:
   * New archive_read_open2() supports a 'skip' client function
   * Old archive_read_open() is implemented as a wrapper now, to
     continue supporting the old API/ABI.
   * _read_open_fd and _read_open_file sprout new 'skip' functions.
   * compression layer gets a new 'skip' operation.
   * compression_none passes skip requests through to client.
   * compression_{gzip,bzip2,compress} simply ignore skip requests.

Thanks to: Benjamin Lutz, who designed and implemented the whole thing.
   I'm just committing it.  ;-)

TODO: Need to update the documentation a little bit.
2006-07-30 00:29:01 +00:00
Tim Kientzle
85af60729f Don't mention 'pax' in the context of POSIX-1988, since
pax wasn't introduced until the 1993 (?) revision.

(I need to double-check when pax was introduced and
clarify some of the history here.  In particular,
I should explain that the 'pax' standard now owns the
'ustar' format spec.)
2006-07-29 23:51:10 +00:00
Tim Kientzle
aa12ea14a8 Remove mention of 'tp' format, since that support has been
removed.  (It was introduced experimentally and I have simply
never had time to finish it.)
2006-07-29 23:49:25 +00:00
Simon L. B. Nielsen
76f29359f7 Do not put BN_CTX structures on the stack, but instead allocate them
runtime using BN_CTX_new().  This is done since in OpenSSL 0.9.7e we
can only allocate BN_CTX on the stack by including an internal OpenSSL
header file, and in OpenSSL 0.9.8 BN_CTX is entirely opaque, so having
it on the stack is not possible at all.

This is done as preparation for OpenSSL 0.9.8b import.

Tested on:	amd64 i386 ia64
Tested with:	src/tools/regression/lib/libmp
2006-07-28 23:00:16 +00:00
Stefan Farfeleder
1dd3ff6658 Remove debug code.
Suggested by:	des
2006-07-28 21:34:37 +00:00
Jason Evans
b3dcb52814 Conditionally expand the size_invs lookup table in arena_run_reg_dalloc()
so that architectures with a quantum of 8 (rather than 16) work.

Restore arm's quantum to 8.

Submitted by:	jmg
2006-07-27 19:09:32 +00:00
Olivier Houchard
4cfa5e0135 Use 4 as QUANTUM_2POW_MIN on arm as it is on any other architecture, to avoid
triggering an assertion later.
2006-07-27 14:36:28 +00:00
Yaroslav Tykhiy
74d580d770 style.Makefile(5) is good for our eyes. 2006-07-27 12:36:46 +00:00
Yaroslav Tykhiy
ad82a90b81 Respect MK_INET6_SUPPORT. 2006-07-27 04:54:03 +00:00
Jason Evans
b8f9774731 Fix cpp logic in arena_malloc() to adjust size when assertions are enabled,
even if stats gathering is disabled. [1]

Remove 'size' parameter from several functions that do not use it.

Reported by:	[1] ache
2006-07-27 04:00:12 +00:00
Warner Losh
c40855dbed Remove stale comment about arm 2006-07-26 16:56:56 +00:00
Yaroslav Tykhiy
11eb328ec5 Respect MK_INET6_SUPPORT. 2006-07-26 08:36:46 +00:00
Yaroslav Tykhiy
720fc1c7dc Fix build w/o INET6.
Submitted by:	Andre Albsmeier <Andre.Albsmeier siemens com>
2006-07-26 08:35:46 +00:00
John Birrell
6358aecacd Increase the number of CPUs to 32 to suit sun4v.
Reviewed by: rwatson@
2006-07-26 07:46:32 +00:00
Yaroslav Tykhiy
42e4359156 Rev. 1.44 of this file didn't introduce a right solution,
but we don't seem to have one yet, so just add an XXX comment on
passing rux_runtime to bintime2timeval() wrongly.

Spotted by:	gcc(1) (warning)
2006-07-25 22:39:57 +00:00
David Xu
05c3a5eab4 1. Don't override underscore version of aio_suspend(), system(),
wait(), waitpid() and usleep(), they are internal versions and
   should not be cancellation points.
2. Make wait3() as a cancellation point.
3. Move raise() and pause() into file thr_sig.c.
4. Add functions _sigsuspend, _sigwait, _sigtimedwait and _sigwaitinfo,
   remove SIGCANCEL bit in wait-set for those functions, the signal is
   used internally to implement thread cancellation.
2006-07-25 12:50:05 +00:00
Norikatsu Shigemura
27a9d57fed Add missing ;.
Pointy hat to:	myself
Approved by:	deischen (implicitly)
2006-07-23 15:53:12 +00:00
Hajimu UMEMOTO
e24e9d9988 do not overload the port number on to the return value of
str2number().  this could result in an unexpected code path.

Obtained from:	KAME
MFC after:	1 week
2006-07-23 15:31:03 +00:00
Norikatsu Shigemura
e257c93bbc Add missing syscalls.
Reviewed by:	deischen
Approved by:	deischen
2006-07-23 13:08:54 +00:00
Hajimu UMEMOTO
18d2f53d00 stop use of mutex lock in ICMP lookup.
MFC after:	1 week
2006-07-23 07:07:49 +00:00
Hajimu UMEMOTO
816dc28540 remove obsolete comments.
MFC after:	3 days
2006-07-22 14:36:56 +00:00
Hajimu UMEMOTO
da83bf18e4 simplification in explore_numeric: unified the post-process with
GET_AI and GET_PORT.  Commented on an impossible case.

Obtained from:	KAME
MFC after:	1 week
2006-07-21 19:02:28 +00:00
Hajimu UMEMOTO
0cf41987df RFC3493 requires use of inet_aton for AF_INET.
Obtained from:	KAME
MFC after:	1 week
2006-07-21 19:00:22 +00:00
Hajimu UMEMOTO
0aceddcef7 clean-up: rewrote explore_null and explore_numeric without using sentinel.
we do not need it since we make (at most) a single addrinfo entry in these
cases.

Obtained from:	KAME
MFC after:	1 week
2006-07-21 18:57:44 +00:00
Hajimu UMEMOTO
b88ad6b5d6 - draft-ietf-ipngwg-icmp-namelookups-09
- make it compilable

It still requires root privilege and is experimental.

Obtained from:	KAME
MFC after:	1 week
2006-07-21 18:55:51 +00:00
Stefan Farfeleder
143a84cb95 Use variadic macros that comply with C99. Keep the GCC-style ones if
DEBUG is defined and GCC is used.
2006-07-17 20:39:08 +00:00
Stefan Farfeleder
c67bd97df8 Change the GCC specific __FUNCTION__ to C99's __func__.
OK'ed by:	des
2006-07-17 11:48:52 +00:00
Stefan Farfeleder
60cd586318 Make the variadic macro debug() comply to C99. 2006-07-17 09:33:24 +00:00
Stefan Farfeleder
33ef612ede Use a prototype for res_init().
MFC after:	3 days
2006-07-17 09:27:26 +00:00
Xin LI
da84584390 Unexpand two TAILQ_FOREACH_SAFE cases.
Ok'ed by:	davidxu
2006-07-17 09:23:44 +00:00
Warner Losh
d5fbc8f429 Note the convention that humanize_number follows.
Add 'engineering' numbers to table.
2006-07-15 20:53:36 +00:00
Maxim Konovalov
0ec15b18a2 o compat_group() and files_group() are more complicated than I thought
in rev. 1.34.  Mainly I missed the fact that the buffer is used for two
purposes:

1) storing a group line from the group file;

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

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

Submitted by:	Kirk R Webb
MFC after:	2 weeks
2006-07-14 17:45:33 +00:00
David Xu
e2dc286c1c Caching scheduling policy and priority in userland, a critical but baddly
written application is frequently changing thread priority for SCHED_OTHER
policy.
2006-07-13 22:45:19 +00:00
David Xu
561a89f945 Use thr_setscheduler, thr_getscheduler and thr_setschedparam to implement
pthread functions.
2006-07-13 06:35:43 +00:00
Maxim Konovalov
a07b02ef92 o Add missed comma, xref kld(4). 2006-07-12 14:33:52 +00:00
David Xu
7b4f8f037f Use kernel facilities to support real-time scheduling. 2006-07-12 06:13:18 +00:00
David Xu
9bbc6c7f54 __error could be called too early before libthr is initialized, test
this case and return global varible errno instead.
2006-07-12 03:44:05 +00:00
Robert Watson
1e5294bc0a Following repo-copy of mac_is_present_np.3 to mac_is_present.3, remove
old file, update references, etc.  The C function is already named
mac_is_present().

Obtained from:	TrustedBSD Project
2006-07-07 14:02:17 +00:00
Bruce Evans
d79d610d9c Fixed the threshold for using the simple Taylor approximation.
In e_log.c, there was just a off-by-1 (1 ulp) error in the comment
about the threshold.  The precision of the threshold is unimportant,
but the magic numbers in the code are easier to understand when the
threshold is described precisely.

In e_logf.c, mistranslation of the magic numbers gave an off-by-1
(1 * 16 ulps) error in the intended negative bound for the threshold
and an off-by-7 (7 * 16 ulps) error in the intended positive bound for
the threshold, and the intended bounds were not translated from the
double precision bounds so they were unnecessarily small by a factor
of about 2048.

The optimization of using the simple Taylor approximation for args
near a power of 2 is dubious since it only applies to a relatively
small proportion of args, but if it is done then doing it 2048 times
as often _may_ be more efficient.  (My benchmarks show unexplained
dependencies on the data that increase with further optimizations
in this area.)
2006-07-07 04:33:08 +00:00
Bruce Evans
fe72622ebe Fixed tanh(-0.0) on ia64 and optimizeed tanh(x) for 2**-55 <= |x| <
2**-28 as a side effect, by merging with the float precision version
of tanh() and the double precision version of sinh().

For tiny x, tanh(x) ~= x, and we used the expression x*(one+x) to
return this value (x) and set the inexact flag iff x != 0.  This
doesn't work on ia64 since gcc -O does the dubious optimization
x*(one+x) = x+x*x so as to use fma, so the sign of -0.0 was lost.

Instead, handle tiny x in the same as sinh(), although this is imperfect:
- return x directly and set the inexact flag in a less efficient way.
- increased the threshold for non-tinyness from 2**-55 to 2**-28 so that
  many more cases are optimized than are pessimized.

Updated some comments and fixed bugs in others (ranges for half-open
intervals mostly had the open end backwards, and there were nearby style
bugs).
2006-07-05 22:59:33 +00:00
Bruce Evans
3454a5a101 Removed the optimized asm versions of scalb() and scalbf(). These
functions are only for compatibility with obsolete standards.  They
shouldn't be used, so they shouldn't be optimized.  Use the generic
versions instead.

This fixes scalbf() as a side effect.  The optimized asm version left
garbage on the FP stack.  I fixed the corresponding bug in the optimized
asm scalb() and scalbn() in 1996.  NetBSD fixed it in scalb(), scalbn()
and scalbnf() in 1999 but missed fixing it in scalbf().  Then in 2005
the bug was reimplemented in FreeBSD by importing NetBSD's scalbf().

The generic versions have slightly different error handling:
- the asm versions blindly round the second parameter to a (floating
  point) integer and proceed, while the generic versions return NaN
  if this rounding changes the value.  POSIX permits both behaviours
  (these functions are XSI extensions and the behaviour for a bogus
  non-integral second parameter is unspecified).   Apart from this
  and the bug in scalbf(), the behaviour of the generic versions seems
  to be identical.  (I only exhusatively tested
  generic_scalbf(1.0F, anyfloat) == asm_scalb(1.0F, anyfloat).  This
  covers many representative corner cases involving NaNs and Infs but
  doesn't test exception flags.  The brokenness of scalbf() showed up
  as weird behaviour after testing just 7 integer cases sequentially.)
2006-07-05 20:06:42 +00:00
Bruce Evans
8eca9455de Backed out rev.1.10. It tried to implement ldexpf() as a weak reference
to scalbf(), but ldexpf() cannot be implemented in that way since the
types of the second parameter differ.  ldexpf() can be implemented as
a weak or strong reference to scalbnf() (*) but that was already done
long before rev.1.10 was committed.  The old implementation uses a
reference, so rev.1.10 had no effect on applications.  The C files for
the scalb() family are not used for amd64 or i386, so rev.1.10 had even
less effect for these arches.

(*) scalbnf() raises the radix to the given exponent, while ldexpf()
raises 2 to the given exponent.  Thus the functions are equivalent
except possibly for their error handling iff the radix is 2.  Standards
more or less require identical error handling.  Under FreeBSD, the
functions are equivalent except for more details being missing in
scalbnf()'s man page.
2006-07-05 02:16:29 +00:00
Jason Evans
5355c74026 Use some math tricks in arena_run_reg_dalloc() to avoid actual division, as
well as avoiding a switch statement.  This change has no significant impact
to performance when branch prediction is successful at predicting the sizes
of objects passed to free(), but in the case that the object sizes are
semi-random, this change has the potential to prevent many branch prediction
misses, thus improving performance substantially.

Take advantage of alignment guarantees in ipalloc(), and pad object sizes to
something less than a power of two when possible.  This has the potential
to substantially reduce internal fragmentation for objects allocated via
posix_memalign().

Avoid an unnecessary pow2_ceil() call in arena_ralloc().

Submitted by:	djam8193ah@hotmail.com
2006-07-01 16:51:10 +00:00
Jason Evans
00d8242c2b Make the behavior of malloc(0) standards-compliant by getting rid of nil,
and instead creating a small allocation for each malloc(0) call.  The
optional SysV compatibility behavior remains unchanged.

Add a couple of assertions.

Fix a couple of typos in error message strings.
2006-06-30 20:54:15 +00:00
Giorgos Keramidas
1d3a1c8bce twalk() expects an `action' function not a comparison function.
The text is correct in the "DESCRIPTION" section, so fix "SYNOPSIS"
to use the correct name.

PR:		docs/90498
Submitted by:	Vasil Dimov
MFC after:	3 days
2006-06-23 13:36:33 +00:00
Brian Somers
25b5a928f7 Remove some unused variables 2006-06-23 01:42:03 +00:00
Konstantin Belousov
455dd7d4c7 Make the mincore(2) return ENOMEM when requested range is not fully mapped.
Requested by:	Bruno Haible <bruno at clisp org>
Reviewed by:	alc
Approved by:	pjd (mentor)
MFC after:	1 month
2006-06-21 12:59:05 +00:00
Jason Evans
0fc8aff0c4 Add a missing case for the switch statement in arena_run_reg_dalloc(). [1]
Fix a leak in chunk_dealloc(). [2]

Reported by:	[1] djam8193ah@hotmail.com,
		[2] Ville-Pertti Keinonen <will@exomi.com>
2006-06-20 20:38:25 +00:00
David E. O'Brien
b3f1b4a2c7 Update for the 'file' 4.17 import. 2006-06-19 08:10:23 +00:00
Maxim Konovalov
613c94ac78 o Typo: ownship -> ownership.
Obtained from:	DragonFlyBSD
2006-06-17 07:25:58 +00:00
Maxim Konovalov
f0a3522b5d o Make grep ^strlcpy work: put a return value type on separate line. 2006-06-15 15:56:55 +00:00
Maxim Konovalov
05922cdfcc o Sort .Xrs. 2006-06-13 12:49:14 +00:00
Poul-Henning Kamp
dfe969585d Add xref to statfs(2) 2006-06-13 12:23:22 +00:00
Dag-Erling Smørgrav
9aa2cb8613 Respect FETCH_BIND_ADDRESS when opening the data connection.
PR:		misc/98872
2006-06-13 10:21:03 +00:00
Dag-Erling Smørgrav
c23fb8a4d3 Fix a bug introduced in rev 1.92, where, when changing from one directory
to another, the first CWD after a string of CDUPs would incorrectly include
a slash before the directory name.

Reported by:	obrien
PR:		bin/83278
2006-06-13 10:19:59 +00:00
Shunsuke Akiyama
b3c87f5c78 Specify default path for SHLIBDIR before bsd.own.mk does.
This fix shared library installed correct place.
2006-06-11 09:14:06 +00:00
Xin LI
db31b8ae3c Don't build IPv6 support if we have choosen not to have it. 2006-06-09 18:11:29 +00:00
Maxim Konovalov
0295184c7e o Remove a cruft prevented libpthread sigaction(2) wrapper to
do its work for SIGINFO.  Always install libpthread signal handler
wrapper for SIGINFO even if user SIG_IGN's or SIG_DFL's it.

SIGINFO has a special meaning for libpthread: when LIBPTHREAD_DEBUG
enviroment variable defined it is used for dumping an information
about threads to /tmp/.

Reported by:	mi
Reviewed by:	deischen
MFC after:	2 weeks
2006-06-09 14:23:40 +00:00
Maksim Yevmenkin
84ab930628 Fix an unwanted gcc4 warning.
Submitted by:	delphij
MFC after:	3 days
2006-06-06 16:58:19 +00:00
Xin LI
1cec70ad72 - ANSIfy.
- Remove two unnecessary casts.

These changes would help gcc4 compile.
2006-06-05 18:22:13 +00:00
Konstantin Belousov
3d5fa0356e Replace absolute addressing in the call instructions with position-independend
calls. This eliminates TEXTREL from libc, making its text segment relocatable.

PR:	i386/85242
Approved by:	kan (mentor)
MFC after:	1 month
2006-06-05 14:59:33 +00:00
Robert Watson
e3901dc97d Add audit_submit.3 to the set of man pages built and installed with
libbsm.  This interface is new as of OpenBSM 1.0 alpha 6.

Submitted by:	csjp
Obtained from:	TrustedBSD Project
2006-06-05 12:53:44 +00:00
Xin LI
60555db2e2 Include strings.h for bzero() 2006-06-05 08:51:14 +00:00
David Xu
7fabe0b5cc Remove unused member. 2006-06-03 00:19:40 +00:00
David Xu
b971a73040 Remove unused member field m_queue. 2006-06-02 08:37:01 +00:00
Maxim Konovalov
d230fe5161 o Record a file offset for a last successfully parsed group file line.
If the initial buffer size (1KB) for the given group line is not big
enough, reset the offset.  It helps to do not miss this line when
getrg() reallocates the larger buffer and tries to parse the line again.

PR:		bin/52433, kern/55031, bin/83696, misc/97640, misc/98111
Submitted by:	bsw71@mail.ru, Philip M. Gollucci, Justin Erenkrantz
Glanced at:	nectar
MFC after:	1 month
2006-06-01 15:45:06 +00:00
Maxim Konovalov
332a76f71b o Document the fact truncate(2) has no effect for !VDIR or !VREG files.
Submitted by:	ceri
2006-06-01 14:20:43 +00:00
Xin LI
631574e7dc Explicitly request pre-zeroed memory instead of memset'ing our
own.

Ok'ed by:	davidxu
2006-05-31 00:31:38 +00:00
Ruslan Ermilov
84c929db19 Fix the output.
Noticed by:	rodrigc
2006-05-27 09:04:43 +00:00
Xin LI
aa5c5263bc - Add include for libutil.h and string.h for prototype.
- Cast the rvalue to be compared with the result of
   strlen() to size_t.
2006-05-25 04:01:04 +00:00
Warner Losh
6e66cb3b79 GC old a.out and K&R support. 2006-05-23 02:52:14 +00:00
Marius Strobl
bb4e1f9101 GC these crt{begin,end}.c, which are unused since the last FreeBSD platform
switched to those created from GCC's crtstuff.c 4 years ago.
2006-05-22 19:30:02 +00:00
Andrey A. Chernov
4151a8cb14 Reflect int -> size_t changes in glob.h 2006-05-22 06:53:35 +00:00
Andrey A. Chernov
4b767fa67f Reflect size_t changes in glob.h
Obtained from: NetBSD (mostly)
2006-05-22 06:33:19 +00:00
Andrey A. Chernov
55cd304ad1 Remove pending actions asked in comments for SHLIB_MAJOR bump, done.
Reviewed by:    ume
2006-05-22 05:12:44 +00:00
Andrey A. Chernov
ba87bfdcd4 Remove the kludge, as asked in the Makefile:
# If you bump SHLIB_MAJOR, remove the kluge from gen/gethostname.c.

Reviewed by:    ume
2006-05-22 05:04:53 +00:00
Hajimu UMEMOTO
794063c03f Bump library majro version for gethostbyaddr(3). 2006-05-21 15:15:21 +00:00
Hajimu UMEMOTO
473c8b2ecf Nuke some compatibility crufts of resolver for 6.X and earlier.
X-MFC after:	never
2006-05-21 11:29:26 +00:00
Hajimu UMEMOTO
1bdf356bd3 Fix gethostbyaddr() prototype to conform to IEEE Std 1003.1 on 64 bit
arch.

X-MFC after:	never
2006-05-21 11:27:28 +00:00
Hajimu UMEMOTO
734aa10414 Return EAI_OVERFLOW instead of EAI_MEMORY when the supplied buffer is
too short.  This conforms to RFC3493, POSIX and XPG6.

Obtained from:	NetBSD
2006-05-21 11:22:31 +00:00
Hajimu UMEMOTO
d808369aa1 Upgrade res_update(3) and the friends to BIND9's one excluding TSIG
support.

X-MFC after:	never
2006-05-21 11:19:36 +00:00
Hajimu UMEMOTO
f62c4786e1 Vendor import of BIND 9.3.2 2006-05-21 11:10:07 +00:00
Hajimu UMEMOTO
135a67244d This commit was generated by cvs2svn to compensate for changes in r158782,
which included commits to RCS files with non-trunk default branches.
2006-05-21 11:10:07 +00:00
Craig Rodrigues
e6d1e46944 Remove reference to "System call restart" in intro(2). intro(2) does not
have such a reference.  Add a reference instead to SA_RESTART in
sigaction(2).
2006-05-20 21:49:03 +00:00
Maxim Konovalov
3953c11715 o .Xr strtonum(3).
MFC after:	1 week
2006-05-20 21:11:35 +00:00
Jung-uk Kim
1761ec1040 Correct decoding a string containing '/'.
PR:		97485
Submitted by:	Mikko Tyolajarvi < mbsd at pacbell dot net >
2006-05-19 19:06:38 +00:00
David Xu
ef39743bc3 Fix return value. 2006-05-17 05:14:45 +00:00
David Xu
2ed66c9390 get thread signal info. 2006-05-17 05:12:42 +00:00
David Xu
0eb14dbdd6 Export offsets of thread signal pending set and signal mask for debugger. 2006-05-17 04:59:59 +00:00
Giorgos Keramidas
79652c510a * Document the fact that non-superusers cannot change file flags for
objects with SF_IMMUTABLE, SF_APPEND, or SF_NOUNLINK.
* Document that non-superusers cannot set or clear any SF_* flag
  (setting fails with EPERM, clearing is silently ignored).
* Document that superusers cannot change any flag if one of
  SF_IMMUTABLE, SF_APPEND, SF_NOUNLINK is set and securelevel is
  greater than 0.
* Document SF_SNAPSHOT and note that it is maintained by the
  system and is, for this reason, impossible to set to clear by
  any user.

PR:             docs/33877
Submitted by:   harti
Help by:        George Marsellis <gam9478@njit.edu>
MFC after:      1 week
2006-05-16 20:24:41 +00:00
Dag-Erling Smørgrav
9fd9594daf Add a manual dependency on ssh_namespace.h.
Discussed with:	ru
2006-05-13 21:38:16 +00:00
Dag-Erling Smørgrav
ed22e27d8a Introduce a namespace munging hack inspired by NetBSD to avoid polluting
the namespace of applications which inadvertantly link in libssh (usually
through pam_ssh)

Suggested by:	lukem@netbsd.org
MFC after:	6 weeks
2006-05-13 13:47:45 +00:00
Hajimu UMEMOTO
3da59cd007 Fix gethostbyaddr() prototype to conform to IEEE Std 1003.1:
http://www.opengroup.org/onlinepubs/009695399/functions/gethostbyaddr.html

gethostbyaddr_r() is changed as well.
It breaks ABI backward compatibility on 64 bit arch.  So, we fix it
on 32 bit arch only for now.

Reported by:	Rostislav Krasny <rosti.bsd@gmail.com>
2006-05-12 15:37:23 +00:00
David Xu
3a31b448c0 Save errno before calling pthread_mutex_lock because pthread_mutex_lock
may change errno unexpectly.
2006-05-11 09:10:33 +00:00
David Xu
e92b415c5a Add symbol versions: FBSD_1.0 and FBSDprivate. 2006-05-11 07:02:52 +00:00
Jason Evans
3212b810d8 Increase the minimum chunk size by a power of two (32kB --> 64kB, assuming
4kB pages), in order to avoid dangerous rounding error when calculating
fullness limits during run promotion/demotion.

Convert a structure bitfield to a normal field in areana_run_t.  This should
have been changed along with the other fields in revision 1.120.
2006-05-10 00:07:45 +00:00
David Xu
7649f45c3e In order to let new binutils can compile it, replace movl with
movw for segment saving and restoring.

Submitted by: Diego 'Flameeyes' Petteno flameeyes at gentoo dot org
2006-05-07 08:19:04 +00:00
Brian S. Dean
de76bc3609 A few minor wording changes and a clarification about error conditions. 2006-05-03 17:33:29 +00:00
Hajimu UMEMOTO
b947683ce1 Fix alignment problem on AMD64.
Reported by:	Pascal Hofstee <caelian__at__gmail.com>
Submitted by:	Michael Bushkov <bushman__at__rsu.ru>
Tested by:	Pascal Hofstee <caelian__at__gmail.com>
2006-05-02 23:02:32 +00:00
Tim Kientzle
d3b6573b00 Simplify some of the wide-character handling, inspired
in part by OpenBSD's not-quite-standard-compliant
standard libraries.  (No loss of functionality,
just minor recoding to not rely on certain "standard"
facilities that weren't actually needed.)
2006-05-01 01:02:19 +00:00
Tim Kientzle
673ec5a652 Whitespace cleanup. 2006-05-01 00:55:44 +00:00
Hajimu UMEMOTO
eb59e992e1 cache' couldn't co-exist with compat'.
Submitted by:	"Michael Bushkov" <bushman__at__rsu.ru>
2006-04-30 21:25:00 +00:00
Joe Marcus Clarke
a7a6dfbd14 Go with a different version of the previous patch so to preserve errno.
Approved by:	scottl (implicit)
2006-04-30 07:08:43 +00:00
Joe Marcus Clarke
8bc181f506 Fix a file descriptor leak in cam_lookup_pass() when the ioctl to find
the passthru device fails.

Approved by:	scottl
MFC after:	1 day
2006-04-30 07:02:40 +00:00
Hajimu UMEMOTO
06a99fe36f - Extend the nsswitch to support Services, Protocols and Rpc
databases.
- Make nsswitch support caching.

Submitted by:	Michael Bushkov <bushman__at__rsu.ru>
Sponsored by:	Google Summer of Code 2005
2006-04-28 12:03:38 +00:00
David Xu
0a5fa45560 s/long/int. 2006-04-27 08:25:13 +00:00
David Xu
245116cafc - Use same priority range returned by kernel's sched_get_priority_min()
and sched_get_priority_max() syscalls.
- Remove unused fields from structure pthread_attr.
2006-04-27 08:18:23 +00:00
Jason Evans
f7768b9f34 Change the semantics of brk_max to dynamically deal with data segment
bounds. [1]

Modify logic for utilizing the data segment, such that it is possible to
create huge allocations there.

Shrink the data segment when deallocating a chunk, if it is at the end of
the data segment.

Rename chunk_size to csize in huge_malloc(), in order to avoid masking a
static variable of the same name. [1]

Reported by:	Paul Allen <nospam@ugcs.caltech.edu>
2006-04-27 01:03:00 +00:00
Maxim Konovalov
66802e2cc7 o Add IDs for Plan9, QNX4.X, Mac OS-X, Linux exteneded partitions.
PR:		bin/96326
Submitted by:	Alex Kozlov
MFC after:	2 weeks
2006-04-25 20:42:15 +00:00
David Malone
89ddbd45e5 Add some new options to mac_bsdestended. We can now match on:
subject: ranges of uid, ranges of gid, jail id
	objects: ranges of uid, ranges of gid, filesystem,
		object is suid, object is sgid, object matches subject uid/gid
		object type

We can also negate individual conditions. The ruleset language is
a superset of the previous language, so old rules should continue
to work.

These changes require a change to the API between libugidfw and the
mac_bsdextended module. Add a version number, so we can tell if
we're running mismatched versions.

Update man pages to reflect changes, add extra test cases to
test_ugidfw.c and add a shell script that checks that the the
module seems to do what we expect.

Suggestions from: rwatson, trhodes
Reviewed by: trhodes
MFC after: 2 months
2006-04-23 17:06:18 +00:00
David Xu
d96413eaa4 Remove multiple _get_curthread() calls. 2006-04-23 11:23:37 +00:00
Daniel Eischen
babd660805 Oops, correct the weak reference (s/fclose/fcloseall).
Spotted by:	Antoine Brodin (antoine _dot_ brodin _at_ laposte _dot_ net)
2006-04-22 16:47:59 +00:00
Daniel Eischen
ca7f278f1d Now that libc has fcloseall(), remove _cleanup() from the list
of FreeBSD private symbols.
2006-04-22 15:11:33 +00:00
Daniel Eischen
b62c955c52 Add fcloseall() to libc. This removes the need to export _cleanup().
Linux also provides an fcloseall() implementation.

Discussed on:	arch
2006-04-22 15:09:15 +00:00
Tom Rhodes
38467e931c Update for rev 1.205 of vm_mmap.c.
Submitted by:	fanf
2006-04-21 07:22:55 +00:00
Peter Wemm
e9ca6fe47e Teach libkvm how to read minidumps. It turns out that minidumps are
far more convenient for libkvm to work with because of the page table
block at the beginning.  As a result, the MD code is smaller.

libkvm will automatically detect old vs mini dumps on i386 and amd64.

libkvm will handle i386 PAE and non-PAE modes.  There is a PAE flag in
the i386 minidump header to signal the width of the entries in the
page table block.

Other convenient values are also present, such as kernbase and the direct
map addresses on amd64.
2006-04-21 04:32:51 +00:00
Christian Brueffer
b208d15b48 Document how the backoff delay is calculated.
Submitted by:	markus
MFC after:	3 days
2006-04-19 17:46:27 +00:00
Ceri Davies
c499f23b6e Correct usage example.
PR:		docs/95059
Submitted by:	Jos Backus
MFC after:	4 days
2006-04-18 21:37:24 +00:00
Maxim Konovalov
9b63b79ee0 o dbm_close(3) returns void not zero or anything else. Touch .Dd.
PR:		docs/80070
Submitted by:	Aleksej Saushev
MFC after:	2 weeks
2006-04-16 16:33:26 +00:00
Marius Strobl
f2189783c9 For _Qp_{fge,fgt,fle,flt}() the SCD states that "Exceptions mimic fcmpeq",
this means they should set the cmpe flag when calling __fpu_compare().

Submitted by:	stefanf
MFC after:	2 weeks
2006-04-16 14:32:53 +00:00
Hajimu UMEMOTO
d3ac2b30d4 - make reentrant version of netdb functions glibc style API, and
expose them to outside of libc.
- make netdb functions NSS friendly.

Reviewed by:	arch@ and current@ (no objection)
2006-04-15 16:20:27 +00:00
Daniel Eischen
797f4fb875 Don't export __gdtoa. The only known ports that rely on
this or the deprecated POSIX functions {e,g,f}cvt() have
newer versions that do not (rely on them).

Requested by:	marius
2006-04-15 15:35:20 +00:00
Maxim Konovalov
6ad8b89261 o Document SO_NOSIGPIPE, touch .Dd.
PR:		docs/78479
Submitted by:	Mikko Tyolajarvi
MFC after:	2 weeks
2006-04-15 13:37:35 +00:00
Ruslan Ermilov
1427d59bee List pwritev in the NAME section. 2006-04-14 19:34:07 +00:00
Jens Schweikhardt
e4b2624f46 s/soley/solely 2006-04-13 18:19:44 +00:00
Ruslan Ermilov
00a99575e3 Apply style.Makefile(5) here. 2006-04-13 08:12:31 +00:00
Ruslan Ermilov
0d9df638c7 Install the shared library under /usr/lib; it's not used by anything
in /bin or /sbin.

Not objected to by:	phk
2006-04-13 08:08:21 +00:00
Ruslan Ermilov
8f01da43bd Place shared libpcap library under /lib, currently needed by
/sbin/ipf and /sbin/pflogd.

OK'ed by:	mlaier
2006-04-13 07:25:02 +00:00
Xin LI
34562de4d5 Unexpand TAILQ_FIRST(foo) == NULL to TAILQ_EMPTY.
Ok'ed by:	davidxu
2006-04-13 03:09:34 +00:00
Ruslan Ermilov
320008a3d7 Fix a symlink. 2006-04-12 19:51:14 +00:00
Ruslan Ermilov
84e709f1f1 Install shared libpthread library into /lib; needed by some
/sbin programs.
2006-04-12 19:42:20 +00:00
John-Mark Gurney
4d5e876be3 use pwrite to always write at the begining of the file.. If multiple calls
to pidfile_write happen, the pidfile will have nul characters prepended
due to the cached file descriptor offset...

Reviewed by:	scottl
MFC after:	3 days
2006-04-11 23:10:02 +00:00
Marius Strobl
ea84e2b899 - Move _Qp_* and __dtoul from FBSDprivate to the list of FBSD_1.0 symbols
as well as add __sparc_utrap_install to FBSD_1.0; these are required by
  the SCD libc 64 psABI and thus meant to be officially exported symbols.
- Remove the __fpu_* entries as well as the __sigtramp entry altogether as
  these are internal to the libc FPU emulation and the signal trampoline
  initialization in sigaction(2) respectively and thus don't need to be
  externally visible.
- Add __sparc_utrap_setup to the list of FBSDprivate symbols as it's used
  in src/lib/csu/sparc64/crt1.c to initialize the libc FPU emulation (I
  think alternatively src/lib/csu/sparc64/crt1.c could be changed to use
  __sparc_utrap_install instead, at the expense of increasing the size of
  executables a bit).
- Add an entry for the vfork symbol to the FBSD_1 list and entries for it's
  associated symbols generated by the RSYSCALL() macro to the FBSDprivate
  list. There's some magic in place that automatically generates code for
  vfork() if there's no explicit MD code for it so it might make sense to
  move these symbols from the MD symbol map files to a MI one.

The last two changes make the libc symbol versioning useable on sparc64.

Ok'ed by:	deischen
2006-04-11 19:43:36 +00:00
Christian Brueffer
ba1cb6f3ea Document that VIS_CSTYLE encodes space (040) as '\s'.
PR:		95546
Submitted by:	Jan Schaumann <jschauma@netmeister.org>
MFC after:	3 days
2006-04-09 16:39:43 +00:00
Hajimu UMEMOTO
f76963aba1 Don't test if RES_INIT is set to see res_state structure is
initialized.  Some application may reset RES_INIT.  Use the
way in __res_vinit(), instead.
2006-04-08 18:19:35 +00:00
David Xu
a97944597b Do not check validity of timeout if a mutex can be acquired immediately.
Completly drop recursive mutex in pthread_cond_wait and restore recursive
after resumption. Reorganize code to make gcc to generate better code.
2006-04-08 13:24:44 +00:00
Jason Evans
f90cbdf17f Add an unreachable return statement, in order to avoid a compiler warning
for non-standard optimization levels.

Reported by:	Michael Zach <zach@webges.com>
2006-04-05 18:46:24 +00:00
Jason Evans
50ff9670e2 Only initialize the first per-chunk page map element for free runs. This
makes run split/coalesce operations of complexity lg(n) rather than n.
2006-04-05 04:15:12 +00:00
Jason Evans
94fc7dc0d5 Add malloc_usable_size() to the RETURN VALUES section. 2006-04-04 20:27:53 +00:00
Jason Evans
cf01f0d7c5 Add init_lock, and use it to protect against allocator initialization
races.  This isn't currently necessary for libpthread or libthr, but
without it external threads libraries like the linuxthreads port are
not safe to use.

Reported by:	ganbold@micom.mng.net
2006-04-04 19:46:28 +00:00
Jason Evans
1c6d5bde6c Refactor per-run bitmap manipulation functions so that bitmap offsets only
have to be calculated once per allocator operation.

Make nil const.

Update various comments.

Remove/avoid division where possible.

For the one division operation that remains in the critical path, add a
switch statement that has a case for each small size class, and do division
with a constant divisor in each case.  This allows the compiler to generate
optimized code that does not use hardware division [1].

Obtained from:	peter [1]
2006-04-04 03:51:47 +00:00
David Xu
b7e118b1e0 Remove declaration of _thr_initial from MD header file, it is no longer
needed.
2006-04-04 03:35:26 +00:00
David Xu
7bd761788d Simplify _get_curthread() and _tcb_ctor because libc and rtld now
already allocate thread pointer space in tls block for initial thread.
Only i386 and amd64 have been done, others still have to be tested.
2006-04-04 03:26:06 +00:00
David Xu
37a6356bbe WARNS level 4 cleanup. 2006-04-04 02:57:49 +00:00
Poul-Henning Kamp
75239a017f Add missing #if's for NO_FLOATING_POINT 2006-04-01 19:06:54 +00:00
Hajimu UMEMOTO
3c3c80e4c8 fix indent. 2006-04-01 15:53:39 +00:00
Daniel Eischen
9fe1984e64 Add __gdtoa to the list of FreeBSD private symbols. Unfortunately,
this is used by some 3rd party applications when {e,f,g}cvt() are
not found.  POSIX defines the xcvt() funtions but says they are
deprecated in favor or sprintf().  We'll import these functions
from OpenBSD and remove __gdtoa() from the exported interfaces
when libc version is bumped.
2006-04-01 02:56:09 +00:00
Jason Evans
cd70100e5d Optimize runtime performance, primary using the following techniques:
* Avoid choosing an arena until it's certain that an arena is needed
    for allocation.

  * Convert division/multiplication to bitshifting where possible.

  * Avoid accessing TLS variables in single-threaded code.

  * Reduce the amount of pointer dereferencing.

  * Move lock acquisition in critical paths to only protect the the code
    that requires synchronization, and completely remove locking where
    possible.
2006-03-30 20:25:52 +00:00
Hajimu UMEMOTO
eb27a220f8 Expose res_update and friends again. At least, ports/mail/spamilter
uses them.
Now, we have res_nupdate and res_nmkupdate as well, but they are
still based on our old resolver for binary backward compatibility.
So, they don't provide new features such as TSIG support.

Reported by:	pointyhat via kris
2006-03-30 20:15:53 +00:00
Tom Rhodes
639dab2286 Fix a bug where, for 6-byte sequences, the top 6 bits get compared to
111111 rather than the top 7 bits being compared against 1111110 causing
illegal bytes fe and ff being treated the same as legal bytes fc and fd.
2006-03-30 09:04:12 +00:00
Daniel Eischen
4c6aab055d Add __collate_load_error and __collate_range_cmp to the list of
FBSDprivate locale symbols.  These functions are needed by
libcompat.

Add _cleanup to the list of stdio FBSDprivate symbols.  Some
third party applications use this.  This will be removed and
replaced by fcloseall() once libc version is bumped.

Add _res to the list of resolv symbols.

Found by:	portbuilder runs (thanks Kris!)
2006-03-30 04:37:08 +00:00
Daniel Eischen
029c3cdf55 Add symbol versioning.
Reviewed by:	davidxu
2006-03-29 14:08:45 +00:00
Dag-Erling Smørgrav
1e5e6f25c5 Bring libpthread up to WARNS level 2.
Reviewed by:	deischen
2006-03-29 05:38:19 +00:00
Daniel Eischen
d688b9ce23 Account for recent changes in namespace.h. Use _pthread_create
instead of pthread_create.
2006-03-29 04:20:53 +00:00
Jason Evans
6b2c15da6a Add malloc_usable_size(3).
Discussed with:		arch@
2006-03-28 22:16:04 +00:00
Dag-Erling Smørgrav
adb19548bd Fix prototype mismatch and use of un-namespaced pthread functions. 2006-03-28 21:50:12 +00:00
Dag-Erling Smørgrav
552585665b Fix prototype mismatch. 2006-03-28 21:46:55 +00:00
Daniel Eischen
2445cd7c11 Use the correct type for and argument. Recent changes to namespace.h
exposed this bug.

Reported by:	kris
2006-03-28 21:07:59 +00:00
Dag-Erling Smørgrav
a0da77c91d Add semaphore functions, and remove some dupes from the #if 0 section. 2006-03-28 18:48:49 +00:00
Dag-Erling Smørgrav
23a8b7859b Add a bunch of missing pthread functions, and move out-of-order functions. 2006-03-28 16:41:06 +00:00
Hajimu UMEMOTO
1259a17acd If the query choked with EDNS0, retry without EDNS0.
Obtained from:	res_nquery() of BIND9.
2006-03-28 07:42:57 +00:00
David Xu
c0d2338cdd Allocate space for thread pointer, this allows thread library to access
its pointer from begin, and simplifies _get_curthread() in libthr.
2006-03-28 06:09:24 +00:00