Defines | |
#define | IX_SPAWN_DEFAULT 0 |
no specific spawn options | |
#define | IX_SPAWN_SESSION 1 |
spawn process as session leader | |
Functions | |
int | ix_daemon (char *dir) |
void * | memdup (void *src, size_t len) |
char * | ix_path (void) |
char * | ix_stralloc (char *s, int len) |
char * | ix_strncpy (char *d, char *s, int len) |
pid_t | ix_spawn (char *cmd, int opt, int f[3], char *env[]) |
int | ix_getpidof (char *proc, pid_t pid[], int maxpid) |
get process id by name | |
int | ix_read_block (int fd, void *buffer, int len, int tio) |
int | ix_write_block (int sd, void *buffer, int len, int tio) |
int ix_daemon | ( | char * | dir | ) |
process is set to daemon state
dir | if not NULL change current working directory to dir |
int ix_getpidof | ( | char * | proc, | |
pid_t | pid[], | |||
int | maxpid | |||
) |
get process id by name
get a list of process ids by name
proc | process name array of pid to fill maximal number of entries in pid |
char* ix_path | ( | void | ) |
returns the ixtools working path
pid_t ix_spawn | ( | char * | cmd, | |
int | opt, | |||
int | f[3], | |||
char * | env[] | |||
) |
spawn a new process
cmd | process name to start | |
opt | options | |
f | array of open filedescriptors to redirect stdin, stdout, stderr (if not supplied the stdin, stdout and stderr from calling process are inherited) | |
env | null terminated array of environment settings |
char* ix_stralloc | ( | char * | s, | |
int | len | |||
) |
allocates memory of len+1 bytes and duplicates s
char* ix_strncpy | ( | char * | d, | |
char * | s, | |||
int | len | |||
) |
copies s to d but no more than len bytes, ensures that d is zero terminated
void* memdup | ( | void * | src, | |
size_t | len | |||
) |
memdup like strdup ;-)