diff options
| author | 2024-05-21 18:57:13 +0200 | |
|---|---|---|
| committer | 2024-05-21 18:57:13 +0200 | |
| commit | cdfaf6dc57a03503cec46cad5fbfd6fec45b0f52 (patch) | |
| tree | 17f477dfb3671185930a721648979705551537c3 | |
| parent | Added const everywhere. (diff) | |
| download | penes-snac2-cdfaf6dc57a03503cec46cad5fbfd6fec45b0f52.tar.gz penes-snac2-cdfaf6dc57a03503cec46cad5fbfd6fec45b0f52.tar.xz penes-snac2-cdfaf6dc57a03503cec46cad5fbfd6fec45b0f52.zip | |
New compilation variable WITHOUT_SHM, to disable shared memory functions.
Diffstat (limited to '')
| -rw-r--r-- | README.md | 6 | ||||
| -rw-r--r-- | httpd.c | 23 |
2 files changed, 29 insertions, 0 deletions
| @@ -71,6 +71,12 @@ If your compilation process complains about undefined references to `shm_open()` | |||
| 71 | make LDFLAGS=-lrt | 71 | make LDFLAGS=-lrt |
| 72 | ``` | 72 | ``` |
| 73 | 73 | ||
| 74 | If it still doesn't work (because your system does not implement the shared memory functions) or you are just not interested, you can compile out with | ||
| 75 | |||
| 76 | ```sh | ||
| 77 | make CFLAGS=-DWITHOUT_SHM | ||
| 78 | ``` | ||
| 79 | |||
| 74 | See the administrator manual on how to proceed from here. | 80 | See the administrator manual on how to proceed from here. |
| 75 | 81 | ||
| 76 | ## Testing via Docker | 82 | ## Testing via Docker |
| @@ -653,6 +653,29 @@ void term_handler(int s) | |||
| 653 | } | 653 | } |
| 654 | 654 | ||
| 655 | 655 | ||
| 656 | #ifdef WITHOUT_SHM | ||
| 657 | |||
| 658 | /* dummy versions */ | ||
| 659 | |||
| 660 | int shm_open(const char *name, int flags, mode_t mode) | ||
| 661 | { | ||
| 662 | (void)name; | ||
| 663 | (void)flags; | ||
| 664 | (void)mode; | ||
| 665 | |||
| 666 | errno = ENOTSUP; | ||
| 667 | return -1; | ||
| 668 | } | ||
| 669 | |||
| 670 | int shm_unlink(const char *name) | ||
| 671 | { | ||
| 672 | (void)name; | ||
| 673 | return -1; | ||
| 674 | } | ||
| 675 | |||
| 676 | |||
| 677 | #endif | ||
| 678 | |||
| 656 | srv_state *srv_state_op(xs_str **fname, int op) | 679 | srv_state *srv_state_op(xs_str **fname, int op) |
| 657 | /* opens or deletes the shared memory object */ | 680 | /* opens or deletes the shared memory object */ |
| 658 | { | 681 | { |