xref: /llvm-project/clang-tools-extra/docs/clang-tidy/checks/android/cloexec-creat.rst (revision 6e566bc5523f743bc34a7e26f050f1f2b4d699a8)
1.. title:: clang-tidy - android-cloexec-creat
2
3android-cloexec-creat
4=====================
5
6The usage of ``creat()`` is not recommended, it's better to use ``open()``.
7
8Examples:
9
10.. code-block:: c++
11
12  int fd = creat(path, mode);
13
14  // becomes
15
16  int fd = open(path, O_WRONLY | O_CREAT | O_TRUNC | O_CLOEXEC, mode);
17