Changeset View
Changeset View
Standalone View
Standalone View
lib/libc/gen/statvfs.c
Show First 20 Lines • Show All 104 Lines • ▼ Show 20 Lines | if (from->f_flags & MNT_RDONLY) | ||||
to->f_flag |= ST_RDONLY; | to->f_flag |= ST_RDONLY; | ||||
if (from->f_flags & MNT_NOSUID) | if (from->f_flags & MNT_NOSUID) | ||||
to->f_flag |= ST_NOSUID; | to->f_flag |= ST_NOSUID; | ||||
/* XXX should we clamp negative values? */ | /* XXX should we clamp negative values? */ | ||||
#define COPY(field) \ | #define COPY(field) \ | ||||
do { \ | do { \ | ||||
to->field = from->field; \ | to->field = from->field; \ | ||||
if (from->field != to->field) { \ | if ((__typeof(from->field))from->field != (__typeof(from->field))to->field) { \ | ||||
errno = EOVERFLOW; \ | errno = EOVERFLOW; \ | ||||
return (-1); \ | return (-1); \ | ||||
} \ | } \ | ||||
} while(0) | } while(0) | ||||
COPY(f_bavail); | COPY(f_bavail); | ||||
COPY(f_bfree); | COPY(f_bfree); | ||||
COPY(f_blocks); | COPY(f_blocks); | ||||
Show All 39 Lines |