fd.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 51 Filedescriptor Functions */
10
11#ifndef SQUID_FD_H_
12#define SQUID_FD_H_
13
14namespace Comm {
15
20{
21public:
24 Descriptor(int fd, unsigned int type, const char *description);
25 Descriptor(Descriptor &&) = delete; // no copying (and, for now, moving) of any kind
26
29
31 operator int() const { return fd_; }
32
34 int release() { const auto result = fd_; fd_ = -1; return result; }
35
36private:
37 int fd_;
38};
39
40} // namespace Comm
41
42void fd_close(int fd);
43void fd_open(int fd, unsigned int type, const char *);
44void fd_note(int fd, const char *);
45void fd_bytes(int fd, int len, unsigned int type);
46void fdDumpOpen(void);
47int fdUsageHigh(void);
48void fdAdjustReserved(void);
49int default_read_method(int, char *, int);
50int default_write_method(int, const char *, int);
51
52#endif /* SQUID_FD_H_ */
53
int fd_
Definition: fd.h:37
Descriptor(Descriptor &&)=delete
Descriptor(int fd, unsigned int type, const char *description)
Definition: fd.cc:325
~Descriptor()
Closes and calls legacy fd_close() unless release() was called earlier.
Definition: fd.cc:330
int release()
Forgets the descriptor and prevents its automatic closure (by us).
Definition: fd.h:34
int type
Definition: errorpage.cc:152
void fd_open(int fd, unsigned int type, const char *)
Definition: minimal.cc:14
int default_read_method(int, char *, int)
Definition: fd.cc:130
void fd_close(int fd)
Definition: minimal.cc:20
void fd_note(int fd, const char *)
Definition: fd.cc:217
int default_write_method(int, const char *, int)
Definition: fd.cc:136
void fdAdjustReserved(void)
Definition: fd.cc:287
void fd_bytes(int fd, int len, unsigned int type)
Definition: fd.cc:227
void fdDumpOpen(void)
Definition: fd.cc:243
int fdUsageHigh(void)
Definition: fd.cc:272
Abstraction layer for TCP, UDP, TLS, UDS and filedescriptor sockets.
Definition: AcceptLimiter.h:17
int unsigned int
Definition: stub_fd.cc:19

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors