Home
last modified time | relevance | path

Searched refs:dev_fd (Results 1 – 12 of 12) sorted by relevance

/external/ltp/lib/
Dtst_device.c73 int ctl_fd, dev_fd, rc, i; in find_free_loopdev() local
112 dev_fd = open(dev_path, O_RDONLY); in find_free_loopdev()
114 if (dev_fd < 0) in find_free_loopdev()
117 if (ioctl(dev_fd, LOOP_GET_STATUS, &loopinfo) == 0) { in find_free_loopdev()
123 close(dev_fd); in find_free_loopdev()
127 close(dev_fd); in find_free_loopdev()
137 int dev_fd, file_fd; in attach_device() local
140 dev_fd = open(dev, O_RDWR); in attach_device()
141 if (dev_fd < 0) { in attach_device()
149 close(dev_fd); in attach_device()
[all …]
/external/f2fs-tools/tools/sg_write_buffer/
Dsg_pt_linux.c194 check_file_type(int dev_fd, struct stat * dev_statp, bool * is_bsg_p, in check_file_type() argument
206 if (dev_fd >= 0) { in check_file_type()
207 if (fstat(dev_fd, dev_statp) < 0) { in check_file_type()
226 nsid = ioctl(dev_fd, NVME_IOCTL_ID, NULL); in check_file_type()
240 pr2ws("%s: invalid file descriptor (%d)\n", __func__, dev_fd); in check_file_type()
279 check_pt_file_handle(int dev_fd, const char * device_name, int verbose) in check_pt_file_handle() argument
282 pr2ws("%s: dev_fd=%d, device_name: %s\n", __func__, dev_fd, in check_pt_file_handle()
289 if (dev_fd >= 0) { in check_pt_file_handle()
295 is_sg = check_file_type(dev_fd, &a_stat, &is_bsg, &is_nvme, &nsid, in check_pt_file_handle()
395 construct_scsi_pt_obj_with_fd(int dev_fd, int verbose) in construct_scsi_pt_obj_with_fd() argument
[all …]
Dsg_pt_linux_nvme.c329 res = ioctl(ptp->dev_fd, NVME_IOCTL_ADMIN_CMD, cmdp); in do_nvme_admin_cmd()
1093 if ((ptp->dev_fd >= 0) && (fd != ptp->dev_fd)) { in sg_do_nvme_pt()
1099 ptp->dev_fd = fd; in sg_do_nvme_pt()
1100 } else if (ptp->dev_fd < 0) { in sg_do_nvme_pt()
/external/ltp/testcases/kernel/syscalls/preadv/
Dpreadv03.c105 int dev_fd, ret; in setup() local
107 dev_fd = SAFE_OPEN(tst_device->dev, O_RDWR); in setup()
108 SAFE_IOCTL(dev_fd, BLKSSZGET, &ret); in setup()
109 SAFE_CLOSE(dev_fd); in setup()
/external/ltp/testcases/kernel/syscalls/pwritev/
Dpwritev03.c104 int dev_fd, ret; in setup() local
106 dev_fd = SAFE_OPEN(tst_device->dev, O_RDWR); in setup()
107 SAFE_IOCTL(dev_fd, BLKSSZGET, &ret); in setup()
108 SAFE_CLOSE(dev_fd); in setup()
/external/toybox/toys/pending/
Dfdisk.c85 static int num_parts, disp_unit_cyl, dos_flag, dev_fd = 3; variable
151 if (ioctl(dev_fd, BLKSSZGET, &arg) == 0) g_sect_size = arg; in read_sec_sz()
166 if (ioctl(dev_fd, BLKGETSIZE64, &sec64) == 0) { in read_size()
174 if (ioctl(dev_fd, BLKGETSIZE, &sectors) == 0) in read_size()
227 if (ioctl(dev_fd, HDIO_GETGEO, &geometry)) return; in read_geometry()
260 xlseek(dev_fd, (off_t)(offset * g_sect_size), SEEK_SET); in read_ebr()
262 if (g_sect_size != readall(dev_fd, sec_buf, g_sect_size)) { in read_ebr()
263 close(dev_fd); in read_ebr()
355 if(fd != dev_fd) { in read_mbr()
356 if(dup2(fd, dev_fd) != dev_fd) perror_exit("Can't dup2"); in read_mbr()
[all …]
/external/f2fs-tools/tools/sg_write_buffer/include/
Dsg_pt.h52 int check_pt_file_handle(int dev_fd, const char * device_name, int verbose);
70 construct_scsi_pt_obj_with_fd(int dev_fd, int verbose);
76 int set_pt_file_handle(struct sg_pt_base * objp, int dev_fd, int verbose);
Dsg_pt_linux.h103 int dev_fd; /* -1 if not given (yet) */ member
/external/linux-kselftest/tools/testing/selftests/kvm/lib/
Dkvm_util.c703 int dev_fd, ret; in vcpu_mmap_sz() local
705 dev_fd = open(KVM_DEV_PATH, O_RDONLY); in vcpu_mmap_sz()
706 if (dev_fd < 0) in vcpu_mmap_sz()
709 ret = ioctl(dev_fd, KVM_GET_VCPU_MMAP_SIZE, NULL); in vcpu_mmap_sz()
714 close(dev_fd); in vcpu_mmap_sz()
/external/ppp/pppd/
Dpppd.h617 void generic_disestablish_ppp __P((int dev_fd)); /* Restore device setting */
618 int generic_establish_ppp __P((int dev_fd)); /* Make a ppp interface */
Dsys-linux.c597 void generic_disestablish_ppp(int dev_fd) in generic_disestablish_ppp() argument
/external/minijail/
Dlibminijail.c1382 int dev_fd; in mount_dev() local
1407 dev_fd = open(dev_path, O_DIRECTORY|O_PATH|O_CLOEXEC); in mount_dev()
1408 if (dev_fd < 0) { in mount_dev()
1416 ret = mknodat(dev_fd, ds->name, ds->mode, in mount_dev()
1425 ret = symlinkat(ds->dest, dev_fd, ds->source); in mount_dev()
1432 close(dev_fd); in mount_dev()