diff options
Diffstat (limited to 'support/nfs/cacheio.c')
-rw-r--r-- | support/nfs/cacheio.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/support/nfs/cacheio.c b/support/nfs/cacheio.c index 960d801..2af4fa3 100644 --- a/support/nfs/cacheio.c +++ b/support/nfs/cacheio.c @@ -19,6 +19,10 @@ #include <stdio.h> #include <ctype.h> #include <unistd.h> +#include <sys/types.h> +#include <sys/stat.h> +#include <fcntl.h> +#include <time.h> void qword_add(char **bpp, int *lp, char *str) { @@ -214,3 +218,15 @@ int readline(int fd, char **buf, int *lenp) return 1; } + +/* Check if we should use the new caching interface + * This succeeds iff the "nfsd" filesystem is mounted on + * /proc/fs/nfs + */ +int +check_new_cache(void) +{ + struct stat stb; + return (stat("/proc/fs/nfs/filehandle", &stb) == 0); +} + |