* sunrpc/svc_authux.c (_svcauth_unix): Remove spurious printf (ugh!).

* sysdeps/i386/bits/byteswap.h (__bswap_16, __bswap_32, __bswap_64):
	Evaluate argument exactly once.  Remove __volatile__ from asm's.

	* include/unistd.h: Use libc_hidden_proto for getdomainname
	and getlogin_r.
	* sysdeps/generic/getdomain.c: Add libc_hidden_def.
	* sysdeps/mach/hurd/getdomain.c: Likewise.
	* sysdeps/unix/getlogin_r.c: Likewise.
	* sysdeps/mach/hurd/getlogin_r.c: Likewise.
	* sysdeps/generic/getlogin_r.c: Likewise.

	* include/rpc/auth_des.h: Use libc_hidden_proto for rtime.
	* sunrpc/rtime.c: Add libc_hidden_def.

	* include/string.h: Use libc_hidden_proto for basename.
	* string/basename.c [_LIBC]: Add libc_hidden_def.

	* sysdeps/unix/sysv/linux/opensock.c (__opensock): socket -> __socket.

	* locale/loadarchive.c: munmap -> __munmap throughout.

	* include/netdb.h: Use libc_hidden_proto for gai_strerror.
	* sysdeps/posix/gai_strerror.c: Add libc_hidden_def.
	* sysdeps/generic/gai_strerror.c: Likewise.
This commit is contained in:
Roland McGrath 2002-08-12 02:02:20 +00:00
parent a83f1ae4c8
commit 7a8bdff02c
18 changed files with 89 additions and 45 deletions

View File

@ -1,5 +1,32 @@
2002-08-11 Roland McGrath <roland@redhat.com>
* sunrpc/svc_authux.c (_svcauth_unix): Remove spurious printf (ugh!).
* sysdeps/i386/bits/byteswap.h (__bswap_16, __bswap_32, __bswap_64):
Evaluate argument exactly once. Remove __volatile__ from asm's.
* include/unistd.h: Use libc_hidden_proto for getdomainname
and getlogin_r.
* sysdeps/generic/getdomain.c: Add libc_hidden_def.
* sysdeps/mach/hurd/getdomain.c: Likewise.
* sysdeps/unix/getlogin_r.c: Likewise.
* sysdeps/mach/hurd/getlogin_r.c: Likewise.
* sysdeps/generic/getlogin_r.c: Likewise.
* include/rpc/auth_des.h: Use libc_hidden_proto for rtime.
* sunrpc/rtime.c: Add libc_hidden_def.
* include/string.h: Use libc_hidden_proto for basename.
* string/basename.c [_LIBC]: Add libc_hidden_def.
* sysdeps/unix/sysv/linux/opensock.c (__opensock): socket -> __socket.
* locale/loadarchive.c: munmap -> __munmap throughout.
* include/netdb.h: Use libc_hidden_proto for gai_strerror.
* sysdeps/posix/gai_strerror.c: Add libc_hidden_def.
* sysdeps/generic/gai_strerror.c: Likewise.
* include/sys/errno.h: New file.
* include/signal.h: No libc_hidden_proto for raise,

View File

