Home
last modified time | relevance | path

Searched refs:devfd (Results 1 – 19 of 19) sorted by relevance

/netbsd-src/sys/arch/prep/stand/installboot/
H A Dinstallboot.c183 load_prep_partition(int devfd, struct mbr_partition *ppp) in load_prep_partition() argument
189 if (devread(devfd, mbr, MBR_BBSECTOR, DEV_BSIZE, "MBR") != 0) in load_prep_partition()
227 int devfd = -1; in main() local
257 if ((devfd = open(dev, O_RDONLY, 0)) < 0) { in main()
262 if (load_prep_partition(devfd, &ppp)) { in main()
272 close(devfd); in main()
279 if ((devfd = open(dev, O_RDWR, 0)) < 0) { in main()
288 (void)lseek(devfd, (off_t)dbtob(ppp.mbrp_start), SEEK_SET); in main()
289 if (write(devfd, boot00, sizeof(boot00)) != sizeof(boot00)) { in main()
294 (void)lseek(devfd, (off_t)dbtob(ppp.mbrp_start+1), SEEK_SET); in main()
[all …]
/netbsd-src/external/bsd/ipf/dist/tools/
H A Dipfs.c223 int c, lock = -1, devfd = -1, err = 0, rw = -1, ns = -1, set = 0; local
312 devfd = opendevice(NULL);
315 devfd = opendevice(IPSTATE_NAME);
317 devfd = opendevice(IPNAT_NAME);
319 if (devfd == -1)
324 err = setlock(devfd, lock);
331 err = writenat(devfd, filename);
333 err = writestate(devfd, filename);
340 err = readnat(devfd, filename);
342 err = readstate(devfd, filename);
[all …]
/netbsd-src/sys/arch/mvme68k/stand/installboot/
H A Dinstallboot.c98 int devfd; in main() local
144 if ((devfd = open(dev, O_RDONLY, 0)) < 0) in main()
148 if (loadblocknums(boot, devfd) != 0) in main()
151 (void)close(devfd); in main()
163 if ((devfd = open(dev, O_RDWR, 0)) < 0) in main()
166 if (lseek(devfd, DEV_BSIZE, SEEK_SET) != DEV_BSIZE) in main()
172 if (write(devfd, protostore, protosize) != protosize) in main()
174 (void)close(devfd); in main()
238 loadblocknums(char *boot, int devfd) in loadblocknums() argument
279 devread(devfd, sblock, (daddr_t)(BBSIZE / DEV_BSIZE), in loadblocknums()
[all …]
/netbsd-src/usr.sbin/srtconfig/
H A Dsrtconfig.c34 static int devfd; variable
100 devfd = open(txt_dev,how,0); in open_dev()
101 if (devfd < 0) in open_dev()
113 if (ioctl(devfd,SRT_GETRT,&r) < 0) in query_n()
145 { if (ioctl(devfd,SRT_GETNRT,&n) < 0) in do_query()
156 if (ioctl(devfd,SRT_DELRT,&n) < 0) in do_del()
172 if (ioctl(devfd,SRT_GETNRT,&v) < 0) in do_set()
214 if (ioctl(devfd,SRT_SETRT,&r) < 0) in do_set()
226 if (ioctl(devfd,SRT_GFLAGS,&f) < 0) in do_flags()
258 if (ioctl(devfd,SRT_GFLAGS,&f) < 0) in do_sflag()
[all …]
/netbsd-src/sbin/luactl/
H A Dluactl.c50 int devfd = -1; variable
85 if ((devfd = open(_PATH_DEV_LUA, O_RDWR)) == -1) in main()
126 if (ioctl(devfd, LUAINFO, &info) == -1) in getinfo()
134 if (ioctl(devfd, LUAINFO, &info) == -1) in getinfo()
158 if (ioctl(devfd, LUACREATE, &cr) == -1) in create()
174 if (ioctl(devfd, LUADESTROY, &cr) == -1) in destroy()
191 if (ioctl(devfd, LUAREQUIRE, &r) == -1) in require()
208 if (ioctl(devfd, LUALOAD, &l) == -1) in load()
/netbsd-src/usr.sbin/gpioctl/
H A Dgpioctl.c42 static int devfd = -1; variable
121 if ((devfd = open(dev, O_RDWR)) == -1) in main()
219 if (ioctl(devfd, GPIOINFO, &info) == -1) in getinfo()
242 if (ioctl(devfd, GPIOREAD, &req) == -1) in gpioread()
273 if (ioctl(devfd, GPIOWRITE, &req) == -1) in gpiowrite()
276 if (ioctl(devfd, GPIOTOGGLE, &req) == -1) in gpiowrite()
310 if (ioctl(devfd, GPIOSET, &set) == -1) in gpioset()
347 if (ioctl(devfd, GPIOUNSET, &set) == -1) in gpiounset()
358 if (ioctl(devfd, GPIOINFO, &info) == -1) in gpiolist()
364 if (ioctl(devfd, GPIOREAD, &req) == -1) in gpiolist()
[all …]
/netbsd-src/sbin/resize_lfs/
H A Dresize_lfs.c66 int devfd, rootfd; in main() local
104 devfd = open(rdev, O_RDONLY); in main()
105 if (devfd < 0) in main()
113 if (getdiskinfo(rdev, devfd, NULL, &geo, &dkw) == -1) in main()
129 pread(devfd, buf, sboff, LFS_SBPAD); in main()
137 close(devfd); in main()
/netbsd-src/usr.sbin/tprof/
H A Dtprof.c90 int devfd; variable
164 ssz = read(devfd, buf, sizeof(buf)); in process_samples()
202 ret = ioctl(devfd, TPROF_IOC_GETCOUNTS, &counts); in show_counters()
459 ret = ioctl(devfd, TPROF_IOC_CONFIGURE_EVENT, &params[i]); in tprof_monitor_common()
466 ret = ioctl(devfd, TPROF_IOC_START, &mask); in tprof_monitor_common()
476 close(devfd); in tprof_monitor_common()
510 ret = ioctl(devfd, TPROF_IOC_STOP, &mask); in tprof_monitor_common()
523 ret = ioctl(devfd, TPROF_IOC_GETSTAT, &ts); in tprof_monitor_common()
565 devfd = open(_PATH_TPROF, O_RDWR); in main()
566 if (devfd == -1) { in main()
[all …]
H A Dtprof_top.c553 ret = ioctl(devfd, TPROF_IOC_GETSTAT, ts); in show_tprof_stat()
610 ret = ioctl(devfd, TPROF_IOC_GETCOUNTS, &countsbuf); in show_counters()
976 ret = ioctl(devfd, TPROF_IOC_CONFIGURE_EVENT, &params[i]); in tprof_top()
983 ret = ioctl(devfd, TPROF_IOC_START, &mask); in tprof_top()
1012 FD_SET(devfd, &r); in tprof_top()
1013 nfound = select(devfd + 1, &r, NULL, NULL, NULL); in tprof_top()
1052 if (FD_ISSET(devfd, &r)) { in tprof_top()
1053 len = read(devfd, tprof_buf, tprof_bufsize); in tprof_top()
H A Dtprof.h34 extern int devfd;
/netbsd-src/sys/modules/examples/ping/
H A Dcmd_ping.c45 int devfd; in main() local
49 if ((devfd = open(_PATH_DEV_PING, O_RDWR)) == -1) in main()
52 if (ioctl(devfd, CMD_PING) == -1) in main()
57 if (close(devfd) == -1) in main()
/netbsd-src/sys/modules/examples/ping_block/
H A Dcmd_ping.c45 int devfd; in main() local
49 if ((devfd = open(_PATH_DEV_PING, O_RDWR)) == -1) in main()
52 if (ioctl(devfd, CMD_PING) == -1) in main()
57 if (close(devfd) == -1) in main()
/netbsd-src/lib/libukfs/
H A Dukfs.c214 int devfd = -1; in ukfs_part_probe() local
257 devfd = open(devpath, O_RDONLY); in ukfs_part_probe()
258 if (devfd == -1) { in ukfs_part_probe()
264 if (pread(devfd, buf, sizeof(buf), 0) == -1) { in ukfs_part_probe()
357 if (devfd != -1) in ukfs_part_probe()
358 close(devfd); in ukfs_part_probe()
447 int rv = 0, devfd; in process_diskdevice() local
452 devfd = open(devpath, rdonly ? O_RDONLY : O_RDWR); in process_diskdevice()
453 if (devfd == -1) { in process_diskdevice()
458 if (fstat(devfd, &sb) == -1) { in process_diskdevice()
[all …]
/netbsd-src/sys/modules/examples/fopsmapper/
H A Dcmd_mapper.c44 int devfd; in main() local
47 if ((devfd = open(_PATH_DEV_MAPPER, O_RDONLY)) == -1) in main()
50 map = mmap(0, sysconf(_SC_PAGESIZE), PROT_READ, MAP_SHARED, devfd, 0); in main()
59 if (close(devfd) == -1) in main()
/netbsd-src/sys/modules/examples/mapper/
H A Dcmd_mapper.c44 int devfd; in main() local
47 if ((devfd = open(_PATH_DEV_MAPPER, O_RDONLY)) == -1) in main()
51 devfd, 0)); in main()
60 if (close(devfd) == -1) in main()
/netbsd-src/sbin/newfs_lfs/
H A Dmake_lfs.c389 make_lfs(int devfd, uint secsize, struct dkwedge_info *dkw, int minfree, in make_lfs() argument
437 fs = lfs_init(devfd, start, 0, 1, 1/* XXX debug*/); in make_lfs()
807 vp = lfs_raw_vget(fs, ULFS_ROOTINO, devfd, 0x0); in make_lfs()
833 vp = lfs_raw_vget(fs, LOSTFOUNDINO, devfd, 0x0); in make_lfs()
/netbsd-src/sbin/fsck_ext2fs/
H A Dsetup.c503 calcsb(const char *dev, int devfd, struct m_ext2fs *fs) in calcsb() argument
508 if (getdiskinfo(dev, devfd, NULL, &geo, &dkw) == -1) in calcsb()
/netbsd-src/sbin/fsck_lfs/
H A Dlfs.c469 lfs_init(int devfd, daddr_t sblkno, daddr_t idaddr, int dummy_read, int debug) in lfs_init() argument
480 devvp->v_fd = devfd; in lfs_init()
/netbsd-src/sbin/fsck_ffs/
H A Dsetup.c1082 calcsb(const char *dev, int devfd, struct fs *fs) in calcsb() argument