Changeset View
Changeset View
Standalone View
Standalone View
usr.sbin/bhyve/rfb.c
Show All 39 Lines | |||||
#include <sys/time.h> | #include <sys/time.h> | ||||
#include <arpa/inet.h> | #include <arpa/inet.h> | ||||
#include <machine/cpufunc.h> | #include <machine/cpufunc.h> | ||||
#include <machine/specialreg.h> | #include <machine/specialreg.h> | ||||
#include <netinet/in.h> | #include <netinet/in.h> | ||||
#include <netdb.h> | #include <netdb.h> | ||||
#include <assert.h> | #include <assert.h> | ||||
#ifndef WITHOUT_CAPSICUM | |||||
#include <capsicum_helpers.h> | |||||
#endif | |||||
#include <err.h> | #include <err.h> | ||||
#include <errno.h> | #include <errno.h> | ||||
#include <pthread.h> | #include <pthread.h> | ||||
#include <pthread_np.h> | #include <pthread_np.h> | ||||
#include <signal.h> | #include <signal.h> | ||||
#include <stdbool.h> | #include <stdbool.h> | ||||
#include <stdlib.h> | #include <stdlib.h> | ||||
#include <stdio.h> | #include <stdio.h> | ||||
▲ Show 20 Lines • Show All 963 Lines • ▼ Show 20 Lines | #endif | ||||
if (listen(rc->sfd, 1) < 0) { | if (listen(rc->sfd, 1) < 0) { | ||||
perror("listen"); | perror("listen"); | ||||
freeaddrinfo(ai); | freeaddrinfo(ai); | ||||
return (-1); | return (-1); | ||||
} | } | ||||
#ifndef WITHOUT_CAPSICUM | #ifndef WITHOUT_CAPSICUM | ||||
cap_rights_init(&rights, CAP_ACCEPT, CAP_EVENT, CAP_READ, CAP_WRITE); | cap_rights_init(&rights, CAP_ACCEPT, CAP_EVENT, CAP_READ, CAP_WRITE); | ||||
if (cap_rights_limit(rc->sfd, &rights) == -1 && errno != ENOSYS) | if (caph_rights_limit(rc->sfd, &rights) == -1) | ||||
errx(EX_OSERR, "Unable to apply rights for sandbox"); | errx(EX_OSERR, "Unable to apply rights for sandbox"); | ||||
#endif | #endif | ||||
rc->hw_crc = sse42_supported(); | rc->hw_crc = sse42_supported(); | ||||
rc->conn_wait = wait; | rc->conn_wait = wait; | ||||
if (wait) { | if (wait) { | ||||
pthread_mutex_init(&rc->mtx, NULL); | pthread_mutex_init(&rc->mtx, NULL); | ||||
Show All 16 Lines |