Lines Matching defs:fd
63 static int get_attrs(descriptor_t *dp, int fd, nvlist_t *attrs);
111 int fd;
126 fd = open(devpath, O_RDONLY|O_NDELAY);
128 if ((*errp = get_attrs(dp, fd, attrs)) != 0) {
133 if (fd >= 0) {
134 (void) close(fd);
219 int fd;
223 fd = open(devpath, O_RDONLY|O_NDELAY);
225 if (fd >= 0 && media_read_info(fd, &minfo) &&
226 ioctl(fd, DKIOCINFO, &dkinfo) >= 0) {
230 if (fd >= 0) {
231 (void) close(fd);
387 get_attrs(descriptor_t *dp, int fd, nvlist_t *attrs)
403 if (fd < 0) {
408 if (!media_read_info(fd, &minfo)) {
412 if ((status = read_extvtoc(fd, &vtoc)) >= 0) {
414 } else if (status == VT_ENOTSUP && efi_alloc_and_read(fd, &efip) >= 0) {
426 if (ioctl(fd, DKIOCINFO, &dkinfo) >= 0) {
576 if (fstat(fd, &buf) != -1) {
631 int fd;
642 if ((fd = drive_open_disk(desc->p.disk, NULL, 0)) < 0) {
647 if ((status = read_extvtoc(fd, &vtoc)) >= 0) {
649 } else if (status == VT_ENOTSUP && efi_alloc_and_read(fd, &efip) >= 0) {
652 (void) close(fd);
656 (void) close(fd);
732 int fd;
734 if ((fd = open(devp->devpath, O_RDONLY|O_NDELAY)) >= 0) {
736 if (ioctl(fd, DKIOCINFO, &dkinfo) >= 0) {
739 (void) close(fd);
776 int fd;
779 if ((fd = drive_open_disk(dp, NULL, 0)) >= 0) {
780 if ((status = read_extvtoc(fd, &vtoc)) >= 0) {
783 efi_alloc_and_read(fd, &efip) >= 0) {
786 (void) close(fd);
831 int fd;
879 if ((fd = drive_open_disk(diskp, NULL, 0)) < 0) {
884 if ((status = read_extvtoc(fd, &vtoc)) >= 0) {
886 } else if (status == VT_ENOTSUP && efi_alloc_and_read(fd, &efip) >= 0) {
889 (void) close(fd);
893 (void) close(fd);