df.c File Reference

#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <limits.h>
#include <fcntl.h>
#include <errno.h>
#include <unistd.h>
#include <stdlib.h>
#include <string.h>
#include <dirent.h>
#include <minix/minlib.h>
#include <minix/config.h>
#include <minix/const.h>
#include <minix/type.h>
#include <servers/fs/const.h>
#include <servers/fs/type.h>
#include <servers/fs/super.h>

Include dependency graph for df.c:

Go to the source code of this file.

Data Structures

struct  mtab

Defines

#define v12_super_block   super_block
#define SUPER_V1   SUPER_MAGIC
#define ISDISK(mode)   S_ISBLK(mode)
#define percent(num, tot)   ((int) ((100L * (num) + ((tot) - 1)) / (tot)))
#define L(n)   ((long) (n))

Functions

mtabsearchtab (char *name)
void readmtab (char *type)
int df (const struct mtab *mt)
bit_t bit_count (unsigned blocks, bit_t bits, int fd, int bs)
void usage (void)
int main (int argc, char *argv[])

Variables

int errno
char MTAB [] = "/etc/mtab"
int iflag = 0
int Pflag = 0
int kflag = 0
int istty
uid_t ruid
uid_t euid
gid_t rgid
gid_t egid
int unitsize


Define Documentation

#define ISDISK mode   )     S_ISBLK(mode)
 

Definition at line 45 of file df.c.

Referenced by readmtab(), and searchtab().

#define L n   )     ((long) (n))
 

Definition at line 268 of file df.c.

Referenced by __flushbuf(), _buf_flush(), _dstget(), _tr_align(), _tr_init(), _tr_stored_block(), _tr_tally(), _tzset(), ackbibi(), add(), add_dir(), add_ext(), adjmove(), adler32(), allocate(), another_hunk(), ar_fow(), ar_open(), ar_rdsync(), ar_rev(), ar_set_wr(), ar_write(), asciirecv(), asciisend(), atapi_open(), b64_rsft(), backtrace(), basefind(), bcpio_rd(), bcpio_wr(), beforedo(), binaryrecv(), binarysend(), bitoff(), biton(), bits(), blkflush(), breakpt(), calloc(), cfi(), cfu(), change(), check(), cidr_aton(), cif4(), cmd_edit(), cmd_errlist(), cmd_file(), cmd_global(), cmd_join(), cmd_move(), cmd_read(), cmd_shell(), cmd_substitute(), cmd_write(), compact(), compile(), compress(), conv_stamp(), convert(), copy_member(), count(), cp_file(), cpio_rd(), cpio_wr(), crc32_combine(), cuf4(), cvtnum(), date_exp(), deflate(), deflateInit2_(), deflateReset(), deliver(), determine(), df(), disdata(), disk_io(), display(), distext(), div_ext(), dns_ttl(), do_backward(), do_close(), do_fcntl(), do_firstline(), do_forward(), do_ioctl(), do_visit(), dodir(), doexcmd(), doexrc(), dorun(), dump_stack(), eat_dir(), exebpnt(), exgmark(), expr_operator(), extend(), file_open(), file_size(), file_time(), filesize(), fill(), filter(), findidle(), findwhen(), fpathconf(), FS(), fsize(), get_data(), get_message(), get_reg(), getdecl(), getexp(), getfree(), getfreeMinClusters(), getzrxinit(), gnu_symbolvalue(), gz_open(), gzinit(), gzread(), gzrewind(), gzscan(), gzseek(), gztell(), icmp_router_advertisement(), inflatePrime(), inflateSetDictionary(), init_block(), init_keys(), init_params(), initialize(), initkeys(), input(), intr_init(), intuit_diff_type(), ldexp(), Ldexp(), lex_gettoken(), linespec(), link_free_chunk(), ljhand(), lm_init(), load_code(), load_file(), lock_dev(), locked(), long2str(), lookext(), lookup(), m_fword(), m_match(), m_modify(), m_scroll(), m_sentence(), m_updnto(), magic(), main(), make_file(), MakeMove(), malloc(), mark2phys(), mktime(), modify(), modtime(), netspec(), nextblock(), nrm_ext(), num(), objout(), offset(), open_archive(), open_patch_file(), openredirect(), parse_errmsg(), partition(), paste(), patch_stack(), pathconf(), peek_dword(), personprint(), plan_b(), Print_Duration(), Print_Uptime(), printhex(), Process(), process(), procheader(), prot_init(), prratio(), purgeline(), pushio(), putboot(), rand(), rd_fdopen(), rd_skip(), rd_unsigned2(), rd_wrfile(), Read_Block(), read_core(), read_header(), read_info(), Read_Super_Block(), readblock(), readbox(), Recover_Blocks(), redraw(), redrawrange(), reg_addr(), regcomp(), regular(), ret_to_continue(), rewind(), rmil(), rootdir(), run(), rw_super(), saybibi(), score(), Search(), sendfile(), sendzsinit(), september(), set_bit(), set_crc(), set_ftime(), set_mtime(), set_up(), setsize(), setstack(), setviz(), shortprint(), SimpleFileOpen(), sjhand(), smartdrawtext(), split(), stack_trace(), stop_proc(), storename(), str2size(), strings(), strip(), sub_ext(), subr(), symbolvalue(), sys_memset(), sys_physcopy(), sys_vircopy(), sysconf(), tar_wr(), tcp_GEmod4G(), tcp_Gmod4G(), tcp_LEmod4G(), tcp_Lmod4G(), test04(), test06(), test11(), test11a(), test16a(), test19b(), test19d(), test19e(), test19f(), test19g(), test2g(), test35c(), test38b(), test39e(), test39f(), test7d(), test_gzio(), there_is_another_patch(), tmpabort(), tmpsave(), tmpstart(), to_lastline(), touch(), truncated(), tryz(), tstart(), undo(), unix_copydir(), unix_write(), unlink_free_chunk(), update(), update_conf(), update_keys(), ustar_wr(), v_insert(), v_overtype(), v_popup(), v_undoline(), v_xchar(), value(), vcpio_rd(), vcpio_wr(), vi(), w_identify(), wctx(), wr_int2(), wr_long(), wr_rdfile(), wr_skip(), write_header(), write_wave_header(), WT(), yank(), zdump(), zlibCompileFlags(), zrbhdr32(), zrdat32(), zrf4(), zrf8(), zsbh32(), zsda32(), and zsendfile().

