mirror of
https://sourceware.org/git/glibc.git
synced 2024-11-12 16:20:06 +00:00
* sysdeps/posix/readv.c: Include <errno.h>, use __set_errno macro.
* sysdeps/posix/writev.c: Likewise. From Momchil Velikov <velco@fadata.bg>. * elf/dl-error.c [! _LIBC_REENTRANT]: Use a static variable instead of calling *GL(dl_error_catch_tsd) for a thread-local location. * elf/rtld.c (startup_error_tsd): Conditionalize on [_LIBC_REENTRANT]. (dl_main): Same for GL(dl_error_catch_tsd) initialization. * elf/dl-tsd.c: Conditionalize contents on [_LIBC_REENTRANT]. * libio/iofflush.c: Add libc_hidden_def. * libio/iofwrite.c: Likewise. * sysdeps/generic/sigtimedwait.c: Likewise. * sysdeps/generic/sigwaitinfo.c: Likewise. * sysdeps/posix/sigwait.c: Likewise. Reported by Momchil Velikov <velco@fadata.bg>. * inet/inet_lnaof.c (inet_lnaof): Change return type to in_addr_t to match <arpa/inet.h> declaration. * inet/inet_netof.c (inet_netof): Likewise. * inet/inet_mkadr.c (inet_makeaddr): Likewise for argument types. Reported by Momchil Velikov <velco@fadata.bg>.
This commit is contained in:
parent
13a571a747
commit
bf2cc5fb02
23
ChangeLog
23
ChangeLog
@ -1,5 +1,28 @@
|
|||||||
2002-11-24 Roland McGrath <roland@redhat.com>
|
2002-11-24 Roland McGrath <roland@redhat.com>
|
||||||
|
|
||||||
|
* sysdeps/posix/readv.c: Include <errno.h>, use __set_errno macro.
|
||||||
|
* sysdeps/posix/writev.c: Likewise.
|
||||||
|
From Momchil Velikov <velco@fadata.bg>.
|
||||||
|
|
||||||
|
* elf/dl-error.c [! _LIBC_REENTRANT]: Use a static variable instead of
|
||||||
|
calling *GL(dl_error_catch_tsd) for a thread-local location.
|
||||||
|
* elf/rtld.c (startup_error_tsd): Conditionalize on [_LIBC_REENTRANT].
|
||||||
|
(dl_main): Same for GL(dl_error_catch_tsd) initialization.
|
||||||
|
* elf/dl-tsd.c: Conditionalize contents on [_LIBC_REENTRANT].
|
||||||
|
|
||||||
|
* libio/iofflush.c: Add libc_hidden_def.
|
||||||
|
* libio/iofwrite.c: Likewise.
|
||||||
|
* sysdeps/generic/sigtimedwait.c: Likewise.
|
||||||
|
* sysdeps/generic/sigwaitinfo.c: Likewise.
|
||||||
|
* sysdeps/posix/sigwait.c: Likewise.
|
||||||
|
Reported by Momchil Velikov <velco@fadata.bg>.
|
||||||
|
|
||||||
|
* inet/inet_lnaof.c (inet_lnaof): Change return type to in_addr_t
|
||||||
|
to match <arpa/inet.h> declaration.
|
||||||
|
* inet/inet_netof.c (inet_netof): Likewise.
|
||||||
|
* inet/inet_mkadr.c (inet_makeaddr): Likewise for argument types.
|
||||||
|
Reported by Momchil Velikov <velco@fadata.bg>.
|
||||||
|
|
||||||
* configure.in: Skip AUTOCONF check under --without-cvs.
|
* configure.in: Skip AUTOCONF check under --without-cvs.
|
||||||
* configure: Regenerated.
|
* configure: Regenerated.
|
||||||
|
|
||||||
|
@ -57,6 +57,12 @@ INTVARDEF(_dl_out_of_memory)
|
|||||||
global variable. */
|
global variable. */
|
||||||
static receiver_fct receiver;
|
static receiver_fct receiver;
|
||||||
|
|
||||||
|
#ifdef _LIBC_REENTRANT
|
||||||
|
# define CATCH_HOOK (*(struct catch **) (*GL(dl_error_catch_tsd)) ())
|
||||||
|
#else
|
||||||
|
static struct catch *catch_hook;
|
||||||
|
# define CATCH_HOOK catch_hook
|
||||||
|
#endif
|
||||||
|
|
||||||
void
|
void
|
||||||
internal_function
|
internal_function
|
||||||
@ -68,7 +74,7 @@ _dl_signal_error (int errcode, const char *objname, const char *occation,
|
|||||||
if (! errstring)
|
if (! errstring)
|
||||||
errstring = N_("DYNAMIC LINKER BUG!!!");
|
errstring = N_("DYNAMIC LINKER BUG!!!");
|
||||||
|
|
||||||
lcatch = *((*GL(dl_error_catch_tsd)) ());
|
lcatch = CATCH_HOOK;
|
||||||
if (objname == NULL)
|
if (objname == NULL)
|
||||||
objname = "";
|
objname = "";
|
||||||
if (lcatch != NULL)
|
if (lcatch != NULL)
|
||||||
@ -147,7 +153,7 @@ _dl_catch_error (const char **objname, const char **errstring,
|
|||||||
inefficient. So we initialize `c' by hand. */
|
inefficient. So we initialize `c' by hand. */
|
||||||
c.errstring = NULL;
|
c.errstring = NULL;
|
||||||
|
|
||||||
void **catchp = (*GL(dl_error_catch_tsd)) ();
|
struct catch **const catchp = &CATCH_HOOK;
|
||||||
old = *catchp;
|
old = *catchp;
|
||||||
errcode = setjmp (c.env);
|
errcode = setjmp (c.env);
|
||||||
if (__builtin_expect (errcode, 0) == 0)
|
if (__builtin_expect (errcode, 0) == 0)
|
||||||
@ -173,7 +179,7 @@ void
|
|||||||
internal_function
|
internal_function
|
||||||
_dl_receive_error (receiver_fct fct, void (*operate) (void *), void *args)
|
_dl_receive_error (receiver_fct fct, void (*operate) (void *), void *args)
|
||||||
{
|
{
|
||||||
void **catchp = (*GL(dl_error_catch_tsd)) ();
|
struct catch **const catchp = &CATCH_HOOK;
|
||||||
struct catch *old_catch;
|
struct catch *old_catch;
|
||||||
receiver_fct old_receiver;
|
receiver_fct old_receiver;
|
||||||
|
|
||||||
|
20
elf/dl-tsd.c
20
elf/dl-tsd.c
@ -17,10 +17,12 @@
|
|||||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||||
02111-1307 USA. */
|
02111-1307 USA. */
|
||||||
|
|
||||||
#include <ldsodefs.h>
|
#ifdef _LIBC_REENTRANT
|
||||||
#include <tls.h>
|
|
||||||
|
|
||||||
#ifndef SHARED
|
# include <ldsodefs.h>
|
||||||
|
# include <tls.h>
|
||||||
|
|
||||||
|
# ifndef SHARED
|
||||||
|
|
||||||
/* _dl_error_catch_tsd points to this for the single-threaded case.
|
/* _dl_error_catch_tsd points to this for the single-threaded case.
|
||||||
It's reset by the thread library for multithreaded programs
|
It's reset by the thread library for multithreaded programs
|
||||||
@ -28,17 +30,17 @@
|
|||||||
static void ** __attribute__ ((const))
|
static void ** __attribute__ ((const))
|
||||||
startup_error_tsd (void)
|
startup_error_tsd (void)
|
||||||
{
|
{
|
||||||
#if USE___THREAD
|
# if USE___THREAD
|
||||||
static __thread void *data;
|
static __thread void *data;
|
||||||
#else
|
# else
|
||||||
static void *data;
|
static void *data;
|
||||||
#endif
|
# endif
|
||||||
return &data;
|
return &data;
|
||||||
}
|
}
|
||||||
void **(*_dl_error_catch_tsd) (void) __attribute__ ((const))
|
void **(*_dl_error_catch_tsd) (void) __attribute__ ((const))
|
||||||
= &startup_error_tsd;
|
= &startup_error_tsd;
|
||||||
|
|
||||||
#elif USE___THREAD
|
# elif USE___THREAD
|
||||||
|
|
||||||
/* libpthread sets _dl_error_catch_tsd to point to this function.
|
/* libpthread sets _dl_error_catch_tsd to point to this function.
|
||||||
We define it here instead of in libpthread so that it doesn't
|
We define it here instead of in libpthread so that it doesn't
|
||||||
@ -51,4 +53,6 @@ __libc_dl_error_tsd (void)
|
|||||||
return &data;
|
return &data;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
# endif /* SHARED */
|
||||||
|
|
||||||
|
#endif /* _LIBC_REENTRANT */
|
||||||
|
@ -560,6 +560,7 @@ match_version (const char *string, struct link_map *map)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef _LIBC_REENTRANT
|
||||||
/* _dl_error_catch_tsd points to this for the single-threaded case.
|
/* _dl_error_catch_tsd points to this for the single-threaded case.
|
||||||
It's reset by the thread library for multithreaded programs. */
|
It's reset by the thread library for multithreaded programs. */
|
||||||
static void ** __attribute__ ((const))
|
static void ** __attribute__ ((const))
|
||||||
@ -568,6 +569,7 @@ startup_error_tsd (void)
|
|||||||
static void *data;
|
static void *data;
|
||||||
return &data;
|
return &data;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
static const char *library_path; /* The library search path. */
|
static const char *library_path; /* The library search path. */
|
||||||
static const char *preloadlist; /* The list preloaded objects. */
|
static const char *preloadlist; /* The list preloaded objects. */
|
||||||
@ -598,8 +600,10 @@ dl_main (const ElfW(Phdr) *phdr,
|
|||||||
void *tcbp;
|
void *tcbp;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef _LIBC_REENTRANT
|
||||||
/* Explicit initialization since the reloc would just be more work. */
|
/* Explicit initialization since the reloc would just be more work. */
|
||||||
GL(dl_error_catch_tsd) = &startup_error_tsd;
|
GL(dl_error_catch_tsd) = &startup_error_tsd;
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Process the environment variable which control the behaviour. */
|
/* Process the environment variable which control the behaviour. */
|
||||||
process_envvars (&mode);
|
process_envvars (&mode);
|
||||||
|
@ -40,7 +40,7 @@ static char sccsid[] = "@(#)inet_lnaof.c 8.1 (Berkeley) 6/4/93";
|
|||||||
* internet address; handles class a/b/c network
|
* internet address; handles class a/b/c network
|
||||||
* number formats.
|
* number formats.
|
||||||
*/
|
*/
|
||||||
u_int32_t
|
in_addr_t
|
||||||
inet_lnaof(in)
|
inet_lnaof(in)
|
||||||
struct in_addr in;
|
struct in_addr in;
|
||||||
{
|
{
|
||||||
|
@ -41,7 +41,7 @@ static char sccsid[] = "@(#)inet_makeaddr.c 8.1 (Berkeley) 6/4/93";
|
|||||||
*/
|
*/
|
||||||
struct in_addr
|
struct in_addr
|
||||||
inet_makeaddr(net, host)
|
inet_makeaddr(net, host)
|
||||||
u_int32_t net, host;
|
in_addr_t net, host;
|
||||||
{
|
{
|
||||||
u_int32_t addr;
|
u_int32_t addr;
|
||||||
|
|
||||||
|
@ -39,7 +39,7 @@ static char sccsid[] = "@(#)inet_netof.c 8.1 (Berkeley) 6/4/93";
|
|||||||
* Return the network number from an internet
|
* Return the network number from an internet
|
||||||
* address; handles class a/b/c network #'s.
|
* address; handles class a/b/c network #'s.
|
||||||
*/
|
*/
|
||||||
u_int32_t
|
in_addr_t
|
||||||
inet_netof(in)
|
inet_netof(in)
|
||||||
struct in_addr in;
|
struct in_addr in;
|
||||||
{
|
{
|
||||||
|
@ -53,5 +53,6 @@ weak_alias (_IO_fflush, fflush)
|
|||||||
|
|
||||||
#ifndef _IO_MTSAFE_IO
|
#ifndef _IO_MTSAFE_IO
|
||||||
weak_alias (_IO_fflush, fflush_unlocked)
|
weak_alias (_IO_fflush, fflush_unlocked)
|
||||||
|
libc_hidden_weak (fflush_unlocked)
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
@ -58,5 +58,6 @@ weak_alias (_IO_fwrite, fwrite)
|
|||||||
libc_hidden_weak (fwrite)
|
libc_hidden_weak (fwrite)
|
||||||
# ifndef _IO_MTSAFE_IO
|
# ifndef _IO_MTSAFE_IO
|
||||||
weak_alias (_IO_fwrite, fwrite_unlocked)
|
weak_alias (_IO_fwrite, fwrite_unlocked)
|
||||||
|
libc_hidden_weak (fwrite_unlocked)
|
||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/* Implementation of sigtimedwait function from POSIX.1b.
|
/* Implementation of sigtimedwait function from POSIX.1b.
|
||||||
Copyright (C) 1997 Free Software Foundation, Inc.
|
Copyright (C) 1997, 2002 Free Software Foundation, Inc.
|
||||||
This file is part of the GNU C Library.
|
This file is part of the GNU C Library.
|
||||||
|
|
||||||
The GNU C Library is free software; you can redistribute it and/or
|
The GNU C Library is free software; you can redistribute it and/or
|
||||||
@ -27,6 +27,7 @@ __sigtimedwait (const sigset_t *set, siginfo_t *info,
|
|||||||
__set_errno (ENOSYS);
|
__set_errno (ENOSYS);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
libc_hidden_def (__sigtimedwait)
|
||||||
weak_alias (__sigtimedwait, sigtimedwait)
|
weak_alias (__sigtimedwait, sigtimedwait)
|
||||||
|
|
||||||
stub_warning (sigtimedwait)
|
stub_warning (sigtimedwait)
|
||||||
|
@ -26,6 +26,7 @@ __sigwaitinfo (const sigset_t *set, siginfo_t *info)
|
|||||||
__set_errno (ENOSYS);
|
__set_errno (ENOSYS);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
libc_hidden_def (__sigwaitinfo)
|
||||||
weak_alias (__sigwaitinfo, sigwaitinfo)
|
weak_alias (__sigwaitinfo, sigwaitinfo)
|
||||||
|
|
||||||
stub_warning (sigwaitinfo)
|
stub_warning (sigwaitinfo)
|
||||||
|
@ -23,6 +23,7 @@
|
|||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
#include <sys/param.h>
|
#include <sys/param.h>
|
||||||
#include <sys/uio.h>
|
#include <sys/uio.h>
|
||||||
|
#include <errno.h>
|
||||||
|
|
||||||
/* Read data from file descriptor FD, and put the result in the
|
/* Read data from file descriptor FD, and put the result in the
|
||||||
buffers described by VECTOR, which is a vector of COUNT `struct iovec's.
|
buffers described by VECTOR, which is a vector of COUNT `struct iovec's.
|
||||||
@ -46,7 +47,7 @@ __libc_readv (int fd, const struct iovec *vector, int count)
|
|||||||
/* Check for ssize_t overflow. */
|
/* Check for ssize_t overflow. */
|
||||||
if (SSIZE_MAX - bytes < vector[i].iov_len)
|
if (SSIZE_MAX - bytes < vector[i].iov_len)
|
||||||
{
|
{
|
||||||
errno = EINVAL;
|
__set_errno (EINVAL);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
bytes += vector[i].iov_len;
|
bytes += vector[i].iov_len;
|
||||||
|
@ -80,6 +80,7 @@ __sigwait (const sigset_t *set, int *sig)
|
|||||||
*sig = was_sig;
|
*sig = was_sig;
|
||||||
return was_sig == -1 ? -1 : 0;
|
return was_sig == -1 ? -1 : 0;
|
||||||
}
|
}
|
||||||
|
libc_hidden_def (__sigwait)
|
||||||
weak_alias (__sigwait, sigwait)
|
weak_alias (__sigwait, sigwait)
|
||||||
|
|
||||||
|
|
||||||
|
@ -23,6 +23,7 @@
|
|||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
#include <sys/param.h>
|
#include <sys/param.h>
|
||||||
#include <sys/uio.h>
|
#include <sys/uio.h>
|
||||||
|
#include <errno.h>
|
||||||
|
|
||||||
/* Write data pointed by the buffers described by VECTOR, which
|
/* Write data pointed by the buffers described by VECTOR, which
|
||||||
is a vector of COUNT `struct iovec's, to file descriptor FD.
|
is a vector of COUNT `struct iovec's, to file descriptor FD.
|
||||||
@ -46,7 +47,7 @@ __libc_writev (int fd, const struct iovec *vector, int count)
|
|||||||
/* Check for ssize_t overflow. */
|
/* Check for ssize_t overflow. */
|
||||||
if (SSIZE_MAX - bytes < vector[i].iov_len)
|
if (SSIZE_MAX - bytes < vector[i].iov_len)
|
||||||
{
|
{
|
||||||
errno = EINVAL;
|
__set_errno (EINVAL);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
bytes += vector[i].iov_len;
|
bytes += vector[i].iov_len;
|
||||||
|
Loading…
Reference in New Issue
Block a user