Lines Matching refs:fd

121 	c->file.fd = -1;  in chunk_init()
170 chunk_file_pread (int fd, void *buf, size_t count, off_t offset) in chunk_file_pread() argument
178 if (-1 == lseek(fd, offset, SEEK_SET)) in chunk_file_pread()
185 rd =pread(fd, buf, count, offset); in chunk_file_pread()
187 rd = read(fd, buf, count); in chunk_file_pread()
204 else if (c->file.fd != -1) { in chunk_reset_file_chunk()
205 close(c->file.fd); in chunk_reset_file_chunk()
211 c->file.fd = -1; in chunk_reset_file_chunk()
497 …e_fd(chunkqueue * const restrict cq, const buffer * const restrict fn, int fd, off_t offset, off_t… in chunkqueue_append_file_fd() argument
499 (chunkqueue_append_file_chunk(cq, fn, offset, len))->file.fd = fd; in chunkqueue_append_file_fd()
502 close(fd); in chunkqueue_append_file_fd()
681 if (c->file.fd >= 0) { in chunkqueue_dup_file_chunk_fd()
683 d->file.fd = c->file.fd; in chunkqueue_dup_file_chunk_fd()
689 d->file.fd = fdevent_dup_cloexec(c->file.fd); in chunkqueue_dup_file_chunk_fd()
766 c->file.fd = in chunkqueue_get_append_newtempfile()
768 if (-1 != c->file.fd) return c; in chunkqueue_get_append_newtempfile()
772 c->file.fd = in chunkqueue_get_append_newtempfile()
774 if (-1 != c->file.fd) return c; in chunkqueue_get_append_newtempfile()
800 if (NULL != c && c->file.is_temp && c->file.fd >= 0) { in chunkqueue_get_append_tempfile()
807 int rc = close(c->file.fd); in chunkqueue_get_append_tempfile()
808 c->file.fd = -1; in chunkqueue_get_append_tempfile()
835 int rc = close(c->file.fd); in chunkqueue_append_tempfile_err()
836 c->file.fd = -1; in chunkqueue_append_tempfile_err()
888 if (dst_c->file.fd < 0) return -1; in chunkqueue_append_mem_to_tempfile()
892 const ssize_t written =pwrite(dst_c->file.fd, mem, len, dst_c->file.length); in chunkqueue_append_mem_to_tempfile()
895 const ssize_t written = write(dst_c->file.fd, mem, len); in chunkqueue_append_mem_to_tempfile()
989 if (c->file.fd < 0) return -1; in chunkqueue_append_cqmem_to_tempfile()
992 ssize_t wr = pwritev(c->file.fd, iov, (int)iovcnt, c->file.length); in chunkqueue_append_cqmem_to_tempfile()
1024 static ssize_t chunkqueue_append_drain_pipe_tempfile(chunkqueue * const restrict cq, const int fd, … in chunkqueue_append_drain_pipe_tempfile() argument
1034 rd = read(fd, buf, sizeof(buf)); in chunkqueue_append_drain_pipe_tempfile()
1053 ssize_t chunkqueue_append_splice_pipe_tempfile(chunkqueue * const restrict cq, const int fd, unsign… in chunkqueue_append_splice_pipe_tempfile() argument
1069 ssize_t wr = splice(fd, NULL, c->file.fd, &off, len, in chunkqueue_append_splice_pipe_tempfile()
1101 wr = chunkqueue_append_drain_pipe_tempfile(cq, fd, len, errh); in chunkqueue_append_splice_pipe_tempfile()
1146 ssize_t chunkqueue_append_splice_sock_tempfile(chunkqueue * const restrict cq, const int fd, unsign… in chunkqueue_append_splice_sock_tempfile() argument
1153 ssize_t wr = splice(fd, NULL, pipes[1], NULL, len, in chunkqueue_append_splice_sock_tempfile()
1335 if (-1 == c->file.fd) { in chunk_open_file_chunk()
1337 if (-1 == (c->file.fd = fdevent_open_cloexec(c->mem->ptr, 1, O_RDONLY, 0))) { in chunk_open_file_chunk()
1347 if (-1 == fstat(c->file.fd, &st)) { in chunk_open_file_chunk()
1367 chunkqueue_write_data (const int fd, const void *buf, size_t len) in chunkqueue_write_data() argument
1371 do { wr = write(fd, buf, len); } while (-1 == wr && errno == EINTR); in chunkqueue_write_data()
1381 chunkqueue_write_chunk_file_intermed (const int fd, chunk * const restrict c, log_error_st * const … in chunkqueue_write_chunk_file_intermed() argument
1390 return chunkqueue_write_data(fd, data, dlen); in chunkqueue_write_chunk_file_intermed()
1401 chunkqueue_write_chunk_file (const int fd, chunk * const restrict c, log_error_st * const errh) in chunkqueue_write_chunk_file() argument
1418 sendfile(fd, c->file.fd, &offset, len < INT32_MAX ? len : INT32_MAX); in chunkqueue_write_chunk_file()
1428 return chunkqueue_write_data(fd, chunk_file_view_dptr(cfv, c->offset), in chunkqueue_write_chunk_file()
1433 return chunkqueue_write_chunk_file_intermed(fd, c, errh); in chunkqueue_write_chunk_file()
1438 chunkqueue_write_chunk_mem (const int fd, const chunk * const restrict c) in chunkqueue_write_chunk_mem() argument
1442 return chunkqueue_write_data(fd, buf, len); in chunkqueue_write_chunk_mem()
1447 chunkqueue_write_chunk (const int fd, chunkqueue * const restrict cq, log_error_st * const restrict… in chunkqueue_write_chunk() argument
1453 return chunkqueue_write_chunk_mem(fd, c); in chunkqueue_write_chunk()
1455 return chunkqueue_write_chunk_file(fd, c, errh); in chunkqueue_write_chunk()
1464 chunkqueue_write_chunk_to_pipe (const int fd, chunkqueue * const restrict cq, log_error_st * const … in chunkqueue_write_chunk_to_pipe() argument
1473 ? splice(c->file.fd, &abs_offset, fd, NULL, len, SPLICE_F_NONBLOCK) in chunkqueue_write_chunk_to_pipe()
1477 return chunkqueue_write_chunk(fd, cq, errh); in chunkqueue_write_chunk_to_pipe()
1498 if (filec != cq->last || filec->type != FILE_CHUNK || filec->file.fd < 0) in chunkqueue_small_resp_optim()
1518 rd = chunk_file_pread(filec->file.fd, ptr+offset, (size_t)len, in chunkqueue_small_resp_optim()
1579 if (c->file.fd >= 0 || 0 == chunk_open_file_chunk(c, errh)) { in chunkqueue_peek_data()
1611 "SIGBUS in mmap: %s %d", c->mem->ptr, c->file.fd); in chunkqueue_peek_data()
1625 ssize_t rd = chunk_file_pread(c->file.fd, data_in+*dlen, in chunkqueue_peek_data()
1718 if (c->file.fd < 0 && 0 != chunk_open_file_chunk(c, errh)) { in chunkqueue_chunk_file_viewadj()
1744 c->file.fd, cfv->foff); in chunkqueue_chunk_file_viewadj()
1751 MAP_PRIVATE, c->file.fd, cfv->foff); in chunkqueue_chunk_file_viewadj()
1764 close(c->file.fd); in chunkqueue_chunk_file_viewadj()
1765 c->file.fd = -1; in chunkqueue_chunk_file_viewadj()