about summary refs log tree commit diff
path: root/sysdeps
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2004-06-01 18:53:04 +0000
committerUlrich Drepper <drepper@redhat.com>2004-06-01 18:53:04 +0000
commitfbf86ddab2cd53c0a63173c1eb8b39c2b970fb8d (patch)
tree233df1d9ff53bdaa0453c2e3f5d8f5aea4f0f90b /sysdeps
parent016deb4c4fb9c52abe842bfc468af2ea38691dbc (diff)
downloadglibc-fbf86ddab2cd53c0a63173c1eb8b39c2b970fb8d.tar.gz
glibc-fbf86ddab2cd53c0a63173c1eb8b39c2b970fb8d.tar.xz
glibc-fbf86ddab2cd53c0a63173c1eb8b39c2b970fb8d.zip
Update.
2004-05-10  Jakub Jelinek  <jakub@redhat.com>

	* sysdeps/posix/sysconf.c (__sysconf) <cases _SC_REALTIME_SIGNALS,
	_SC_PRIORITY_SCHEDULING, _SC_TIMERS, _SC_ASYNCHRONOUS_IO,
	_SC_PRIORITIZED_IO, _SC_SYNCHRONIZED_IO, _SC_FSYNC, _SC_MAPPED_FILES,
	_SC_MEMLOCK, _SC_MEMLOCK_RANGE, _SC_MEMORY_PROTECTION,
	_SC_MESSAGE_PASSING, _SC_SEMAPHORES, _SC_SHARED_MEMORY_OBJECTS,
	_SC_THREADS, _SC_THREAD_SAFE_FUNCTIONS, _SC_THREAD_ATTR_STACKADDR,
	_SC_THREAD_ATTR_STACKSIZE, _SC_THREAD_PRIORITY_SCHEDULING,
	_SC_THREAD_PRIO_INHERIT, _SC_THREAD_PRIO_PROTECT,
	_SC_THREAD_PROCESS_SHARED>: Return _POSIX_* value instead of 1.
	* sysdeps/unix/sysv/linux/sysconf.c (__sysconf)
	<case _SC_MONOTONIC_CLOCK>: Return _POSIX_VERSION instead of 1.

2004-05-07  Jeroen Dekkers  <jeroen@dekkers.cx>

	* sysdeps/mach/hurd/i386/Makefile (CFLAGS-init-first.c): Add
	-momit-leaf-frame-pointer.

	* inet/test-ifaddrs.c (addr_string): Surround AF_PACKET case with
	#ifdef AF_PACKET.

	* sysdeps/mach/hurd/getcwd.c
	(_hurd_canonicalize_directory_name_intern): Only realloc when
	size is <= 0.

	* sysdeps/mach/hurd/mmap.c (__mmap): Fail when addr or offset
	isn't page aligned.

	* sysdeps/mach/hurd/spawni.c (EXPAND_DTABLE): Set dtablesize to
	new size.

	* sysdeps/mach/hurd/Versions (GLIBC_PRIVATE): Add __libc_read,
	__libc_write and __libc_lseek64.
Diffstat (limited to 'sysdeps')
-rw-r--r--sysdeps/mach/hurd/Versions3
-rw-r--r--sysdeps/mach/hurd/getcwd.c7
-rw-r--r--sysdeps/mach/hurd/i386/Makefile3
-rw-r--r--sysdeps/mach/hurd/mmap.c24
-rw-r--r--sysdeps/mach/hurd/spawni.c5
-rw-r--r--sysdeps/posix/sysconf.c44
-rw-r--r--sysdeps/unix/sysv/linux/sysconf.c2
7 files changed, 41 insertions, 47 deletions
diff --git a/sysdeps/mach/hurd/Versions b/sysdeps/mach/hurd/Versions
index dcaaae6146..89e19061af 100644
--- a/sysdeps/mach/hurd/Versions
+++ b/sysdeps/mach/hurd/Versions
@@ -4,6 +4,9 @@ libc {
     __getcwd; __mmap;
   }
   GLIBC_PRIVATE {
+    # Functions shared with the dynamic linker
+    __libc_read; __libc_write; __libc_lseek64;
+
     _dl_init_first;
   }
 }
