Print this page
9704 move socket functions to libc

@@ -1065,81 +1065,82 @@
             /* const union sigval */ void *value, int si_code, int block);
         return (__sigqueue(pid, signo, value.sival_ptr, SI_QUEUE, 0));
 }
 
 int
-_so_accept(int sock, struct sockaddr *addr, uint_t *addrlen, int version,
-    int flags)
+_so_accept(int sock, struct sockaddr *addr, socklen_t *addrlen,
+    int version, int flags)
 {
-        extern int __so_accept(int, struct sockaddr *, uint_t *, int, int);
+        extern int __so_accept(int, struct sockaddr *, socklen_t *, int, int);
         int rv;
 
         PERFORM(__so_accept(sock, addr, addrlen, version, flags))
 }
 
 int
-_so_connect(int sock, struct sockaddr *addr, uint_t addrlen, int version)
+_so_connect(int sock, const struct sockaddr *addr, socklen_t addrlen,
+    int version)
 {
-        extern int __so_connect(int, struct sockaddr *, uint_t, int);
+        extern int __so_connect(int, const struct sockaddr *, socklen_t, int);
         int rv;
 
         PERFORM(__so_connect(sock, addr, addrlen, version))
 }
 
-int
+ssize_t
 _so_recv(int sock, void *buf, size_t len, int flags)
 {
-        extern int __so_recv(int, void *, size_t, int);
+        extern ssize_t __so_recv(int, void *, size_t, int);
         int rv;
 
         PERFORM(__so_recv(sock, buf, len, flags))
 }
 
-int
-_so_recvfrom(int sock, void *buf, size_t len, int flags,
-    struct sockaddr *addr, int *addrlen)
+ssize_t
+_so_recvfrom(int sock, void *buf, size_t len, int flags, struct sockaddr *addr,
+    socklen_t *addrlen)
 {
-        extern int __so_recvfrom(int, void *, size_t, int,
-            struct sockaddr *, int *);
+        extern ssize_t __so_recvfrom(int, void *, size_t, int,
+            struct sockaddr *, socklen_t *);
         int rv;
 
         PERFORM(__so_recvfrom(sock, buf, len, flags, addr, addrlen))
 }
 
-int
+ssize_t
 _so_recvmsg(int sock, struct msghdr *msg, int flags)
 {
-        extern int __so_recvmsg(int, struct msghdr *, int);
+        extern ssize_t __so_recvmsg(int, struct msghdr *, int);
         int rv;
 
         PERFORM(__so_recvmsg(sock, msg, flags))
 }
 
-int
+ssize_t
 _so_send(int sock, const void *buf, size_t len, int flags)
 {
-        extern int __so_send(int, const void *, size_t, int);
+        extern ssize_t __so_send(int, const void *, size_t, int);
         int rv;
 
         PERFORM(__so_send(sock, buf, len, flags))
 }
 
-int
+ssize_t
 _so_sendmsg(int sock, const struct msghdr *msg, int flags)
 {
-        extern int __so_sendmsg(int, const struct msghdr *, int);
+        extern ssize_t __so_sendmsg(int, const struct msghdr *, int);
         int rv;
 
         PERFORM(__so_sendmsg(sock, msg, flags))
 }
 
-int
+ssize_t
 _so_sendto(int sock, const void *buf, size_t len, int flags,
-    const struct sockaddr *addr, int *addrlen)
+    const struct sockaddr *addr, socklen_t addrlen)
 {
-        extern int __so_sendto(int, const void *, size_t, int,
-            const struct sockaddr *, int *);
+        extern ssize_t __so_sendto(int, const void *, size_t, int,
+            const struct sockaddr *, socklen_t);
         int rv;
 
         PERFORM(__so_sendto(sock, buf, len, flags, addr, addrlen))
 }