Add a helper so tests can determine if they are running on
NFS since some tests are not valid if run from NFS or the results may vary.

-k

diff -Nur ltp.orig/include/test.h ltp/include/test.h
--- ltp.orig/include/test.h     2006-05-26 01:17:53.000000000 -0500
+++ ltp/include/test.h  2007-11-14 13:29:46.000000000 -0600
@@ -236,6 +236,7 @@
extern int tst_kvercmp(int, int, int);
extern int tst_is_cwd_tmpfs();
+extern int tst_is_cwd_nfs();
extern int tst_cwd_has_free(int required_kib);
extern int Tst_count;
diff -Nur ltp.orig/lib/tst_is_cwd_nfs.c ltp/lib/tst_is_cwd_nfs.c
--- ltp.orig/lib/tst_is_cwd_nfs.c 1969-12-31 18:00:00.000000000 -0600
+++ ltp/lib/tst_is_cwd_nfs.c    2007-11-14 13:29:08.000000000 -0600
@@ -0,0 +1,26 @@
+/*
+ *    AUTHOR
+ *     Kumar Gala <[EMAIL PROTECTED]>, 2007-11-14
+ *     based on tst_is_cwd_tmpfs()
+ *
+ *    DESCRIPTION
+ *     Check if current directory is on a nfs filesystem
+ *     If current directory is nfs, return 1
+ *     If current directory is NOT nfs, return 0
+ *
+ *
+ */
+
+#include <sys/vfs.h>
+
+#define NFS_MAGIC 0x6969 /* man 2 statfs */
+
+int
+tst_is_cwd_nfs()
+{
+       struct statfs sf;
+       statfs(".", &sf);
+
+       /* Verify that the file is not on a nfs filesystem */
+       return sf.f_type == NFS_MAGIC?1:0;
+}

Attachment: ltp-add-tst-nfs-lib.patch
Description: Binary data

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

Reply via email to