1 /* A GNU-like <stdlib.h>.
3 Copyright (C) 1995, 2001-2004, 2006-2011 Free Software Foundation, Inc.
5 This program is free software: you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 3 of the License, or
8 (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>. */
19 @PRAGMA_SYSTEM_HEADER@
23 #if defined __need_malloc_and_calloc
24 /* Special invocation convention inside glibc header files. */
26 #@INCLUDE_NEXT@ @NEXT_STDLIB_H@
29 /* Normal invocation convention. */
33 /* The include_next requires a split double-inclusion guard. */
34 #@INCLUDE_NEXT@ @NEXT_STDLIB_H@
39 /* NetBSD 5.0 mis-defines NULL. */
42 /* MirBSD 10 defines WEXITSTATUS in <sys/wait.h>, not in <stdlib.h>. */
43 #if @GNULIB_SYSTEM_POSIX@ && !defined WEXITSTATUS
44 # include <sys/wait.h>
47 /* Solaris declares getloadavg() in <sys/loadavg.h>. */
48 #if (@GNULIB_GETLOADAVG@ || defined GNULIB_POSIXCHECK) && @HAVE_SYS_LOADAVG_H@
49 # include <sys/loadavg.h>
52 /* OSF/1 5.1 declares 'struct random_data' in <random.h>, which is included
53 from <stdlib.h> if _REENTRANT is defined. Include it always. */
58 #if !@HAVE_STRUCT_RANDOM_DATA@ || (@GNULIB_RANDOM_R@ && !@HAVE_RANDOM_R@)
62 #if !@HAVE_STRUCT_RANDOM_DATA@
63 /* Define 'struct random_data'.
64 But allow multiple gnulib generated <stdlib.h> replacements to coexist. */
65 # if !GNULIB_defined_struct_random_data
68 int32_t *fptr; /* Front pointer. */
69 int32_t *rptr; /* Rear pointer. */
70 int32_t *state; /* Array of state values. */
71 int rand_type; /* Type of random number generator. */
72 int rand_deg; /* Degree of random number generator. */
73 int rand_sep; /* Distance between front and rear. */
74 int32_t *end_ptr; /* Pointer behind state table. */
76 # define GNULIB_defined_struct_random_data 1
80 #if (@GNULIB_MKSTEMP@ || @GNULIB_GETSUBOPT@ || defined GNULIB_POSIXCHECK) && ! defined __GLIBC__ && !((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__)
81 /* On MacOS X 10.3, only <unistd.h> declares mkstemp. */
82 /* On Cygwin 1.7.1, only <unistd.h> declares getsubopt. */
83 /* But avoid namespace pollution on glibc systems and native Windows. */
88 # if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 8)
89 # define __attribute__(Spec) /* empty */
93 /* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */
95 /* The definition of _GL_ARG_NONNULL is copied here. */
97 /* The definition of _GL_WARN_ON_USE is copied here. */
100 /* Some systems do not define EXIT_*, despite otherwise supporting C89. */
102 # define EXIT_SUCCESS 0
104 /* Tandem/NSK and other platforms that define EXIT_FAILURE as -1 interfere
105 with proper operation of xargs. */
107 # define EXIT_FAILURE 1
108 #elif EXIT_FAILURE != 1
110 # define EXIT_FAILURE 1
115 /* Terminate the current process with the given return code, without running
116 the 'atexit' handlers. */
118 _GL_FUNCDECL_SYS (_Exit, void, (int status) __attribute__ ((__noreturn__)));
120 _GL_CXXALIAS_SYS (_Exit, void, (int status));
121 _GL_CXXALIASWARN (_Exit);
122 #elif defined GNULIB_POSIXCHECK
124 # if HAVE_RAW_DECL__EXIT
125 _GL_WARN_ON_USE (_Exit, "_Exit is unportable - "
126 "use gnulib module _Exit for portability");
132 /* Parse a signed decimal integer.
133 Returns the value of the integer. Errors are not detected. */
135 _GL_FUNCDECL_SYS (atoll, long long, (const char *string) _GL_ARG_NONNULL ((1)));
137 _GL_CXXALIAS_SYS (atoll, long long, (const char *string));
138 _GL_CXXALIASWARN (atoll);
139 #elif defined GNULIB_POSIXCHECK
141 # if HAVE_RAW_DECL_ATOLL
142 _GL_WARN_ON_USE (atoll, "atoll is unportable - "
143 "use gnulib module atoll for portability");
147 #if @GNULIB_CALLOC_POSIX@
148 # if @REPLACE_CALLOC@
149 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
151 # define calloc rpl_calloc
153 _GL_FUNCDECL_RPL (calloc, void *, (size_t nmemb, size_t size));
154 _GL_CXXALIAS_RPL (calloc, void *, (size_t nmemb, size_t size));
156 _GL_CXXALIAS_SYS (calloc, void *, (size_t nmemb, size_t size));
158 _GL_CXXALIASWARN (calloc);
159 #elif defined GNULIB_POSIXCHECK
161 /* Assume calloc is always declared. */
162 _GL_WARN_ON_USE (calloc, "calloc is not POSIX compliant everywhere - "
163 "use gnulib module calloc-posix for portability");
166 #if @GNULIB_CANONICALIZE_FILE_NAME@
167 # if @REPLACE_CANONICALIZE_FILE_NAME@
168 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
169 # define canonicalize_file_name rpl_canonicalize_file_name
171 _GL_FUNCDECL_RPL (canonicalize_file_name, char *, (const char *name)
172 _GL_ARG_NONNULL ((1)));
173 _GL_CXXALIAS_RPL (canonicalize_file_name, char *, (const char *name));
175 # if !@HAVE_CANONICALIZE_FILE_NAME@
176 _GL_FUNCDECL_SYS (canonicalize_file_name, char *, (const char *name)
177 _GL_ARG_NONNULL ((1)));
179 _GL_CXXALIAS_SYS (canonicalize_file_name, char *, (const char *name));
181 _GL_CXXALIASWARN (canonicalize_file_name);
182 #elif defined GNULIB_POSIXCHECK
183 # undef canonicalize_file_name
184 # if HAVE_RAW_DECL_CANONICALIZE_FILE_NAME
185 _GL_WARN_ON_USE (canonicalize_file_name,
186 "canonicalize_file_name is unportable - "
187 "use gnulib module canonicalize-lgpl for portability");
191 #if @GNULIB_GETLOADAVG@
192 /* Store max(NELEM,3) load average numbers in LOADAVG[].
193 The three numbers are the load average of the last 1 minute, the last 5
194 minutes, and the last 15 minutes, respectively.
195 LOADAVG is an array of NELEM numbers. */
196 # if !@HAVE_DECL_GETLOADAVG@
197 _GL_FUNCDECL_SYS (getloadavg, int, (double loadavg[], int nelem)
198 _GL_ARG_NONNULL ((1)));
200 _GL_CXXALIAS_SYS (getloadavg, int, (double loadavg[], int nelem));
201 _GL_CXXALIASWARN (getloadavg);
202 #elif defined GNULIB_POSIXCHECK
204 # if HAVE_RAW_DECL_GETLOADAVG
205 _GL_WARN_ON_USE (getloadavg, "getloadavg is not portable - "
206 "use gnulib module getloadavg for portability");
210 #if @GNULIB_GETSUBOPT@
211 /* Assuming *OPTIONP is a comma separated list of elements of the form
212 "token" or "token=value", getsubopt parses the first of these elements.
213 If the first element refers to a "token" that is member of the given
214 NULL-terminated array of tokens:
215 - It replaces the comma with a NUL byte, updates *OPTIONP to point past
216 the first option and the comma, sets *VALUEP to the value of the
217 element (or NULL if it doesn't contain an "=" sign),
218 - It returns the index of the "token" in the given array of tokens.
219 Otherwise it returns -1, and *OPTIONP and *VALUEP are undefined.
220 For more details see the POSIX:2001 specification.
221 http://www.opengroup.org/susv3xsh/getsubopt.html */
222 # if !@HAVE_GETSUBOPT@
223 _GL_FUNCDECL_SYS (getsubopt, int,
224 (char **optionp, char *const *tokens, char **valuep)
225 _GL_ARG_NONNULL ((1, 2, 3)));
227 _GL_CXXALIAS_SYS (getsubopt, int,
228 (char **optionp, char *const *tokens, char **valuep));
229 _GL_CXXALIASWARN (getsubopt);
230 #elif defined GNULIB_POSIXCHECK
232 # if HAVE_RAW_DECL_GETSUBOPT
233 _GL_WARN_ON_USE (getsubopt, "getsubopt is unportable - "
234 "use gnulib module getsubopt for portability");
239 /* Change the ownership and access permission of the slave side of the
240 pseudo-terminal whose master side is specified by FD. */
242 _GL_FUNCDECL_SYS (grantpt, int, (int fd));
244 _GL_CXXALIAS_SYS (grantpt, int, (int fd));
245 _GL_CXXALIASWARN (grantpt);
246 #elif defined GNULIB_POSIXCHECK
248 # if HAVE_RAW_DECL_GRANTPT
249 _GL_WARN_ON_USE (ptsname, "grantpt is not portable - "
250 "use gnulib module grantpt for portability");
254 #if @GNULIB_MALLOC_POSIX@
255 # if @REPLACE_MALLOC@
256 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
258 # define malloc rpl_malloc
260 _GL_FUNCDECL_RPL (malloc, void *, (size_t size));
261 _GL_CXXALIAS_RPL (malloc, void *, (size_t size));
263 _GL_CXXALIAS_SYS (malloc, void *, (size_t size));
265 _GL_CXXALIASWARN (malloc);
266 #elif defined GNULIB_POSIXCHECK
268 /* Assume malloc is always declared. */
269 _GL_WARN_ON_USE (malloc, "malloc is not POSIX compliant everywhere - "
270 "use gnulib module malloc-posix for portability");
274 /* Create a unique temporary directory from TEMPLATE.
275 The last six characters of TEMPLATE must be "XXXXXX";
276 they are replaced with a string that makes the directory name unique.
277 Returns TEMPLATE, or a null pointer if it cannot get a unique name.
278 The directory is created mode 700. */
280 _GL_FUNCDECL_SYS (mkdtemp, char *, (char * /*template*/) _GL_ARG_NONNULL ((1)));
282 _GL_CXXALIAS_SYS (mkdtemp, char *, (char * /*template*/));
283 _GL_CXXALIASWARN (mkdtemp);
284 #elif defined GNULIB_POSIXCHECK
286 # if HAVE_RAW_DECL_MKDTEMP
287 _GL_WARN_ON_USE (mkdtemp, "mkdtemp is unportable - "
288 "use gnulib module mkdtemp for portability");
292 #if @GNULIB_MKOSTEMP@
293 /* Create a unique temporary file from TEMPLATE.
294 The last six characters of TEMPLATE must be "XXXXXX";
295 they are replaced with a string that makes the file name unique.
296 The flags are a bitmask, possibly including O_CLOEXEC (defined in <fcntl.h>)
297 and O_TEXT, O_BINARY (defined in "binary-io.h").
298 The file is then created, with the specified flags, ensuring it didn't exist
300 The file is created read-write (mask at least 0600 & ~umask), but it may be
301 world-readable and world-writable (mask 0666 & ~umask), depending on the
303 Returns the open file descriptor if successful, otherwise -1 and errno
305 # if !@HAVE_MKOSTEMP@
306 _GL_FUNCDECL_SYS (mkostemp, int, (char * /*template*/, int /*flags*/)
307 _GL_ARG_NONNULL ((1)));
309 _GL_CXXALIAS_SYS (mkostemp, int, (char * /*template*/, int /*flags*/));
310 _GL_CXXALIASWARN (mkostemp);
311 #elif defined GNULIB_POSIXCHECK
313 # if HAVE_RAW_DECL_MKOSTEMP
314 _GL_WARN_ON_USE (mkostemp, "mkostemp is unportable - "
315 "use gnulib module mkostemp for portability");
319 #if @GNULIB_MKOSTEMPS@
320 /* Create a unique temporary file from TEMPLATE.
321 The last six characters of TEMPLATE before a suffix of length
322 SUFFIXLEN must be "XXXXXX";
323 they are replaced with a string that makes the file name unique.
324 The flags are a bitmask, possibly including O_CLOEXEC (defined in <fcntl.h>)
325 and O_TEXT, O_BINARY (defined in "binary-io.h").
326 The file is then created, with the specified flags, ensuring it didn't exist
328 The file is created read-write (mask at least 0600 & ~umask), but it may be
329 world-readable and world-writable (mask 0666 & ~umask), depending on the
331 Returns the open file descriptor if successful, otherwise -1 and errno
333 # if !@HAVE_MKOSTEMPS@
334 _GL_FUNCDECL_SYS (mkostemps, int,
335 (char * /*template*/, int /*suffixlen*/, int /*flags*/)
336 _GL_ARG_NONNULL ((1)));
338 _GL_CXXALIAS_SYS (mkostemps, int,
339 (char * /*template*/, int /*suffixlen*/, int /*flags*/));
340 _GL_CXXALIASWARN (mkostemps);
341 #elif defined GNULIB_POSIXCHECK
343 # if HAVE_RAW_DECL_MKOSTEMPS
344 _GL_WARN_ON_USE (mkostemps, "mkostemps is unportable - "
345 "use gnulib module mkostemps for portability");
350 /* Create a unique temporary file from TEMPLATE.
351 The last six characters of TEMPLATE must be "XXXXXX";
352 they are replaced with a string that makes the file name unique.
353 The file is then created, ensuring it didn't exist before.
354 The file is created read-write (mask at least 0600 & ~umask), but it may be
355 world-readable and world-writable (mask 0666 & ~umask), depending on the
357 Returns the open file descriptor if successful, otherwise -1 and errno
359 # if @REPLACE_MKSTEMP@
360 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
361 # define mkstemp rpl_mkstemp
363 _GL_FUNCDECL_RPL (mkstemp, int, (char * /*template*/) _GL_ARG_NONNULL ((1)));
364 _GL_CXXALIAS_RPL (mkstemp, int, (char * /*template*/));
366 # if ! @HAVE_MKSTEMP@
367 _GL_FUNCDECL_SYS (mkstemp, int, (char * /*template*/) _GL_ARG_NONNULL ((1)));
369 _GL_CXXALIAS_SYS (mkstemp, int, (char * /*template*/));
371 _GL_CXXALIASWARN (mkstemp);
372 #elif defined GNULIB_POSIXCHECK
374 # if HAVE_RAW_DECL_MKSTEMP
375 _GL_WARN_ON_USE (mkstemp, "mkstemp is unportable - "
376 "use gnulib module mkstemp for portability");
380 #if @GNULIB_MKSTEMPS@
381 /* Create a unique temporary file from TEMPLATE.
382 The last six characters of TEMPLATE prior to a suffix of length
383 SUFFIXLEN must be "XXXXXX";
384 they are replaced with a string that makes the file name unique.
385 The file is then created, ensuring it didn't exist before.
386 The file is created read-write (mask at least 0600 & ~umask), but it may be
387 world-readable and world-writable (mask 0666 & ~umask), depending on the
389 Returns the open file descriptor if successful, otherwise -1 and errno
391 # if !@HAVE_MKSTEMPS@
392 _GL_FUNCDECL_SYS (mkstemps, int, (char * /*template*/, int /*suffixlen*/)
393 _GL_ARG_NONNULL ((1)));
395 _GL_CXXALIAS_SYS (mkstemps, int, (char * /*template*/, int /*suffixlen*/));
396 _GL_CXXALIASWARN (mkstemps);
397 #elif defined GNULIB_POSIXCHECK
399 # if HAVE_RAW_DECL_MKSTEMPS
400 _GL_WARN_ON_USE (mkstemps, "mkstemps is unportable - "
401 "use gnulib module mkstemps for portability");
406 /* Return the pathname of the pseudo-terminal slave associated with
407 the master FD is open on, or NULL on errors. */
409 _GL_FUNCDECL_SYS (ptsname, char *, (int fd));
411 _GL_CXXALIAS_SYS (ptsname, char *, (int fd));
412 _GL_CXXALIASWARN (ptsname);
413 #elif defined GNULIB_POSIXCHECK
415 # if HAVE_RAW_DECL_PTSNAME
416 _GL_WARN_ON_USE (ptsname, "ptsname is not portable - "
417 "use gnulib module ptsname for portability");
422 # if @REPLACE_PUTENV@
423 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
425 # define putenv rpl_putenv
427 _GL_FUNCDECL_RPL (putenv, int, (char *string) _GL_ARG_NONNULL ((1)));
428 _GL_CXXALIAS_RPL (putenv, int, (char *string));
430 _GL_CXXALIAS_SYS (putenv, int, (char *string));
432 _GL_CXXALIASWARN (putenv);
436 #if @GNULIB_RANDOM_R@
437 # if !@HAVE_RANDOM_R@
439 # define RAND_MAX 2147483647
444 #if @GNULIB_RANDOM_R@
445 # if !@HAVE_RANDOM_R@
446 _GL_FUNCDECL_SYS (random_r, int, (struct random_data *buf, int32_t *result)
447 _GL_ARG_NONNULL ((1, 2)));
449 _GL_CXXALIAS_SYS (random_r, int, (struct random_data *buf, int32_t *result));
450 _GL_CXXALIASWARN (random_r);
451 #elif defined GNULIB_POSIXCHECK
453 # if HAVE_RAW_DECL_RANDOM_R
454 _GL_WARN_ON_USE (random_r, "random_r is unportable - "
455 "use gnulib module random_r for portability");
459 #if @GNULIB_RANDOM_R@
460 # if !@HAVE_RANDOM_R@
461 _GL_FUNCDECL_SYS (srandom_r, int,
462 (unsigned int seed, struct random_data *rand_state)
463 _GL_ARG_NONNULL ((2)));
465 _GL_CXXALIAS_SYS (srandom_r, int,
466 (unsigned int seed, struct random_data *rand_state));
467 _GL_CXXALIASWARN (srandom_r);
468 #elif defined GNULIB_POSIXCHECK
470 # if HAVE_RAW_DECL_SRANDOM_R
471 _GL_WARN_ON_USE (srandom_r, "srandom_r is unportable - "
472 "use gnulib module random_r for portability");
476 #if @GNULIB_RANDOM_R@
477 # if !@HAVE_RANDOM_R@
478 _GL_FUNCDECL_SYS (initstate_r, int,
479 (unsigned int seed, char *buf, size_t buf_size,
480 struct random_data *rand_state)
481 _GL_ARG_NONNULL ((2, 4)));
483 _GL_CXXALIAS_SYS (initstate_r, int,
484 (unsigned int seed, char *buf, size_t buf_size,
485 struct random_data *rand_state));
486 _GL_CXXALIASWARN (initstate_r);
487 #elif defined GNULIB_POSIXCHECK
489 # if HAVE_RAW_DECL_INITSTATE_R
490 _GL_WARN_ON_USE (initstate_r, "initstate_r is unportable - "
491 "use gnulib module random_r for portability");
495 #if @GNULIB_RANDOM_R@
496 # if !@HAVE_RANDOM_R@
497 _GL_FUNCDECL_SYS (setstate_r, int,
498 (char *arg_state, struct random_data *rand_state)
499 _GL_ARG_NONNULL ((1, 2)));
501 _GL_CXXALIAS_SYS (setstate_r, int,
502 (char *arg_state, struct random_data *rand_state));
503 _GL_CXXALIASWARN (setstate_r);
504 #elif defined GNULIB_POSIXCHECK
506 # if HAVE_RAW_DECL_SETSTATE_R
507 _GL_WARN_ON_USE (setstate_r, "setstate_r is unportable - "
508 "use gnulib module random_r for portability");
513 #if @GNULIB_REALLOC_POSIX@
514 # if @REPLACE_REALLOC@
515 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
517 # define realloc rpl_realloc
519 _GL_FUNCDECL_RPL (realloc, void *, (void *ptr, size_t size));
520 _GL_CXXALIAS_RPL (realloc, void *, (void *ptr, size_t size));
522 _GL_CXXALIAS_SYS (realloc, void *, (void *ptr, size_t size));
524 _GL_CXXALIASWARN (realloc);
525 #elif defined GNULIB_POSIXCHECK
527 /* Assume realloc is always declared. */
528 _GL_WARN_ON_USE (realloc, "realloc is not POSIX compliant everywhere - "
529 "use gnulib module realloc-posix for portability");
532 #if @GNULIB_REALPATH@
533 # if @REPLACE_REALPATH@
534 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
535 # define realpath rpl_realpath
537 _GL_FUNCDECL_RPL (realpath, char *, (const char *name, char *resolved)
538 _GL_ARG_NONNULL ((1)));
539 _GL_CXXALIAS_RPL (realpath, char *, (const char *name, char *resolved));
541 # if !@HAVE_REALPATH@
542 _GL_FUNCDECL_SYS (realpath, char *, (const char *name, char *resolved)
543 _GL_ARG_NONNULL ((1)));
545 _GL_CXXALIAS_SYS (realpath, char *, (const char *name, char *resolved));
547 _GL_CXXALIASWARN (realpath);
548 #elif defined GNULIB_POSIXCHECK
550 # if HAVE_RAW_DECL_REALPATH
551 _GL_WARN_ON_USE (realpath, "realpath is unportable - use gnulib module "
552 "canonicalize or canonicalize-lgpl for portability");
557 /* Test a user response to a question.
558 Return 1 if it is affirmative, 0 if it is negative, or -1 if not clear. */
560 _GL_FUNCDECL_SYS (rpmatch, int, (const char *response) _GL_ARG_NONNULL ((1)));
562 _GL_CXXALIAS_SYS (rpmatch, int, (const char *response));
563 _GL_CXXALIASWARN (rpmatch);
564 #elif defined GNULIB_POSIXCHECK
566 # if HAVE_RAW_DECL_RPMATCH
567 _GL_WARN_ON_USE (rpmatch, "rpmatch is unportable - "
568 "use gnulib module rpmatch for portability");
573 /* Set NAME to VALUE in the environment.
574 If REPLACE is nonzero, overwrite an existing value. */
575 # if @REPLACE_SETENV@
576 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
578 # define setenv rpl_setenv
580 _GL_FUNCDECL_RPL (setenv, int,
581 (const char *name, const char *value, int replace)
582 _GL_ARG_NONNULL ((1)));
583 _GL_CXXALIAS_RPL (setenv, int,
584 (const char *name, const char *value, int replace));
586 # if !@HAVE_DECL_SETENV@
587 _GL_FUNCDECL_SYS (setenv, int,
588 (const char *name, const char *value, int replace)
589 _GL_ARG_NONNULL ((1)));
591 _GL_CXXALIAS_SYS (setenv, int,
592 (const char *name, const char *value, int replace));
594 # if !(@REPLACE_SETENV@ && !@HAVE_DECL_SETENV@)
595 _GL_CXXALIASWARN (setenv);
597 #elif defined GNULIB_POSIXCHECK
599 # if HAVE_RAW_DECL_SETENV
600 _GL_WARN_ON_USE (setenv, "setenv is unportable - "
601 "use gnulib module setenv for portability");
606 /* Parse a double from STRING, updating ENDP if appropriate. */
607 # if @REPLACE_STRTOD@
608 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
609 # define strtod rpl_strtod
611 _GL_FUNCDECL_RPL (strtod, double, (const char *str, char **endp)
612 _GL_ARG_NONNULL ((1)));
613 _GL_CXXALIAS_RPL (strtod, double, (const char *str, char **endp));
616 _GL_FUNCDECL_SYS (strtod, double, (const char *str, char **endp)
617 _GL_ARG_NONNULL ((1)));
619 _GL_CXXALIAS_SYS (strtod, double, (const char *str, char **endp));
621 _GL_CXXALIASWARN (strtod);
622 #elif defined GNULIB_POSIXCHECK
624 # if HAVE_RAW_DECL_STRTOD
625 _GL_WARN_ON_USE (strtod, "strtod is unportable - "
626 "use gnulib module strtod for portability");
631 /* Parse a signed integer whose textual representation starts at STRING.
632 The integer is expected to be in base BASE (2 <= BASE <= 36); if BASE == 0,
633 it may be decimal or octal (with prefix "0") or hexadecimal (with prefix
635 If ENDPTR is not NULL, the address of the first byte after the integer is
637 Upon overflow, the return value is LLONG_MAX or LLONG_MIN, and errno is set
640 _GL_FUNCDECL_SYS (strtoll, long long,
641 (const char *string, char **endptr, int base)
642 _GL_ARG_NONNULL ((1)));
644 _GL_CXXALIAS_SYS (strtoll, long long,
645 (const char *string, char **endptr, int base));
646 _GL_CXXALIASWARN (strtoll);
647 #elif defined GNULIB_POSIXCHECK
649 # if HAVE_RAW_DECL_STRTOLL
650 _GL_WARN_ON_USE (strtoll, "strtoll is unportable - "
651 "use gnulib module strtoll for portability");
655 #if @GNULIB_STRTOULL@
656 /* Parse an unsigned integer whose textual representation starts at STRING.
657 The integer is expected to be in base BASE (2 <= BASE <= 36); if BASE == 0,
658 it may be decimal or octal (with prefix "0") or hexadecimal (with prefix
660 If ENDPTR is not NULL, the address of the first byte after the integer is
662 Upon overflow, the return value is ULLONG_MAX, and errno is set to
664 # if !@HAVE_STRTOULL@
665 _GL_FUNCDECL_SYS (strtoull, unsigned long long,
666 (const char *string, char **endptr, int base)
667 _GL_ARG_NONNULL ((1)));
669 _GL_CXXALIAS_SYS (strtoull, unsigned long long,
670 (const char *string, char **endptr, int base));
671 _GL_CXXALIASWARN (strtoull);
672 #elif defined GNULIB_POSIXCHECK
674 # if HAVE_RAW_DECL_STRTOULL
675 _GL_WARN_ON_USE (strtoull, "strtoull is unportable - "
676 "use gnulib module strtoull for portability");
680 #if @GNULIB_UNLOCKPT@
681 /* Unlock the slave side of the pseudo-terminal whose master side is specified
682 by FD, so that it can be opened. */
683 # if !@HAVE_UNLOCKPT@
684 _GL_FUNCDECL_SYS (unlockpt, int, (int fd));
686 _GL_CXXALIAS_SYS (unlockpt, int, (int fd));
687 _GL_CXXALIASWARN (unlockpt);
688 #elif defined GNULIB_POSIXCHECK
690 # if HAVE_RAW_DECL_UNLOCKPT
691 _GL_WARN_ON_USE (unlockpt, "unlockpt is not portable - "
692 "use gnulib module unlockpt for portability");
696 #if @GNULIB_UNSETENV@
697 /* Remove the variable NAME from the environment. */
698 # if @REPLACE_UNSETENV@
699 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
701 # define unsetenv rpl_unsetenv
703 _GL_FUNCDECL_RPL (unsetenv, int, (const char *name) _GL_ARG_NONNULL ((1)));
704 _GL_CXXALIAS_RPL (unsetenv, int, (const char *name));
706 # if !@HAVE_DECL_UNSETENV@
707 _GL_FUNCDECL_SYS (unsetenv, int, (const char *name) _GL_ARG_NONNULL ((1)));
709 _GL_CXXALIAS_SYS (unsetenv, int, (const char *name));
711 # if !(@REPLACE_UNSETENV@ && !@HAVE_DECL_UNSETENV@)
712 _GL_CXXALIASWARN (unsetenv);
714 #elif defined GNULIB_POSIXCHECK
716 # if HAVE_RAW_DECL_UNSETENV
717 _GL_WARN_ON_USE (unsetenv, "unsetenv is unportable - "
718 "use gnulib module unsetenv for portability");
723 #endif /* _GL_STDLIB_H */
724 #endif /* _GL_STDLIB_H */