execl(3)

DESCRIPTION

Replaces the calling image with path, constructing argv from the NULL-terminated argument list and inheriting environ.

SYNOPSIS

#include <unistd.h>

int execl(const char *path, const char *arg0, ...);

RETURN VALUE

  • Does not return on success
  • returns -1 and sets errno on failure.

ERRORS

  • -E2BIG
    • The argument or environment vector exceeds its limit.
  • -EFAULT
    • A path or argument pointer is invalid.
  • -ENOENT
    • Path does not exist.
  • -ENOEXEC
    • Path is not a valid executable.
  • -ENOMEM
    • The replacement image cannot be allocated.

NOTES

The final variadic argument must be a null pointer.