1 | /** @file
|
---|
2 | * IPRT / No-CRT - fcntl.h
|
---|
3 | */
|
---|
4 |
|
---|
5 | /*
|
---|
6 | * Copyright (C) 2006-2022 Oracle Corporation
|
---|
7 | *
|
---|
8 | * This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
9 | * available from http://www.virtualbox.org. This file is free software;
|
---|
10 | * you can redistribute it and/or modify it under the terms of the GNU
|
---|
11 | * General Public License (GPL) as published by the Free Software
|
---|
12 | * Foundation, in version 2 as it comes in the "COPYING" file of the
|
---|
13 | * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
|
---|
14 | * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
15 | *
|
---|
16 | * The contents of this file may alternatively be used under the terms
|
---|
17 | * of the Common Development and Distribution License Version 1.0
|
---|
18 | * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
|
---|
19 | * VirtualBox OSE distribution, in which case the provisions of the
|
---|
20 | * CDDL are applicable instead of those of the GPL.
|
---|
21 | *
|
---|
22 | * You may elect to license modified versions of this file under the
|
---|
23 | * terms and conditions of either the GPL or the CDDL or both.
|
---|
24 | */
|
---|
25 |
|
---|
26 | #ifndef IPRT_INCLUDED_nocrt_fcntl_h
|
---|
27 | #define IPRT_INCLUDED_nocrt_fcntl_h
|
---|
28 | #ifndef RT_WITHOUT_PRAGMA_ONCE
|
---|
29 | # pragma once
|
---|
30 | #endif
|
---|
31 |
|
---|
32 | #include <iprt/nocrt/time.h> /* to establish the timespec and timeval types before iprt/file.h includes iprt/time.h */
|
---|
33 | #include <iprt/file.h>
|
---|
34 |
|
---|
35 | #ifdef IPRT_NO_CRT_FOR_3RD_PARTY
|
---|
36 |
|
---|
37 | /* Open flags:*/
|
---|
38 | AssertCompile(RT_IS_POWER_OF_TWO(RTFILE_O_OPEN_CREATE));
|
---|
39 | AssertCompile(RT_IS_POWER_OF_TWO(RTFILE_O_CREATE));
|
---|
40 | # define _O_CREAT RTFILE_O_OPEN_CREATE
|
---|
41 | # define _O_EXCL RTFILE_O_CREATE /**< Will remove RTFILE_O_OPEN_CREATE when processing it. */
|
---|
42 | # define _O_TRUNC RTFILE_O_TRUNCATE
|
---|
43 | # define _O_APPEND RTFILE_O_APPEND
|
---|
44 | # define _O_RDONLY RTFILE_O_READ
|
---|
45 | # define _O_WRONLY RTFILE_O_WRITE
|
---|
46 | # define _O_RDWR (RTFILE_O_READ | RTFILE_O_WRITE)
|
---|
47 | # define _O_CLOEXEC RTFILE_O_INHERIT /**< Invert meaning when processing it. */
|
---|
48 | # define _O_NOINHERIT O_CLOEXEC
|
---|
49 | # define _O_LARGEFILE 0
|
---|
50 | # define _O_BINARY 0
|
---|
51 |
|
---|
52 | # define O_CREAT _O_CREAT
|
---|
53 | # define O_EXCL _O_EXCL
|
---|
54 | # define O_TRUNC _O_TRUNC
|
---|
55 | # define O_APPEND _O_APPEND
|
---|
56 | # define O_RDONLY _O_RDONLY
|
---|
57 | # define O_WRONLY _O_WRONLY
|
---|
58 | # define O_RDWR _O_RDWR
|
---|
59 | # define O_CLOEXEC _O_CLOEXEC
|
---|
60 | # define O_NOINHERIT _O_NOINHERIT
|
---|
61 | # define O_BINARY _O_BINARY
|
---|
62 |
|
---|
63 | RT_C_DECLS_BEGIN
|
---|
64 |
|
---|
65 | int RT_NOCRT(open)(const char *pszFilename, uint64_t fFlags, ... /*RTFMODE fMode*/);
|
---|
66 | int RT_NOCRT(_open)(const char *pszFilename, uint64_t fFlags, ... /*RTFMODE fMode*/);
|
---|
67 |
|
---|
68 | # if !defined(RT_WITHOUT_NOCRT_WRAPPERS) && !defined(RT_WITHOUT_NOCRT_WRAPPER_ALIASES)
|
---|
69 | # define open RT_NOCRT(open)
|
---|
70 | # define _open RT_NOCRT(_open)
|
---|
71 | # endif
|
---|
72 |
|
---|
73 | RT_C_DECLS_END
|
---|
74 |
|
---|
75 | #endif /* IPRT_NO_CRT_FOR_3RD_PARTY */
|
---|
76 |
|
---|
77 |
|
---|
78 |
|
---|
79 | #endif /* !IPRT_INCLUDED_nocrt_fcntl_h */
|
---|
80 |
|
---|