about summary refs log tree commit diff
path: root/sysdeps
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>2001-04-01 05:04:31 +0000
committerRoland McGrath <roland@gnu.org>2001-04-01 05:04:31 +0000
commit8a0746ae74914cbdf02fc609e15d267692695792 (patch)
treeff39d2bacaa6ecc8896a8a42918443d4f0824f7d /sysdeps
parent24cf21d780e14d5a7e04257afdf67f6c7ca90f83 (diff)
downloadglibc-8a0746ae74914cbdf02fc609e15d267692695792.tar.gz
glibc-8a0746ae74914cbdf02fc609e15d267692695792.tar.xz
glibc-8a0746ae74914cbdf02fc609e15d267692695792.zip
* sysdeps/mach/hurd/Makefile ($(link-rpcuserlibs)): Don't append
	options after $(build-module), which is no longer a single command.
	(LDFLAGS-link-rpcuserlibs): New variable to hold those options.
	(LDFLAGS-libmachuser-link.so, LDFLAGS-libhurduser-link.so): New
	variables using it.  Reported by Mark Kettenis <kettenis@gnu.org>.

2001-03-11  Roland McGrath  <roland@frob.com>

	* elf/rtld.c (dl_main): Add cast to quiet warning.
	* elf/dl-load.c (_dl_map_object_from_fd): Likewise.
	* iconv/gconv_conf.c (__gconv_get_path): Likewise.
	(__gconv_read_conf): Likewise.
	* iconv/gconv_db.c (gen_steps): Likewise.
	(__gconv_find_transform): Likewise.
	* locale/programs/charmap-dir.c (fopen_uncompressed): Likewise.
	(fopen_uncompressed): Use const in second argument's type.

2001-03-11  Roland McGrath  <roland@frob.com>

	* sysdeps/mach/hurd/dl-sysdep.c (__writev): New function.

	* mach/mach_error.h: Fix ancient #endif syntax.
	* hurd/hurdmalloc.c: Likewise.

	* sysdeps/generic/atomicity.h (exchange_and_add, atomic_add,
	compare_and_swap): Add volatile qualifier to first arg, to bring
	these prototypes in line with all the other implementations.
	Add a #warning to remind the builder that these are not atomic.

2001-03-04  Roland McGrath  <roland@frob.com>

	* hurd/vpprintf.c (vpprintf) [USE_IN_LIBIO]: Use innermore first
	member of TEMP_F so its type is _IO_FILE * as expected.

	* hurd/fopenport.c (seekio): Conditionalize type of POS argument
	on [USE_IN_LIBIO].  Check the value for overflow, since for libio
	it might exceed off_t's range.

2001-02-25  Roland McGrath  <roland@frob.com>

	* sysdeps/mach/hurd/sysd-stdio.c (__stdio_reopen): Use prototype.
	* sysdeps/unix/bsd/getpt.c (__posix_openpt): Likewise.

	* sysdeps/mach/hurd/i386/intr-msg.h (SYSCALL_EXAMINE): Make this a
	macro instead of an inline function,
	(MSG_EXAMINE): Likewise.

	* hurd/hurd/ioctl.h (_HURD_HANDLE_IOCTLS_1): Remove extraneous ##.

	* hurd/get-host.c: Include <string.h> for decls of built-ins.
	* hurd/hurdchdir.c: Likewise.
	* sysdeps/mach/hurd/i386/sigreturn.c: Likweise.
	* sysdeps/mach/hurd/opendir.c: Likewise.

	* mach/mach_init.c: Include <unistd.h> for _exit decl.

	* mach/errsystems.awk: Give output file a trailing newline.

	* mach/Machrules (MIG): Prepend CC='${CC}' to the mig command, so that
	the script will use our compiler for the cpp stage.

	With --enable-all-warnings we get a whole bunch of warnings,
	and these are just a few fixes; there are more needed to silence it.
	* mach/mach/mig_support.h (__mig_strncpy, mig_strncpy): Add extern
	decls before extern inline defns to quiet gcc warning.
	* hurd/hurd/threadvar.h (__hurd_threadvar_location_from_sp): Likewise.
	* sysdeps/mach/i386/machine-sp.h (__thread_stack_pointer): Likewise.
