summaryrefslogtreecommitdiff
path: root/include/libc
diff options
context:
space:
mode:
authorBernard Xiong <[email protected]>2018-02-07 19:49:31 +0800
committerBernard Xiong <[email protected]>2018-02-07 19:55:35 +0800
commit4e41b0573b93468c8cfd3425ed2f13c8ec0574f6 (patch)
tree52b287edfe40410d14d48675caaf1c5c2c043bcd /include/libc
parent64a20c0f154b0c9facfefb8b02ba3584b2a9eeb5 (diff)
[libc] fix the fcntl issue in newlib
Diffstat (limited to 'include/libc')
-rw-r--r--include/libc/libc_fcntl.h33
1 files changed, 28 insertions, 5 deletions
diff --git a/include/libc/libc_fcntl.h b/include/libc/libc_fcntl.h
index f8dd66c7fd..86774a5630 100644
--- a/include/libc/libc_fcntl.h
+++ b/include/libc/libc_fcntl.h
@@ -1,6 +1,27 @@
/*
- * fcntl.h file in libc
- */
+ * File : libc_fcntl.h
+ * This file is part of RT-Thread RTOS
+ * COPYRIGHT (C) 2017 - 2018, RT-Thread Development Team
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Change Logs:
+ * Date Author Notes
+ * 2018-02-07 Bernard Add O_DIRECTORY definition in NEWLIB mode.
+ */
+
#ifndef LIBC_FCNTL_H__
#define LIBC_FCNTL_H__
@@ -8,11 +29,10 @@
#include <fcntl.h>
#ifndef O_NONBLOCK
-#define O_NONBLOCK 04000
+#define O_NONBLOCK 0x4000
#endif
#if defined(_WIN32)
-#define O_DIRECTORY 0200000
#define O_ACCMODE (_O_RDONLY | _O_WRONLY | _O_RDWR)
#endif
@@ -23,6 +43,10 @@
#define F_SETFL 4
#endif
+#ifndef O_DIRECTORY
+#define O_DIRECTORY 0x200000
+#endif
+
#else
#define O_RDONLY 00
#define O_WRONLY 01
@@ -77,4 +101,3 @@
#endif
#endif
-