diff --git a/gtests/net/packetdrill/packet_socket_pcap.c b/gtests/net/packetdrill/packet_socket_pcap.c index 568aef97147d9842e0cb877100995c6839c39c11..e9ca862234e7989e05545bd9614a1dc5d492e068 100644 --- a/gtests/net/packetdrill/packet_socket_pcap.c +++ b/gtests/net/packetdrill/packet_socket_pcap.c @@ -35,7 +35,7 @@ #ifdef USE_LIBPCAP -#if defined(__FreeBSD__) || defined(__APPLE__) +#if defined(__FreeBSD__) || defined(__APPLE__) || defined(__SunOS_5_11) #include <pcap/pcap.h> #elif defined(__OpenBSD__) || defined(__NetBSD__) #include <pcap.h> @@ -257,7 +257,7 @@ int packet_socket_receive(struct packet_socket *psock, (u32)pkt_header->ts.tv_sec, (u32)pkt_header->ts.tv_usec); -#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__APPLE__) +#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__APPLE__) || defined(__SunOS_5_11) packet->time_usecs = timeval_to_usecs(&pkt_header->ts); #elif defined(__OpenBSD__) packet->time_usecs = bpf_timeval_to_usecs(&pkt_header->ts); diff --git a/gtests/net/packetdrill/run_system_call.c b/gtests/net/packetdrill/run_system_call.c index a0e538061e39e0d0bb3c04342fce50fb48bbd399..19776b79aac425fbd1a1daf86ddb6389a4c84091 100644 --- a/gtests/net/packetdrill/run_system_call.c +++ b/gtests/net/packetdrill/run_system_call.c @@ -6934,6 +6934,7 @@ static int await_idle_thread(struct state *state) return STATUS_OK; } +#if !defined(__SunOS_5_11) static int yield(void) { #if defined(linux) @@ -6948,6 +6949,7 @@ static int yield(void) return 0; #endif /* defined(__APPLE__) */ } +#endif /* Enqueue the system call for the syscall thread and wake up the thread. */ static void enqueue_system_call( @@ -6997,8 +6999,12 @@ static void enqueue_system_call( DEBUGP("main thread: unlocking and yielding\n"); thread_id = state->syscalls->thread_id; run_unlock(state); +#if defined(__SunOS_5_11) + yield(); +#else if (yield() != 0) die_perror("yield"); +#endif DEBUGP("main thread: checking syscall thread state\n"); if (is_thread_sleeping(getpid(), thread_id))