Diffstat (limited to 'sysdeps')
-rw-r--r--sysdeps/mach/hurd/Makefile9
-rw-r--r--sysdeps/mach/hurd/dl-sysdep.c34
-rw-r--r--sysdeps/mach/hurd/i386/intr-msg.h90
-rw-r--r--sysdeps/mach/hurd/i386/sigreturn.c3
-rw-r--r--sysdeps/mach/hurd/opendir.c3
-rw-r--r--sysdeps/mach/hurd/sysd-stdio.c11
-rw-r--r--sysdeps/mach/i386/machine-sp.h3
-rw-r--r--sysdeps/unix/bsd/getpt.c3
8 files changed, 95 insertions, 61 deletions
diff --git a/sysdeps/mach/hurd/Makefile b/sysdeps/mach/hurd/Makefile
index 05bf1d222d..007016dabc 100644
--- a/sysdeps/mach/hurd/Makefile
+++ b/sysdeps/mach/hurd/Makefile
@@ -1,4 +1,4 @@
-# Copyright (C) 1993,94,95,96,97,98,99,2000 Free Software Foundation, Inc.
+# Copyright (C) 1993,94,95,96,97,98,99,2000,01 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
@@ -149,7 +149,12 @@ lib-noranlib: $(common-objpfx)hurd/libhurduser-link.so
 endif
 
 $(link-rpcuserlibs): %-link.so: %_pic.a
-	$(build-module) -nostdlib -Wl,-soname=$(*F).so$($(*F).so-version)
+# The $(build-module) variable now contains a sequence of several commands,
+# so we can't tweak the ld command just by adding text to this command line.
+	$(build-module)
+LDFLAGS-link-rpcuserlibs = -nostdlib -Wl,-soname=$(*F).so$($(*F).so-version)
+LDFLAGS-libmachuser-link.so = $(LDFLAGS-link-rpcuserlibs)
+LDFLAGS-libhurduser-link.so = $(LDFLAGS-link-rpcuserlibs)
 
 # And get them into the libc.so ldscript.
 $(inst_libdir)/libc.so: $(rpcuserlibs)
