[mod_cgi] fix pipe_cloexec() when no O_CLOEXEC
[lighttpd.git] / src / proc_open.h
blobe4b022bfecc34d2b6ba88ece55a893234c0bce99
1 #ifndef LI_PROC_OPEN_H
2 #define LI_PROC_OPEN_H
3 #include "first.h"
5 #include "buffer.h"
7 #ifdef WIN32
8 #include <windows.h>
9 typedef HANDLE descriptor_t;
10 typedef HANDLE proc_pid_t;
11 #else
12 typedef int descriptor_t;
13 typedef pid_t proc_pid_t;
14 #endif
16 typedef struct {
17 descriptor_t parent, child;
18 int fd;
19 } pipe_t;
21 typedef struct {
22 pipe_t in, out, err;
23 proc_pid_t child;
24 } proc_handler_t;
26 int proc_close(proc_handler_t *ht);
27 int proc_open(proc_handler_t *ht, const char *command);
28 int proc_open_buffer(const char *command, buffer *in, buffer *out, buffer *err);
30 #endif