#define percent num,
tot   )     ((int) ((100L * (num) + ((tot) - 1)) / (tot)))
 

Definition at line 265 of file df.c.

Referenced by df().

#define SUPER_V1   SUPER_MAGIC
 

Definition at line 41 of file df.c.

#define v12_super_block   super_block
 

Definition at line 40 of file df.c.

Referenced by df().


Function Documentation

bit_t bit_count unsigned  blocks,
bit_t  bits,
int  fd,
int  bs
 

Definition at line 399 of file df.c.

References _MAX_BLOCK_SIZE, b, busy, CHAR_BIT, i, and read.

Referenced by df(), and Draw_Map().

int df const struct mtab mt  ) 
 

Definition at line 270 of file df.c.

References _MAX_BLOCK_SIZE, _STATIC_BLOCK_SIZE, bit_count(), block_size, close, mtab::devname, egid, errno, euid, fprintf(), iflag, istty, L, lseek, mtab::mountpoint, n, O_RDONLY, open, percent, Pflag, printf, putchar, read, rgid, ruid, SEEK_SET, setegid, seteuid, sp, stderr, strerror(), strlen(), SUPER_BLOCK_BYTES, SUPER_V1, SUPER_V2, SUPER_V3, unitsize, and v12_super_block.

Referenced by main().

int main int  argc,
char *  argv[]
 

Definition at line 77 of file df.c.

References df(), egid, euid, ex, exit(), getegid, geteuid, getgid, getuid, i, iflag, isatty, istty, kflag, mtab::next, NULL, Pflag, printf, readmtab(), rgid, ruid, searchtab(), type, unitsize, and usage.

void readmtab char *  type  ) 
 

Definition at line 135 of file df.c.

References devname, exit(), fclose(), fopen(), fprintf(), get_mtab_entry(), ISDISK, load_mtab(), malloc(), mountpoint, MTAB, mtab::next, NULL, st, stat::st_mode, stat::st_rdev, stat, stderr, strcmp, strcpy(), strlen(), and version.

Referenced by main().

struct mtab * searchtab char *  name  ) 
 

Definition at line 214 of file df.c.

References mtab::device, devname, ISDISK, mtab::next, NULL, st, stat::st_dev, stat::st_mode, stat::st_rdev, stat, and unknown.

Referenced by main().

void usage void   ) 
 

Definition at line 69 of file df.c.

References exit(), fprintf(), and stderr.


Variable Documentation

gid_t egid
 

Definition at line 67 of file df.c.

int errno
 

Definition at line 70 of file rcp.c.

uid_t euid
 

Definition at line 66 of file df.c.

int iflag = 0
 

Definition at line 62 of file df.c.

int istty
 

Definition at line 65 of file df.c.

int kflag = 0
 

Definition at line 64 of file df.c.

Referenced by chk_same(), cpio_options(), main(), mk_link(), pax_options(), and unlnk_exist().

char MTAB[] = "/etc/mtab"
 

Definition at line 48 of file df.c.

Referenced by readmtab().

int Pflag = 0
 

Definition at line 63 of file df.c.

Referenced by df(), and main().

gid_t rgid
 

Definition at line 67 of file df.c.

uid_t ruid
 

Definition at line 66 of file df.c.

int unitsize
 

Definition at line 75 of file df.c.

Referenced by df(), and main().


Generated on Fri Apr 14 23:06:26 2006 for minix by  doxygen 1.4.6