diff --git a/sysdeps/mach/hurd/dl-sysdep.c b/sysdeps/mach/hurd/dl-sysdep.c
index 3e0531b10b..25ae5bbc68 100644
--- a/sysdeps/mach/hurd/dl-sysdep.c
+++ b/sysdeps/mach/hurd/dl-sysdep.c
@@ -1,5 +1,5 @@
 /* Operating system support for run-time dynamic linker.  Hurd version.
-   Copyright (C) 1995, 96, 97, 98, 99, 2000 Free Software Foundation, Inc.
+   Copyright (C) 1995,96,97,98,99,2000,2001 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
@@ -36,6 +36,7 @@
 #include <stdarg.h>
 #include <ctype.h>
 #include <sys/stat.h>
+#include <sys/uio.h>
 
 #include <entry.h>
 #include <dl-machine.h>
@@ -554,6 +555,37 @@ __libc_write (int fd, const void *buf, size_t nbytes)
   return nwrote;
 }
 
+/* This is only used for printing messages (see dl-misc.c).  */
+__ssize_t weak_function
+__writev (int fd, const struct iovec *iov, int niov)
+{
+  int i;
+  size_t total = 0;
+  for (i = 0; i < niov; ++i)
+    total += iov[i].iov_len;
+
+  assert (fd < _hurd_init_dtablesize);
+
+  if (total != 0)
+    {
+      char buf[total], *bufp = buf;
+      error_t err;
+      mach_msg_type_number_t nwrote;
+
+      for (i = 0; i < niov; ++i)
+	bufp = (memcpy (bufp, iov[i].iov_base, iov[i].iov_len)
+		+ iov[i].iov_len);
+
+      err = __io_write (_hurd_init_dtable[fd], buf, total, -1, &nwrote);
+      if (err)
+	return __hurd_fail (err);
+
+      return nwrote;
+    }
+  return 0;
+}
+
+
 off_t weak_function
 __lseek (int fd, off_t offset, int whence)
 {
diff --git a/sysdeps/mach/hurd/i386/intr-msg.h b/sysdeps/mach/hurd/i386/intr-msg.h
index d862d5842a..dcfc5d4e4d 100644
--- a/sysdeps/mach/hurd/i386/intr-msg.h
+++ b/sysdeps/mach/hurd/i386/intr-msg.h
@@ -1,5 +1,5 @@
 /* Machine-dependent details of interruptible RPC messaging.  i386 version.
-   Copyright (C) 1995, 1996, 1997, 1999 Free Software Foundation, Inc.
+   Copyright (C) 1995,96,97,99,2001 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
@@ -53,20 +53,20 @@ INTR_MSG_BACK_OUT (struct i386_thread_state *state)
 
 #include "hurdfault.h"
 
-static inline int
-SYSCALL_EXAMINE (struct i386_thread_state *state, int *callno)
-{
-  struct { unsigned int c[2]; } *p = (void *) (state->eip - 7);
-  int result;
-  if (_hurdsig_catch_memory_fault (p))
-    return 0;
-  if (result = p->c[0] == 0x0000009a && (p->c[1] & 0x00ffffff) == 0x00000700)
-    /* The PC is just after an `lcall $7,$0' instruction.
-       This is a system call in progress; %eax holds the call number.  */
-    *callno = state->eax;
-  _hurdsig_end_catch_fault ();
-  return result;
-}
+/* This cannot be an inline function because it calls setjmp.  */
+#define SYSCALL_EXAMINE(state, callno)					      \
+({									      \
+  struct { unsigned int c[2]; } *p = (void *) ((state)->eip - 7);	      \
+  int result;								      \
+  if (_hurdsig_catch_memory_fault (p))					      \
+    return 0;								      \
+  if (result = p->c[0] == 0x0000009a && (p->c[1] & 0x00ffffff) == 0x00000700) \
+    /* The PC is just after an `lcall $7,$0' instruction.		      \
+       This is a system call in progress; %eax holds the call number.  */     \
+    *(callno) = (state)->eax;						      \
+  _hurdsig_end_catch_fault ();						      \
+  result;								      \
+})
 
 
 struct mach_msg_trap_args
@@ -83,35 +83,31 @@ struct mach_msg_trap_args
   };
 
 