diff --git a/sysdeps/mach/hurd/getcwd.c b/sysdeps/mach/hurd/getcwd.c
index 510290460c..7e07e6b404 100644
--- a/sysdeps/mach/hurd/getcwd.c
+++ b/sysdeps/mach/hurd/getcwd.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991,92,93,94,95,96,97,98,2002 Free Software Foundation, Inc.
+/* Copyright (C) 1991,92,93,94,95,96,97,98,2002,04 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
@@ -50,6 +50,7 @@ _hurd_canonicalize_directory_name_internal (file_t thisdir,
   file_t parent;
   char *dirbuf = NULL;
   unsigned int dirbufsize = 0;
+  const size_t orig_size = size;
 
   inline void cleanup (void)
     {
@@ -67,7 +68,7 @@ _hurd_canonicalize_directory_name_internal (file_t thisdir,
     }
 
 
-  if (size == 0)
+  if (size <= 0)
     {
       if (buf != NULL)
 	{
@@ -226,7 +227,7 @@ _hurd_canonicalize_directory_name_internal (file_t thisdir,
 
 	  if (file_namep - file_name < d->d_namlen + 1)
 	    {
-	      if (buf != NULL)
+	      if (orig_size > 0)
 		{
 		  errno = ERANGE;
 		  return NULL;
diff --git a/sysdeps/mach/hurd/i386/Makefile b/sysdeps/mach/hurd/i386/Makefile
index 56fcba8fb9..e7d3b44682 100644
--- a/sysdeps/mach/hurd/i386/Makefile
+++ b/sysdeps/mach/hurd/i386/Makefile
@@ -3,3 +3,6 @@ sysdep_routines += ioperm
 sysdep_headers += sys/io.h
 endif
 
+ifeq ($(subdir),csu)
+CFLAGS-init-first.c += -momit-leaf-frame-pointer
+endif
diff --git a/sysdeps/mach/hurd/mmap.c b/sysdeps/mach/hurd/mmap.c
index 85bde529b9..1d1460cead 100644
--- a/sysdeps/mach/hurd/mmap.c
+++ b/sysdeps/mach/hurd/mmap.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1994,1995,1996,1997,1999,2002,2003
+/* Copyright (C) 1994,1995,1996,1997,1999,2002,2003,2004
 	Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
@@ -39,10 +39,13 @@ __mmap (__ptr_t addr, size_t len, int prot, int flags, int fd, off_t offset)
   vm_prot_t vmprot;
   memory_object_t memobj;
   vm_address_t mapaddr;
-  vm_size_t pageoff;
 
   mapaddr = (vm_address_t) addr;
 
+  /* ADDR and OFFSET must be page-aligned.  */
+  if ((mapaddr & (vm_page_size - 1)) || (offset & (vm_page_size - 1)))
+    return (__ptr_t) (long int) __hurd_fail (EINVAL);
+
   if ((flags & (MAP_TYPE|MAP_INHERIT)) == MAP_ANON
       && prot == (PROT_READ|PROT_WRITE)) /* cf VM_PROT_DEFAULT */
     {
@@ -62,20 +65,6 @@ __mmap (__ptr_t addr, size_t len, int prot, int flags, int fd, off_t offset)
       return err ? (__ptr_t) (long int) __hurd_fail (err) : (__ptr_t) mapaddr;
     }
 
-  pageoff = offset & (vm_page_size - 1);
-  offset &= ~(vm_page_size - 1);
-
-  if (flags & MAP_FIXED)
-    {
-      /* A specific address is requested.  It need not be page-aligned;
-	 it just needs to be congruent with the object offset.  */
-      if ((mapaddr & (vm_page_size - 1)) != pageoff)
-	return (__ptr_t) (long int) __hurd_fail (EINVAL);
-      else
-	/* We will add back PAGEOFF after mapping.  */
-	mapaddr -= pageoff;
-    }
-
   vmprot = VM_PROT_NONE;
   if (prot & PROT_READ)
     vmprot |= VM_PROT_READ;
