| 15 |
#include <stdio.h> |
#include <stdio.h> |
| 16 |
#include <unistd.h> |
#include <unistd.h> |
| 17 |
|
|
| 18 |
#define ARTICLE_BLOCK_SHM_FILE "~article_block_shm.dat" |
static const char ARTICLE_BLOCK_SHM_FILE[] = "~article_block_shm.dat"; |
| 19 |
#define SECTION_LIST_SHM_FILE "~section_list_shm.dat" |
static const char SECTION_LIST_SHM_FILE[] = "~section_list_shm.dat"; |
| 20 |
#define TRIE_DICT_SHM_FILE "~trie_dict_shm.dat" |
static const char TRIE_DICT_SHM_FILE[] = "~trie_dict_shm.dat"; |
| 21 |
#define USER_LIST_SHM_FILE "~user_list_shm.dat" |
static const char USER_LIST_SHM_FILE[] = "~user_list_shm.dat"; |
| 22 |
|
|
| 23 |
const char *sname[] = { |
const char *sname[] = { |
| 24 |
"Test", |
"Test", |
| 68 |
log_error_redir(STDERR_FILENO); |
log_error_redir(STDERR_FILENO); |
| 69 |
|
|
| 70 |
// - 1 to make blocks allocated is less than required, to trigger error handling |
// - 1 to make blocks allocated is less than required, to trigger error handling |
| 71 |
block_count = BBS_article_limit_per_section * BBS_max_section / ARTICLE_PER_BLOCK; |
block_count = BBS_article_limit_per_section * BBS_max_section / BBS_article_count_per_block; |
| 72 |
|
|
| 73 |
if ((fp = fopen(ARTICLE_BLOCK_SHM_FILE, "w")) == NULL) |
if ((fp = fopen(ARTICLE_BLOCK_SHM_FILE, "w")) == NULL) |
| 74 |
{ |
{ |