Lines Matching defs:outfd
220 int outfd;
245 int outfd;
2209 int infd, outfd, blocks;
2253 outfd = STDOUT_FILENO;
2327 if ((outfd = open(outf, O_RDWR)) < 0) {
2335 res = ioctl(outfd, SG_SET_RESERVED_SIZE, &t);
2338 res = ioctl(outfd, SG_GET_VERSION_NUM, &t);
2345 outfd = -1; /* don't bother opening */
2354 if ((outfd = open(outf, flags, 0666)) < 0) {
2363 if ((outfd = open(outf, O_WRONLY)) < 0) {
2376 if (llse_llseek(outfd, offset, SEEK_SET) < 0) {
2387 if ((STDIN_FILENO == infd) && (STDOUT_FILENO == outfd)) {
2413 res = read_capacity(outfd, &out_num_sect, &out_sect_sz);
2418 read_capacity(outfd, &out_num_sect,
2544 sg_write(outfd, wrkPos, blocks, seek, bs,
2547 if (ioctl(outfd, SG_GET_RESERVED_SIZE, &buf_sz)
2558 sg_write(outfd, wrkPos, blocks, seek, bs,
2564 sg_write(outfd, wrkPos, blocks, seek, bs,
2578 while (((res = write(outfd, wrkPos, blocks * bs)) < 0)
2626 res = sync_cache(outfd);
2630 res = sync_cache(outfd);
2640 if ((STDOUT_FILENO != outfd) && (FT_DEV_NULL != out_type))
2641 close(outfd);
6282 int infd, outfd, blocks;
6314 outfd = STDOUT_FILENO;
6381 if ((outfd = open(outf, O_RDWR)) < 0) {
6388 res = ioctl(outfd, SG_GET_VERSION_NUM, &t);
6394 if (ioctl(outfd, SG_GET_RESERVED_SIZE, &t) < 0) {
6401 (outfd, SG_SET_RESERVED_SIZE,
6411 outfd, 0);
6422 outfd = -1; /* don't bother opening */
6425 if ((outfd =
6436 if ((outfd = open(outf, O_WRONLY)) < 0) {
6448 if (llse_llseek(outfd, offset, SEEK_SET) < 0) {
6459 if ((STDIN_FILENO == infd) && (STDOUT_FILENO == outfd)) {
6498 res = read_capacity(outfd, &out_num_sect, &out_sect_sz);
6503 read_capacity(outfd, &out_num_sect,
6638 sg_write2(outfd, wrkPos, blocks, seek, bs,
6644 sg_write2(outfd, wrkPos, blocks, seek, bs,
6659 while (((res = write(outfd, wrkPos, blocks * bs)) < 0)
6707 res = sync_cache(outfd);
6711 res = sync_cache(outfd);
6723 if ((STDOUT_FILENO != outfd) && (FT_DEV_NULL != out_type))
6724 close(outfd);
6821 rep->outfd = clp->outfd;
6973 while (((res = write(clp->outfd, rep->buffp,
7172 while (((res = write(rep->wr ? rep->outfd : rep->infd, hp,
7199 while (((res = read(wr ? rep->outfd : rep->infd, &io_hdr,
7325 rcoll.outfd = STDOUT_FILENO;
7375 if ((rcoll.outfd = open(outf, O_RDWR)) < 0) {
7383 if (sg_prepare(rcoll.outfd, rcoll.bs, rcoll.bpt,
7387 rcoll.outfd = -1; /* don't bother opening */
7390 if ((rcoll.outfd =
7401 if ((rcoll.outfd = open(outf, O_WRONLY)) < 0) {
7414 if (llse_llseek(rcoll.outfd, offset, SEEK_SET) <
7426 if ((STDIN_FILENO == rcoll.infd) && (STDOUT_FILENO == rcoll.outfd)) {
7454 read_capacity(rcoll.outfd, &out_num_sect,
7460 read_capacity(rcoll.outfd, &out_num_sect,
7599 res = sync_cache(rcoll.outfd);
7603 res = sync_cache(rcoll.outfd);
7616 if ((STDOUT_FILENO != rcoll.outfd) && (FT_DEV_NULL != rcoll.out_type))
7617 close(rcoll.outfd);