Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/timerfd_ctx.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
#ifndef TIMERFD_CTX_H_
#define TIMERFD_CTX_H_

#ifdef __OpenBSD__
#include <sys/time.h>
#else
#include <sys/timespec.h>
#endif

#include <errno.h>
#include <stdatomic.h>
Expand Down
4 changes: 2 additions & 2 deletions test/epoll-test.c
Original file line number Diff line number Diff line change
Expand Up @@ -562,7 +562,7 @@ ATF_TC_BODY_FD_LEAKCHECK(epoll__no_epollin_on_closed_empty_pipe, tcptr)
ATF_TC_WITHOUT_HEAD(epoll__write_to_pipe_until_full);
ATF_TC_BODY_FD_LEAKCHECK(epoll__write_to_pipe_until_full, tcptr)
{
#ifdef __NetBSD__
#if defined(__NetBSD__) || defined(__OpenBSD__)
atf_tc_skip("test assumes a pipe buffer size of 65536");
#endif
int ep = epoll_create1(EPOLL_CLOEXEC);
Expand Down Expand Up @@ -764,7 +764,7 @@ ATF_TC_BODY_FD_LEAKCHECK(epoll__socket_shutdown, tcptr)
ATF_TC_WITHOUT_HEAD(epoll__epollhup_on_fresh_socket);
ATF_TC_BODY_FD_LEAKCHECK(epoll__epollhup_on_fresh_socket, tcptr)
{
#ifdef __NetBSD__
#if defined(__NetBSD__) || defined(__OpenBSD__)
atf_tc_skip("NetBSD does not support EV_FORCEONESHOT");
#endif
int sock = socket(PF_INET, SOCK_STREAM | SOCK_CLOEXEC, 0);
Expand Down
2 changes: 2 additions & 0 deletions test/eventfd-ctx-test.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@

#include "atf-c-leakcheck.h"

#ifndef nitems
#define nitems(x) (sizeof((x)) / sizeof((x)[0]))
#endif

ATF_TC_WITHOUT_HEAD(eventfd__init_terminate);
ATF_TC_BODY_FD_LEAKCHECK(eventfd__init_terminate, tc)
Expand Down
10 changes: 9 additions & 1 deletion test/microatf/atf-c.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,14 @@

#include <unistd.h>

#ifdef __OpenBSD__
#define STAILQ_ENTRY SIMPLEQ_ENTRY
#define STAILQ_FOREACH SIMPLEQ_FOREACH
#define STAILQ_HEAD SIMPLEQ_HEAD
#define STAILQ_HEAD_INITIALIZER SIMPLEQ_HEAD_INITIALIZER
#define STAILQ_INSERT_TAIL SIMPLEQ_INSERT_TAIL
#endif

/**/

#define MICROATF_ATTRIBUTE_UNUSED __attribute__((__unused__))
Expand Down Expand Up @@ -133,7 +141,7 @@ microatf_context_write_result_pack(microatf_context_t *context,
return;
}

#ifdef __NetBSD__
#if defined(__NetBSD__) || defined(__OpenBSD__)
fclose(context->result_file);
context->result_file = fopen(context->result_file_path, "w");
#else
Expand Down
2 changes: 2 additions & 0 deletions test/timerfd-test.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@

#ifndef __linux__
#include <sys/event.h>
#ifndef __OpenBSD__
#include <sys/timespec.h>
#endif
#endif

#include <sys/param.h>
#include <sys/select.h>
Expand Down