]> arthur.barton.de Git - ngircd-alex.git/blob - src/ngircd/proc.h
57612f172d5e61e2339ea703758a0283b5b9be7c
[ngircd-alex.git] / src / ngircd / proc.h
1 /*
2  * ngIRCd -- The Next Generation IRC Daemon
3  * Copyright (c)2001-2010 Alexander Barton (alex@barton.de)
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 2 of the License, or
8  * (at your option) any later version.
9  * Please read the file COPYING, README and AUTHORS for more information.
10  *
11  * Process management (header)
12  */
13
14 #ifndef __proc_h__
15 #define __proc_h__
16
17 /* This struct must not be accessed directly! */
18 typedef struct _Proc_Stat {
19         pid_t pid;      /* PID of the child process or 0 if none */
20         int pipe_fd;    /* Pipe file descriptor or -1 if none */
21 } PROC_STAT;
22
23 #define Proc_InProgress(x)      ((x)->pid != 0)
24 #define Proc_GetPipeFd(x)       ((x)->pipe_fd)
25
26 GLOBAL void Proc_InitStruct PARAMS((PROC_STAT *proc));
27
28 GLOBAL pid_t Proc_Fork PARAMS((PROC_STAT *proc, int *pipefds,
29                                void (*cbfunc)(int, short), int timeout));
30
31 GLOBAL void Proc_GenericSignalHandler PARAMS((int Signal));
32
33 GLOBAL size_t Proc_Read PARAMS((PROC_STAT *proc, void *buffer, size_t buflen));
34
35 #endif
36
37 /* -eof- */