diff options
author | Roland McGrath <roland@gnu.org> | 1996-01-31 10:00:24 +0000 |
---|---|---|
committer | Roland McGrath <roland@gnu.org> | 1996-01-31 10:00:24 +0000 |
commit | 01cdeca0c96838a92d9f810f9c4ae59e8129db2a (patch) | |
tree | c8f0ffd011deb496646771bf8fdf084e2c7281fb /hurd | |
parent | Mon Jan 29 21:53:40 1996 Roland McGrath <roland@churchy.gnu.ai.mit.edu> (diff) | |
download | glibc-01cdeca0c96838a92d9f810f9c4ae59e8129db2a.tar.gz glibc-01cdeca0c96838a92d9f810f9c4ae59e8129db2a.tar.bz2 glibc-01cdeca0c96838a92d9f810f9c4ae59e8129db2a.zip |
Tue Jan 30 13:32:05 1996 Roland McGrath <roland@churchy.gnu.ai.mit.edu>cvs/libc-960131
* dirent/scandir.c: Allocate dirents with correct size for name, and
copy with correct size.
* hurd/hurdinit.c [! PIC] (map0): New function, on _hurd_preinit_hook.
* stdio-common/vfscanf.c (TYPEMOD): New macro of all type modifier
flag bits.
(__vfscanf): Fix checking of extra type modifiers.
* time/asia, time/australasia, time/backward: Updated from ADO 96b.
Tue Jan 30 12:17:26 1996 Ulrich Drepper <drepper@ipd.info.uni-karlsruhe.de>
* stdlib/strtod.c: Only negate exponent when there really is one.
* stdio-common/vfscanf.c: Accept type modifiers on %n.
Fix FP number parsing.
Diffstat (limited to 'hurd')
-rw-r--r-- | hurd/hurdinit.c | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/hurd/hurdinit.c b/hurd/hurdinit.c index bed78b8321..e7558c3ef7 100644 --- a/hurd/hurdinit.c +++ b/hurd/hurdinit.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1992, 1993, 1994, 1995 Free Software Foundation, Inc. +/* Copyright (C) 1992, 1993, 1994, 1995, 1996 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -197,3 +197,27 @@ _hurd_setproc (process_t procserver) return 0; } + +#ifndef PIC + +/* Map the page at address zero with no access allowed, so + dereferencing NULL will fault and no "anywhere" allocations + (e.g. the out of line memory containing the argument strings) + can be assigned address zero, which C says is not a valid pointer. + + When dynamically linked, this will be done by the dynamic linker + before we run. */ + +static void map0 (void) __attribute__ ((unused)); +text_set_element (_hurd_preinit_hook, map0); + +static void +map0 (void) +{ + vm_address_t addr = 0; + __vm_map (__mach_task_self (), + &addr, __vm_page_size, 0, 0, MACH_PORT_NULL, 0, 1, + VM_PROT_NONE, VM_PROT_NONE, VM_INHERIT_COPY); +} + +#endif |