@@ -173,9 +162,6 @@ __mmap (__ptr_t addr, size_t len, int prot, int flags, int fd, off_t offset)
   if (err)
     return (__ptr_t) (long int) __hurd_fail (err);
 
-  /* Adjust the mapping address for the offset-within-page.  */
-  mapaddr += pageoff;
-
   return (__ptr_t) mapaddr;
 }
 
diff --git a/sysdeps/mach/hurd/spawni.c b/sysdeps/mach/hurd/spawni.c
index 73b4d3507c..244ca2d6e1 100644
--- a/sysdeps/mach/hurd/spawni.c
+++ b/sysdeps/mach/hurd/spawni.c
@@ -1,5 +1,5 @@
 /* spawn a new process running an executable.  Hurd version.
-   Copyright (C) 2001,02 Free Software Foundation, Inc.
+   Copyright (C) 2001,02,04 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
@@ -399,6 +399,7 @@ __spawni (pid_t *pid, const char *file,
 	      NEW_TABLE (dtable, newfd);				      \
 	      NEW_TABLE (ulink_dtable, newfd);				      \
 	      NEW_TABLE (dtable_cells, newfd);				      \
+	      dtablesize = newfd + 1;		       		       	      \
 	    }								      \
 	  ((unsigned int)newfd < dtablesize ? 0 : EMFILE);		      \
 	})
@@ -592,7 +593,7 @@ __spawni (pid_t *pid, const char *file,
 	    case ESTALE:
 	    case ENOTDIR:
 	      /* Those errors indicate the file is missing or not executable
-v		 by us, in which case we want to just try the next path
+		 by us, in which case we want to just try the next path
 		 directory.  */
 	      continue;
 
diff --git a/sysdeps/posix/sysconf.c b/sysdeps/posix/sysconf.c
index 66f978ba3b..d1286a06fe 100644
--- a/sysdeps/posix/sysconf.c
+++ b/sysdeps/posix/sysconf.c
@@ -97,98 +97,98 @@ __sysconf (name)
 
     case _SC_REALTIME_SIGNALS:
 #ifdef	_POSIX_REALTIME_SIGNALS
-      return 1;
+      return _POSIX_REALTIME_SIGNALS;
 #else
       return -1;
 #endif
 
     case _SC_PRIORITY_SCHEDULING:
 #ifdef	_POSIX_PRIORITY_SCHEDULING
-      return 1;
+      return _POSIX_PRIORITY_SCHEDULING;
 #else
       return -1;
 #endif
 
     case _SC_TIMERS:
 #ifdef	_POSIX_TIMERS
-      return 1;
+      return _POSIX_TIMERS;
 #else
       return -1;
 #endif
 
     case _SC_ASYNCHRONOUS_IO:
 #ifdef	_POSIX_ASYNCHRONOUS_IO
-      return 1;
+      return _POSIX_ASYNCHRONOUS_IO;
 #else
       return -1;
 #endif
 
     case _SC_PRIORITIZED_IO:
 #ifdef	_POSIX_PRIORITIZED_IO
-      return 1;
+      return _POSIX_PRIORITIZED_IO;
 #else
       return -1;
 #endif
 
     case _SC_SYNCHRONIZED_IO:
 #ifdef	_POSIX_SYNCHRONIZED_IO
-      return 1;
+      return _POSIX_SYNCHRONIZED_IO;
 #else
       return -1;
 #endif
 
     case _SC_FSYNC:
 #ifdef	_POSIX_FSYNC
-      return 1;
+      return _POSIX_FSYNC;
 #else
       return -1;
 #endif
 
     case _SC_MAPPED_FILES:
 #ifdef	_POSIX_MAPPED_FILES
-      return 1;
+      return _POSIX_MAPPED_FILES;
 #else
       return -1;
 #endif
 
     case _SC_MEMLOCK:
 #ifdef	_POSIX_MEMLOCK
-      return 1;
+      return _POSIX_MEMLOCK;
 #else
       return -1;
 #endif
 
     case _SC_MEMLOCK_RANGE:
 #ifdef	_POSIX_MEMLOCK_RANGE
