NeoMutt  2024-04-25-89-g194907
Teaching an old dog new tricks
DOXYGEN
Loading...
Searching...
No Matches
monitor.c File Reference

Monitor files for changes. More...

#include "config.h"
#include <errno.h>
#include <limits.h>
#include <poll.h>
#include <stdbool.h>
#include <stdint.h>
#include <string.h>
#include <sys/inotify.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>
#include "mutt/lib.h"
#include "core/lib.h"
#include "monitor.h"
#include "index/lib.h"
#include <fcntl.h>
+ Include dependency graph for monitor.c:

Go to the source code of this file.

Data Structures

struct  Monitor
 A watch on a file. More...
 
struct  MonitorInfo
 Information about a monitored file. More...
 

Macros

#define INOTIFY_MASK_DIR   (IN_MOVED_TO | IN_ATTRIB | IN_CLOSE_WRITE | IN_ISDIR)
 
#define INOTIFY_MASK_FILE   IN_CLOSE_WRITE
 
#define EVENT_BUFLEN   MAX(4096, sizeof(struct inotify_event) + NAME_MAX + 1)
 

Enumerations

enum  ResolveResult {
  RESOLVE_RES_FAIL_NOMAILBOX = -3 , RESOLVE_RES_FAIL_NOTYPE = -2 , RESOLVE_RES_FAIL_STAT = -1 , RESOLVE_RES_OK_NOTEXISTING = 0 ,
  RESOLVE_RES_OK_EXISTING = 1
}
 Results for the Monitor functions. More...
 

Functions

static void mutt_poll_fd_add (int fd, short events)
 Add a file to the watch list.
 
static int mutt_poll_fd_remove (int fd)
 Remove a file from the watch list.
 
static int monitor_init (void)
 Set up file monitoring.
 
static void monitor_check_cleanup (void)
 Close down file monitoring.
 
static struct Monitormonitor_new (struct MonitorInfo *info, int descriptor)
 Create a new file monitor.
 
static void monitor_info_free (struct MonitorInfo *info)
 Shutdown a file monitor.
 
static void monitor_delete (struct Monitor *monitor)
 Free a file monitor.
 
static int monitor_handle_ignore (int desc)
 Listen for when a backup file is closed.
 
static enum ResolveResult monitor_resolve (struct MonitorInfo *info, struct Mailbox *m)
 Get the monitor for a mailbox.
 
int mutt_monitor_poll (void)
 Check for filesystem changes.
 
int mutt_monitor_add (struct Mailbox *m)
 Add a watch for a mailbox.
 
int mutt_monitor_remove (struct Mailbox *m)
 Remove a watch for a mailbox.
 

Variables

bool MonitorFilesChanged = false
 Set to true when a monitored file has changed.
 
bool MonitorCurMboxChanged = false
 Set to true when the current mailbox has changed.
 
static int INotifyFd = -1
 Inotify file descriptor.
 
static struct MonitorMonitor = NULL
 Linked list of monitored Mailboxes.
 
static size_t PollFdsCount = 0
 Number of used entries in the PollFds array.
 
static size_t PollFdsLen = 0
 Size of PollFds array.
 
static struct pollfd * PollFds = NULL
 Array of monitored file descriptors.
 
static int MonitorCurMboxDescriptor = -1
 Monitor file descriptor of the current mailbox.
 

Detailed Description

Monitor files for changes.

Authors
  • Gero Treuer
  • Richard Russon
  • Ian Zimmerman
  • Pietro Cerutti
  • R Primus

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.

Definition in file monitor.c.

Macro Definition Documentation

◆ INOTIFY_MASK_DIR

#define INOTIFY_MASK_DIR   (IN_MOVED_TO | IN_ATTRIB | IN_CLOSE_WRITE | IN_ISDIR)

Definition at line 70 of file monitor.c.

◆ INOTIFY_MASK_FILE

#define INOTIFY_MASK_FILE   IN_CLOSE_WRITE

Definition at line 71 of file monitor.c.

◆ EVENT_BUFLEN

#define EVENT_BUFLEN   MAX(4096, sizeof(struct inotify_event) + NAME_MAX + 1)

Definition at line 73 of file monitor.c.

Enumeration Type Documentation

◆ ResolveResult

Results for the Monitor functions.

