* 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. */
| 1144 | * rights where the control fields are now. |
| 1145 | */ |
| 1146 | int |
| 1147 | orecvmsg(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 | |
| 1170 | int |