glibc/include/sys/socket.h
Ulrich Drepper a4baf360be Update.
* io/sys/stat.h [__USE_MISC]: Define __need_timespec for struct stat.
	* sysdeps/unix/sysv/linux/xstatconv.c (xstat_conv): Adjust for
	nsec resolution changes.
	(xstat64_conv): Likewise.
	(xstat32_conv): Likewise.
	* sysdeps/unix/sysv/linux/kernel_stat.h: Add nsec resolution for
	struct kernel_stat.
	* sysdeps/unix/sysv/linux/bits/stat.h: Add nsec resolution for
	structs stat and stat64.
	* time/time.h (__timespec_defined): Define for __USE_MISC.

2002-12-31  Ulrich Drepper  <drepper@redhat.com>

	* include/signal.h: Add libc_hidden_proto for __libc_current_sigrtmin
	and __libc_current_sigrtmax.

2002-12-31  Jakub Jelinek  <jakub@redhat.com>

	* include/errno.h (__errno_location): Add prototype.
	Use libc_hidden_proto unconditionally.
	* include/netdb.h (__h_errno_location): Use libc_hidden_proto
	unconditionally.
	* include/resolv.h (__res_state): Likewise.

	* hurd/errno-loc.c (__errno_location): Add libc_hidden_def.
	* include/sys/socket.h (accept): Add libc_hidden_proto.
	* include/errno.h (__errno_location): Likewise.
	* include/netdb.h (__h_errno_location): Likewise.
	* include/resolv.h (__res_state): Likewise.
	* include/unistd.h (__lseek): Likewise.
	* sysdeps/generic/errno-loc.c (__errno_location): Add libc_hidden_def.
	* sysdeps/generic/herrno-loc.c (__h_errno_location): Likewise.
	* sysdeps/generic/res-state.c (__res_state): Likewise.
	* sysdeps/generic/accept.c (accept): Likewise.
	* sysdeps/generic/lseek.c (__lseek): Likewise.
	* sysdeps/generic/allocrtsig.c (__libc_current_sigrtmin,
	__libc_current_sigrtmax): Likewise.
	* sysdeps/mach/hurd/accept.c (accept): Likewise.
	* sysdeps/mach/hurd/lseek.c (__lseek): Likewise.
	* sysdeps/unix/sysv/aix/accept.c (accept): Likewise.
	* sysdeps/unix/sysv/aix/lseek.c (__lseek): Likewise.
	* sysdeps/unix/sysv/linux/accept.S (accept): Likewise.
	* sysdeps/unix/inet/syscalls.list (__GI_accept): New alias to accept.
	* sysdeps/unix/sysv/linux/alpha/syscalls.list (__GI_accept): Likewise.
	* sysdeps/unix/sysv/linux/hppa/syscalls.list (__GI_accept): Likewise.
	* sysdeps/unix/sysv/linux/ia64/syscalls.list (__GI___lseek): New
	alias to llseek.
	(__GI_accept): New alias to accept.
	* sysdeps/unix/sysv/linux/mips/syscalls.list (__GI_accept): Likewise.
	* sysdeps/unix/sysv/linux/s390/s390-64/syscalls.list (__GI___lseek):
	New alias to llseek.
	(__GI_accept): New alias to accept.
	* sysdeps/unix/sysv/linux/sparc/sparc64/syscalls.list (__GI_accept):
	Likewise.
	* sysdeps/unix/sysv/linux/x86_64/syscalls.list (__GI_accept):
	Likewise.
	* sysdeps/unix/syscalls.list (__GI___lseek): New alias to lseek.

	* sysdeps/alpha/setjmp.S : Use libc_hidden_def(name) instead of
	strong_alias (name, __GI_name).
	* sysdeps/arm/bsd-_setjmp.S : Likewise.
	* sysdeps/hppa/bsd-_setjmp.S : Likewise.
	* sysdeps/i386/bsd-_setjmp.S : Likewise.
	* sysdeps/mips/mips64/bsd-_setjmp.S : Likewise.
	* sysdeps/mips/bsd-_setjmp.S : Likewise.
	* sysdeps/powerpc/powerpc32/bsd-_setjmp.S : Likewise.
	* sysdeps/powerpc/powerpc64/setjmp.S : Likewise.
	* sysdeps/s390/s390-32/elf/setjmp.S : Likewise.
	* sysdeps/s390/s390-32/bsd-_setjmp.S : Likewise.
	* sysdeps/s390/s390-64/elf/setjmp.S : Likewise.
	* sysdeps/s390/s390-64/bsd-_setjmp.S : Likewise.
	* sysdeps/sh/bsd-_setjmp.S : Likewise.
	* sysdeps/sparc/sparc32/setjmp.S : Likewise.
	* sysdeps/unix/arm/fork.S : Likewise.
	* sysdeps/unix/bsd/hp/m68k/vfork.S : Likewise.
	* sysdeps/unix/bsd/i386/vfork.S : Likewise.
	* sysdeps/unix/bsd/osf/alpha/fork.S : Likewise.
	* sysdeps/unix/bsd/sun/m68k/vfork.S : Likewise.
	* sysdeps/unix/bsd/ultrix4/mips/vfork.S : Likewise.
	* sysdeps/unix/bsd/vax/vfork.S : Likewise.
	* sysdeps/unix/i386/fork.S : Likewise.
	* sysdeps/unix/mips/fork.S : Likewise.
	* sysdeps/unix/sparc/fork.S : Likewise.
	* sysdeps/unix/sparc/vfork.S : Likewise.
	* sysdeps/unix/sysv/linux/arm/vfork.S : Likewise.
	* sysdeps/unix/sysv/linux/cris/vfork.S : Likewise.
	* sysdeps/unix/sysv/linux/i386/vfork.S : Likewise.
	* sysdeps/unix/sysv/linux/ia64/fork.S : Likewise.
	* sysdeps/unix/sysv/linux/ia64/setjmp.S : Likewise.
	* sysdeps/unix/sysv/linux/ia64/vfork.S : Likewise.
	* sysdeps/unix/sysv/linux/m68k/vfork.S : Likewise.
	* sysdeps/unix/sysv/linux/sh/vfork.S : Likewise.
	* sysdeps/unix/sysv/linux/sparc/sparc64/longjmp.S : Likewise.
	* sysdeps/unix/sysv/linux/sparc/sparc64/setjmp.S : Likewise.
	* sysdeps/unix/sysv/linux/sparc/fork.S : Likewise.
	* sysdeps/unix/sysv/linux/sparc/vfork.S : Likewise.
	* sysdeps/unix/sysv/linux/x86_64/vfork.S : Likewise.
	* sysdeps/unix/fork.S : Likewise.
	* sysdeps/vax/bsd-_setjmp.S : Likewise.
	* sysdeps/x86_64/bsd-_setjmp.S : Likewise.

	* sysdeps/unix/sysv/linux/ia64/sysdep.h: Guard against multiple
	inclusion.