@ -31,6 +31,7 @@ libc_hidden_proto (ruserok_af)
libc_hidden_proto (getaddrinfo)
libc_hidden_proto (getnameinfo)
libc_hidden_proto (freeaddrinfo)
libc_hidden_proto (gai_strerror)
/* Document internal interfaces. */
extern int __gethostent_r (struct hostent *__restrict __result_buf,

View File

@ -3,6 +3,7 @@
#include <sunrpc/rpc/auth_des.h>
libc_hidden_proto (getpublickey)
libc_hidden_proto (rtime)
extern bool_t xdr_authdes_cred (XDR *xdrs, struct authdes_cred *cred);
extern bool_t xdr_authdes_verf (register XDR *xdrs,

View File

@ -71,6 +71,7 @@ libc_hidden_proto (__strdup)
libc_hidden_proto (__strndup)
libc_hidden_proto (__strerror_r)
libc_hidden_proto (__strverscmp)
libc_hidden_proto (basename)
# ifndef _ISOMAC
# ifndef index

View File

@ -10,6 +10,8 @@ libc_hidden_proto (execlp)
libc_hidden_proto (execvp)
libc_hidden_proto (getpid)
libc_hidden_proto (getsid)
libc_hidden_proto (getdomainname)
libc_hidden_proto (getlogin_r)
/* Now define the internal interfaces. */

View File

@ -205,7 +205,7 @@ _nl_load_locale_from_archive (int category, const char **namep)
if (calculate_head_size ((const struct locarhead *) result)
> archive_stat.st_size)
{
(void) munmap (result, archive_stat.st_size);
(void) __munmap (result, archive_stat.st_size);
goto close_and_out;
}
__close (fd);
@ -389,7 +389,7 @@ _nl_load_locale_from_archive (int category, const char **namep)
newp = (struct archmapped *) malloc (sizeof (struct archmapped));
if (newp == NULL)
{
(void) munmap (addr, to - from);
(void) __munmap (addr, to - from);
return NULL;
}
@ -473,13 +473,13 @@ _nl_archive_subfreeres (void)
assert (archmapped == &headmap);
archmapped = NULL;
(void) munmap (headmap.ptr, headmap.len);
(void) __munmap (headmap.ptr, headmap.len);
am = headmap.next;
while (am != NULL)
{
struct archmapped *dead = am;
am = am->next;
(void) munmap (dead->ptr, dead->len);
(void) __munmap (dead->ptr, dead->len);
free (dead);
}
}

View File

@ -1,5 +1,5 @@
/* Return the name-within-directory of a file name.
Copyright (C) 1996, 1997, 1998 Free Software Foundation, Inc.
Copyright (C) 1996,97,98,2002 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
@ -37,3 +37,6 @@ basename (filename)
char *p = strrchr (filename, '/');
return p ? p + 1 : (char *) filename;
}
#ifdef _LIBC
libc_hidden_def (basename)
#endif

View File

@ -145,3 +145,4 @@ rtime (struct sockaddr_in *addrp, struct rpc_timeval *timep,
timep->tv_usec = 0;
return 0;
}
libc_hidden_def (rtime)

View File

@ -104,8 +104,6 @@ _svcauth_unix (struct svc_req *rqst, struct rpc_msg *msg)
*/
if ((5 + gid_len) * BYTES_PER_XDR_UNIT + str_len > auth_len)
{
(void) printf ("bad auth_len gid %d str %d auth %d\n",
gid_len, str_len, auth_len);
stat = AUTH_BADCRED;
goto done;
}

View File

@ -1,4 +1,4 @@
/* Copyright (C) 1996, 1997, 2001 Free Software Foundation, Inc.
/* Copyright (C) 1996,97,2001,02 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,3 +26,4 @@ gai_strerror (int code)
snprintf (buffer, sizeof buffer, "Unknown error (%d)", code);
return buffer;
}
libc_hidden_def (gai_strerror)

View File

@ -1,4 +1,4 @@
/* Copyright (C) 1994, 1995, 1997, 2000 Free Software Foundation, Inc.
/* Copyright (C) 1994,95,97,2000,02 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
@ -60,3 +60,5 @@ stub_warning (getdomainname)
#include <stub-tag.h>
#endif
libc_hidden_def (getdomainname)

View File

@ -1,5 +1,5 @@
/* Reentrant function to return the current login name. Stub version.
Copyright (C) 1996 Free Software Foundation, Inc.
Copyright (C) 1996, 2002 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
@ -31,6 +31,7 @@ getlogin_r (name, name_len)
__set_errno (ENOSYS);
return errno;
}
libc_hidden_def (getlogin_r)
stub_warning (getlogin_r)
#include <stub-tag.h>

View File

@ -31,18 +31,20 @@
#if defined __GNUC__ && __GNUC__ >= 2
# define __bswap_16(x) \
(__extension__ \
({ register unsigned short int __v; \
if (__builtin_constant_p (x)) \
__v = __bswap_constant_16 (x); \
({ register unsigned short int __v, __x = (x); \
if (__builtin_constant_p (__x)) \
__v = __bswap_constant_16 (__x); \
else \
__asm__ __volatile__ ("rorw $8, %w0" \
: "=r" (__v) \
: "0" ((unsigned short int) (x)) \
: "cc"); \
__asm__ ("rorw $8, %w0" \
: "=r" (__v) \
: "0" (__x) \
: "cc"); \
__v; }))
#else
/* This is better than nothing. */
# define __bswap_16(x) __bswap_constant_16 (x)
# define __bswap_16(x) \
(__extension__ \
({ register unsigned short int __x = (x); __bswap_constant_16 (__x); }))
#endif
@ -55,33 +57,33 @@
/* To swap the bytes in a word the i486 processors and up provide the
`bswap' opcode. On i386 we have to use three instructions. */
# if !defined __i486__ && !defined __pentium__ && !defined __pentiumpro__
# define __bswap_32(x) \
# define __bswap_32(x) \
(__extension__ \
({ register unsigned int __v; \
if (__builtin_constant_p (x)) \
__v = __bswap_constant_32 (x); \
({ register unsigned int __v, __x = (x); \
if (__builtin_constant_p (__x)) \
__v = __bswap_constant_32 (__x); \
else \
__asm__ __volatile__ ("rorw $8, %w0;" \
"rorl $16, %0;" \
"rorw $8, %w0" \
: "=r" (__v) \
: "0" ((unsigned int) (x)) \
: "cc"); \
__asm__ ("rorw $8, %w0;" \
"rorl $16, %0;" \
"rorw $8, %w0" \
: "=r" (__v) \
: "0" (__x) \
: "cc"); \
__v; }))
# else
# define __bswap_32(x) \
(__extension__ \
({ register unsigned int __v; \
if (__builtin_constant_p (x)) \
__v = __bswap_constant_32 (x); \
({ register unsigned int __v, __x = (x); \
if (__builtin_constant_p (__x)) \
__v = __bswap_constant_32 (__x); \
else \
__asm__ __volatile__ ("bswap %0" \
: "=r" (__v) \
: "0" ((unsigned int) (x))); \
__asm__ ("bswap %0" : "=r" (__v) : "0" (__x)); \
__v; }))
# endif
#else
# define __bswap_32(x) __bswap_constant_32 (x)
# define __bswap_16(x) \
(__extension__ \
({ register unsigned int __x = (x); __bswap_constant_32 (__x); }))
#endif
@ -101,11 +103,11 @@
(__extension__ \
({ union { __extension__ unsigned long long int __ll; \
unsigned long int __l[2]; } __w, __r; \
if (__builtin_constant_p (x)) \
__r.__ll = __bswap_constant_64 (x); \
__w.__ll = (x); \
if (__builtin_constant_p (__w.__ll)) \
__r.__ll = __bswap_constant_64 (__w.__ll); \
else \
{ \
__w.__ll = (x); \
__r.__l[0] = __bswap_32 (__w.__l[1]); \
__r.__l[1] = __bswap_32 (__w.__l[0]); \
} \

View File

@ -1,4 +1,4 @@
/* Copyright (C) 1998 Free Software Foundation, Inc.
/* Copyright (C) 1998, 2002 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
@ -29,3 +29,4 @@ getdomainname (char *name, size_t len)
ssize_t n = _hurd_get_host_config ("/etc/nisdomain", name, len);
return n < 0 ? -1 : 0;
}
libc_hidden_def (getdomainname)

View File

@ -1,5 +1,5 @@
/* Reentrant function to return the current login name. Hurd version.
Copyright (C) 1996 Free Software Foundation, Inc.
Copyright (C) 1996, 2002 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
@ -39,3 +39,4 @@ getlogin_r (name, name_len)
strncpy (name, login, name_len);
return 0;
}
libc_hidden_def (getlogin_r)

View File

@ -1,4 +1,4 @@
/* Copyright (C) 1997, 2001 Free Software Foundation, Inc.
/* Copyright (C) 1997,2001,02 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Philip Blundell <pjb27@cam.ac.uk>, 1997.
@ -56,3 +56,4 @@ gai_strerror (int code)
return _("Unknown error");
}
libc_hidden_def (gai_strerror)

View File

@ -1,5 +1,5 @@
/* Reentrant function to return the current login name. Unix version.
Copyright (C) 1991, 1992, 1996, 1997, 1998 Free Software Foundation, Inc.
Copyright (C) 1991,92,96,97,98,2002 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
@ -51,7 +51,7 @@ getlogin_r (name, name_len)
getlogin(). */
result = __ttyname_r (0, real_tty_path, sizeof (tty_pathname));
if (result != 0)
return result;
@ -86,3 +86,4 @@ getlogin_r (name, name_len)
return result;
}
libc_hidden_def (getlogin_r)

View File

@ -67,7 +67,7 @@ __opensock (void)
{
assert (last_type != 0);
result = socket (last_family, last_type, 0);
result = __socket (last_family, last_type, 0);
if (result != -1 || errno != EAFNOSUPPORT)
/* Maybe the socket type isn't supported anymore (module is
unloaded). In this case again try to find the type. */
@ -102,7 +102,7 @@ __opensock (void)
if (afs[cnt].family == AF_NETROM || afs[cnt].family == AF_X25)
type = SOCK_SEQPACKET;
result = socket (afs[cnt].family, type, 0);
result = __socket (afs[cnt].family, type, 0);
if (result != -1)
{
/* Found an available family. */