MCPcopy Create free account
hub / github.com/F-Stack/f-stack / ff_sendto

Function ff_sendto

lib/ff_syscall_wrapper.c:1181–1214  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1179}
1180
1181ssize_t
1182ff_sendto(int s, const void *buf, size_t len, int flags,
1183 const struct linux_sockaddr *to, socklen_t tolen)
1184{
1185 struct msghdr msg;
1186 struct iovec aiov;
1187 int rc;
1188
1189 struct sockaddr_storage bsdaddr;
1190 struct sockaddr *pf = (struct sockaddr *)&bsdaddr;
1191
1192 if (to) {
1193 linux2freebsd_sockaddr(to, tolen, pf);
1194 } else {
1195 pf = NULL;
1196 }
1197
1198 msg.msg_name = pf;
1199 msg.msg_namelen = tolen;
1200 msg.msg_iov = &aiov;
1201 msg.msg_iovlen = 1;
1202 msg.msg_control = 0;
1203 aiov.iov_base = __DECONST(void *, buf);
1204 aiov.iov_len = len;
1205 if ((rc = sendit(curthread, s, &msg, flags)))
1206 goto kern_fail;
1207
1208 rc = curthread->td_retval[0];
1209
1210 return (rc);
1211kern_fail:
1212 ff_os_errno(rc);
1213 return (-1);
1214}
1215
1216ssize_t
1217ff_sendmsg(int s, const struct msghdr *msg, int flags)

Callers 4

ff_sendFunction · 0.85
sendtoFunction · 0.85
ff_sys_sendtoFunction · 0.85
ff_hook_sendtoFunction · 0.85

Calls 3

linux2freebsd_sockaddrFunction · 0.85
senditFunction · 0.85
ff_os_errnoFunction · 0.85

Tested by

no test coverage detected