-      return 1;
+      return _POSIX_MEMLOCK_RANGE;
 #else
       return -1;
 #endif
 
     case _SC_MEMORY_PROTECTION:
 #ifdef	_POSIX_MEMORY_PROTECTION
-      return 1;
+      return _POSIX_MEMORY_PROTECTION;
 #else
       return -1;
 #endif
 
     case _SC_MESSAGE_PASSING:
 #ifdef	_POSIX_MESSAGE_PASSING
-      return 1;
+      return _POSIX_MESSAGE_PASSING;
 #else
       return -1;
 #endif
 
     case _SC_SEMAPHORES:
 #ifdef	_POSIX_SEMAPHORES
-      return 1;
+      return _POSIX_SEMAPHORES;
 #else
       return -1;
 #endif
 
     case _SC_SHARED_MEMORY_OBJECTS:
 #ifdef	_POSIX_SHARED_MEMORY_OBJECTS
-      return 1;
+      return _POSIX_SHARED_MEMORY_OBJECTS;
 #else
       return -1;
 #endif
@@ -507,14 +507,14 @@ __sysconf (name)
       /* POSIX 1003.1c (POSIX Threads).  */
     case _SC_THREADS:
 #ifdef	_POSIX_THREADS
-      return 1;
+      return _POSIX_THREADS;
 #else
       return -1;
 #endif
 
     case _SC_THREAD_SAFE_FUNCTIONS:
 #ifdef	_POSIX_THREAD_SAFE_FUNCTIONS
-      return 1;
+      return _POSIX_THREAD_SAFE_FUNCTIONS;
 #else
       return -1;
 #endif
@@ -569,42 +569,42 @@ __sysconf (name)
 
     case _SC_THREAD_ATTR_STACKADDR:
 #ifdef	_POSIX_THREAD_ATTR_STACKADDR
-      return 1;
+      return _POSIX_THREAD_ATTR_STACKADDR;
 #else
       return -1;
 #endif
 
     case _SC_THREAD_ATTR_STACKSIZE:
 #ifdef	_POSIX_THREAD_ATTR_STACKSIZE
-      return 1;
+      return _POSIX_THREAD_ATTR_STACKSIZE;
 #else
       return -1;
 #endif
 
     case _SC_THREAD_PRIORITY_SCHEDULING:
 #ifdef	_POSIX_THREAD_PRIORITY_SCHEDULING
-      return 1;
+      return _POSIX_THREAD_PRIORITY_SCHEDULING;
 #else
       return -1;
 #endif
 
     case _SC_THREAD_PRIO_INHERIT:
 #ifdef	_POSIX_THREAD_PRIO_INHERIT
-      return 1;
+      return _POSIX_THREAD_PRIO_INHERIT;
 #else
       return -1;
 #endif
 
     case _SC_THREAD_PRIO_PROTECT:
 #ifdef	_POSIX_THREAD_PRIO_PROTECT
-      return 1;
+      return _POSIX_THREAD_PRIO_PROTECT;
 #else
       return -1;
 #endif
 
     case _SC_THREAD_PROCESS_SHARED:
 #ifdef	_POSIX_THREAD_PROCESS_SHARED
-      return 1;
+      return _POSIX_THREAD_PROCESS_SHARED;
 #else
       return -1;
 #endif
diff --git a/sysdeps/unix/sysv/linux/sysconf.c b/sysdeps/unix/sysv/linux/sysconf.c
index de07e8062f..3cf6aa70bb 100644
--- a/sysdeps/unix/sysv/linux/sysconf.c
+++ b/sysdeps/unix/sysv/linux/sysconf.c
@@ -44,7 +44,7 @@ __sysconf (int name)
 	INTERNAL_SYSCALL_DECL (err);
 	int r;
 	r = INTERNAL_SYSCALL (clock_getres, err, 2, CLOCK_MONOTONIC, &ts);
-	return INTERNAL_SYSCALL_ERROR_P (r, err) ? -1 : 1;
+	return INTERNAL_SYSCALL_ERROR_P (r, err) ? -1 : _POSIX_VERSION;
       }
 #endif