X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=lib%2Fstdlib.in.h;h=9ac7199568313654112f9d5b4fbfa669a38460a6;hb=0aa929caab127f13327b070132fff8a22d19bc75;hp=f6ebe253c8775b8b5bd4fee65dfd2e09f103ffb1;hpb=fd3784cec9020789823de5d21dac19f3061ba0fd;p=gnulib.git diff --git a/lib/stdlib.in.h b/lib/stdlib.in.h index f6ebe253c..9ac719956 100644 --- a/lib/stdlib.in.h +++ b/lib/stdlib.in.h @@ -1,6 +1,6 @@ /* A GNU-like . - Copyright (C) 1995, 2001-2004, 2006-2008 Free Software Foundation, Inc. + Copyright (C) 1995, 2001-2004, 2006-2009 Free Software Foundation, Inc. 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 @@ -35,12 +35,20 @@ #ifndef _GL_STDLIB_H #define _GL_STDLIB_H +/* NetBSD 5.0 mis-defines NULL. */ +#include /* Solaris declares getloadavg() in . */ #if @GNULIB_GETLOADAVG@ && @HAVE_SYS_LOADAVG_H@ # include #endif +/* OSF/1 5.1 declares 'struct random_data' in , which is included + from if _REENTRANT is defined. Include it always. */ +#if @HAVE_RANDOM_H@ +# include +#endif + #if @GNULIB_RANDOM_R@ || !@HAVE_STRUCT_RANDOM_DATA@ # include #endif @@ -52,8 +60,8 @@ struct random_data int32_t *rptr; /* Rear pointer. */ int32_t *state; /* Array of state values. */ int rand_type; /* Type of random number generator. */ - int rand_deg; /* Degree of random number generator. */ - int rand_sep; /* Distance between front and rear. */ + int rand_deg; /* Degree of random number generator. */ + int rand_sep; /* Distance between front and rear. */ int32_t *end_ptr; /* Pointer behind state table. */ }; #endif @@ -199,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 ) + 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.