1/**
2 * This file has no copyright assigned and is placed in the Public Domain.
3 * This file is part of the mingw-w64 runtime package.
4 * No warranty is given; refer to the file DISCLAIMER.PD within this package.
5 */
6#ifndef _UNISTD_H
7#define _UNISTD_H
8#define __UNISTD_H_SOURCED__ 1
9
10#include <io.h>
11#include <process.h>
12#include <getopt.h>
13
14/* These are also defined in stdio.h. */
15#ifndef SEEK_SET
16#define SEEK_SET 0
17#define SEEK_CUR 1
18#define SEEK_END 2
19#endif
20
21/* These are also defined in stdio.h. */
22#ifndef STDIN_FILENO
23#define STDIN_FILENO 0
24#define STDOUT_FILENO 1
25#define STDERR_FILENO 2
26#endif
27
28/* Used by shutdown(2). */
29#ifdef _POSIX_SOURCE
30
31/* MySql connector already defined SHUT_RDWR. */
32#ifndef SHUT_RDWR
33#define SHUT_RD 0x00
34#define SHUT_WR 0x01
35#define SHUT_RDWR 0x02
36#endif
37
38#endif
39
40#ifdef __cplusplus
41extern "C" {
42#endif
43
44#pragma push_macro("sleep")
45#undef sleep
46unsigned int __cdecl sleep (unsigned int);
47#pragma pop_macro("sleep")
48
49#if !defined __NO_ISOCEXT
50#include <sys/types.h> /* For useconds_t. */
51
52int __cdecl __MINGW_NOTHROW usleep(useconds_t);
53#endif /* Not __NO_ISOCEXT */
54
55#ifndef FTRUNCATE_DEFINED
56#define FTRUNCATE_DEFINED
57/* This is defined as a real library function to allow autoconf
58 to verify its existence. */
59int ftruncate(int, off_t)
60#if (defined(_FILE_OFFSET_BITS) && (_FILE_OFFSET_BITS == 64))
61__MINGW_ASM_CALL(ftruncate64)
62#endif
63;
64int ftruncate64(int, _off64_t);
65int truncate(const char *, off_t)
66#if (defined(_FILE_OFFSET_BITS) && (_FILE_OFFSET_BITS == 64))
67__MINGW_ASM_CALL(truncate64)
68#endif
69;
70int truncate64(const char *, _off64_t);
71#endif /* FTRUNCATE_DEFINED */
72
73#ifndef _CRT_SWAB_DEFINED
74#define _CRT_SWAB_DEFINED /* Also in stdlib.h */
75 void __cdecl swab(char *_Buf1,char *_Buf2,int _SizeInBytes) __MINGW_ATTRIB_DEPRECATED_MSVC2005;
76#endif
77
78#if defined(_CRT_USE_WINAPI_FAMILY_DESKTOP_APP) || defined(WINSTORECOMPAT)
79#ifndef _CRT_GETPID_DEFINED
80#define _CRT_GETPID_DEFINED /* Also in process.h */
81 int __cdecl getpid(void) __MINGW_ATTRIB_DEPRECATED_MSVC2005;
82#endif
83#endif /* _CRT_USE_WINAPI_FAMILY_DESKTOP_APP || WINSTORECOMPAT */
84
85#ifdef __cplusplus
86}
87#endif
88
89#include <pthread_unistd.h>
90
91#undef __UNISTD_H_SOURCED__
92#endif /* _UNISTD_H */
93