|
Teonet library
0.4.7
|
#include "config/config.h"#include <stdio.h>#include <stdlib.h>#include <string.h>#include <unistd.h>#include <errno.h>#include <signal.h>#include "pidfile.h"#include "utils/utils.h"Macros | |
| #define | GET_PIDFILE_DIR() ksnet_formatMessage("%s/", ksnet_getDataDir()) |
| #define | PIDFILE_EX "pid" |
| #define | PIDFILE_NAME_LEN 128 |
| #define | EXE_NAME "ksnet" |
Functions | |
| void | init_pidfile (int port) |
| Create the pid file name. More... | |
| void | kill_pidfile () |
| Free the pid file name. More... | |
| int | _write_pidfile (char *pidfilename) |
| Write current pid to the specified pidfile. More... | |
| int | write_pidfile () |
| Write current pid to the all pidfiles. More... | |
| int | _read_pidfile (char *pidfilename) |
| Read current pid from the specified pidfile. More... | |
| void | read_pidfile (int *port_pid) |
| Read current pid from the all pidfiles. More... | |
| int | check_pid (int pid) |
| Search for process with pid. More... | |
| void | remove_pidfile () |
| Remove the pid files. More... | |
TEONET 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/.
| #define EXE_NAME "ksnet" |
Referenced by init_pidfile().
| #define GET_PIDFILE_DIR | ( | ) | ksnet_formatMessage("%s/", ksnet_getDataDir()) |
Referenced by init_pidfile().
| #define PIDFILE_EX "pid" |
Referenced by init_pidfile().
| #define PIDFILE_NAME_LEN 128 |
Referenced by init_pidfile().
| int _read_pidfile | ( | char * | pidfilename | ) |
Read current pid from the specified pidfile.
| pidfilename | Pid file name |
Referenced by read_pidfile().
| int _write_pidfile | ( | char * | pidfilename | ) |
Write current pid to the specified pidfile.
| pidfilename | Pid file name |
Referenced by write_pidfile().
| int check_pid | ( | int | pid | ) |
| void init_pidfile | ( | int | port | ) |
Create the pid file name.
| port | Port number |
References EXE_NAME, free(), GET_PIDFILE_DIR, malloc(), PIDFILE_EX, and PIDFILE_NAME_LEN.
Referenced by start_stop_daemon().
| void kill_pidfile | ( | ) |
| void read_pidfile | ( | int * | port_pid | ) |
Read current pid from the all pidfiles.
| port_pid |
References _read_pidfile().
Referenced by start_stop_daemon().
| void remove_pidfile | ( | ) |
Remove the pid files.
Referenced by start_stop_daemon().
| int write_pidfile | ( | ) |
Write current pid to the all pidfiles.
References _write_pidfile(), and result.
Referenced by start_stop_daemon().