[lxc-devel] [lxc/master] CODING_STYLE: add section about _exit()
brauner on Github
lxc-bot at linuxcontainers.org
Mon Feb 26 10:22:32 UTC 2018
A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 364 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20180226/21e1028a/attachment.bin>
-------------- next part --------------
From 4ad78f87c7c524fc64dc16ed67346284e0db20e1 Mon Sep 17 00:00:00 2001
From: Christian Brauner <christian.brauner at ubuntu.com>
Date: Mon, 26 Feb 2018 11:21:51 +0100
Subject: [PATCH] CODING_STYLE: add section about _exit()
Signed-off-by: Christian Brauner <christian.brauner at ubuntu.com>
---
CODING_STYLE.md | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/CODING_STYLE.md b/CODING_STYLE.md
index 64974fa84..a3bf41a4a 100644
--- a/CODING_STYLE.md
+++ b/CODING_STYLE.md
@@ -512,3 +512,8 @@ rules to use them:
Signed-off-by: Christian Brauner <christian.brauner at ubuntu.com>
```
+#### Use `_exit()` To Terminate `fork()`ed Child Processes
+
+- When `fork()`ing off a child process use `_exit()` to terminate it instead of
+ `exit()`. The `exit()` function is not thread-safe and thus not suited for
+ the shared library which must ensure that it is thread-safe.
More information about the lxc-devel
mailing list