Enumerator
RESOLVE_RES_FAIL_NOMAILBOX 

No Mailbox to work on.

RESOLVE_RES_FAIL_NOTYPE 

Can't identify Mailbox type.

RESOLVE_RES_FAIL_STAT 

Can't stat() the Mailbox file.

RESOLVE_RES_OK_NOTEXISTING 

File exists, no monitor is attached.

RESOLVE_RES_OK_EXISTING 

File exists, monitor is already attached.

Definition at line 78 of file monitor.c.

79{
85};
@ RESOLVE_RES_FAIL_NOTYPE
Can't identify Mailbox type.
Definition: monitor.c:81
@ RESOLVE_RES_FAIL_STAT
Can't stat() the Mailbox file.
Definition: monitor.c:82
@ RESOLVE_RES_OK_NOTEXISTING
File exists, no monitor is attached.
Definition: monitor.c:83
@ RESOLVE_RES_FAIL_NOMAILBOX
No Mailbox to work on.
Definition: monitor.c:80
@ RESOLVE_RES_OK_EXISTING
File exists, monitor is already attached.
Definition: monitor.c:84

Function Documentation

◆ mutt_poll_fd_add()

static void mutt_poll_fd_add ( int  fd,
short  events 
)
static

Add a file to the watch list.

Parameters
fdFile to watch
eventsEvents to listen for, e.g. POLLIN

Definition at line 119 of file monitor.c.

120{
121 int i = 0;
122 for (; (i < PollFdsCount) && (PollFds[i].fd != fd); i++)
123 ; // do nothing
124
125 if (i == PollFdsCount)
126 {
128 {
129 PollFdsLen += 2;
130 mutt_mem_realloc(&PollFds, PollFdsLen * sizeof(struct pollfd));
131 }
132 PollFdsCount++;
133 PollFds[i].fd = fd;
134 PollFds[i].events = events;
135 }
136 else
137 {
138 PollFds[i].events |= events;
139 }
140}
void mutt_mem_realloc(void *ptr, size_t size)
Resize a block of memory on the heap.
Definition: memory.c:115
static size_t PollFdsCount
Number of used entries in the PollFds array.
Definition: monitor.c:62
static size_t PollFdsLen
Size of PollFds array.
Definition: monitor.c:64
static struct pollfd * PollFds
Array of monitored file descriptors.
Definition: monitor.c:66
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ mutt_poll_fd_remove()

static int mutt_poll_fd_remove ( int  fd)
static

Remove a file from the watch list.

Parameters
fdFile to remove
Return values
0Success
-1Error

Definition at line 148 of file monitor.c.

149{
150 int i = 0;
151 for (; (i < PollFdsCount) && (PollFds[i].fd != fd); i++)
152 ; // do nothing
153
154 if (i == PollFdsCount)
155 return -1;
156 int d = PollFdsCount - i - 1;
157 if (d != 0)
158 memmove(&PollFds[i], &PollFds[i + 1], d * sizeof(struct pollfd));
159 PollFdsCount--;
160 return 0;
161}
+ Here is the caller graph for this function:

◆ monitor_init()

static int monitor_init ( void  )
static

Set up file monitoring.

Return values
0Success
-1Error

Definition at line 168 of file monitor.c.

169{
170 if (INotifyFd != -1)
171 return 0;
172
173#ifdef HAVE_INOTIFY_INIT1
174 INotifyFd = inotify_init1(IN_NONBLOCK | IN_CLOEXEC);
175 if (INotifyFd == -1)
176 {
177 mutt_debug(LL_DEBUG2, "inotify_init1 failed, errno=%d %s\n", errno, strerror(errno));
178 return -1;
179 }
180#else
181 INotifyFd = inotify_init();
182 if (INotifyFd == -1)
183 {
184 mutt_debug(LL_DEBUG2, "monitor: inotify_init failed, errno=%d %s\n", errno,
185 strerror(errno));
186 return -1;
187 }
188 fcntl(INotifyFd, F_SETFL, O_NONBLOCK);
189 fcntl(INotifyFd, F_SETFD, FD_CLOEXEC);
190#endif
191 mutt_poll_fd_add(0, POLLIN);
193
194 return 0;
195}
#define mutt_debug(LEVEL,...)
Definition: logging2.h:89
@ LL_DEBUG2
Log at debug level 2.
Definition: logging2.h:44
static int INotifyFd
Inotify file descriptor.
Definition: monitor.c:58
static void mutt_poll_fd_add(int fd, short events)
Add a file to the watch list.
Definition: monitor.c:119
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ monitor_check_cleanup()

