This is the mail archive of the mailing list for the glibc project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

FreeBSD port (4): declare __libc_sendto and __libc_recvfrom


The FreeBSD port needs to call the functions __libc_sendto, __libc_recvfrom,
for its implementation of the functions send() and recv().  To avoid
warnings, here is a patch to declare this in the glibc-internal header files.

2002-07-06  Bruno Haible  <>

	* include/sys/socket.h (__libc_sendto, __libc_recvfrom): New

diff -r -c3 glibc-20020627.bak/include/sys/socket.h glibc-20020627/include/sys/socket.h
--- glibc-20020627.bak/include/sys/socket.h	Wed May 15 14:30:18 2002
+++ glibc-20020627/include/sys/socket.h	Fri Jul  5 01:19:45 2002
@@ -2,6 +2,10 @@
 #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;
@@ -24,6 +28,20 @@
 /* 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);
+/* 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.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]