freebsd-dev/lib/libc
Marcel Moolenaar fd7707aa50 Do not adjust to the pagesize at runtime. Besides for the one-time
initialization overhead, there's a problem in that we never call
imalloc() and thus malloc_init() for zero-sized allocations. As a
result, malloc(0) returns NULL when it's the first or only malloc in
the program. Any non-zero allocation will initialize the malloc code
with the side-effect that subsequent zero-sized allocations return a
non-NULL pointer. This is because the pointer we return for zero-
sized allocations is calculated from malloc_pageshift, which needs
to be initialized at runtime on ia64.

The result of the inconsistent behaviour described above is that
configure scripts failed the test for a GNU compatible malloc. This
resulted in a lot of broken ports.

Other, even simpler, solutions were possible as well:
1.  initialize malloc_pageshift with some non-zero value (say 13 for
    8KB pages) and keep the runtime adjustment.
2.  Stop using malloc_pageshift to calculate ZEROSIZEPTR.

Removal of the runtime adjustment was chosen because then ia64 is the
same as any other platform. It is not to say that using a page size
obtained at runtime is bad per se. It's that there's currently a high
level of gratuity for its existence and the moment it causes problems
is the moment you need to get rid of it. Hence, it's not unthinkable
that this commit is (partially) reverted some time in the future when
we do have a good reason for it and a good way to achieve it.

Approved by: re@ (rwatson)
Reported by: kris (portmgr@) -- may the ports be with you
2003-11-28 18:03:22 +00:00
..
alpha - Use the magic for ___sigreturn in __sigset. 2003-11-14 03:21:22 +00:00
amd64 Add implementations of amd64_[gs]et_[fg]sbase(). 2003-10-23 06:07:09 +00:00
compat-43 mdoc(7): Use the new feature of the .In macro. 2003-09-08 19:57:22 +00:00
db mdoc(7): Use the new feature of the .In macro. 2003-09-08 19:57:22 +00:00
gdtoa Userland spinlocks bad. Sleep locks good. 2003-06-21 08:20:14 +00:00
gen Fix problem where initgroups would silently truncate groups with 2003-11-19 15:51:26 +00:00
gmon Use C99 compatible ASM statements. 2003-06-02 02:32:22 +00:00
i386 mdoc(7): Use the new feature of the .In macro. 2003-09-08 19:57:22 +00:00
ia64 Virtual addresses in headers of ELF files for dynamic objects need 2003-11-08 05:29:49 +00:00
include Remove #include of spinlock.h from libc_private.h. Declare spinlocks as 2003-11-05 18:17:30 +00:00
locale Update cross references after utf2/euc move. 2003-11-15 02:26:04 +00:00
net Add the userland part of the NET_RT_IFMALIST sysctl MIB. A new function, 2003-11-14 18:53:22 +00:00
nls Remove incomplete support for running FreeBSD userland on old NetBSD kernels 2003-10-29 10:45:01 +00:00
posix1e Staticize label_default_head to prevent it from leaking out of mac.c. 2003-11-17 19:48:35 +00:00
powerpc Add the mlockall() and munlockall() system calls. 2003-08-11 07:14:08 +00:00
quad libc_r wasn't so tied to libc for 22 months. 2002-11-18 09:50:57 +00:00
regex mdoc(7): Use the new feature of the .In macro. 2003-09-08 19:57:22 +00:00
rpc Make this part identical with NetBSD: Use recvlen instead of inlen. 2003-10-29 09:25:07 +00:00
sparc64 Install the user trap handlers that libc provides from a constructor, so 2003-11-18 14:21:41 +00:00
stdio Use __sfvwrite() instead of __sputc() via __fputwc() to write to fake 2003-11-12 08:49:12 +00:00
stdlib Do not adjust to the pagesize at runtime. Besides for the one-time 2003-11-28 18:03:22 +00:00
stdtime Detect range errors when using the %s specifier. Previously, LONG_MAX 2003-11-17 04:19:15 +00:00
string Pass NULL instead of a pointer to a zeroed mbstate_t object. 2003-11-05 08:07:00 +00:00
sys Replace out of date struct statfs definition with a reference to statfs(2). 2003-11-21 01:30:28 +00:00
uuid Remove stale DCE 1.1 pointers to the IBM site. The URLs aren't valid 2003-08-08 19:18:43 +00:00
xdr Fix amd(8) clients, if a FreeBSD mountd(8) server is used. 2003-05-28 09:13:09 +00:00
yp Back out the `hiding' of strlcpy and strlcat. Several people 2003-05-01 19:03:14 +00:00
Makefile Baby steps. Set WARNS=1 for libc. 2003-11-17 04:20:02 +00:00