mountpoint.c revision aff1e150e13980354cfd794c74dac76a791a641e
/* Copyright (c) 2006 Timo Sirainen */
#include "lib.h"
#include "mountpoint.h"
#ifdef HAVE_STATVFS_MNTFROMNAME
# define STATVFS_STR "statvfs"
#elif defined(HAVE_STATFS_MNTFROMNAME)
# define STATVFS_STR "statfs"
#elif defined(HAVE_MNTENT_H)
# include <stdio.h>
# include <mntent.h> /* Linux */
#elif defined(HAVE_SYS_MNTTAB_H)
# include <stdio.h>
#else
# define MOUNTPOINT_UNKNOWN
#endif
#ifdef HAVE_SYS_MNTTAB_H
#else
#endif
/* AIX doesn't have these defined */
#ifndef MNTTYPE_SWAP
# define MNTTYPE_SWAP "swap"
#endif
#ifndef MNTTYPE_IGNORE
# define MNTTYPE_IGNORE "ignore"
#endif
{
#ifdef MOUNTPOINT_UNKNOWN
return -1;
/* BSDs */
return 0;
return -1;
}
#ifdef __osf__ /* Tru64 */
#else
#endif
return 1;
#else
#ifdef HAVE_SYS_MNTTAB_H
#else
#endif
unsigned int block_size;
FILE *f;
return 0;
return -1;
}
#ifdef HAVE_SYS_MNTTAB_H
/* Solaris */
if (f == NULL) {
return -1;
}
continue;
break;
}
}
fclose(f);
#else
/* Linux */
if (f == NULL) {
return -1;
}
continue;
break;
}
}
endmntent(f);
#endif
if (device_path == NULL)
return 0;
return 1;
#endif
}