aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/csource/generated.go
diff options
context:
space:
mode:
authorGreg Steuck <blackgnezdo@gmail.com>2018-11-30 11:55:51 -0800
committerDmitry Vyukov <dvyukov@google.com>2018-11-30 19:55:51 +0000
commitd8988561c04c0244155309bdf701998b9fb98dd5 (patch)
tree9d022f5c7cf53a78828ccb4bcb6823ac59e599fa /pkg/csource/generated.go
parentf0d4c650a3a689c859bfc34db06d1fab696ff31e (diff)
openbsd: repair pkg/csource_test
Diffstat (limited to 'pkg/csource/generated.go')
-rw-r--r--pkg/csource/generated.go74
1 files changed, 35 insertions, 39 deletions
diff --git a/pkg/csource/generated.go b/pkg/csource/generated.go
index 5faa7735b..d399fb405 100644
--- a/pkg/csource/generated.go
+++ b/pkg/csource/generated.go
@@ -408,6 +408,41 @@ void child()
#if GOOS_openbsd
+#define __syscall syscall
+
+#if SYZ_EXECUTOR || __NR_syz_open_pts
+
+#include <termios.h>
+#include <util.h>
+
+static uintptr_t syz_open_pts(void)
+{
+ int master, slave;
+
+ if (openpty(&master, &slave, NULL, NULL, NULL) == -1)
+ return -1;
+ if (dup2(master, master + 100) != -1)
+ close(master);
+ return slave;
+}
+
+#endif
+
+#if SYZ_EXECUTOR || SYZ_TUN_ENABLE
+
+#include <fcntl.h>
+#include <net/if_tun.h>
+#include <sys/types.h>
+
+static int tunfd = -1;
+#define SYZ_TUN_MAX_PACKET_SIZE 1000
+#define MAX_TUN 4
+#define TUN_IFACE "tap%d"
+#define TUN_DEVICE "/dev/tap%d"
+
+#define LOCAL_IPV4 "172.20.%d.170"
+#define LOCAL_IPV6 "fe80::%02hxaa"
+
static void vsnprintf_check(char* str, size_t size, const char* format, va_list args)
{
int rv;
@@ -450,45 +485,6 @@ static void execute_command(bool panic, const char* format, ...)
}
}
-#define __syscall syscall
-
-#if SYZ_EXECUTOR || __NR_syz_open_pts
-
-#if defined(__OpenBSD__)
-#include <termios.h>
-#include <util.h>
-#else
-#include <pty.h>
-#endif
-
-static uintptr_t syz_open_pts(void)
-{
- int master, slave;
-
- if (openpty(&master, &slave, NULL, NULL, NULL) == -1)
- return -1;
- if (dup2(master, master + 100) != -1)
- close(master);
- return slave;
-}
-
-#endif
-
-#if SYZ_EXECUTOR || SYZ_TUN_ENABLE
-
-#include <fcntl.h>
-#include <net/if_tun.h>
-#include <sys/types.h>
-
-static int tunfd = -1;
-#define SYZ_TUN_MAX_PACKET_SIZE 1000
-#define MAX_TUN 4
-#define TUN_IFACE "tap%d"
-#define TUN_DEVICE "/dev/tap%d"
-
-#define LOCAL_IPV4 "172.20.%d.170"
-#define LOCAL_IPV6 "fe80::%02hxaa"
-
static void initialize_tun(int tun_id)
{
#if SYZ_EXECUTOR