diff options
author | Pedro Martelletto <pedro@cvs.openbsd.org> | 2005-12-07 01:47:05 +0000 |
---|---|---|
committer | Pedro Martelletto <pedro@cvs.openbsd.org> | 2005-12-07 01:47:05 +0000 |
commit | 509dd1e74df0f75272624065d0fbe78f1279ea0d (patch) | |
tree | 2714df8854ae22aeffaf447594720bb9279b9e1c /regress/sys | |
parent | df66fdcb3f6680b2b175bd9b5c3073525f633010 (diff) |
Moved to regress/sys/dev/fdesc
Diffstat (limited to 'regress/sys')
-rw-r--r-- | regress/sys/fdescfs/Makefile | 7 | ||||
-rw-r--r-- | regress/sys/fdescfs/confuse/Makefile | 5 | ||||
-rw-r--r-- | regress/sys/fdescfs/confuse/confuse.c | 41 |
3 files changed, 0 insertions, 53 deletions
diff --git a/regress/sys/fdescfs/Makefile b/regress/sys/fdescfs/Makefile deleted file mode 100644 index 155d34b51de..00000000000 --- a/regress/sys/fdescfs/Makefile +++ /dev/null @@ -1,7 +0,0 @@ -# $OpenBSD: Makefile,v 1.2 2002/02/23 01:25:11 art Exp $ - -SUBDIR=confuse - -install: - -.include <bsd.subdir.mk> diff --git a/regress/sys/fdescfs/confuse/Makefile b/regress/sys/fdescfs/confuse/Makefile deleted file mode 100644 index 40401cd70c7..00000000000 --- a/regress/sys/fdescfs/confuse/Makefile +++ /dev/null @@ -1,5 +0,0 @@ -# $OpenBSD: Makefile,v 1.1 2002/02/08 17:33:32 art Exp $ - -PROG= confuse - -.include <bsd.regress.mk> diff --git a/regress/sys/fdescfs/confuse/confuse.c b/regress/sys/fdescfs/confuse/confuse.c deleted file mode 100644 index a46aeced9e3..00000000000 --- a/regress/sys/fdescfs/confuse/confuse.c +++ /dev/null @@ -1,41 +0,0 @@ -/* $OpenBSD: confuse.c,v 1.2 2003/07/31 21:48:07 deraadt Exp $ */ -/* - * Written by Artur Grabowski <art@openbsd.org> 2002 Public Domain. - */ -#include <stdio.h> -#include <stdlib.h> -#include <unistd.h> -#include <err.h> -#include <fcntl.h> -#include <errno.h> - -int -main(int argc, char *argv[]) -{ - char fname[64]; - int fd, newfd; - - if ((fd = open("/dev/null", O_RDONLY)) < 0) - err(1, "open(/dev/null)"); - - /* Try to confuse fdescfs by making it open into itself. */ - close(fd); - - snprintf(fname, sizeof(fname), "/dev/fd/%d", fd); - - if ((newfd = open(fname, O_RDONLY)) == fd) - errx(1, "open of %s to %d succeeded, beware.", fname, fd); - - if (newfd >= 0) - errx(1, "open(%s) gave us the unexpected %d", fname, fd); - - if (errno == ENOENT) - err(1, "open(%s)", fname); - - if (errno == ENXIO) - errx(1, "no support for fdesc in kernel"); - - warn("errno was (%d)", errno); - - return 0; -} |