kcmp: Convert docs to docparse
PATCH v2 1/1 kcmp: Convert docs to docparse
+ update copyright
Signed-off-by Ma Xinjian <[email protected]>
--- testcases/kernel/syscalls/kcmp/kcmp01.c | 16 ++++++++++------ testcases/kernel/syscalls/kcmp/kcmp02.c | 20 ++++++++++++-------- testcases/kernel/syscalls/kcmp/kcmp03.c | 17 +++++++++-------- 3 files changed, 31 insertions(+), 22 deletions(-)
testcases/kernel/syscalls/kcmp/kcmp01.c +10 -6
@@ -1,14 +1,18 @@// SPDX-License-Identifier: GPL-2.0-or-later /* * Copyright (c) 2015 Cedric Hnyda <[email protected]> +* Copyright (c) Linux Test Project, 2015-2024 */ -/* Description: -* Verify that: -* 1) kcmp returns 0 with two process and two fd refering to the -* same open file -* 2) kcmp doesn't return 0 with two process and two fd not -* refering to the same open file +/*\ +* [Description] +* +* Verify that +* +* 1. kcmp() returns 0 with two process and two fd refering to the same +* open file +* 2. kcmp() doesn't return 0 with two process and two fd not refering +* to the same open file */ #define _GNU_SOURCE
testcases/kernel/syscalls/kcmp/kcmp02.c +12 -8
@@ -1,16 +1,20 @@// SPDX-License-Identifier: GPL-2.0-or-later /* * Copyright (c) 2015 Cedric Hnyda <[email protected]> +* Copyright (c) Linux Test Project, 2015-2024 */ -/* Description: -* Verify that: -* 1) kcmp fails with bad pid -* 2) kcmp fails with invalid flag -* 3) kcmp fails with invalid flag -* 4) kcmp fails with invalid flag -* 5) kcmp fails with invalid flag -* 6) kcmp fails with invalid fd +/*\ +* [Description] +* +* Verify that, kcmp() returns -1 and sets errno to +* +* 1. ESRCH if pid does not exist +* 2. EINVAL if type is invalid (it's not in man page) +* 3. EINVAL if type is invalid (it's a negative number, -1) +* 4. EINVAL if type is invalid (it's a negative number, the smallest integer) +* 5. EINVAL if type is invalid (it's too high, the largest integer) +* 6. EBADF if fd is invalid */ #define _GNU_SOURCE
testcases/kernel/syscalls/kcmp/kcmp03.c +9 -8
@@ -1,17 +1,18 @@// SPDX-License-Identifier: GPL-2.0-or-later /* * Copyright (c) 2016 Xiao Yang <[email protected]> +* Copyright (c) Linux Test Project, 2016-2024 */ -/* -* Testname: kcmp03.c +/*\ +* [Description] * -* Description: -* 1) kcmp() returns 0 if the processes share the same file system information. -* 2) kcmp() returns 0 if the processes share I/O context. -* 3) kcmp() returns 0 if the processes share the same list of System V -* semaphore undo operations. -* 4) kcmp() returns 0 if the processes share the same address space. +* Verify that, kcmp() returns 0 if the processes +* +* 1. share the same file system information +* 2. share I/O context +* 3. share the same list of System V semaphore undo operations +* 4. share the same address space */ #define _GNU_SOURCE
Signature · 5 lines
2.42.0 -- Mailing list info: https://lists.linux.it/listinfo/ltp
Hi Ma Xinjian,
...
testcases/kernel/syscalls/kcmp/kcmp02.c line 17
Quoted 12 lines
testcases/kernel/syscalls/kcmp/kcmp02.c +11
-0+/*\ +* [Description] +* +* Verify that, kcmp() returns -1 and sets errno to +* +* 1. ESRCH if pid does not exist +* 2. EINVAL if type is invalid (it's not in man page) +* 3. EINVAL if type is invalid (it's a negative number, -1) +* 4. EINVAL if type is invalid (it's a negative number, the smallest integer) +* 5. EINVAL if type is invalid (it's too high, the largest integer) +* 6. EBADF if fd is invalid
I slightly changed this and merged.
IMHO it's better to use "file descriptor" then just fd (although it's obvious, let's be more formal). OTOH we can use commonly used constants (INT_MAX, ...) instead of "the largest integer").
Thanks!
Kind regards,
Petr
Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp