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

Function ff_recvmsg

lib/ff_syscall_wrapper.c:1305–1329  ·  view source on GitHub ↗

* It is considered here that the upper 4 bytes of * msg->iovlen and msg->msg_controllen in linux_msghdr are 0. */

Source from the content-addressed store, hash-verified

1303 * msg->iovlen and msg->msg_controllen in linux_msghdr are 0.
1304 */
1305ssize_t
1306ff_recvmsg(int s, struct msghdr *msg, int flags)
1307{
1308 int rc, ret;
1309 struct msghdr freebsd_msg;
1310
1311 ret = linux2freebsd_msghdr((struct linux_msghdr *)msg, &freebsd_msg, 0);
1312 if (ret < 0) {
1313 rc = EINVAL;
1314 goto kern_fail;
1315 }
1316 freebsd_msg.msg_flags = flags;
1317
1318 if ((rc = kern_recvit(curthread, s, &freebsd_msg, UIO_SYSSPACE, NULL))) {
1319 goto kern_fail;
1320 }
1321 rc = curthread->td_retval[0];
1322
1323 freebsd2linux_msghdr((struct linux_msghdr *)msg, &freebsd_msg, 0);
1324
1325 return (rc);
1326kern_fail:
1327 ff_os_errno(rc);
1328 return (-1);
1329}
1330
1331int
1332ff_fcntl(int fd, int cmd, ...)

Callers 2

recvmsgFunction · 0.85
ff_sys_recvmsgFunction · 0.85

Calls 4

linux2freebsd_msghdrFunction · 0.85
kern_recvitFunction · 0.85
freebsd2linux_msghdrFunction · 0.85
ff_os_errnoFunction · 0.85

Tested by

no test coverage detected