libite 2.6.1
systemf.c File Reference
#include <errno.h>
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/wait.h>

Go to the source code of this file.

Functions

int systemf (const char *fmt,...)
 

Detailed Description

Author
Joachim Wiberg
Date
2021

Definition in file systemf.c.

Function Documentation

◆ systemf()

int systemf ( const char * fmt,
... )

Like system(), but takes a formatted string as argument.

Parameters
fmtprintf style format list to command to run

This system() wrapper greatly simplifies operations that usually consist of composing a command from parts into a dynamic buffer before calling it. The return value from system() is also parsed, checking for proper exit and signals.

Returns
If the command exits normally, the return code of the command is returned. Otherwise, if the command is signalled, the return code is -1 and errno is set to EINTR.

Definition at line 44 of file systemf.c.