This is the mail archive of the newlib@sourceware.org mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Wrong documentation for open()


Hello Eric!

Eric Blake wrote on 2015-04-09 17:38 MET:
> Patches welcome.

Untested patch attached.

PS: I'm using the newlib contained in TI MSP430-GCC v3.2.3.0:
gcc version 4.9.1 20140707 (prerelease (msp430-14r1-167)) (GNUPro 14r1)
(Based on: GCC 4.8 GDB 7.7 Binutils 2.24 Newlib 2.1) (GCC)

-- 
MfG / Regards
Friedrich Lobenstock

diff --git a/libgloss/open.c b/libgloss/open.c
index 468b11c..c57b227 100644
--- a/libgloss/open.c
+++ b/libgloss/open.c
@@ -22,8 +22,7 @@
 int
 _DEFUN (open, (buf, flags, mode),
        const char *buf _AND
-       int flags _AND
-       int mode)
+       int flags _DOTS)
 {
   errno = EIO;
   return (-1);
diff --git a/newlib/libc/sys.tex b/newlib/libc/sys.tex
index 3b04c15..157e5f3 100644
--- a/newlib/libc/sys.tex
+++ b/newlib/libc/sys.tex
@@ -184,7 +184,7 @@ int lseek(int file, int ptr, int dir) @{
 Open a file.  Minimal implementation:
 
 @example
-int open(const char *name, int flags, int mode) @{
+int open(const char *name, int flags, ...) @{
   return -1;
 @}
 @end example
@@ -344,7 +344,7 @@ to the global data block, which holds @code{errno}.
 
 @example
 int _open_r(void *@var{reent},
-    const char *@var{file}, int @var{flags}, int @var{mode});
+    const char *@var{file}, int @var{flags}, ...);
 @end example
 
 @ifset STDIO64

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]