Changeset View
Changeset View
Standalone View
Standalone View
sys/compat/linux/linux_socket.c
Show First 20 Lines • Show All 784 Lines • ▼ Show 20 Lines | struct linux_send_args { | ||||
register_t msg; | register_t msg; | ||||
register_t len; | register_t len; | ||||
register_t flags; | register_t flags; | ||||
}; | }; | ||||
static int | static int | ||||
linux_send(struct thread *td, struct linux_send_args *args) | linux_send(struct thread *td, struct linux_send_args *args) | ||||
{ | { | ||||
struct sendto_args /* { | |||||
int s; | |||||
caddr_t buf; | |||||
int len; | |||||
int flags; | |||||
caddr_t to; | |||||
int tolen; | |||||
} */ bsd_args; | |||||
struct file *fp; | struct file *fp; | ||||
int error, fflag; | int error, fflag; | ||||
bsd_args.s = args->s; | error = kern_sendto(td, args->s, PTRIN(args->msg), args->len, | ||||
bsd_args.buf = (caddr_t)PTRIN(args->msg); | args->flags, NULL, 0); | ||||
bsd_args.len = args->len; | |||||
bsd_args.flags = args->flags; | |||||
bsd_args.to = NULL; | |||||
bsd_args.tolen = 0; | |||||
error = sys_sendto(td, &bsd_args); | |||||
if (error == ENOTCONN) { | if (error == ENOTCONN) { | ||||
/* | /* | ||||
* Linux doesn't return ENOTCONN for non-blocking sockets. | * Linux doesn't return ENOTCONN for non-blocking sockets. | ||||
* Instead it returns the EAGAIN. | * Instead it returns the EAGAIN. | ||||
*/ | */ | ||||
error = getsock_cap(td, args->s, &cap_send_rights, &fp, | error = getsock_cap(td, args->s, &cap_send_rights, &fp, | ||||
&fflag, NULL); | &fflag, NULL); | ||||
if (error == 0) { | if (error == 0) { | ||||
▲ Show 20 Lines • Show All 857 Lines • Show Last 20 Lines |