use statvfs(3) on OpenBSD (#472)
This commit is contained in:
parent
126fcaef25
commit
f3b9ad2086
|
@ -63,7 +63,7 @@ static int print_bytes_human(char *outwalk, uint64_t bytes, const char *prefix_t
|
|||
* Determines whether remaining bytes are below given threshold.
|
||||
*
|
||||
*/
|
||||
#if defined(__OpenBSD__) || defined(__DragonFly__) || defined(__APPLE__)
|
||||
#if defined(__DragonFly__) || defined(__APPLE__)
|
||||
static bool below_threshold(struct statfs buf, const char *prefix_type, const char *threshold_type, const double low_threshold) {
|
||||
#else
|
||||
static bool below_threshold(struct statvfs buf, const char *prefix_type, const char *threshold_type, const double low_threshold) {
|
||||
|
@ -124,14 +124,14 @@ void print_disk_info(disk_info_ctx_t *ctx) {
|
|||
|
||||
INSTANCE(ctx->path);
|
||||
|
||||
#if defined(__OpenBSD__) || defined(__DragonFly__) || defined(__APPLE__)
|
||||
#if defined(__DragonFly__) || defined(__APPLE__)
|
||||
struct statfs buf;
|
||||
|
||||
if (statfs(path, &buf) == -1)
|
||||
return;
|
||||
|
||||
mounted = true;
|
||||
#elif defined(__NetBSD__) || defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
|
||||
#elif defined(__NetBSD__) || defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__OpenBSD__)
|
||||
struct statvfs buf;
|
||||
|
||||
if (statvfs(ctx->path, &buf) == -1)
|
||||
|
|
Loading…
Reference in New Issue