summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--regress/lib/libc_r/Makefile4
-rw-r--r--regress/lib/libc_r/pcap/Makefile8
-rw-r--r--regress/lib/libc_r/pcap/pcap.c70
-rw-r--r--regress/lib/libpthread/Makefile4
-rw-r--r--regress/lib/libpthread/pcap/Makefile8
-rw-r--r--regress/lib/libpthread/pcap/pcap.c70
6 files changed, 4 insertions, 160 deletions
diff --git a/regress/lib/libc_r/Makefile b/regress/lib/libc_r/Makefile
index 67b36876805..f09a5177bfd 100644
--- a/regress/lib/libc_r/Makefile
+++ b/regress/lib/libc_r/Makefile
@@ -1,6 +1,6 @@
-# $OpenBSD: Makefile,v 1.5 2001/11/10 02:44:48 marc Exp $
+# $OpenBSD: Makefile,v 1.6 2001/11/11 01:16:26 marc Exp $
-SUBDIR= cancel close cwd execve fork group netdb pcap poll \
+SUBDIR= cancel close cwd execve fork group netdb poll \
preemption pthread_cond_timedwait pthread_create \
pthread_join pthread_mutex readdir select setjmp signal \
sigsuspend sigwait sleep socket stdarg stdio switch system
diff --git a/regress/lib/libc_r/pcap/Makefile b/regress/lib/libc_r/pcap/Makefile
deleted file mode 100644
index cfc551c9927..00000000000
--- a/regress/lib/libc_r/pcap/Makefile
+++ /dev/null
@@ -1,8 +0,0 @@
-# $OpenBSD: Makefile,v 1.1 2001/11/10 02:44:48 marc Exp $
-
-PROG= pcap
-SRCS= pcap.c
-
-LDADD+= -lpcap
-
-.include <bsd.prog.mk>
diff --git a/regress/lib/libc_r/pcap/pcap.c b/regress/lib/libc_r/pcap/pcap.c
deleted file mode 100644
index c22ed538ddb..00000000000
--- a/regress/lib/libc_r/pcap/pcap.c
+++ /dev/null
@@ -1,70 +0,0 @@
-/* $OpenBSD: pcap.c,v 1.1 2001/11/10 02:44:48 marc Exp $ */
-/*
- * Copyright (c) 2001 Marco S. Hyman
- *
- * Permission to copy all or part of this material with or without
- * modification for any purpose is granted provided that the above
- * copyright notice and this paragraph are duplicated in all copies.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
- */
-
-#include <pcap.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <unistd.h>
-
-#include "test.h"
-
-#define LOOPBACK_IF "lo0"
-#define SNAPLEN 96
-#define NO_PROMISC 0
-#define PKTCNT 3
-
-volatile int packet_count = 0;
-
-void
-packet_ignore(u_char *tag, const struct pcap_pkthdr *hdr, const u_char *data)
-{
- packet_count += 1;
-}
-
-void *
-pcap_thread(void *arg)
-{
- char errbuf[PCAP_ERRBUF_SIZE];
- pcap_t *handle;
-
- SET_NAME("pcap_thread");
- handle = pcap_open_live(LOOPBACK_IF, SNAPLEN, NO_PROMISC, 0, errbuf);
- if (!handle)
- PANIC("You may need to run this test as UID 0 (root)");
- ASSERT(pcap_loop(handle, PKTCNT, packet_ignore, 0) != -1);
- return 0;
-}
-
-void *
-ping_thread(void *arg)
-{
- SET_NAME("ping_thread");
- ASSERT(system("ping -c 3 127.0.0.1") == 0);
- sleep(2);
- ASSERT(packet_count == 3);
- SUCCEED;
-}
-
-int
-main(int argc, char **argv)
-{
- pthread_t pcap;
- pthread_t ping;
-
- CHECKr(pthread_create(&pcap, NULL, pcap_thread, NULL));
- sleep(1);
- CHECKr(pthread_create(&ping, NULL, ping_thread, NULL));
- while (1)
- ;
- PANIC("while");
-}
diff --git a/regress/lib/libpthread/Makefile b/regress/lib/libpthread/Makefile
index 67b36876805..f09a5177bfd 100644
--- a/regress/lib/libpthread/Makefile
+++ b/regress/lib/libpthread/Makefile
@@ -1,6 +1,6 @@
-# $OpenBSD: Makefile,v 1.5 2001/11/10 02:44:48 marc Exp $
+# $OpenBSD: Makefile,v 1.6 2001/11/11 01:16:26 marc Exp $
-SUBDIR= cancel close cwd execve fork group netdb pcap poll \
+SUBDIR= cancel close cwd execve fork group netdb poll \
preemption pthread_cond_timedwait pthread_create \
pthread_join pthread_mutex readdir select setjmp signal \
sigsuspend sigwait sleep socket stdarg stdio switch system
diff --git a/regress/lib/libpthread/pcap/Makefile b/regress/lib/libpthread/pcap/Makefile
deleted file mode 100644
index cfc551c9927..00000000000
--- a/regress/lib/libpthread/pcap/Makefile
+++ /dev/null
@@ -1,8 +0,0 @@
-# $OpenBSD: Makefile,v 1.1 2001/11/10 02:44:48 marc Exp $
-
-PROG= pcap
-SRCS= pcap.c
-
-LDADD+= -lpcap
-
-.include <bsd.prog.mk>
diff --git a/regress/lib/libpthread/pcap/pcap.c b/regress/lib/libpthread/pcap/pcap.c
deleted file mode 100644
index c22ed538ddb..00000000000
--- a/regress/lib/libpthread/pcap/pcap.c
+++ /dev/null
@@ -1,70 +0,0 @@
-/* $OpenBSD: pcap.c,v 1.1 2001/11/10 02:44:48 marc Exp $ */
-/*
- * Copyright (c) 2001 Marco S. Hyman
- *
- * Permission to copy all or part of this material with or without
- * modification for any purpose is granted provided that the above
- * copyright notice and this paragraph are duplicated in all copies.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
- */
-
-#include <pcap.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <unistd.h>
-
-#include "test.h"
-
-#define LOOPBACK_IF "lo0"
-#define SNAPLEN 96
-#define NO_PROMISC 0
-#define PKTCNT 3
-
-volatile int packet_count = 0;
-
-void
-packet_ignore(u_char *tag, const struct pcap_pkthdr *hdr, const u_char *data)
-{
- packet_count += 1;
-}
-
-void *
-pcap_thread(void *arg)
-{
- char errbuf[PCAP_ERRBUF_SIZE];
- pcap_t *handle;
-
- SET_NAME("pcap_thread");
- handle = pcap_open_live(LOOPBACK_IF, SNAPLEN, NO_PROMISC, 0, errbuf);
- if (!handle)
- PANIC("You may need to run this test as UID 0 (root)");
- ASSERT(pcap_loop(handle, PKTCNT, packet_ignore, 0) != -1);
- return 0;
-}
-
-void *
-ping_thread(void *arg)
-{
- SET_NAME("ping_thread");
- ASSERT(system("ping -c 3 127.0.0.1") == 0);
- sleep(2);
- ASSERT(packet_count == 3);
- SUCCEED;
-}
-
-int
-main(int argc, char **argv)
-{
- pthread_t pcap;
- pthread_t ping;
-
- CHECKr(pthread_create(&pcap, NULL, pcap_thread, NULL));
- sleep(1);
- CHECKr(pthread_create(&ping, NULL, ping_thread, NULL));
- while (1)
- ;
- PANIC("while");
-}