df.c (90108) | df.c (91081) |
---|---|
1/* 2 * Copyright (c) 1980, 1990, 1993, 1994 3 * The Regents of the University of California. All rights reserved. 4 * (c) UNIX System Laboratories, Inc. 5 * All or some portions of this file are derived from material licensed 6 * to the University of California by American Telephone and Telegraph 7 * Co. or Unix System Laboratories, Inc. and are reproduced herein with 8 * the permission of UNIX System Laboratories, Inc. --- 33 unchanged lines hidden (view full) --- 42 The Regents of the University of California. All rights reserved.\n"; 43#endif /* not lint */ 44 45#ifndef lint 46#if 0 47static char sccsid[] = "@(#)df.c 8.9 (Berkeley) 5/8/95"; 48#else 49static const char rcsid[] = | 1/* 2 * Copyright (c) 1980, 1990, 1993, 1994 3 * The Regents of the University of California. All rights reserved. 4 * (c) UNIX System Laboratories, Inc. 5 * All or some portions of this file are derived from material licensed 6 * to the University of California by American Telephone and Telegraph 7 * Co. or Unix System Laboratories, Inc. and are reproduced herein with 8 * the permission of UNIX System Laboratories, Inc. --- 33 unchanged lines hidden (view full) --- 42 The Regents of the University of California. All rights reserved.\n"; 43#endif /* not lint */ 44 45#ifndef lint 46#if 0 47static char sccsid[] = "@(#)df.c 8.9 (Berkeley) 5/8/95"; 48#else 49static const char rcsid[] = |
50 "$FreeBSD: head/bin/df/df.c 90108 2002-02-02 06:24:13Z imp $"; | 50 "$FreeBSD: head/bin/df/df.c 91081 2002-02-22 20:57:53Z markm $"; |
51#endif 52#endif /* not lint */ 53 | 51#endif 52#endif /* not lint */ 53 |
54#include <sys/cdefs.h> |
|
54#include <sys/param.h> 55#include <sys/stat.h> 56#include <sys/mount.h> 57#include <sys/sysctl.h> 58#include <ufs/ufs/ufsmount.h> | 55#include <sys/param.h> 56#include <sys/stat.h> 57#include <sys/mount.h> 58#include <sys/sysctl.h> 59#include <ufs/ufs/ufsmount.h> |
60#include <ufs/ffs/fs.h> |
|
59 60#include <err.h> 61#include <errno.h> 62#include <fcntl.h> | 61 62#include <err.h> 63#include <errno.h> 64#include <fcntl.h> |
65#include <fstab.h> |
|
63#include <math.h> 64#include <stdio.h> 65#include <stdlib.h> 66#include <string.h> 67#include <sysexits.h> 68#include <unistd.h> 69 70#define UNITS_SI 1 --- 18 unchanged lines hidden (view full) --- 89#define PETA_SI_SZ (PETA_SZ(1000ULL)) 90 91unsigned long long vals_si [] = {1, KILO_SI_SZ, MEGA_SI_SZ, GIGA_SI_SZ, TERA_SI_SZ, PETA_SI_SZ}; 92unsigned long long vals_base2[] = {1, KILO_2_SZ, MEGA_2_SZ, GIGA_2_SZ, TERA_2_SZ, PETA_2_SZ}; 93unsigned long long *valp; 94 95typedef enum { NONE, KILO, MEGA, GIGA, TERA, PETA, UNIT_MAX } unit_t; 96 | 66#include <math.h> 67#include <stdio.h> 68#include <stdlib.h> 69#include <string.h> 70#include <sysexits.h> 71#include <unistd.h> 72 73#define UNITS_SI 1 --- 18 unchanged lines hidden (view full) --- 92#define PETA_SI_SZ (PETA_SZ(1000ULL)) 93 94unsigned long long vals_si [] = {1, KILO_SI_SZ, MEGA_SI_SZ, GIGA_SI_SZ, TERA_SI_SZ, PETA_SI_SZ}; 95unsigned long long vals_base2[] = {1, KILO_2_SZ, MEGA_2_SZ, GIGA_2_SZ, TERA_2_SZ, PETA_2_SZ}; 96unsigned long long *valp; 97 98typedef enum { NONE, KILO, MEGA, GIGA, TERA, PETA, UNIT_MAX } unit_t; 99 |
97int unitp [] = { NONE, KILO, MEGA, GIGA, TERA, PETA }; | 100unit_t unitp [] = { NONE, KILO, MEGA, GIGA, TERA, PETA }; |
98 99int bread(off_t, void *, int); 100int checkvfsname(const char *, char **); 101char *getmntpt(char *); 102char *makenetvfslist(void); 103char **makevfslist(char *); 104void prthuman(struct statfs *, long); 105void prthumanval(double); --- 309 unchanged lines hidden (view full) --- 415 (void)printf(" "); 416 (void)printf(" %s\n", sfsp->f_mntonname); 417} 418 419/* 420 * This code constitutes the pre-system call Berkeley df code for extracting 421 * information from filesystem superblocks. 422 */ | 101 102int bread(off_t, void *, int); 103int checkvfsname(const char *, char **); 104char *getmntpt(char *); 105char *makenetvfslist(void); 106char **makevfslist(char *); 107void prthuman(struct statfs *, long); 108void prthumanval(double); --- 309 unchanged lines hidden (view full) --- 418 (void)printf(" "); 419 (void)printf(" %s\n", sfsp->f_mntonname); 420} 421 422/* 423 * This code constitutes the pre-system call Berkeley df code for extracting 424 * information from filesystem superblocks. 425 */ |
423#include <ufs/ufs/dinode.h> 424#include <ufs/ffs/fs.h> 425#include <errno.h> 426#include <fstab.h> | |
427 428union { 429 struct fs iu_fs; 430 char dummy[SBSIZE]; 431} sb; 432#define sblock sb.iu_fs 433 434int rfd; --- 118 unchanged lines hidden --- | 426 427union { 428 struct fs iu_fs; 429 char dummy[SBSIZE]; 430} sb; 431#define sblock sb.iu_fs 432 433int rfd; --- 118 unchanged lines hidden --- |