diff options
author | Allan McRae <allan@archlinux.org> | 2010-11-16 07:15:21 +0100 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2010-12-13 03:29:43 +0100 |
commit | f4e9deb6d74614ac427b37513359d91588dd1542 (patch) | |
tree | 3f707d2046a12ee0808a3e0cbd3eed8a1d036767 /lib/libalpm/diskspace.h | |
parent | adb10c3ab244cc00eb863d5b036fa7bdd76f8152 (diff) | |
download | pacman-f4e9deb6d74614ac427b37513359d91588dd1542.tar.gz pacman-f4e9deb6d74614ac427b37513359d91588dd1542.tar.xz |
Add function for listing system mount points
Add a mount_point_list() function that attempts to portably obtain
a list of system mount points and a struct to hold needed mount point
information.
Abort the transaction if we are unable to determine the mount points.
Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'lib/libalpm/diskspace.h')
-rw-r--r-- | lib/libalpm/diskspace.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/lib/libalpm/diskspace.h b/lib/libalpm/diskspace.h index 69e39d8e..15ff2f67 100644 --- a/lib/libalpm/diskspace.h +++ b/lib/libalpm/diskspace.h @@ -20,8 +20,28 @@ #ifndef _ALPM_DISKSPACE_H #define _ALPM_DISKSPACE_H +#if defined HAVE_GETMNTINFO_STATFS +#include <sys/mount.h> +#else +#include <sys/statvfs.h> +#endif + #include "alpm.h" +typedef struct __alpm_mountpoint_t { + /* mount point information */ + char *mount_dir; +#if defined HAVE_GETMNTINFO_STATFS + struct statfs *fsp; +#else + struct statvfs *fsp; +#endif + /* storage for additional disk usage calculations */ + long blocks_needed; + long max_blocks_needed; + int used; +} alpm_mountpoint_t; + int _alpm_check_diskspace(pmtrans_t *trans, pmdb_t *db); #endif /* _ALPM_DISKSPACE_H */ |