Mail Archives: djgpp-workers/2009/04/12/07:48:59
X-Authentication-Warning: | delorie.com: mail set sender to djgpp-workers-bounces using -f
|
X-Recipient: | djgpp-workers AT delorie DOT com
|
X-Authenticated: | #27081556
|
X-Provags-ID: | V01U2FsdGVkX1+CbjpZptyCQroFcBwOxFOnp/Ppa/qMvlvGhG7PTR
|
| 4UBbSVEFGglfk2
|
Message-ID: | <000b01c9bb64$96fb11d0$2602a8c0@computername>
|
From: | "Juan Manuel Guerrero" <juan DOT guerrero AT gmx DOT de>
|
To: | <djgpp-workers AT delorie DOT com>
|
Subject: | Re: mkstemp() declaration
|
Date: | Sun, 12 Apr 2009 13:48:25 +0200
|
MIME-Version: | 1.0
|
X-Priority: | 3
|
X-MSMail-Priority: | Normal
|
X-Mailer: | Microsoft Outlook Express 6.00.2800.1106
|
X-MimeOLE: | Produced By Microsoft MimeOLE V6.00.2800.1106
|
X-Y-GMX-Trusted: | 0
|
X-FuHaFi: | 0.54
|
Reply-To: | djgpp-workers AT delorie DOT com
|
Here is a new patch taking into account the issues proposed:
- functions prototypes are kept in stdio.h for backward compatibility.
- a note has been added to the .txh files explaining that prototypes are now in
stdlib.h and kept in stdio.h for backward compatibility.
If there are no objections until tomorrow I will apply the patch.
Regards,
Juan M. Guerrero
2009-04-12 Juan Manuel Guerrero <juan DOT guerrero AT gmx DOT de>
* include/stdlib.h: Declarations for mktemp() and mkstemp() added.
* src/libc/compat/stdio/mkstemp.c: Include stdlib.h for function prototype.
* src/libc/compat/stdio/mkstemp.txh: Change example code. Include stdlib.h
instead of stdio.h for function prototype.
* src/libc/compat/stdio/mktemp.c: Include stdlib.h for function prototype.
* src/libc/compat/stdio/mktemp.txh: Change example code. Include stdlib.h
instead of stdio.h for function prototype.
* src/docs/kb/wc204.txi: Entry concerning mkstemp and mktemp added.
diff -aprNU3 djgpp.orig/include/stdlib.h djgpp/include/stdlib.h
--- djgpp.orig/include/stdlib.h 2003-02-20 19:06:14 +0000
+++ djgpp/include/stdlib.h 2009-04-12 13:16:56 +0000
@@ -101,6 +101,8 @@ unsigned long long int strtoull(const ch
long a64l(const char *_string);
char * l64a(long _value);
+char * mktemp(char *_template);
+int mkstemp(char *_template);
int putenv(char *_val);
char * realpath(const char *_path, char *_resolved);
int setenv(const char *_var, const char *_val, int _overwrite);
diff -aprNU3 djgpp.orig/src/docs/kb/wc204.txi djgpp/src/docs/kb/wc204.txi
--- djgpp.orig/src/docs/kb/wc204.txi 2009-02-01 11:22:26 +0000
+++ djgpp/src/docs/kb/wc204.txi 2009-04-12 13:16:56 +0000
@@ -1176,3 +1176,10 @@ stored in the member @code{name} of the
and used by @code{readdir}, @code{rewinddir} and @code{__set_need_fake_dot_dotdot}.
Now it only contains the canonicalized path to the directory without a terminating slash.
Those functions that require the trailing search pattern @code{/*.*} will append it.
+
+@findex mktemp AT r{, and SUS compliance}
+@findex mkstemp AT r{, and SUS compliance}
+The function prototypes of @code{mktemp} and @code{mkstemp} are now also in
+@code{<sdtlib.h>}. This is to archive Single Unix Specification compliance.
+To keep backward compatibility to prototypes are also kept in @code{<sdtio.h>}
+but there usage are deprecated.
diff -aprNU3 djgpp.orig/src/libc/compat/stdio/mkstemp.c djgpp/src/libc/compat/stdio/mkstemp.c
--- djgpp.orig/src/libc/compat/stdio/mkstemp.c 2002-10-17 23:00:24 +0000
+++ djgpp/src/libc/compat/stdio/mkstemp.c 2009-04-12 13:18:00 +0000
@@ -1,9 +1,11 @@
+/* Copyright (C) 2009 DJ Delorie, see COPYING.DJ for details */
/* Copyright (C) 2001 DJ Delorie, see COPYING.DJ for details */
/* Copyright (C) 2000 DJ Delorie, see COPYING.DJ for details */
/* Copyright (C) 1998 DJ Delorie, see COPYING.DJ for details */
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
#include <libc/symlink.h>
#include <string.h>
+#include <stdlib.h>
#include <stdio.h>
#include <fcntl.h>
#include <errno.h>
diff -aprNU3 djgpp.orig/src/libc/compat/stdio/mkstemp.txh djgpp/src/libc/compat/stdio/mkstemp.txh
--- djgpp.orig/src/libc/compat/stdio/mkstemp.txh 2003-01-29 12:39:18 +0000
+++ djgpp/src/libc/compat/stdio/mkstemp.txh 2009-04-12 13:16:56 +0000
@@ -3,7 +3,7 @@
@subheading Syntax
@example
-#include <stdio.h>
+#include <stdlib.h>
int mkstemp(char *template);
@end example
@@ -28,7 +28,11 @@ The open file descriptor.
@subheading Portability
-@portability !ansi, !posix
+@port-note posix To follow the Single Unix Specification, djgpp 2.04 has now
+the prototype in @code{<stdlib.h>}. To keep backward compatibility the
+prototype is also kept in @code{<stdio.h>} but its usage is deprecated.
+
+@portability !ansi, posix
@subheading Example
diff -aprNU3 djgpp.orig/src/libc/compat/stdio/mktemp.c djgpp/src/libc/compat/stdio/mktemp.c
--- djgpp.orig/src/libc/compat/stdio/mktemp.c 2000-08-28 13:29:30 +0000
+++ djgpp/src/libc/compat/stdio/mktemp.c 2009-04-12 13:18:00 +0000
@@ -1,3 +1,4 @@
+/* Copyright (C) 2009 DJ Delorie, see COPYING.DJ for details */
/* Copyright (C) 2000 DJ Delorie, see COPYING.DJ for details */
/* Copyright (C) 1996 DJ Delorie, see COPYING.DJ for details */
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
@@ -5,6 +6,7 @@
#include <libc/bss.h>
#include <libc/symlink.h>
#include <unistd.h>
+#include <stdlib.h>
#include <stdio.h>
#include <string.h>
diff -aprNU3 djgpp.orig/src/libc/compat/stdio/mktemp.txh djgpp/src/libc/compat/stdio/mktemp.txh
--- djgpp.orig/src/libc/compat/stdio/mktemp.txh 2003-01-29 12:39:18 +0000
+++ djgpp/src/libc/compat/stdio/mktemp.txh 2009-04-12 13:16:56 +0000
@@ -3,7 +3,7 @@
@subheading Syntax
@example
-#include <stdio.h>
+#include <stdlib.h>
char *mktemp(char *template);
@end example
@@ -26,6 +26,10 @@ the resulting filename is returned.
@subheading Portability
+@port-note posix To follow the Single Unix Specification, djgpp 2.04 has now
+the prototype in @code{<stdlib.h>}. To keep backward compatibility the
+prototype is also kept in @code{<stdio.h>} but its usage is deprecated.
+
@portability !ansi, !posix
@subheading Example
- Raw text -