/* Operating system support for run-time dynamic linker. Hurd version.
- Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003
- Free Software Foundation, Inc.
+ Copyright (C) 1995-2013 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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, write to the Free
- Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- 02111-1307 USA. */
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+/* In the static library, this is all handled by dl-support.c
+ or by the vanilla definitions in the rest of the C library. */
+#ifdef SHARED
#include <hurd.h>
#include <link.h>
INTVARDEF(__libc_enable_secure)
int __libc_multiple_libcs = 0; /* Defining this here avoids the inclusion
of init-first. */
-/* This variable containts the lowest stack address ever used. */
+/* This variable contains the lowest stack address ever used. */
void *__libc_stack_end;
#if HP_TIMING_AVAIL
ElfW(Addr)
_dl_sysdep_start (void **start_argptr,
void (*dl_main) (const ElfW(Phdr) *phdr, ElfW(Word) phent,
- ElfW(Addr) *user_entry))
+ ElfW(Addr) *user_entry,
+ ElfW(auxv_t) *auxv))
{
void go (intptr_t *argdata)
{
- extern unsigned int _dl_skip_args; /* rtld.c */
char **p;
/* Cache the information in various global variables. */
up and leave us to transfer control to USER_ENTRY. */
(*dl_main) ((const ElfW(Phdr) *) _dl_hurd_data->phdr,
_dl_hurd_data->phdrsz / sizeof (ElfW(Phdr)),
- &_dl_hurd_data->user_entry);
+ &_dl_hurd_data->user_entry, NULL);
/* The call above might screw a few things up.
__mach_init ();
/* Initialize frequently used global variable. */
- GL(dl_pagesize) = __getpagesize ();
+ GLRO(dl_pagesize) = __getpagesize ();
#if HP_TIMING_AVAIL
HP_TIMING_NOW (_dl_cpuclock_offset);
return MACH_PORT_NULL;
}
- assert (!(flags & ~O_READ));
+ assert (!(flags & ~(O_READ | O_CLOEXEC)));
startdir = _dl_hurd_data->portarray[file_name[0] == '/' ?
INIT_PORT_CRDIR : INIT_PORT_CWDIR];
mach_msg_type_number_t nread;
data = buf;
+ nread = nbytes;
err = __io_read ((mach_port_t) fd, &data, &nread, -1, nbytes);
if (err)
return __hurd_fail (err);
__ssize_t weak_function
__writev (int fd, const struct iovec *iov, int niov)
{
+ if (fd >= _hurd_init_dtablesize)
+ {
+ errno = EBADF;
+ return -1;
+ }
+
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;
}
pid_t weak_function
-__getpid ()
+__getpid (void)
{
pid_t pid, ppid;
int orphaned;
}
-/* Return an array of useful/necessary hardware capability names. */
-const struct r_strlenpair *
-internal_function
-_dl_important_hwcaps (const char *platform, size_t platform_len, size_t *sz,
- size_t *max_capstrlen)
-{
- struct r_strlenpair *result;
-
- /* Return an empty array. Hurd has no hardware capabilities. */
- result = (struct r_strlenpair *) malloc (sizeof (*result));
- if (result == NULL)
- INTUSE (_dl_signal_error) (ENOMEM, NULL, NULL,
- "cannot create capability list");
-
- result[0].str = (char *) result; /* Does not really matter. */
- result[0].len = 0;
-
- *sz = 1;
- return result;
-}
-
void weak_function
_dl_init_first (int argc, ...)
{
/* This no-op definition only gets used if libc is not linked in. */
}
+
+#endif /* SHARED */