Print this page
9704 move socket functions to libc

Split Close
Expand all
Collapse all
          --- old/usr/src/lib/libc/port/threads/scalls.c
          +++ new/usr/src/lib/libc/port/threads/scalls.c
↓ open down ↓ 1059 lines elided ↑ open up ↑
1060 1060  
1061 1061  int
1062 1062  sigqueue(pid_t pid, int signo, const union sigval value)
1063 1063  {
1064 1064          extern int __sigqueue(pid_t pid, int signo,
1065 1065              /* const union sigval */ void *value, int si_code, int block);
1066 1066          return (__sigqueue(pid, signo, value.sival_ptr, SI_QUEUE, 0));
1067 1067  }
1068 1068  
1069 1069  int
1070      -_so_accept(int sock, struct sockaddr *addr, uint_t *addrlen, int version,
1071      -    int flags)
     1070 +_so_accept(int sock, struct sockaddr *addr, socklen_t *addrlen,
     1071 +    int version, int flags)
1072 1072  {
1073      -        extern int __so_accept(int, struct sockaddr *, uint_t *, int, int);
     1073 +        extern int __so_accept(int, struct sockaddr *, socklen_t *, int, int);
1074 1074          int rv;
1075 1075  
1076 1076          PERFORM(__so_accept(sock, addr, addrlen, version, flags))
1077 1077  }
1078 1078  
1079 1079  int
1080      -_so_connect(int sock, struct sockaddr *addr, uint_t addrlen, int version)
     1080 +_so_connect(int sock, const struct sockaddr *addr, socklen_t addrlen,
     1081 +    int version)
1081 1082  {
1082      -        extern int __so_connect(int, struct sockaddr *, uint_t, int);
     1083 +        extern int __so_connect(int, const struct sockaddr *, socklen_t, int);
1083 1084          int rv;
1084 1085  
1085 1086          PERFORM(__so_connect(sock, addr, addrlen, version))
1086 1087  }
1087 1088  
1088      -int
     1089 +ssize_t
1089 1090  _so_recv(int sock, void *buf, size_t len, int flags)
1090 1091  {
1091      -        extern int __so_recv(int, void *, size_t, int);
     1092 +        extern ssize_t __so_recv(int, void *, size_t, int);
1092 1093          int rv;
1093 1094  
1094 1095          PERFORM(__so_recv(sock, buf, len, flags))
1095 1096  }
1096 1097  
1097      -int
1098      -_so_recvfrom(int sock, void *buf, size_t len, int flags,
1099      -    struct sockaddr *addr, int *addrlen)
     1098 +ssize_t
     1099 +_so_recvfrom(int sock, void *buf, size_t len, int flags, struct sockaddr *addr,
     1100 +    socklen_t *addrlen)
1100 1101  {
1101      -        extern int __so_recvfrom(int, void *, size_t, int,
1102      -            struct sockaddr *, int *);
     1102 +        extern ssize_t __so_recvfrom(int, void *, size_t, int,
     1103 +            struct sockaddr *, socklen_t *);
1103 1104          int rv;
1104 1105  
1105 1106          PERFORM(__so_recvfrom(sock, buf, len, flags, addr, addrlen))
1106 1107  }
1107 1108  
1108      -int
     1109 +ssize_t
1109 1110  _so_recvmsg(int sock, struct msghdr *msg, int flags)
1110 1111  {
1111      -        extern int __so_recvmsg(int, struct msghdr *, int);
     1112 +        extern ssize_t __so_recvmsg(int, struct msghdr *, int);
1112 1113          int rv;
1113 1114  
1114 1115          PERFORM(__so_recvmsg(sock, msg, flags))
1115 1116  }
1116 1117  
1117      -int
     1118 +ssize_t
1118 1119  _so_send(int sock, const void *buf, size_t len, int flags)
1119 1120  {
1120      -        extern int __so_send(int, const void *, size_t, int);
     1121 +        extern ssize_t __so_send(int, const void *, size_t, int);
1121 1122          int rv;
1122 1123  
1123 1124          PERFORM(__so_send(sock, buf, len, flags))
1124 1125  }
1125 1126  
1126      -int
     1127 +ssize_t
1127 1128  _so_sendmsg(int sock, const struct msghdr *msg, int flags)
1128 1129  {
1129      -        extern int __so_sendmsg(int, const struct msghdr *, int);
     1130 +        extern ssize_t __so_sendmsg(int, const struct msghdr *, int);
1130 1131          int rv;
1131 1132  
1132 1133          PERFORM(__so_sendmsg(sock, msg, flags))
1133 1134  }
1134 1135  
1135      -int
     1136 +ssize_t
1136 1137  _so_sendto(int sock, const void *buf, size_t len, int flags,
1137      -    const struct sockaddr *addr, int *addrlen)
     1138 +    const struct sockaddr *addr, socklen_t addrlen)
1138 1139  {
1139      -        extern int __so_sendto(int, const void *, size_t, int,
1140      -            const struct sockaddr *, int *);
     1140 +        extern ssize_t __so_sendto(int, const void *, size_t, int,
     1141 +            const struct sockaddr *, socklen_t);
1141 1142          int rv;
1142 1143  
1143 1144          PERFORM(__so_sendto(sock, buf, len, flags, addr, addrlen))
1144 1145  }
1145 1146  
1146 1147  int
1147 1148  tcdrain(int fildes)
1148 1149  {
1149 1150          extern int __tcdrain(int);
1150 1151          int rv;
↓ open down ↓ 23 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX