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

Function orecvmsg

freebsd/kern/uipc_syscalls.c:1146–1167  ·  view source on GitHub ↗

* Old recvmsg. This code takes advantage of the fact that the old msghdr * overlays the new one, missing only the flags, and with the (old) access * rights where the control fields are now. */

Source from the content-addressed store, hash-verified

1144 * rights where the control fields are now.
1145 */
1146int
1147orecvmsg(struct thread *td, struct orecvmsg_args *uap)
1148{
1149 struct msghdr msg;
1150 struct iovec *iov;
1151 int error;
1152
1153 error = copyin(uap->msg, &msg, sizeof (struct omsghdr));
1154 if (error != 0)
1155 return (error);
1156 error = copyiniov(msg.msg_iov, msg.msg_iovlen, &iov, EMSGSIZE);
1157 if (error != 0)
1158 return (error);
1159 msg.msg_flags = uap->flags | MSG_COMPAT;
1160 msg.msg_iov = iov;
1161 error = recvit(td, uap->s, &msg, &uap->msg->msg_namelen);
1162 if (msg.msg_controllen && error == 0)
1163 error = copyout(&msg.msg_controllen,
1164 &uap->msg->msg_accrightslen, sizeof (int));
1165 free(iov, M_IOV);
1166 return (error);
1167}
1168#endif
1169
1170int

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