xref: /freebsd/contrib/llvm-project/libc/src/__support/OSUtil/fcntl.h (revision bb722a7d0f1642bff6487f943ad0427799a6e5bf)
1 //===-- Implementation header of internal fcntl function ------------------===//
2 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
3 // See https://llvm.org/LICENSE.txt for license information.
4 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
5 //
6 //===----------------------------------------------------------------------===//
7 
8 #ifndef LLVM_LIBC_SRC___SUPPORT_OSUTIL_FCNTL_H
9 #define LLVM_LIBC_SRC___SUPPORT_OSUTIL_FCNTL_H
10 
11 #include "hdr/types/mode_t.h"
12 #include "src/__support/error_or.h"
13 #include "src/__support/macros/config.h"
14 
15 namespace LIBC_NAMESPACE_DECL {
16 namespace internal {
17 
18 ErrorOr<int> fcntl(int fd, int cmd, void *arg = nullptr);
19 
20 ErrorOr<int> open(const char *path, int flags, mode_t mode_flags = 0);
21 
22 ErrorOr<int> close(int fd);
23 
24 } // namespace internal
25 } // namespace LIBC_NAMESPACE_DECL
26 
27 #endif // LLVM_LIBC_SRC___SUPPORT_OSUTIL_FCNTL_H
28