-static inline int
-MSG_EXAMINE (struct i386_thread_state *state, int *msgid,
-	     mach_port_t *rcv_name, mach_port_t *send_name,
-	     mach_msg_option_t *option, mach_msg_timeout_t *timeout)
-{
-  const struct mach_msg_trap_args *args = (const void *) state->uesp;
-  mach_msg_header_t *msg;
-
-  if (_hurdsig_catch_memory_fault (args))
-    return -1;
-  msg = args->msg;
-  *option = args->option;
-  *timeout = args->timeout;
-  *rcv_name = args->rcv_name;
-  _hurdsig_end_catch_fault ();
-
-  if (msg == 0)
-    {
-      *send_name = MACH_PORT_NULL;
-      *msgid = 0;
-    }
-  else
-    {
-      if (_hurdsig_catch_memory_fault (msg))
-	return -1;
-      *send_name = msg->msgh_remote_port;
-      *msgid = msg->msgh_id;
-      _hurdsig_end_catch_fault ();
-    }
-
-  return 0;
-}
+/* This cannot be an inline function because it calls setjmp.  */
+#define MSG_EXAMINE(state, msgid, rcvname, send_name, opt, tmout)	      \
+({									      \
+  const struct mach_msg_trap_args *args = (const void *) (state)->uesp;	      \
+  mach_msg_header_t *msg;						      \
+  _hurdsig_catch_memory_fault (args) ? -1 :				      \
+    ({									      \
+      msg = args->msg;							      \
+      *(opt) = args->option;						      \
+      *(tmout) = args->timeout;						      \
+      *(rcvname) = args->rcv_name;					      \
+      _hurdsig_end_catch_fault ();					      \
+      if (msg == 0)							      \
+	{								      \
+	  *(send_name) = MACH_PORT_NULL;				      \
+	  *(msgid) = 0;							      \
+	}								      \
+      else								      \
+	{								      \
+	  if (_hurdsig_catch_memory_fault (msg))			      \
+	    return -1;							      \
+	  *(send_name) = msg->msgh_remote_port;				      \
+	  *(msgid) = msg->msgh_id;					      \
+	  _hurdsig_end_catch_fault ();					      \
+	}								      \
+      0;								      \
+    });									      \
+})
diff --git a/sysdeps/mach/hurd/i386/sigreturn.c b/sysdeps/mach/hurd/i386/sigreturn.c
index 334351d285..c7ee9e2b62 100644
--- a/sysdeps/mach/hurd/i386/sigreturn.c
+++ b/sysdeps/mach/hurd/i386/sigreturn.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 92, 94, 95, 96, 97, 98 Free Software Foundation, Inc.
+/* Copyright (C) 1991,92,94,95,96,97,98,2001 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
@@ -23,6 +23,7 @@ register int *sp asm ("%esp");
 #include <hurd/threadvar.h>
 #include <hurd/msg.h>
 #include <stdlib.h>
+#include <string.h>
 
 int
 __sigreturn (struct sigcontext *scp)
diff --git a/sysdeps/mach/hurd/opendir.c b/sysdeps/mach/hurd/opendir.c
index ae92fd9043..a0e0567a12 100644
--- a/sysdeps/mach/hurd/opendir.c
+++ b/sysdeps/mach/hurd/opendir.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1993, 94, 95, 96, 97, 98 Free Software Foundation, Inc.
+/* Copyright (C) 1993,94,95,96,97,98,2001 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
@@ -20,6 +20,7 @@
 #include <limits.h>
 #include <stddef.h>
 #include <stdlib.h>
+#include <string.h>
 #include <dirent.h>
 #include <fcntl.h>
 #include <sys/types.h>
diff --git a/sysdeps/mach/hurd/sysd-stdio.c b/sysdeps/mach/hurd/sysd-stdio.c
index fea9b56a96..0ba751d217 100644
--- a/sysdeps/mach/hurd/sysd-stdio.c
+++ b/sysdeps/mach/hurd/sysd-stdio.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1994, 95, 96, 97, 98 Free Software Foundation, Inc.
+/* Copyright (C) 1994,95,96,97,98,2001 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
@@ -175,11 +175,10 @@ __stdio_open (filename, m, cookieptr)
 /* Open FILENAME with the mode in M.  Use the same magic cookie
    already in *COOKIEPTR if possible, closing the old cookie with CLOSEFN.  */
 int
-__stdio_reopen (filename, m, cookieptr, closefn)
-     const char *filename;
-     __io_mode m;
-     void **cookieptr;
-     __io_close_fn closefn;
+__stdio_reopen (const char *filename,
+		__io_mode m,
+		void **cookieptr,
+		__io_close_fn closefn)
 {
   int flags;
   file_t port;
diff --git a/sysdeps/mach/i386/machine-sp.h b/sysdeps/mach/i386/machine-sp.h
index da616974f1..985ce878dc 100644
--- a/sysdeps/mach/i386/machine-sp.h
+++ b/sysdeps/mach/i386/machine-sp.h
@@ -1,5 +1,5 @@
 /* Machine-specific function to return the stack pointer.  i386 version.
-   Copyright (C) 1994, 1997 Free Software Foundation, Inc.
+   Copyright (C) 1994,97,2001 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
@@ -26,6 +26,7 @@
 #define _EXTERN_INLINE extern __inline
 #endif
 
+extern void *__thread_stack_pointer (void);
 _EXTERN_INLINE void *
 __thread_stack_pointer (void)
 {
diff --git a/sysdeps/unix/bsd/getpt.c b/sysdeps/unix/bsd/getpt.c
index 6bd1804942..9ae1251c07 100644
--- a/sysdeps/unix/bsd/getpt.c
+++ b/sysdeps/unix/bsd/getpt.c
@@ -81,8 +81,7 @@ weak_alias (__getpt, getpt)
 #ifndef HAVE_POSIX_OPENPT
 /* We cannot define posix_openpt in general for BSD systems.  */
 int
-__posix_openpt (oflag)
-     int oflag;
+__posix_openpt (int oflag)
 {
   __set_errno (ENOSYS);
   return -1;