summaryrefslogtreecommitdiff
path: root/ace/os_include/fcntl.h
blob: b0aeb782555ffd1d65d2d08e0266c2a34b489b11 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
// -*- C++ -*-

//=============================================================================
/**
 *  @file    os_fcntl.h
 *
 *  file control options
 *
 *  $Id$
 *
 *  @author Don Hinton <dhinton@dresystems.com>
 *  @author This code was originally in various places including ace/OS.h.
 */
//=============================================================================

#ifndef ACE_OS_INCLUDE_OS_FCNTL_H
#define ACE_OS_INCLUDE_OS_FCNTL_H

#include "ace/pre.h"

#include "ace/config-all.h"

#if !defined (ACE_LACKS_PRAGMA_ONCE)
# pragma once
#endif /* ACE_LACKS_PRAGMA_ONCE */

#include "ace/os_include/sys/stat.h"
#include "ace/os_include/sys/types.h"

#if !defined (ACE_LACKS_FCNTL_H)
# include /**/ <fcntl.h>
#endif /* !ACE_LACKS_FCNTL_H */

// Place all additions (especially function declarations) within extern "C" {}
#ifdef __cplusplus
extern "C"
{
#endif /* __cplusplus */

#if defined (__BORLANDC__)
#  define _O_CREAT O_CREAT
#  define _O_EXCL  O_EXCL
#  define _O_TRUNC O_TRUNC
   // 0x0800 is used for O_APPEND.  0x08 looks free.
#  define _O_TEMPORARY 0x08 /* see fcntl.h */
#  define _O_RDWR   O_RDWR
#  define _O_WRONLY O_WRONLY
#  define _O_RDONLY O_RDONLY
#  define _O_APPEND O_APPEND
#  define _O_BINARY O_BINARY
#  define _O_TEXT   O_TEXT
#endif /* __BORLANDC__ */

// defined Win32 specific macros for UNIX platforms
#if !defined (O_BINARY)
#  define O_BINARY 0
#endif /* O_BINARY */
#if !defined (_O_BINARY)
#  define _O_BINARY O_BINARY
#endif /* _O_BINARY */
#if !defined (O_TEXT)
#  define O_TEXT 0
#endif /* O_TEXT */
#if !defined (_O_TEXT)
#  define _O_TEXT O_TEXT
#endif /* _O_TEXT */
#if !defined (O_RAW)
#  define O_RAW 0
#endif /* O_RAW */
#if !defined (_O_RAW)
#  define _O_RAW O_RAW
#endif /* _O_RAW */

#if defined (ACE_WIN32)
#  define O_NDELAY    1
#endif /* ACE_WIN32 */

#if defined (ACE_HAS_POSIX_NONBLOCK)
#  define ACE_NONBLOCK O_NONBLOCK
#else
#  define ACE_NONBLOCK O_NDELAY
#endif /* ACE_HAS_POSIX_NONBLOCK */

#ifdef __cplusplus
}
#endif /* __cplusplus */

#include "ace/post.h"
#endif /* ACE_OS_INCLUDE_OS_FCNTL_H */