static void monitor_check_cleanup ( void  )
static

Close down file monitoring.

Definition at line 200 of file monitor.c.

201{
202 if (!Monitor && (INotifyFd != -1))
203 {
205 close(INotifyFd);
206 INotifyFd = -1;
207 MonitorFilesChanged = false;
208 }
209}
static int mutt_poll_fd_remove(int fd)
Remove a file from the watch list.
Definition: monitor.c:148
bool MonitorFilesChanged
Set to true when a monitored file has changed.
Definition: monitor.c:53
A watch on a file.
Definition: monitor.c:91
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ monitor_new()

static struct Monitor * monitor_new ( struct MonitorInfo info,
int  descriptor 
)
static

Create a new file monitor.

Parameters
infoDetails of file to monitor
descriptorWatch descriptor
Return values
ptrNewly allocated Monitor

Definition at line 217 of file monitor.c.

218{
219 struct Monitor *monitor = mutt_mem_calloc(1, sizeof(struct Monitor));
220 monitor->type = info->type;
221 monitor->st_dev = info->st_dev;
222 monitor->st_ino = info->st_ino;
223 monitor->desc = descriptor;
224 monitor->next = Monitor;
225 if (info->type == MUTT_MH)
226 monitor->mh_backup_path = mutt_str_dup(info->path);
227
228 Monitor = monitor;
229
230 return monitor;
231}
@ MUTT_MH
'MH' Mailbox type
Definition: mailbox.h:47
void * mutt_mem_calloc(size_t nmemb, size_t size)
Allocate zeroed memory on the heap.
Definition: memory.c:51
char * mutt_str_dup(const char *str)
Copy a string, safely.
Definition: string.c:253
dev_t st_dev
Definition: monitor.c:108
enum MailboxType type
Definition: monitor.c:105
ino_t st_ino
Definition: monitor.c:109
const char * path
Definition: monitor.c:107
struct Monitor * next
Linked list.
Definition: monitor.c:92
ino_t st_ino
Definition: monitor.c:95
dev_t st_dev
Definition: monitor.c:94
int desc
Definition: monitor.c:97
enum MailboxType type
Definition: monitor.c:96
char * mh_backup_path
Definition: monitor.c:93
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ monitor_info_free()

static void monitor_info_free ( struct MonitorInfo info)
static

Shutdown a file monitor.

Parameters
infoMonitor to shut down

Definition at line 237 of file monitor.c.

238{
239 buf_dealloc(&info->path_buf);
240}
void buf_dealloc(struct Buffer *buf)
Release the memory allocated by a buffer.
Definition: buffer.c:377
struct Buffer path_buf
access via path only (maybe not initialized)
Definition: monitor.c:111
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ monitor_delete()

static void monitor_delete ( struct Monitor monitor)
static

Free a file monitor.

Parameters
monitorMonitor to free

Definition at line 246 of file monitor.c.

247{
248 if (!monitor)
249 return;
250
251 struct Monitor **ptr = &Monitor;
252
253 while (true)
254 {
255 if (!*ptr)
256 return;
257 if (*ptr == monitor)
258 break;
259 ptr = &(*ptr)->next;
260 }
261
262 FREE(&monitor->mh_backup_path);
263 monitor = monitor->next;
264 FREE(ptr);
265 *ptr = monitor;
266}
#define FREE(x)
Definition: memory.h:45
+ Here is the caller graph for this function:

◆ monitor_handle_ignore()

static int monitor_handle_ignore ( int  desc)
static

Listen for when a backup file is closed.

Parameters
descWatch descriptor
Return values
>=0New descriptor
-1Error

Definition at line 274 of file monitor.c.

