29 lines
606 B
C
29 lines
606 B
C
#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_
|