Teonet library  0.4.7
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
pidfile.h
Go to the documentation of this file.
1 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */
2 /*
3  * pidfile.h
4  * Copyright (C) Kirill Scherba 2011-2015 <kirill@scherba.ru>
5  *
6  * TEONET is free software: you can redistribute it and/or modify it
7  * under the terms of the GNU General Public License as published by the
8  * Free Software Foundation, either version 3 of the License, or
9  * (at your option) any later version.
10  *
11  * TEONET is distributed in the hope that it will be useful, but
12  * WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
14  * See the GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License along
17  * with this program. If not, see <http://www.gnu.org/licenses/>.
18  */
19 
20 #ifndef PIDFILE_H
21 #define PIDFILE_H
22 
23 #ifdef __cplusplus
24 extern "C" {
25 #endif
26 
27 void init_pidfile(int port);
28 void kill_pidfile ();
29 int write_pidfile();
30 void read_pidfile(int* port_pid);
31 int check_pid(int pid);
32 void remove_pidfile();
33 
34 #ifdef __cplusplus
35 }
36 #endif
37 
38 #endif /* PIDFILE_H */
int check_pid(int pid)
Search for process with pid.
Definition: pidfile.c:174
int write_pidfile()
Write current pid to the all pidfiles.
Definition: pidfile.c:119
void read_pidfile(int *port_pid)
Read current pid from the all pidfiles.
Definition: pidfile.c:160
void init_pidfile(int port)
Create the pid file name.
Definition: pidfile.c:56
void kill_pidfile()
Free the pid file name.
Definition: pidfile.c:76
void remove_pidfile()
Remove the pid files.
Definition: pidfile.c:191