275{
276 int new_desc = -1;
277 struct Monitor *iter = Monitor;
278 struct stat st = { 0 };
279
280 while (iter && (iter->desc != desc))
281 iter = iter->next;
282
283 if (iter)
284 {
285 if ((iter->type == MUTT_MH) && (stat(iter->mh_backup_path, &st) == 0))
286 {
287 new_desc = inotify_add_watch(INotifyFd, iter->mh_backup_path, INOTIFY_MASK_FILE);
288 if (new_desc == -1)
289 {
290 mutt_debug(LL_DEBUG2, "inotify_add_watch failed for '%s', errno=%d %s\n",
291 iter->mh_backup_path, errno, strerror(errno));
292 }
293 else
294 {
295 mutt_debug(LL_DEBUG3, "inotify_add_watch descriptor=%d for '%s'\n",
296 desc, iter->mh_backup_path);
297 iter->st_dev = st.st_dev;
298 iter->st_ino = st.st_ino;
299 iter->desc = new_desc;
300 }
301 }
302 else
303 {
304 mutt_debug(LL_DEBUG3, "cleanup watch (implicitly removed) - descriptor=%d\n", desc);
305 }
306
307 if (MonitorCurMboxDescriptor == desc)
308 MonitorCurMboxDescriptor = new_desc;
309
310 if (new_desc == -1)
311 {
312 monitor_delete(iter);
314 }
315 }
316
317 return new_desc;
318}
@ LL_DEBUG3
Log at debug level 3.
Definition: logging2.h:45
static void monitor_delete(struct Monitor *monitor)
Free a file monitor.
Definition: monitor.c:246
static int MonitorCurMboxDescriptor
Monitor file descriptor of the current mailbox.
Definition: monitor.c:68
static void monitor_check_cleanup(void)
Close down file monitoring.
Definition: monitor.c:200
#define INOTIFY_MASK_FILE
Definition: monitor.c:71
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ monitor_resolve()

static enum ResolveResult monitor_resolve ( struct MonitorInfo info,
struct Mailbox m 
)
static

Get the monitor for a mailbox.

Parameters
[out]infoDetails of the mailbox's monitor
[in]mMailbox
Return values
>=0mailbox is valid and locally accessible: 0: no monitor / 1: preexisting monitor
-3no mailbox (MonitorInfo: no fields set)
-2type not set
-1stat() failed (see errno; MonitorInfo fields: type, is_dir, path)

If m is NULL, try to get the current mailbox from the Index.

Definition at line 332 of file monitor.c.

333{
334 char *fmt = NULL;
335 struct stat st = { 0 };
336
337 struct Mailbox *m_cur = get_current_mailbox();
338 if (m)
339 {
340 info->type = m->type;
341 info->path = m->realpath;
342 }
343 else if (m_cur)
344 {
345 info->type = m_cur->type;
346 info->path = m_cur->realpath;
347 }
348 else
349 {
351 }
352
353 if (info->type == MUTT_UNKNOWN)
354 {
356 }
357 else if (info->type == MUTT_MAILDIR)
358 {
359 info->is_dir = true;
360 fmt = "%s/new";
361 }
362 else
363 {
364 info->is_dir = false;
365 if (info->type == MUTT_MH)
366 fmt = "%s/.mh_sequences";
367 }
368 if (fmt)
369 {
370 buf_printf(&info->path_buf, fmt, info->path);
371 info->path = buf_string(&info->path_buf);
372 }
373 if (stat(info->path, &st) != 0)
375
376 struct Monitor *iter = Monitor;
377 while (iter && ((iter->st_ino != st.st_ino) || (iter->st_dev != st.st_dev)))
378 iter = iter->next;
379
380 info->st_dev = st.st_dev;
381 info->st_ino = st.st_ino;
382 info->monitor = iter;
383
385}
int buf_printf(struct Buffer *buf, const char *fmt,...)
Format a string overwriting a Buffer.
Definition: buffer.c:161
static const char * buf_string(const struct Buffer *buf)
Convert a buffer to a const char * "string".
Definition: buffer.h:96
@ MUTT_UNKNOWN
Mailbox wasn't recognised.
Definition: mailbox.h:44
@ MUTT_MAILDIR
'Maildir' Mailbox type
Definition: mailbox.h:48
struct Mailbox * get_current_mailbox(void)
Get the current Mailbox.
Definition: index.c:715
A mailbox.
Definition: mailbox.h:79
char * realpath
Used for duplicate detection, context comparison, and the sidebar.
Definition: mailbox.h:81
enum MailboxType type
Mailbox type.
Definition: mailbox.h:102
struct Monitor * monitor
Definition: monitor.c:110
bool is_dir
Definition: monitor.c:106
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ mutt_monitor_poll()

