limb 0.2.0

2024-01-09

exec_ae(3)
limb manual
exec_ae(3)

NAME

exec_ae, exec_a, exec_e, exec - execute a file

SYNOPSIS

#include <limb/exec.h>
void exec_ae(const char *file, const char * const *argv, const char * const *env)
void exec_a(const char *file, const char * const *argv)
void exec_e(const char * const *argv, const char * const *env)
void exec(const char * const *argv)

DESCRIPTION

These functions will replace the current process image with a new process image, constructed from a regular executable file.

The exec_ae() function will execute into file. If it does not contain a slash (/) then the file will be searched into the directories specified in the environment variable PATH or, if there's none, in the constant SKALIBS_DEFAULTPATH (defined when compiling skalibs).

The argv and env arguments shall point to the arrays of arguments and environment for the new process, respectively. Execution is performed using a call to execve(3).

The exec_a() macro is similar to exec_ae() but using the global variable environ as environment.

The exec_e() macro is similar to exec_ae() using argv[0] as file to execute.

The exec() macro is similar to exec_a() using argv[0] as file to execute.

RETURN VALUE

These functions should not return on success. Otherwise they set errno to indicate the error.

ERRORS

These functions might fail and set errno for any of the errors described for execve(3).

limb 0.2.0
2024-01-09
exec_ae(3)