4 #ifdef CONFIG_GETMNTENT
7 #define MTAB "/etc/mtab"
9 int device_is_mounted(const char *dev)
15 mtab = setmntent(MTAB, "r");
19 while ((mnt = getmntent(mtab)) != NULL) {
22 if (!strcmp(mnt->mnt_fsname, dev)) {
32 #elif defined(CONFIG_GETMNTINFO)
34 #include <sys/param.h>
35 #include <sys/mount.h>
37 int device_is_mounted(const char *dev)
42 ret = getmntinfo(&st, MNT_NOWAIT);
46 for (i = 0; i < ret; i++) {
47 if (!strcmp(st[i].f_mntfromname, dev))