2002-12-31 20:46:11 +00:00

142 lines
6.0 KiB
C

#ifndef _SYS_SOCKET_H
#include <socket/sys/socket.h>
/* Now define the internal interfaces. */
/* Create a new socket of type TYPE in domain DOMAIN, using
protocol PROTOCOL. If PROTOCOL is zero, one is chosen automatically.
Returns a file descriptor for the new socket, or -1 for errors. */
extern int __socket (int __domain, int __type,
int __protocol) attribute_hidden;
/* Create two new sockets, of type TYPE in domain DOMAIN and using
protocol PROTOCOL, which are connected to each other, and put file
descriptors for them in FDS[0] and FDS[1]. If PROTOCOL is zero,
one will be chosen automatically. Returns 0 on success, -1 for errors. */
extern int __socketpair (int __domain, int __type, int __protocol,
int __fds[2]) attribute_hidden;
/* Return a socket of any type. The socket can be used in subsequent
ioctl calls to talk to the kernel. */
extern int __opensock (void) internal_function attribute_hidden;
/* Put the address of the peer connected to socket FD into *ADDR
(which is *LEN bytes long), and its actual length into *LEN. */
extern int __getpeername (int __fd, __SOCKADDR_ARG __addr,
socklen_t *__len) attribute_hidden;
/* Send N bytes of BUF to socket FD. Returns the number sent or -1. */
extern ssize_t __libc_send (int __fd, __const void *__buf, size_t __n,
int __flags);
extern ssize_t __send (int __fd, __const void *__buf, size_t __n, int __flags);
libc_hidden_proto (__send)
/* Read N bytes into BUF from socket FD.
Returns the number read or -1 for errors. */
extern ssize_t __libc_recv (int __fd, void *__buf, size_t __n, int __flags);
/* Send N bytes of BUF on socket FD to peer at address ADDR (which is
ADDR_LEN bytes long). Returns the number sent, or -1 for errors. */
extern ssize_t __libc_sendto (int __fd, __const void *__buf, size_t __n,
int __flags, __CONST_SOCKADDR_ARG __addr,
socklen_t __addr_len);
/* Read N bytes into BUF through socket FD.
If ADDR is not NULL, fill in *ADDR_LEN bytes of it with tha address of
the sender, and store the actual size of the address in *ADDR_LEN.
Returns the number of bytes read or -1 for errors. */
extern ssize_t __libc_recvfrom (int __fd, void *__restrict __buf, size_t __n,
int __flags, __SOCKADDR_ARG __addr,
socklen_t *__restrict __addr_len);
/* Open a connection on socket FD to peer at ADDR (which LEN bytes long).
For connectionless socket types, just set the default address to send to
and the only address from which to accept transmissions.
Return 0 on success, -1 for errors. */
extern int __libc_connect (int __fd, __CONST_SOCKADDR_ARG __addr,
socklen_t __len);
extern int __connect (int __fd, __CONST_SOCKADDR_ARG __addr, socklen_t __len);
extern int __connect_internal (int __fd, __CONST_SOCKADDR_ARG __addr,
socklen_t __len) attribute_hidden;
/* Send N bytes of BUF on socket FD to peer at address ADDR (which is
ADDR_LEN bytes long). Returns the number sent, or -1 for errors. */
extern ssize_t __libc_sendto (int __fd, __const void *__buf, size_t __n,
int __flags, __CONST_SOCKADDR_ARG __addr,
socklen_t __addr_len);
extern ssize_t __sendto (int __fd, __const void *__buf, size_t __n,
int __flags, __CONST_SOCKADDR_ARG __addr,
socklen_t __addr_len) attribute_hidden;
/* Read N bytes into BUF through socket FD.
If ADDR is not NULL, fill in *ADDR_LEN bytes of it with tha address of
the sender, and store the actual size of the address in *ADDR_LEN.
Returns the number of bytes read or -1 for errors. */
extern ssize_t __recvfrom (int __fd, void *__restrict __buf, size_t __n,
int __flags, __SOCKADDR_ARG __addr,
socklen_t *__restrict __addr_len) attribute_hidden;
/* Send a message described MESSAGE on socket FD.
Returns the number of bytes sent, or -1 for errors. */
extern ssize_t __libc_sendmsg (int __fd, __const struct msghdr *__message,
int __flags);
extern ssize_t __sendmsg (int __fd, __const struct msghdr *__message,
int __flags) attribute_hidden;
/* Receive a message as described by MESSAGE from socket FD.
Returns the number of bytes read or -1 for errors. */
extern ssize_t __libc_recvmsg (int __fd, struct msghdr *__message,
int __flags);
extern ssize_t __recvmsg (int __fd, struct msghdr *__message,
int __flags) attribute_hidden;
/* Set socket FD's option OPTNAME at protocol level LEVEL
to *OPTVAL (which is OPTLEN bytes long).
Returns 0 on success, -1 for errors. */
extern int __setsockopt (int __fd, int __level, int __optname,
__const void *__optval,
socklen_t __optlen) attribute_hidden;
/* Put the local address of FD into *ADDR and its length in *LEN. */
extern int __getsockname (int __fd, __SOCKADDR_ARG __addr,
socklen_t *__restrict __len) attribute_hidden;
/* Give the socket FD the local address ADDR (which is LEN bytes long). */
extern int __bind (int __fd, __CONST_SOCKADDR_ARG __addr,
socklen_t __len) attribute_hidden;
/* Prepare to accept connections on socket FD.
N connection requests will be queued before further requests are refused.
Returns 0 on success, -1 for errors. */
extern int __listen (int __fd, int __n) attribute_hidden;
/* Await a connection on socket FD.
When a connection arrives, open a new socket to communicate with it,
set *ADDR (which is *ADDR_LEN bytes long) to the address of the connecting
peer and *ADDR_LEN to the address's actual length, and return the
new socket's descriptor, or -1 for errors. */
extern int __libc_accept (int __fd, __SOCKADDR_ARG __addr,
socklen_t *__restrict __addr_len)
__THROW;
libc_hidden_proto (accept)
/* Return the length of a `sockaddr' structure. */
#ifdef _HAVE_SA_LEN
# define SA_LEN(_x) (_x)->sa_len
#else
extern int __libc_sa_len (sa_family_t __af);
extern int __libc_sa_len_internal (sa_family_t __af) attribute_hidden;
# ifndef NOT_IN_libc
# define SA_LEN(_x) INTUSE(__libc_sa_len)((_x)->sa_family)
# else
# define SA_LEN(_x) __libc_sa_len((_x)->sa_family)
# endif
#endif
#ifndef NOT_IN_libc
# define __connect(fd, addr, len) INTUSE(__connect) (fd, addr, len)
#endif
#endif