Main Page | Modules | Alphabetical List | Data Structures | File List | Data Fields | Globals | Related Pages

fo_server.c File Reference

Classic Forum server program. More...

#include "config.h"
#include "defines.h"
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <pthread.h>
#include <gdome.h>
#include <errno.h>
#include <string.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netdb.h>
#include <unistd.h>
#include <sys/un.h>
#include <sys/wait.h>
#include <signal.h>
#include <fcntl.h>
#include <sys/ipc.h>
#include <sys/shm.h>
#include <sys/sem.h>
#include "semaphores.h"
#include "cf_pthread.h"
#include "hashlib.h"
#include "utils.h"
#include "configparser.h"
#include "readline.h"
#include "fo_server.h"
#include "initfinish.h"
#include "serverlib.h"
#include "archiver.h"

Go to the source code of this file.

Functions

void flsh (int n)
void terminate (int n)
void * archiver_and_writer (void *arg)
void setup_server_infos (void)
int create_shm_sem (t_name_value *shm)
int main (int argc, char *argv[])

Variables

int RUN
t_head head


Detailed Description

Classic Forum server program.

This file contains the main program of the forum server.

Definition in file fo_server.c.


Function Documentation

void* archiver_and_writer void *  arg  ) 
 

This function runs the archiver and disk writer in a regular intervall

Parameters:
arg Dummy argument (for pthread_create)
Returns:
Returns always NULL

Definition at line 110 of file fo_server.c.

int create_shm_sem t_name_value shm  ) 
 

This function creates the Shared memory locking semaphore set.

Parameters:
shm The information about the Shared Memory segment and Semaphore IDs

Definition at line 237 of file fo_server.c.

void flsh int  n  ) 
 

This function flushes the file handles of the logfiles. Useful for getting actual information about the state of the server. Activated by sending SIGINT or SIGHUP.

Parameters:
n The signal received

Definition at line 76 of file fo_server.c.

int main int  argc,
char *  argv[]
 

This function is the starting function for the fo_server program. It takes no arguments.

Parameters:
argc The argument count
argv The arguments vectore
Returns:
It returns EXIT_SUCCESS on success and EXIT_FAILURE on failure.

Definition at line 266 of file fo_server.c.

void setup_server_infos void   ) 
 

This function checks if another fo_server process is running in the actual configuration and writes its PID into the PID file. If a server is already running, it terminates execution

Definition at line 147 of file fo_server.c.

void terminate int  n  ) 
 

This function will be called when receiving a signal which says 'Hey, server, terminate!'

Parameters:
n The signal received

Definition at line 98 of file fo_server.c.


Variable Documentation

t_head head
 

contains all necessary data

Definition at line 68 of file fo_server.c.

int RUN
 

Run while this variable is != 0

Definition at line 67 of file fo_server.c.


Generated on Sun Apr 25 16:37:39 2004 for Classic Forum by doxygen 1.3.5