summaryrefslogtreecommitdiffstats
path: root/usr.bin/find
diff options
context:
space:
mode:
authorjb <jb@FreeBSD.org>1998-01-10 21:36:34 +0000
committerjb <jb@FreeBSD.org>1998-01-10 21:36:34 +0000
commit76bf3c3e0e912e1f500550c97869c9c77da8c26d (patch)
tree3ee91d36671d1b1f47f05cc606af312aecbf80de /usr.bin/find
parent3b5bff74dbee91e86e636f332098f4232eb502cf (diff)
downloadFreeBSD-src-76bf3c3e0e912e1f500550c97869c9c77da8c26d.zip
FreeBSD-src-76bf3c3e0e912e1f500550c97869c9c77da8c26d.tar.gz
A partial frontal lobotomy for find if using the NetBSD libc which
doesn't know about getvfsbyname() and the vfsconf structure. This disables the -fstype option if compiled with a pre-processor that defines __NetBSD__. With the FreeBSD built pre-processor, find can only be built with the FreeBSD libc. So when running with a NetBSD kernel, FreeBSD's libc will have to return ENOSYS for things that NetBSD doesn't support. That's life in a hybrid world.
Diffstat (limited to 'usr.bin/find')
-rw-r--r--usr.bin/find/extern.h2
-rw-r--r--usr.bin/find/function.c2
-rw-r--r--usr.bin/find/option.c9
3 files changed, 12 insertions, 1 deletions
diff --git a/usr.bin/find/extern.h b/usr.bin/find/extern.h
index b587015..a11183d 100644
--- a/usr.bin/find/extern.h
+++ b/usr.bin/find/extern.h
@@ -56,7 +56,9 @@ PLAN *c_depth __P((void));
PLAN *c_exec __P((char ***, int));
PLAN *c_execdir __P((char ***));
PLAN *c_follow __P((void));
+#if !defined(__NetBSD__)
PLAN *c_fstype __P((char *));
+#endif
PLAN *c_group __P((char *));
PLAN *c_inum __P((char *));
PLAN *c_links __P((char *));
diff --git a/usr.bin/find/function.c b/usr.bin/find/function.c
index 7c552ef..1810296 100644
--- a/usr.bin/find/function.c
+++ b/usr.bin/find/function.c
@@ -559,6 +559,7 @@ f_fstype(plan, entry)
}
}
+#if !defined(__NetBSD__)
PLAN *
c_fstype(arg)
char *arg;
@@ -598,6 +599,7 @@ c_fstype(arg)
errx(1, "%s: unknown file type", arg);
/* NOTREACHED */
}
+#endif
/*
* -group gname functions --
diff --git a/usr.bin/find/option.c b/usr.bin/find/option.c
index ef5916f..0005cb6 100644
--- a/usr.bin/find/option.c
+++ b/usr.bin/find/option.c
@@ -39,7 +39,7 @@
static char sccsid[] = "@(#)option.c 8.2 (Berkeley) 4/16/94";
*/
static const char rcsid[] =
- "$Id$";
+ "$Id: option.c,v 1.6 1997/11/28 15:48:08 steve Exp $";
#endif /* not lint */
#include <sys/types.h>
@@ -71,7 +71,14 @@ static OPTION const options[] = {
{ "-exec", N_EXEC, c_exec, O_ARGVP },
{ "-execdir", N_EXECDIR, c_execdir, O_ARGVP },
{ "-follow", N_FOLLOW, c_follow, O_ZERO },
+
+/*
+ * NetBSD doesn't provide a getvfsbyname(), so this option
+ * is not available if using a NetBSD kernel.
+ */
+#if !defined(__NetBSD__)
{ "-fstype", N_FSTYPE, c_fstype, O_ARGV },
+#endif
{ "-group", N_GROUP, c_group, O_ARGV },
{ "-inum", N_INUM, c_inum, O_ARGV },
{ "-links", N_LINKS, c_links, O_ARGV },
OpenPOWER on IntegriCloud