Skip to content

Commit

Permalink
include/tst_cmd.h: Improve programming doc
Browse files Browse the repository at this point in the history
Link: https://lore.kernel.org/ltp/[email protected]/
Reviewed-by: Marius Kittler <[email protected]>
Reviewed-by: Andrea Cervesato <[email protected]>
Signed-off-by: Petr Vorel <[email protected]>
  • Loading branch information
pevik committed Feb 23, 2024
1 parent 2c89b2f commit 3868440
Showing 1 changed file with 14 additions and 9 deletions.
23 changes: 14 additions & 9 deletions include/tst_cmd.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,27 +18,32 @@ enum tst_cmd_flags {

/*
* vfork() + execvp() specified program.
* @argv: a list of two (at least program name + NULL) or more pointers that
*
* @param argv A list of two (at least program name + NULL) or more pointers that
* represent the argument list to the new program. The array of pointers
* must be terminated by a NULL pointer.
* @stdout_fd: file descriptor where to redirect stdout. Set -1 if
* @param stdout_fd File descriptor where to redirect stdout. Set -1 if
* redirection is not needed.
* @stderr_fd: file descriptor where to redirect stderr. Set -1 if
* @param stderr_fd File descriptor where to redirect stderr. Set -1 if
* redirection is not needed.
* @flags: enum tst_cmd_flags
* @param flags enum tst_cmd_flags.
* @return The exit status of the program.
*/
int tst_cmd_fds_(void (cleanup_fn)(void),
const char *const argv[],
int stdout_fd,
int stderr_fd,
enum tst_cmd_flags flags);

/* Executes tst_cmd_fds() and redirects its output to a file
* @stdout_path: path where to redirect stdout. Set NULL if redirection is
/*
* Executes tst_cmd_fds() and redirects its output to a file.
*
* @param stdout_path Path where to redirect stdout. Set NULL if redirection is
* not needed.
* @stderr_path: path where to redirect stderr. Set NULL if redirection is
* @param stderr_path Path where to redirect stderr. Set NULL if redirection is
* not needed.
* @flags: enum tst_cmd_flags
* @param flags enum tst_cmd_flags.
* @return The exit status of the program.
*/
int tst_cmd_(void (cleanup_fn)(void),
const char *const argv[],
Expand Down Expand Up @@ -87,7 +92,7 @@ static inline int tst_cmd(void (cleanup_fn)(void),
#endif

/* Wrapper function for system(3), ignorcing SIGCHLD signal.
* @command: the command to be run.
* @param command The command to be run.
*/
int tst_system(const char *command);

Expand Down

0 comments on commit 3868440

Please sign in to comment.