Commit Graph

5288 Commits

Author SHA1 Message Date
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
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
Marcel Moolenaar
ee35caa0b3 Whitespace fix. 2006-09-02 01:07:21 +00:00
Marcel Moolenaar
ce2dfbd199 Enable TLS on PowerPC. 2006-09-01 19:14:14 +00:00
Marcel Moolenaar
9d353fbc3f Fix style(9) in code copied from rtld. 2006-09-01 17:35:48 +00:00
Marcel Moolenaar
bc14049e96 Enable TLS on ia64. 2006-09-01 06:18:43 +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
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
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
2b46c64c9c Remove alpha left-overs. 2006-08-22 08:03:01 +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
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
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
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
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
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
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
33ef612ede Use a prototype for res_init().
MFC after:	3 days
2006-07-17 09:27:26 +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
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
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