Home | History | Annotate | Download | only in toolbox

Lines Matching defs:fname

260     const char *fname, *dtype, *bname;
360 fname = *argv++;
361 if (!opt_create && !strchr(fname, '/')) {
362 snprintf(buf, sizeof(buf), "%s%s", _PATH_DEV, fname);
363 if (!(fname = strdup(buf)))
376 fd = open(fname, O_RDWR | O_CREAT | O_TRUNC, 0644);
378 errx(1, "failed to create %s", fname);
381 } else if ((fd = open(fname, opt_N ? O_RDONLY : O_RDWR)) == -1)
382 err(1, "%s", fname);
384 err(1, "%s", fname);
387 warnx("warning, %s is not a regular file", fname);
390 warnx("warning, %s is not a character device", fname);
393 check_mounted(fname, sb.st_mode);
416 getdiskinfo(fd, fname, dtype, oflag, &bpb);
622 fname, cls * bpb.spc, cls * bpb.spc == 1 ? "" : "s", cls, fat,
738 err(1, "%s", fname);
740 errx(1, "%s: can't write sector %u", fname, lsn);
752 static void check_mounted(const char *fname, mode_t mode)
765 s1 = fname;
768 r = S_ISCHR(mode) && s1 != fname && *s1 == 'r';
774 errx(1, "%s is mounted on %s", fname, mp->f_mntonname);
798 static void getdiskinfo(int fd, const char *fname, const char *dtype,
809 ckgeom(fname, bpb->bps, "bytes/sector");
840 ckgeom(fname, bpb->spt, "sectors/track");
843 ckgeom(fname, bpb->hds, "drive heads");
848 static void getdiskinfo(int fd, const char *fname, const char *dtype,
914 bpb->bps = ckgeom(fname, lp->d_secsize, "bytes/sector");
916 bpb->spt = ckgeom(fname, lp->d_nsectors, "sectors/track");
918 bpb->hds = ckgeom(fname, lp->d_ntracks, "drive heads");
956 static u_int ckgeom(const char *fname, u_int val, const char *msg)
959 errx(1, "%s: no default %s", fname, msg);
961 errx(1, "%s: illegal %s %d", fname, msg, val);