blob: 61c5c39a764b2119c89147434af10bc9e3cb3bd1 [file] [log] [blame]
plars8505e2a2005-02-01 15:01:42 +00001/*
2 * AUTHOR
3 * Ricky Ng-Adam <rngadam@yahoo.com>, 2005-01-01
4 *
5 * DESCRIPTION
6 * Check if current directory is on a tmpfs filesystem
7 * If current directory is tmpfs, return 1
8 * If current directory is NOT tmpfs, return 0
9 *
10 *
11 */
12
13#include <sys/vfs.h>
14
15#define TMPFS_MAGIC 0x01021994 /* man 2 statfs */
16
subrata_modak88c166c2009-06-09 16:01:20 +000017int tst_is_cwd_tmpfs(void)
plars8505e2a2005-02-01 15:01:42 +000018{
19 struct statfs sf;
20 statfs(".", &sf);
21
22 /* Verify that the file is not on a tmpfs (in-memory) filesystem */
23 return sf.f_type == TMPFS_MAGIC?1:0;
24}