int mutt_monitor_poll ( void  )

Check for filesystem changes.

Return values
-3unknown/unexpected events: poll timeout / fds not handled by us
-2monitor detected changes, no STDIN input
-1error (see errno)
0(1) input ready from STDIN, or (2) monitoring inactive -> no poll()

Wait for I/O ready file descriptors or signals.

MonitorFilesChanged also reflects changes to monitored files.

Only STDIN and INotify file handles currently expected/supported. More would ask for common infrastructure (sockets?).

Definition at line 401 of file monitor.c.

402{
403 int rc = 0;
404 char buf[EVENT_BUFLEN]
405 __attribute__((aligned(__alignof__(struct inotify_event)))) = { 0 };
406
407 MonitorFilesChanged = false;
408
409 if (INotifyFd != -1)
410 {
411 int fds = poll(PollFds, PollFdsCount, 1000); // 1 Second
412
413 if (fds == -1)
414 {
415 rc = -1;
416 if (errno != EINTR)
417 {
418 mutt_debug(LL_DEBUG2, "poll() failed, errno=%d %s\n", errno, strerror(errno));
419 }
420 }
421 else
422 {
423 bool input_ready = false;
424 for (int i = 0; fds && (i < PollFdsCount); i++)
425 {
426 if (PollFds[i].revents)
427 {
428 fds--;
429 if (PollFds[i].fd == 0)
430 {
431 input_ready = true;
432 }
433 else if (PollFds[i].fd == INotifyFd)
434 {
435 MonitorFilesChanged = true;
436 mutt_debug(LL_DEBUG3, "file change(s) detected\n");
437 char *ptr = buf;
438 const struct inotify_event *event = NULL;
439
440 while (true)
441 {
442 int len = read(INotifyFd, buf, sizeof(buf));
443 if (len == -1)
444 {
445 if (errno != EAGAIN)
446 {
447 mutt_debug(LL_DEBUG2, "read inotify events failed, errno=%d %s\n",
448 errno, strerror(errno));
449 }
450 break;
451 }
452
453 while (ptr < (buf + len))
454 {
455 event = (const struct inotify_event *) ptr;
456 mutt_debug(LL_DEBUG3, "+ detail: descriptor=%d mask=0x%x\n",
457 event->wd, event->mask);
458 if (event->mask & IN_IGNORED)
459 monitor_handle_ignore(event->wd);
460 else if (event->wd == MonitorCurMboxDescriptor)
462 ptr += sizeof(struct inotify_event) + event->len;
463 }
464 }
465 }
466 }
467 }
468 if (!input_ready)
469 rc = MonitorFilesChanged ? -2 : -3;
470 }
471 }
472
473 return rc;
474}
static int monitor_handle_ignore(int desc)
Listen for when a backup file is closed.
Definition: monitor.c:274
bool MonitorCurMboxChanged
Set to true when the current mailbox has changed.
Definition: monitor.c:55
#define EVENT_BUFLEN
Definition: monitor.c:73
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ mutt_monitor_add()

int mutt_monitor_add ( struct Mailbox m)

Add a watch for a mailbox.

Parameters
mMailbox to watch
Return values
0success: new or already existing monitor
-1failed: no mailbox, inaccessible file, create monitor/watcher failed

If m is NULL, try to get the current mailbox from the Index.

Definition at line 484 of file monitor.c.

