|
Revision 9198, 1.5 KB
(checked in by denton, 15 months ago)
|
|
ucache_info generated text is now printed to a file rather than using the daemon-client piping. The client now reads the file after the daemon has written and closed it.
|
| Line | |
|---|
| 1 | #ifndef UCACHED_H |
|---|
| 2 | #define UCACHED_H |
|---|
| 3 | |
|---|
| 4 | #include <unistd.h> |
|---|
| 5 | #include <sys/types.h> |
|---|
| 6 | #include <sys/ipc.h> |
|---|
| 7 | #include <sys/stat.h> |
|---|
| 8 | #include <sys/shm.h> |
|---|
| 9 | #include <sys/wait.h> |
|---|
| 10 | #include <fcntl.h> |
|---|
| 11 | #include <stdio.h> |
|---|
| 12 | #include <stdlib.h> |
|---|
| 13 | #include <errno.h> |
|---|
| 14 | #include <time.h> |
|---|
| 15 | #include <string.h> |
|---|
| 16 | #include <poll.h> |
|---|
| 17 | #include <ucache.h> |
|---|
| 18 | |
|---|
| 19 | /* Daemon Logging */ |
|---|
| 20 | #ifndef UCACHED_LOG_FILE |
|---|
| 21 | #define UCACHED_LOG_FILE "/tmp/ucached.log" |
|---|
| 22 | #endif |
|---|
| 23 | |
|---|
| 24 | #ifndef UCACHED_INFO_FILE |
|---|
| 25 | #define UCACHED_INFO_FILE "/tmp/ucached.info" |
|---|
| 26 | #endif |
|---|
| 27 | |
|---|
| 28 | #define GOSSIP_UCACHED_DEBUG 0x0001000000000000 |
|---|
| 29 | #define GOSSIP_UCACHED_CMD_DEBUG 0x0000100000000000 |
|---|
| 30 | |
|---|
| 31 | |
|---|
| 32 | /* FIFO Defines */ |
|---|
| 33 | #define FILE_MODE (S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH) |
|---|
| 34 | #define FIFO1 "/tmp/ucached.fifo.1" |
|---|
| 35 | #define FIFO2 "/tmp/ucached.fifo.2" |
|---|
| 36 | #define BUFF_SIZE 4096 |
|---|
| 37 | #define LOG_LEN 256 |
|---|
| 38 | |
|---|
| 39 | #ifndef LOG_TIMESTAMP |
|---|
| 40 | #define LOG_TIMESTAMP 0 |
|---|
| 41 | #endif |
|---|
| 42 | |
|---|
| 43 | #ifndef CREATE_AT_START |
|---|
| 44 | #define CREATE_AT_START 1 |
|---|
| 45 | #endif |
|---|
| 46 | |
|---|
| 47 | #ifndef DEST_AT_EXIT |
|---|
| 48 | #define DEST_AT_EXIT 1 |
|---|
| 49 | #endif |
|---|
| 50 | |
|---|
| 51 | #ifndef FIFO_TIMEOUT |
|---|
| 52 | #define FIFO_TIMEOUT 10 /* Second */ |
|---|
| 53 | #endif |
|---|
| 54 | |
|---|
| 55 | /* For shared memory for ucache and ucache locks */ |
|---|
| 56 | #define KEY_FILE "/etc/fstab" |
|---|
| 57 | #define SHM_ID1 'l' /* for ucache locks */ |
|---|
| 58 | #define SHM_ID2 'm' /* for ucache memory */ |
|---|
| 59 | |
|---|
| 60 | #ifndef SHM_R |
|---|
| 61 | #define SHM_R 0400 |
|---|
| 62 | #endif |
|---|
| 63 | |
|---|
| 64 | #ifndef SHM_W |
|---|
| 65 | #define SHM_W 0200 |
|---|
| 66 | #endif |
|---|
| 67 | |
|---|
| 68 | /* SVSHM Permissions */ |
|---|
| 69 | #ifndef SVSHM_MODE |
|---|
| 70 | #define SVSHM_MODE (SHM_R | SHM_W | SHM_R >> 3 | SHM_W >> 3 | SHM_R >> 6 | SHM_W >> 6) |
|---|
| 71 | #endif |
|---|
| 72 | |
|---|
| 73 | #ifndef BLOCK_LOCK_TIMEOUT |
|---|
| 74 | #define BLOCK_LOCK_TIMEOUT 100 |
|---|
| 75 | #endif |
|---|
| 76 | |
|---|
| 77 | #endif |
|---|