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

Function sys_recvmsg

freebsd/kern/uipc_syscalls.c:1170–1197  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1168#endif
1169
1170int
1171sys_recvmsg(struct thread *td, struct recvmsg_args *uap)
1172{
1173 struct msghdr msg;
1174 struct iovec *uiov, *iov;
1175 int error;
1176
1177 error = copyin(uap->msg, &msg, sizeof (msg));
1178 if (error != 0)
1179 return (error);
1180 error = copyiniov(msg.msg_iov, msg.msg_iovlen, &iov, EMSGSIZE);
1181 if (error != 0)
1182 return (error);
1183 msg.msg_flags = uap->flags;
1184#ifdef COMPAT_OLDSOCK
1185 if (SV_PROC_FLAG(td->td_proc, SV_AOUT))
1186 msg.msg_flags &= ~MSG_COMPAT;
1187#endif
1188 uiov = msg.msg_iov;
1189 msg.msg_iov = iov;
1190 error = recvit(td, uap->s, &msg, NULL);
1191 if (error == 0) {
1192 msg.msg_iov = uiov;
1193 error = copyout(&msg, uap->msg, sizeof(msg));
1194 }
1195 free(iov, M_IOV);
1196 return (error);
1197}
1198
1199int
1200sys_shutdown(struct thread *td, struct shutdown_args *uap)

Callers

nothing calls this directly

Calls 5

recvitFunction · 0.85
copyiniovFunction · 0.70
freeFunction · 0.70
copyinFunction · 0.50
copyoutFunction · 0.50

Tested by

no test coverage detected