]> sjero.net Git - wget/blobdiff - lib/stdlib.in.h
Import gnulib strcasestr.
[wget] / lib / stdlib.in.h
index f99767f600f6c721671db6f74b5ce79c59c28d1a..9ac7199568313654112f9d5b4fbfa669a38460a6 100644 (file)
@@ -35,6 +35,8 @@
 #ifndef _GL_STDLIB_H
 #define _GL_STDLIB_H
 
+/* NetBSD 5.0 mis-defines NULL.  */
+#include <stddef.h>
 
 /* Solaris declares getloadavg() in <sys/loadavg.h>.  */
 #if @GNULIB_GETLOADAVG@ && @HAVE_SYS_LOADAVG_H@
@@ -205,6 +207,31 @@ extern char * mkdtemp (char * /*template*/);
 #endif
 
 
+#if @GNULIB_MKOSTEMP@
+# if !@HAVE_MKOSTEMP@
+/* Create a unique temporary file from TEMPLATE.
+   The last six characters of TEMPLATE must be "XXXXXX";
+   they are replaced with a string that makes the file name unique.
+   The flags are a bitmask, possibly including O_CLOEXEC (defined in <fcntl.h>)
+   and O_TEXT, O_BINARY (defined in "binary-io.h").
+   The file is then created, with the specified flags, ensuring it didn't exist
+   before.
+   The file is created read-write (mask at least 0600 & ~umask), but it may be
+   world-readable and world-writable (mask 0666 & ~umask), depending on the
+   implementation.
+   Returns the open file descriptor if successful, otherwise -1 and errno
+   set.  */
+extern int mkostemp (char * /*template*/, int /*flags*/);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef mkostemp
+# define mkostemp(t,f) \
+    (GL_LINK_WARNING ("mkostemp is unportable - " \
+                      "use gnulib module mkostemp for portability"), \
+     mkostemp (t, f))
+#endif
+
+
 #if @GNULIB_MKSTEMP@
 # if @REPLACE_MKSTEMP@
 /* Create a unique temporary file from TEMPLATE.