diff options
author | Stanislav Kholmanskikh <stanislav.kholmanskikh@oracle.com> | 2014-07-03 11:24:42 +0400 |
---|---|---|
committer | Cyril Hrubis <chrubis@suse.cz> | 2014-07-03 17:26:44 +0200 |
commit | d2eb7d4b10280e8570fe002706bf13c2f3b988fa (patch) | |
tree | 3770f8cbbe069fe2cf96e59ed02dfdec77ed752d /doc | |
parent | 1f5eb3444e73d05af860068ad5522f84401cb1ef (diff) |
test-writing-guidelines: added info about tst_get_unused_pid()
Signed-off-by: Stanislav Kholmanskikh <stanislav.kholmanskikh@oracle.com>
Diffstat (limited to 'doc')
-rw-r--r-- | doc/test-writing-guidelines.txt | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/doc/test-writing-guidelines.txt b/doc/test-writing-guidelines.txt index 0170e541d..2213966db 100644 --- a/doc/test-writing-guidelines.txt +++ b/doc/test-writing-guidelines.txt @@ -875,6 +875,22 @@ newly created dir has two links already - the '.' and the link from parent dir). If no limit is hit or if 'mkdir(2)' failed with 'ENOSPC' or 'EDQUOT', zero is returned and previously created directories are removed. +2.2.17 Getting an unused PID number +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Some tests require a 'PID', which is not used by the OS (does not belong to +any process within it). For example, kill(2) should set errno to 'ESRCH' if +it's passed such 'PID'. + +[source,c] +------------------------------------------------------------------------------- +#include "test.h" + +pid_t tst_get_unused_pid(void (*cleanup)(void)); +------------------------------------------------------------------------------- + +Return a 'PID' value not used by the OS or any process within it. + 2.3 Writing a testcase in shell ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |