* It is considered here that the upper 4 bytes of * msg->iovlen and msg->msg_controllen in linux_msghdr are 0. */
| 1303 | * msg->iovlen and msg->msg_controllen in linux_msghdr are 0. |
| 1304 | */ |
| 1305 | ssize_t |
| 1306 | ff_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); |
| 1326 | kern_fail: |
| 1327 | ff_os_errno(rc); |
| 1328 | return (-1); |
| 1329 | } |
| 1330 | |
| 1331 | int |
| 1332 | ff_fcntl(int fd, int cmd, ...) |
no test coverage detected