mirror of
https://sourceware.org/git/glibc.git
synced 2024-11-19 19:40:06 +00:00
08f600749e
* include/sys/socket.h: Declare __libc_sa_len_internal and define SA_LEN macro to use it if not NOT_IN_libc. * sysdeps/unix/sysv/linux/sa_len.c: Use INTDEF for __libc_sa_len. * include/fcntl.h: Declare __open_internal and define __open and __libc_open macros if not NOT_IN_libc. * sysdeps/generic/open.c: Use INTDEF for __open. * sysdeps/mach/hurd/open.c: Likewise. * sysdeps/unix/sysv/aix/open.c: Likewise. * sysdeps/unix/syscalls.list: Add __open_internal alias. * sysdeps/generic/check_fds.c: Make sure newly opened file descriptor has correct number. * include/fcntl.h: Define __libc_fcntl macro if not NOT_IN_libc. * sysdeps/mach/hurd/fcntl.c: Undefine __libc_fcntl as well. * sysdeps/unix/sysv/aix/fcntl.c: Likewise. * sysdeps/unix/sysv/linux/i386/fcntl.c: Likewise. * include/wctype.h: Declare __iswalpha_l_internal, __iswdigit_l_internal, __iswspace_l_internal, __iswxdigit_l_internal, and __iswctype_internal. Define __iswalpha_l, __iswctype, __iswdigit_l, __iswspace_l, and __iswxdigit_l macros if not NOT_IN_libc. * wctype/iswctype.c: Use INTDEF for __iswctype. * wctype/wcfuncs_l.c: Use INTDEF for all __iswXXX_l.
52 lines
2.0 KiB
C
52 lines
2.0 KiB
C
#ifndef _SYS_SOCKET_H
|
|
#include <socket/sys/socket.h>
|
|
|
|
/* Now define the internal interfaces. */
|
|
extern int __socket (int __domain, int __type, int __protocol);
|
|
|
|
/* 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]);
|
|
|
|
/* 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;
|
|
|
|
/* 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);
|
|
|
|
/* Send N bytes of BUF to socket FD. Returns the number sent or -1. */
|
|
extern ssize_t __send (int __fd, __const void *__buf, size_t __n, int __flags);
|
|
|
|
/* 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 __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;
|
|
|
|
/* 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
|