5 #include "cvmfs_config.h"
25 int pipe_backchannel[2];
26 int pipe_terminate[2];
39 struct pollfd *watch_fds =
40 static_cast<struct pollfd *
>(smalloc(2 *
sizeof(
struct pollfd)));
42 watch_fds[0].events = POLLIN | POLLPRI;
43 watch_fds[0].revents = 0;
45 watch_fds[1].events = POLLIN | POLLPRI;
46 watch_fds[1].revents = 0;
48 int retval = poll(watch_fds, 2, -1);
54 if (watch_fds[0].revents)
58 if (watch_fds[1].revents) {
59 watch_fds[1].revents = 0;
81 struct pollfd *watch_fds =
82 static_cast<struct pollfd *
>(smalloc(2 *
sizeof(
struct pollfd)));
84 watch_fds[0].events = POLLIN | POLLPRI;
85 watch_fds[0].revents = 0;
87 watch_fds[1].events = POLLIN | POLLPRI;
88 watch_fds[1].revents = 0;
90 int retval = poll(watch_fds, 2, -1);
96 if (watch_fds[0].revents)
100 if (watch_fds[1].revents) {
101 if ((watch_fds[1].revents & POLLERR) ||
102 (watch_fds[1].revents & POLLHUP) ||
103 (watch_fds[1].revents & POLLNVAL))
108 watch_fds[1].revents = 0;
127 const string &repository_name)
136 static_cast<void *>(handle));
149 const string &repository_name)
159 static_cast<void *>(handle));
166 const char terminate =
'T';
static void * MainWatchdogListener(void *data)
assert((mem||(size==0))&&"Out Of Memory")
void MakePipe(int pipe_fd[2])
CatalogManager * catalog_manager
ListenerHandle * RegisterWatchdogListener(QuotaManager *quota_manager, const string &repository_name)
QuotaManager * quota_manager
pthread_t thread_listener
ListenerHandle * RegisterUnpinListener(QuotaManager *quota_manager, CatalogManager *catalog_manager, const string &repository_name)
virtual void RegisterBackChannel(int back_channel[2], const std::string &channel_id)=0
virtual void UnregisterBackChannel(int back_channel[2], const std::string &channel_id)=0
void UnregisterListener(ListenerHandle *handle)
static void * MainUnpinListener(void *data)
void WritePipe(int fd, const void *buf, size_t nbyte)
void ReadPipe(int fd, void *buf, size_t nbyte)
void ClosePipe(int pipe_fd[2])
CVMFS_EXPORT void LogCvmfs(const LogSource source, const int mask, const char *format,...)