From 45ddc6eda8d94a1e4fd2e380d8671a1249822ac2 Mon Sep 17 00:00:00 2001 From: Christian Neukirchen Date: Mon, 26 Oct 2015 22:59:23 +0100 Subject: add fstype for Solaris Tested on SunOS omnios 5.11 omnios-85fef88 i86pc i386 i86pc --- lr.c | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) (limited to 'lr.c') diff --git a/lr.c b/lr.c index 8c7892c..d7cf116 100644 --- a/lr.c +++ b/lr.c @@ -40,6 +40,7 @@ #include #include #include +#include #include #include #include @@ -50,6 +51,11 @@ #include #include +/* For Solaris. */ +#if !defined(FNM_CASEFOLD) && defined(FNM_IGNORECASE) +#define FNM_CASEFOLD FNM_IGNORECASE +#endif + static int Dflag; static int Hflag; static int Lflag; @@ -673,6 +679,33 @@ scan_filesystems() scanned_filesystems = 1; } +#elif defined(__SVR4) +#include +void +scan_filesystems() +{ + FILE *mtab; + struct mnttab mnt; + struct stat st; + + mtab = fopen("/etc/mnttab", "r"); + if (!mtab) + return; + + while (getmntent(mtab, &mnt) == 0) { + if (stat(mnt.mnt_mountp, &st) < 0) + continue; + + struct idmap *newkey = malloc(sizeof (struct idmap)); + newkey->id = st.st_dev; + newkey->name = strdup(mnt.mnt_fstype); + tsearch(newkey, &filesystems, idorder); + }; + + fclose(mtab); + + scanned_filesystems = 1; +} #elif defined(__FreeBSD__) || defined(__OpenBSD__) || (defined(__APPLE__) && defined(__MACH__)) #include #include -- cgit 1.4.1