Skip to content

Commit 5870804

Browse files
committed
doc: Convert part of tst_cmd.h comments to kerneldoc
Therefore add 'man3' to extlinks. Signed-off-by: Petr Vorel <pvorel@suse.cz>
1 parent 644d7dd commit 5870804

File tree

3 files changed

+21
-8
lines changed

3 files changed

+21
-8
lines changed

doc/conf.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
'master': (f'{ltp_repo}/blob/master/%s', '%s'),
3737
'git_man': ('https://git-scm.com/docs/git-%s', 'git %s'),
3838
'man2': ('https://man7.org/linux/man-pages/man2/%s.2.html', '%s(2)'),
39+
'man3': ('https://man7.org/linux/man-pages/man3/%s.3.html', '%s(3)'),
3940
# TODO: allow 2nd parameter to show page description instead of plain URL
4041
'kernel_doc': ('https://docs.kernel.org/%s.html', 'https://docs.kernel.org/%s.html'),
4142
'kernel_tree': ('https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/%s', '%s'),

doc/developers/api_c_tests.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@ Checkpoints
2525

2626
.. kernel-doc:: ../../include/tst_checkpoint.h
2727

28+
Commands
29+
--------
30+
.. kernel-doc:: ../../include/tst_cmd.h
31+
2832
Crypto
2933
------
3034
.. kernel-doc:: ../../include/tst_crypto.h

include/tst_cmd.h

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,21 @@
11
/* SPDX-License-Identifier: GPL-2.0-or-later
22
* Copyright (c) 2015-2016 Cyril Hrubis <chrubis@suse.cz>
3+
* Copyright (c) Linux Test Project, 2016-2025
34
*/
45

56
#ifndef TST_CMD_H__
67
#define TST_CMD_H__
78

9+
/**
10+
* enum tst_cmd_flags - flags for tst_cmd() and tst_cmd_fds().
11+
*
12+
* @TST_CMD_PASS_RETVAL: return the program exit code, otherwise it will call
13+
* cleanup_fn() if the program exit code is not zero.
14+
* @TST_CMD_TCONF_ON_MISSING: exit with :c:enum:`TCONF <tst_res_flags>` if
15+
* program is not in ``PATH``.
16+
*/
817
enum tst_cmd_flags {
9-
/*
10-
* return the program exit code, otherwise it will call cleanup_fn() if the
11-
* program exit code is not zero.
12-
*/
1318
TST_CMD_PASS_RETVAL = 1,
14-
15-
/* exit with TCONF if program is not in path */
1619
TST_CMD_TCONF_ON_MISSING = 2,
1720
};
1821

@@ -94,8 +97,13 @@ static inline int tst_cmd(void (cleanup_fn)(void),
9497
}
9598
#endif
9699

97-
/* Wrapper function for system(3), ignorcing SIGCHLD signal.
98-
* @param command The command to be run.
100+
/**
101+
* tst_system() - Wrapper function for :man3:`system`, ignorcing ``SIGCHLD``
102+
* signal.
103+
*
104+
* @command: The command to be run.
105+
*
106+
* Return: The system() return code.
99107
*/
100108
int tst_system(const char *command);
101109

0 commit comments

Comments
 (0)