Lines Matching refs:fd
1431 …ic int mod_deflate_using_libdeflate_err (handler_ctx * const hctx, buffer * const fn, const int fd) in mod_deflate_using_libdeflate_err() argument
1433 if (-1 == fd) { in mod_deflate_using_libdeflate_err()
1435 else if (fd == hctx->cache_fd) { in mod_deflate_using_libdeflate_err()
1436 if (0 != ftruncate(fd, 0)) in mod_deflate_using_libdeflate_err()
1438 if (0 != lseek(fd, 0, SEEK_SET)) in mod_deflate_using_libdeflate_err()
1444 close(fd); in mod_deflate_using_libdeflate_err()
1516 int fd = hctx->cache_fd; in mod_deflate_using_libdeflate() local
1517 if (-1 == fd) { in mod_deflate_using_libdeflate()
1526 fd = fdevent_mkostemp(fn->ptr, 0); in mod_deflate_using_libdeflate()
1527 if (-1 == fd) return 0; in mod_deflate_using_libdeflate()
1534 if (0 != ftruncate(fd, (off_t)sz)) { in mod_deflate_using_libdeflate()
1536 return mod_deflate_using_libdeflate_err(hctx, fn, fd); in mod_deflate_using_libdeflate()
1540 void * const addr = mmap(NULL, sz, PROT_WRITE, MAP_SHARED, fd, 0); in mod_deflate_using_libdeflate()
1543 return mod_deflate_using_libdeflate_err(hctx, fn, fd); in mod_deflate_using_libdeflate()
1575 "SIGBUS in mmap: %s %d", c->mem->ptr, c->file.fd); in mod_deflate_using_libdeflate()
1577 else if (0 != ftruncate(fd, hctx->bytes_out)) in mod_deflate_using_libdeflate()
1581 return mod_deflate_using_libdeflate_err(hctx, fn, fd); in mod_deflate_using_libdeflate()
1583 if (fd != hctx->cache_fd) { in mod_deflate_using_libdeflate()
1586 http_chunk_append_file_fd_range(hctx->r, fn, fd, 0, hctx->bytes_out); in mod_deflate_using_libdeflate()
1615 rd = chunk_file_pread(c->file.fd, p, (size_t)psz, c->offset+n); in mod_deflate_file_chunk_no_mmap()
1663 "SIGBUS in mmap: %s %d", c->mem->ptr, c->file.fd); in mod_deflate_file_chunk_mmap()
1675 if (-1 == c->file.fd) { /* open the file if not already open */ in mod_deflate_file_chunk()
1676 … if (-1 == (c->file.fd = fdevent_open_cloexec(c->mem->ptr, r->conf.follow_symlink, O_RDONLY, 0))) { in mod_deflate_file_chunk()
2049 if (sce->fd < 0 || 0 != http_chunk_append_file_ref(r, sce)) in REQUEST_FUNC()