OSDN Git Service

9d8de8017fafab7d30209b1e1a0ed0d6ed75c3d0
[mingw/mingw-org-wsl.git] / include / unistd.h
1 /**
2  * @file unistd.h
3  * @copy 2012 MinGW.org project
4  *
5  * Permission is hereby granted, free of charge, to any person obtaining a
6  * copy of this software and associated documentation files (the "Software"),
7  * to deal in the Software without restriction, including without limitation
8  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
9  * and/or sell copies of the Software, and to permit persons to whom the
10  * Software is furnished to do so, subject to the following conditions:
11  * 
12  * The above copyright notice and this permission notice (including the next
13  * paragraph) shall be included in all copies or substantial portions of the
14  * Software.
15  * 
16  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22  * DEALINGS IN THE SOFTWARE.
23  */
24 #ifndef _UNISTD_H
25 #define _UNISTD_H
26 #pragma GCC system_header
27
28 /*
29  * unistd.h maps (roughly) to io.h
30  * Other headers included by unistd.h may be selectively processed;
31  * __UNISTD_H_SOURCED__ enables such selective processing.
32  */
33 #define __UNISTD_H_SOURCED__ 1
34
35 #include <io.h>
36 #include <process.h>
37 #include <getopt.h>
38
39 /* These are also defined in stdio.h. */
40 #ifndef SEEK_SET
41 #define SEEK_SET 0
42 #endif
43
44 #ifndef SEEK_CUR
45 #define SEEK_CUR 1
46 #endif
47
48 #ifndef SEEK_END
49 #define SEEK_END 2
50 #endif
51
52 #ifdef __cplusplus
53 extern "C" {
54 #endif
55
56 #if !defined __NO_ISOCEXT
57 #include <sys/types.h> /* For useconds_t. */
58
59 int __cdecl __MINGW_NOTHROW usleep(useconds_t useconds);
60 #endif  /* Not __NO_ISOCEXT */
61
62 /* This is defined as a real library function to allow autoconf
63    to verify its existence. */
64 int ftruncate(int, off_t);
65 #ifndef __NO_INLINE__
66 __CRT_INLINE int ftruncate(int __fd, off_t __length)
67 {
68   return _chsize (__fd, __length);
69 }
70 #endif
71
72 #ifdef __cplusplus
73 }
74 #endif
75
76 #undef __UNISTD_H_SOURCED__
77 #endif /* _UNISTD_H */