static LISP decode_fstab(struct fstab *p) {if (p) return(symalist("spec",strcons(-1,p->fs_spec), "file",strcons(-1,p->fs_file), "type",strcons(-1,p->fs_type), "freq",flocons(p->fs_freq), "passno",flocons(p->fs_passno), "vfstype",rintern(p->fs_vfstype), "mntops",strcons(-1,p->fs_mntops), NULL)); else return(NIL);}
static long longfield(char *name,LISP alist) {LISP value,key = rintern(name); if NULLP(value = assq(key,alist)) return(0); return(get_c_long(cdr(value)));}
static char *strfield(char *name,LISP alist) {LISP value,key = rintern(name); if NULLP(value = assq(key,alist)) return(""); return(get_c_string(cdr(value)));}
LISP lstatfs(LISP path) {long iflag; struct statfs s; iflag = no_interrupt(1); if (statfs(get_c_string(path),&s,sizeof(s))) return(err("statfs",llast_c_errmsg(-1))); no_interrupt(iflag); return(symalist("type",(((s.f_type >= 0) && (s.f_type < MNT_NUMTYPES) && mnt_names[s.f_type]) ? rintern(mnt_names[s.f_type]) : flocons(s.f_type)), "bsize",flocons(s.f_bsize), "blocks",flocons(s.f_blocks), "bfree",flocons(s.f_bfree), "bavail",flocons(s.f_bavail), "files",flocons(s.f_files), "ffree",flocons(s.f_ffree), "mntonname",strcons(-1,s.f_mntonname), "mntfromname",strcons(-1,s.f_mntfromname), NULL));}