[LTP] [PATCH v2] fork13: Fix the doc

Ma Xinjian maxj.fnst@fujitsu.com
Wed Feb 19 06:20:09 CET 2025


Use :: to keep the race description as original text when viewed in RST format.

Signed-off-by: Ma Xinjian <maxj.fnst@fujitsu.com>
---
 testcases/kernel/syscalls/fork/fork13.c | 27 +++++++++++++------------
 1 file changed, 14 insertions(+), 13 deletions(-)

diff --git a/testcases/kernel/syscalls/fork/fork13.c b/testcases/kernel/syscalls/fork/fork13.c
index 3da698e33..add8fc77e 100644
--- a/testcases/kernel/syscalls/fork/fork13.c
+++ b/testcases/kernel/syscalls/fork/fork13.c
@@ -15,21 +15,22 @@
  * implementation.  Furthermore, many shell scripts assume that pid
  * numbers will not be used for some length of time.
  *
- * [Race Description]
- * ---------------------------------------------------------------------
- * A                                B
+ * [Race Description] ::
  *
- * // pid == offset == n            // pid == offset == n + 1
- * test_and_set_bit(offset, map->page)
- *                                  test_and_set_bit(offset, map->page);
- *                                  pid_ns->last_pid = pid;
- * pid_ns->last_pid = pid;
- *                                  // pid == n + 1 is freed (wait())
+ *    ---------------------------------------------------------------------
+ *    A                                B
  *
- *                                  // Next fork()...
- *                                  last = pid_ns->last_pid; // == n
- *                                  pid = last + 1;
- * ---------------------------------------------------------------------
+ *    // pid == offset == n            // pid == offset == n + 1
+ *    test_and_set_bit(offset, map->page)
+ *                                     test_and_set_bit(offset, map->page);
+ *                                     pid_ns->last_pid = pid;
+ *    pid_ns->last_pid = pid;
+ *                                     // pid == n + 1 is freed (wait())
+ *
+ *                                     // Next fork()...
+ *                                     last = pid_ns->last_pid; // == n
+ *                                     pid = last + 1;
+ *    ---------------------------------------------------------------------
  */
 
 #include <sys/types.h>
-- 
2.47.0



More information about the ltp mailing list