485{
486 struct MonitorInfo info = { 0 };
487
488 int rc = 0;
489 enum ResolveResult desc = monitor_resolve(&info, m);
490 if (desc != RESOLVE_RES_OK_NOTEXISTING)
491 {
492 if (!m && (desc == RESOLVE_RES_OK_EXISTING))
494 rc = (desc == RESOLVE_RES_OK_EXISTING) ? 0 : -1;
495 goto cleanup;
496 }
497
498 uint32_t mask = info.is_dir ? INOTIFY_MASK_DIR : INOTIFY_MASK_FILE;
499 if (((INotifyFd == -1) && (monitor_init() == -1)) ||
500 ((desc = inotify_add_watch(INotifyFd, info.path, mask)) == -1))
501 {
502 mutt_debug(LL_DEBUG2, "inotify_add_watch failed for '%s', errno=%d %s\n",
503 info.path, errno, strerror(errno));
504 rc = -1;
505 goto cleanup;
506 }
507
508 mutt_debug(LL_DEBUG3, "inotify_add_watch descriptor=%d for '%s'\n", desc, info.path);
509 if (!m)
511
512 monitor_new(&info, desc);
513
514cleanup:
515 monitor_info_free(&info);
516 return rc;
517}
#define INOTIFY_MASK_DIR
Definition: monitor.c:70
static enum ResolveResult monitor_resolve(struct MonitorInfo *info, struct Mailbox *m)
Get the monitor for a mailbox.
Definition: monitor.c:332
static struct Monitor * monitor_new(struct MonitorInfo *info, int descriptor)
Create a new file monitor.
Definition: monitor.c:217
ResolveResult
Results for the Monitor functions.
Definition: monitor.c:79
static int monitor_init(void)
Set up file monitoring.
Definition: monitor.c:168
static void monitor_info_free(struct MonitorInfo *info)
Shutdown a file monitor.
Definition: monitor.c:237
Information about a monitored file.
Definition: monitor.c:104
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ mutt_monitor_remove()

int mutt_monitor_remove ( struct Mailbox m)

Remove a watch for a mailbox.

Parameters
mMailbox
Return values
0monitor removed (not shared)
1monitor not removed (shared)
2no monitor

If m is NULL, try to get the current mailbox from the Index.

Definition at line 528 of file monitor.c.

529{
530 struct MonitorInfo info = { 0 };
531 struct MonitorInfo info2 = { 0 };
532 int rc = 0;
533
534 if (!m)
535 {
537 MonitorCurMboxChanged = false;
538 }
539
541 {
542 rc = 2;
543 goto cleanup;
544 }
545
546 struct Mailbox *m_cur = get_current_mailbox();
547 if (m_cur)
548 {
549 if (m)
550 {
551 if ((monitor_resolve(&info2, NULL) == RESOLVE_RES_OK_EXISTING) &&
552 (info.st_ino == info2.st_ino) && (info.st_dev == info2.st_dev))
553 {
554 rc = 1;
555 goto cleanup;
556 }
557 }
558 else
559 {
560 if (mailbox_find(m_cur->realpath))
561 {
562 rc = 1;
563 goto cleanup;
564 }
565 }
566 }
567
568 inotify_rm_watch(info.monitor->desc, INotifyFd);
569 mutt_debug(LL_DEBUG3, "inotify_rm_watch for '%s' descriptor=%d\n", info.path,
570 info.monitor->desc);
571
574
575cleanup:
576 monitor_info_free(&info);
577 monitor_info_free(&info2);
578 return rc;
579}
struct Mailbox * mailbox_find(const char *path)
Find the mailbox with a given path.
Definition: mailbox.c:150
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Variable Documentation

◆ MonitorFilesChanged

bool MonitorFilesChanged = false

Set to true when a monitored file has changed.

true after a monitored file has changed

Definition at line 53 of file monitor.c.

◆ MonitorCurMboxChanged

bool MonitorCurMboxChanged = false

Set to true when the current mailbox has changed.

true after the current mailbox has changed

Definition at line 55 of file monitor.c.

◆ INotifyFd

int INotifyFd = -1
static

Inotify file descriptor.

Definition at line 58 of file monitor.c.

◆ Monitor

struct Monitor* Monitor = NULL
static

Linked list of monitored Mailboxes.

Definition at line 60 of file monitor.c.

◆ PollFdsCount

size_t PollFdsCount = 0
static

Number of used entries in the PollFds array.

Definition at line 62 of file monitor.c.

◆ PollFdsLen

size_t PollFdsLen = 0
static

Size of PollFds array.

Definition at line 64 of file monitor.c.

◆ PollFds

struct pollfd* PollFds = NULL
static

Array of monitored file descriptors.

Definition at line 66 of file monitor.c.

◆ MonitorCurMboxDescriptor

int MonitorCurMboxDescriptor = -1
static

Monitor file descriptor of the current mailbox.

Definition at line 68 of file monitor.c.