Changeset View
Changeset View
Standalone View
Standalone View
sys/kern/uipc_syscalls.c
Show First 20 Lines • Show All 818 Lines • ▼ Show 20 Lines | |||||
bad: | bad: | ||||
fdrop(fp, td); | fdrop(fp, td); | ||||
return (error); | return (error); | ||||
} | } | ||||
int | int | ||||
sys_sendto(struct thread *td, struct sendto_args *uap) | sys_sendto(struct thread *td, struct sendto_args *uap) | ||||
{ | { | ||||
return (kern_sendto(td, uap->s, uap->buf, uap->len, | |||||
uap->flags, uap->to, uap->tolen)); | |||||
} | |||||
int | |||||
kern_sendto(struct thread *td, int s, const void *buf, size_t len, | |||||
int flags, const struct sockaddr *to, int tolen) | |||||
{ | |||||
struct msghdr msg; | struct msghdr msg; | ||||
struct iovec aiov; | struct iovec aiov; | ||||
msg.msg_name = __DECONST(void *, uap->to); | msg.msg_name = __DECONST(void *, to); | ||||
msg.msg_namelen = uap->tolen; | msg.msg_namelen = tolen; | ||||
msg.msg_iov = &aiov; | msg.msg_iov = &aiov; | ||||
msg.msg_iovlen = 1; | msg.msg_iovlen = 1; | ||||
msg.msg_control = 0; | msg.msg_control = 0; | ||||
#ifdef COMPAT_OLDSOCK | #ifdef COMPAT_OLDSOCK | ||||
if (SV_PROC_FLAG(td->td_proc, SV_AOUT)) | if (SV_PROC_FLAG(td->td_proc, SV_AOUT)) | ||||
msg.msg_flags = 0; | msg.msg_flags = 0; | ||||
#endif | #endif | ||||
aiov.iov_base = __DECONST(void *, uap->buf); | aiov.iov_base = __DECONST(void *, buf); | ||||
aiov.iov_len = uap->len; | aiov.iov_len = len; | ||||
return (sendit(td, uap->s, &msg, uap->flags)); | return (sendit(td, s, &msg, flags)); | ||||
} | } | ||||
#ifdef COMPAT_OLDSOCK | #ifdef COMPAT_OLDSOCK | ||||
int | int | ||||
osend(struct thread *td, struct osend_args *uap) | osend(struct thread *td, struct osend_args *uap) | ||||
{ | { | ||||
struct msghdr msg; | struct msghdr msg; | ||||
struct iovec aiov; | struct iovec aiov; | ||||
▲ Show 20 Lines • Show All 783 Lines • Show Last 20 Lines |