Changeset View
Changeset View
Standalone View
Standalone View
head/sys/compat/cloudabi/cloudabi_sock.c
| Show First 20 Lines • Show All 204 Lines • ▼ Show 20 Lines | cloudabi_sys_sock_stat_get(struct thread *td, | ||||
| cloudabi_sockstat_t ss = {}; | cloudabi_sockstat_t ss = {}; | ||||
| cap_rights_t rights; | cap_rights_t rights; | ||||
| struct file *fp; | struct file *fp; | ||||
| struct sockaddr *sa; | struct sockaddr *sa; | ||||
| struct socket *so; | struct socket *so; | ||||
| int error; | int error; | ||||
| error = getsock_cap(td, uap->sock, cap_rights_init(&rights, | error = getsock_cap(td, uap->sock, cap_rights_init(&rights, | ||||
| CAP_GETSOCKOPT, CAP_GETPEERNAME, CAP_GETSOCKNAME), &fp, NULL); | CAP_GETSOCKOPT, CAP_GETPEERNAME, CAP_GETSOCKNAME), &fp, NULL, NULL); | ||||
| if (error != 0) | if (error != 0) | ||||
| return (error); | return (error); | ||||
| so = fp->f_data; | so = fp->f_data; | ||||
| CURVNET_SET(so->so_vnet); | CURVNET_SET(so->so_vnet); | ||||
| /* Set ss_sockname. */ | /* Set ss_sockname. */ | ||||
| error = so->so_proto->pr_usrreqs->pru_sockaddr(so, &sa); | error = so->so_proto->pr_usrreqs->pru_sockaddr(so, &sa); | ||||
| Show All 31 Lines | |||||