VirtualBox

source: vbox/trunk/include/iprt/nocrt/unistd.h

Last change on this file was 98103, checked in by vboxsync, 17 months ago

Copyright year updates by scm.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 4.5 KB
Line 
1/** @file
2 * IPRT / No-CRT - Minimal unistd.h header.
3 */
4
5/*
6 * Copyright (C) 2022-2023 Oracle and/or its affiliates.
7 *
8 * This file is part of VirtualBox base platform packages, as
9 * available from https://www.virtualbox.org.
10 *
11 * This program is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU General Public License
13 * as published by the Free Software Foundation, in version 3 of the
14 * License.
15 *
16 * This program is distributed in the hope that it will be useful, but
17 * WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 * General Public License for more details.
20 *
21 * You should have received a copy of the GNU General Public License
22 * along with this program; if not, see <https://www.gnu.org/licenses>.
23 *
24 * The contents of this file may alternatively be used under the terms
25 * of the Common Development and Distribution License Version 1.0
26 * (CDDL), a copy of it is provided in the "COPYING.CDDL" file included
27 * in the VirtualBox distribution, in which case the provisions of the
28 * CDDL are applicable instead of those of the GPL.
29 *
30 * You may elect to license modified versions of this file under the
31 * terms and conditions of either the GPL or the CDDL or both.
32 *
33 * SPDX-License-Identifier: GPL-3.0-only OR CDDL-1.0
34 */
35
36#ifndef IPRT_INCLUDED_nocrt_unistd_h
37#define IPRT_INCLUDED_nocrt_unistd_h
38#ifndef RT_WITHOUT_PRAGMA_ONCE
39# pragma once
40#endif
41
42#include <iprt/nocrt/sys/types.h>
43#ifdef IPRT_NO_CRT_FOR_3RD_PARTY
44# include <iprt/nocrt/time.h> /* file.h includes fs.h which includes time.h */
45# include <iprt/file.h> /* for RTFILE_SEEK_XXX */
46# include <iprt/assertcompile.h>
47#endif
48
49
50#ifdef IPRT_NO_CRT_FOR_3RD_PARTY
51
52/* Flags for access: */
53# define F_OK 0
54# define X_OK 1
55# define W_OK 2
56# define R_OK 4
57
58/* These are also in stdio.h: */
59# undef SEEK_SET
60# define SEEK_SET RTFILE_SEEK_BEGIN
61# undef SEEK_CUR
62# define SEEK_CUR RTFILE_SEEK_CURRENT
63# undef SEEK_END
64# define SEEK_END RTFILE_SEEK_END
65AssertCompile(SEEK_SET == 0); AssertCompile(SEEK_CUR == 1); AssertCompile(SEEK_END == 2); /* Also in WDK header mmiscapi.h. */
66
67RT_C_DECLS_BEGIN
68
69int RT_NOCRT(access)(const char *, int) RT_NOEXCEPT;
70int RT_NOCRT(dup)(int) RT_NOEXCEPT;
71int RT_NOCRT(dup2)(int, int) RT_NOEXCEPT;
72ssize_t RT_NOCRT(read)(int, void *, size_t) RT_NOEXCEPT;
73ssize_t RT_NOCRT(write)(int, const void *, size_t) RT_NOEXCEPT;
74int RT_NOCRT(close)(int) RT_NOEXCEPT;
75int RT_NOCRT(isatty)(int) RT_NOEXCEPT;
76char *RT_NOCRT(getcwd)(char *, size_t) RT_NOEXCEPT;
77RTPROCESS RT_NOCRT(getpid)(void) RT_NOEXCEPT;
78RTPROCESS RT_NOCRT(getppid)(void) RT_NOEXCEPT;
79int RT_NOCRT(unlink)(const char *) RT_NOEXCEPT;
80
81int RT_NOCRT(_access)(const char *, int) RT_NOEXCEPT;
82int RT_NOCRT(_dup)(int) RT_NOEXCEPT;
83int RT_NOCRT(_dup2)(int, int) RT_NOEXCEPT;
84ssize_t RT_NOCRT(_read)(int, void *, size_t) RT_NOEXCEPT;
85ssize_t RT_NOCRT(_write)(int, const void *, size_t) RT_NOEXCEPT;
86int RT_NOCRT(_close)(int) RT_NOEXCEPT;
87int RT_NOCRT(_isatty)(int) RT_NOEXCEPT;
88char *RT_NOCRT(_getcwd)(char *, size_t) RT_NOEXCEPT;
89RTPROCESS RT_NOCRT(_getpid)(void) RT_NOEXCEPT;
90RTPROCESS RT_NOCRT(_getppid)(void) RT_NOEXCEPT;
91int RT_NOCRT(_unlink)(const char *) RT_NOEXCEPT;
92
93# if !defined(RT_WITHOUT_NOCRT_WRAPPERS) && !defined(RT_WITHOUT_NOCRT_WRAPPER_ALIASES)
94# define access RT_NOCRT(access)
95# define dup RT_NOCRT(dup)
96# define dup2 RT_NOCRT(dup2)
97# define read RT_NOCRT(read)
98# define write RT_NOCRT(write)
99# define close RT_NOCRT(close)
100# define isatty RT_NOCRT(isatty)
101# define getcwd RT_NOCRT(getcwd)
102# define getpid RT_NOCRT(getpid)
103# define getppid RT_NOCRT(getppid)
104# define unlink RT_NOCRT(unlink)
105
106# define _access RT_NOCRT(access)
107# define _dup RT_NOCRT(dup)
108# define _dup2 RT_NOCRT(dup2)
109# define _read RT_NOCRT(read)
110# define _write RT_NOCRT(write)
111# define _close RT_NOCRT(close)
112# define _isatty RT_NOCRT(isatty)
113# define _getcwd RT_NOCRT(getcwd)
114# define _getpid RT_NOCRT(getpid)
115# define _getppid RT_NOCRT(getppid)
116# define _unlink RT_NOCRT(unlink)
117# endif
118
119RT_C_DECLS_END
120
121#endif /* IPRT_NO_CRT_FOR_3RD_PARTY */
122
123
124#endif /* !IPRT_INCLUDED_nocrt_unistd_h */
125
Note: See TracBrowser for help on using the repository browser.

© 2023 Oracle
ContactPrivacy policyTerms of Use