Skip to content

Commit

Permalink
kcmp: Convert docs to docparse
Browse files Browse the repository at this point in the history
+ update copyright

Link: https://lore.kernel.org/ltp/[email protected]/
Reviewed-by: Petr Vorel <[email protected]>
Signed-off-by: Ma Xinjian <[email protected]>
[ pvorel: adjust kcmp02.c ]
Signed-off-by: Petr Vorel <[email protected]>
  • Loading branch information
MaXinjian authored and pevik committed Nov 12, 2024
1 parent 68013c8 commit a572127
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 22 deletions.
16 changes: 10 additions & 6 deletions testcases/kernel/syscalls/kcmp/kcmp01.c
Original file line number Diff line number Diff line change
@@ -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 file descriptors refering to the
* same open file
* 2. kcmp() doesn't return 0 with two process and two file descriptors not
* refering to the same open file
*/

#define _GNU_SOURCE
Expand Down
20 changes: 12 additions & 8 deletions testcases/kernel/syscalls/kcmp/kcmp02.c
Original file line number Diff line number Diff line change
@@ -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 (KCMP_TYPES + 1)
* 3. EINVAL if type is invalid (-1)
* 4. EINVAL if type is invalid (INT_MIN)
* 5. EINVAL if type is invalid (INT_MAX)
* 6. EBADF if file descriptor is invalid
*/

#define _GNU_SOURCE
Expand Down
17 changes: 9 additions & 8 deletions testcases/kernel/syscalls/kcmp/kcmp03.c
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit a572127

Please sign in to comment.