fs_io.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 1996-2022 The Squid Software Foundation and contributors
3 *
4 * Squid software is distributed under GPLv2+ license and includes
5 * contributions from numerous individuals and organizations.
6 * Please see the COPYING and CONTRIBUTORS files for details.
7 */
8
9/* DEBUG: section 06 Disk I/O Routines */
10
11#ifndef SQUID_FS_IO_H_
12#define SQUID_FS_IO_H_
13
14#include "mem/forward.h"
15#include "sbuf/forward.h"
16#include "typedefs.h" //DRCB, DWCB
17
18class MemBuf;
19
20// POD
22{
23public:
24 int fd;
25 off_t offset;
27 char *buf;
31};
32
33// POD
35{
36public:
38 char *buf;
39 size_t len;
40 size_t buf_offset;
43};
44
45int file_open(const char *path, int mode);
46void file_close(int fd);
47void file_write(int, off_t, void const *, int len, DWCB *, void *, FREE *);
48void file_write_mbuf(int fd, off_t, MemBuf mb, DWCB * handler, void *handler_data);
49void file_read(int, char *, int, off_t, DRCB *, void *);
50void safeunlink(const char *path, int quiet);
51
52/*
53 * Wrapper for rename(2) which complains if something goes wrong;
54 * the caller is responsible for handing and explaining the
55 * consequences of errors.
56 *
57 * \retval true successful rename
58 * \retval false an error occurred
59 */
60bool FileRename(const SBuf &from, const SBuf &to);
61
62int fsBlockSize(const char *path, int *blksize);
63int fsStats(const char *, int *, int *, int *, int *);
64
65#endif /* SQUID_FS_IO_H_ */
66
Definition: MemBuf.h:24
Definition: SBuf.h:94
int req_len
Definition: fs_io.h:26
void * client_data
Definition: fs_io.h:30
DRCB * handler
Definition: fs_io.h:29
off_t offset
Definition: fs_io.h:25
int fd
Definition: fs_io.h:24
char * buf
Definition: fs_io.h:27
int end_of_file
Definition: fs_io.h:28
Definition: fs_io.h:35
char * buf
Definition: fs_io.h:38
size_t buf_offset
Definition: fs_io.h:40
size_t len
Definition: fs_io.h:39
dwrite_q * next
Definition: fs_io.h:41
off_t file_offset
Definition: fs_io.h:37
FREE * free_func
Definition: fs_io.h:42
void file_write(int, off_t, void const *, int len, DWCB *, void *, FREE *)
Definition: fs_io.cc:326
int file_open(const char *path, int mode)
Definition: fs_io.cc:45
bool FileRename(const SBuf &from, const SBuf &to)
Definition: fs_io.cc:480
int fsBlockSize(const char *path, int *blksize)
Definition: fs_io.cc:503
void file_read(int, char *, int, off_t, DRCB *, void *)
Definition: fs_io.cc:453
void file_write_mbuf(int fd, off_t, MemBuf mb, DWCB *handler, void *handler_data)
Definition: fs_io.cc:374
void safeunlink(const char *path, int quiet)
Definition: fs_io.cc:469
void file_close(int fd)
Definition: fs_io.cc:73
int fsStats(const char *, int *, int *, int *, int *)
Definition: fs_io.cc:527
void FREE(void *)
Definition: forward.h:36
static void handler(int signo)
Definition: purge.cc:854
void DRCB(int, const char *buf, int size, int errflag, void *data)
Definition: typedefs.h:16
void DWCB(int, int, size_t, void *)
Definition: typedefs.h:18

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors