torrent-stats/process.h

29 lines
606 B
C
Raw Permalink Normal View History

2009-05-03 14:20:03 +02:00
#ifndef _PROCESS_H_
#define _PROCESS_H_
#include <sys/types.h>
#include "list.h"
struct child_process {
struct list_head list;
char **argv;
char *pwd;
int fd[3];
pid_t pid;
void (*exit_cb)(struct child_process *child, int exit_code, void *privdata);
void *privdata;
};
struct child_process * childproc_alloc(char *const argv[], const char *pwd);
int childproc_free(struct child_process *child);
pid_t childproc_fork(struct child_process *child, void (*exit_cb)(struct child_process *child, int exit_code, void *privdata), void *privdata);
void childproc_cleanup(void);
#endif // _SPAWN_H_