clang-tools-extra/docs/clang-tidy/checks/android/cloexec-creat.rst
raw| 1 | .. title:: clang-tidy - android-cloexec-creat |
| 2 | |
| 3 | android-cloexec-creat |
| 4 | ===================== |
| 5 | |
| 6 | The usage of ``creat()`` is not recommended, it's better to use ``open()``. |
| 7 | |
| 8 | Examples: |
| 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); |