Debian Codegraph @

clang-tools-extra/docs/clang-tidy/checks/android/cloexec-accept.rst

raw
1 .. title:: clang-tidy - android-cloexec-accept
2
3 android-cloexec-accept
4 ======================
5
6 The usage of ``accept()`` is not recommended, it's better to use ``accept4()``.
7 Without this flag, an opened sensitive file descriptor would remain open across
8 a fork+exec to a lower-privileged SELinux domain.
9
10 Examples:
11
12 .. code-block:: c++
13
14 accept(sockfd, addr, addrlen);
15
16 // becomes
17
18 accept4(sockfd, addr, addrlen, SOCK_CLOEXEC);