summaryrefslogtreecommitdiff
path: root/ace/os_include/fcntl.h
diff options
context:
space:
mode:
Diffstat (limited to 'ace/os_include/fcntl.h')
-rw-r--r--ace/os_include/fcntl.h64
1 files changed, 58 insertions, 6 deletions
diff --git a/ace/os_include/fcntl.h b/ace/os_include/fcntl.h
index 77d356f1c47..b0aeb782555 100644
--- a/ace/os_include/fcntl.h
+++ b/ace/os_include/fcntl.h
@@ -2,19 +2,19 @@
//=============================================================================
/**
- * @file fcntl.h
+ * @file os_fcntl.h
*
* file control options
*
* $Id$
*
- * @author Don Hinton <dhinton@ieee.org>
+ * @author Don Hinton <dhinton@dresystems.com>
* @author This code was originally in various places including ace/OS.h.
*/
//=============================================================================
-#ifndef ACE_OS_INCLUDE_FCNTL_H
-#define ACE_OS_INCLUDE_FCNTL_H
+#ifndef ACE_OS_INCLUDE_OS_FCNTL_H
+#define ACE_OS_INCLUDE_OS_FCNTL_H
#include "ace/pre.h"
@@ -31,7 +31,59 @@
# include /**/ <fcntl.h>
#endif /* !ACE_LACKS_FCNTL_H */
-// @todo move the O_xxx definitions here...
+// 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_FCNTL_H */
+#endif /* ACE_OS_INCLUDE_OS_FCNTL_H */