1 /* A GNU-like <stdlib.h>.
3 Copyright (C) 1995, 2001-2004, 2006-2010 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@
22 #if defined __need_malloc_and_calloc
23 /* Special invocation convention inside glibc header files. */
25 #@INCLUDE_NEXT@ @NEXT_STDLIB_H@
28 /* Normal invocation convention. */
32 /* The include_next requires a split double-inclusion guard. */
33 #@INCLUDE_NEXT@ @NEXT_STDLIB_H@
38 /* NetBSD 5.0 mis-defines NULL. */
41 /* Solaris declares getloadavg() in <sys/loadavg.h>. */
42 #if (@GNULIB_GETLOADAVG@ || defined GNULIB_POSIXCHECK) && @HAVE_SYS_LOADAVG_H@
43 # include <sys/loadavg.h>
46 /* OSF/1 5.1 declares 'struct random_data' in <random.h>, which is included
47 from <stdlib.h> if _REENTRANT is defined. Include it always. */
52 #if !@HAVE_STRUCT_RANDOM_DATA@ || (@GNULIB_RANDOM_R@ && !@HAVE_RANDOM_R@) \
53 || defined GNULIB_POSIXCHECK
57 #if !@HAVE_STRUCT_RANDOM_DATA@
60 int32_t *fptr; /* Front pointer. */
61 int32_t *rptr; /* Rear pointer. */
62 int32_t *state; /* Array of state values. */
63 int rand_type; /* Type of random number generator. */
64 int rand_deg; /* Degree of random number generator. */
65 int rand_sep; /* Distance between front and rear. */
66 int32_t *end_ptr; /* Pointer behind state table. */
70 #if (@GNULIB_MKSTEMP@ || @GNULIB_GETSUBOPT@ || defined GNULIB_POSIXCHECK) && ! defined __GLIBC__ && !((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__)
71 /* On MacOS X 10.3, only <unistd.h> declares mkstemp. */
72 /* On Cygwin 1.7.1, only <unistd.h> declares getsubopt. */
73 /* But avoid namespace pollution on glibc systems and native Windows. */
78 # if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 8)
79 # define __attribute__(Spec) /* empty */
83 /* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */
85 /* The definition of _GL_ARG_NONNULL is copied here. */
87 /* The definition of _GL_WARN_ON_USE is copied here. */
90 /* Some systems do not define EXIT_*, despite otherwise supporting C89. */
92 # define EXIT_SUCCESS 0
94 /* Tandem/NSK and other platforms that define EXIT_FAILURE as -1 interfere
95 with proper operation of xargs. */
97 # define EXIT_FAILURE 1
98 #elif EXIT_FAILURE != 1
100 # define EXIT_FAILURE 1
105 /* Terminate the current process with the given return code, without running
106 the 'atexit' handlers. */
108 _GL_FUNCDECL_SYS (_Exit, void, (int status) __attribute__ ((__noreturn__)));
110 _GL_CXXALIAS_SYS (_Exit, void, (int status));
111 _GL_CXXALIASWARN (_Exit);
112 #elif defined GNULIB_POSIXCHECK
114 # if HAVE_RAW_DECL__EXIT
115 _GL_WARN_ON_USE (_Exit, "_Exit is unportable - "
116 "use gnulib module _Exit for portability");
122 /* Parse a signed decimal integer.
123 Returns the value of the integer. Errors are not detected. */
125 _GL_FUNCDECL_SYS (atoll, long long, (const char *string) _GL_ARG_NONNULL ((1)));
127 _GL_CXXALIAS_SYS (atoll, long long, (const char *string));
128 _GL_CXXALIASWARN (atoll);
129 #elif defined GNULIB_POSIXCHECK
131 # if HAVE_RAW_DECL_ATOLL
132 _GL_WARN_ON_USE (atoll, "atoll is unportable - "
133 "use gnulib module atoll for portability");
137 #if @GNULIB_CALLOC_POSIX@
138 # if @REPLACE_CALLOC@
139 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
141 # define calloc rpl_calloc
143 _GL_FUNCDECL_RPL (calloc, void *, (size_t nmemb, size_t size));
144 _GL_CXXALIAS_RPL (calloc, void *, (size_t nmemb, size_t size));
146 _GL_CXXALIAS_SYS (calloc, void *, (size_t nmemb, size_t size));
148 _GL_CXXALIASWARN (calloc);
149 #elif defined GNULIB_POSIXCHECK
151 /* Assume calloc is always declared. */
152 _GL_WARN_ON_USE (calloc, "calloc is not POSIX compliant everywhere - "
153 "use gnulib module calloc-posix for portability");
156 #if @GNULIB_CANONICALIZE_FILE_NAME@
157 # if @REPLACE_CANONICALIZE_FILE_NAME@
158 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
159 # define canonicalize_file_name rpl_canonicalize_file_name
161 _GL_FUNCDECL_RPL (canonicalize_file_name, char *, (const char *name)
162 _GL_ARG_NONNULL ((1)));
163 _GL_CXXALIAS_RPL (canonicalize_file_name, char *, (const char *name));
165 # if !@HAVE_CANONICALIZE_FILE_NAME@
166 _GL_FUNCDECL_SYS (canonicalize_file_name, char *, (const char *name)
167 _GL_ARG_NONNULL ((1)));
169 _GL_CXXALIAS_SYS (canonicalize_file_name, char *, (const char *name));
171 _GL_CXXALIASWARN (canonicalize_file_name);
172 #elif defined GNULIB_POSIXCHECK
173 # undef canonicalize_file_name
174 # if HAVE_RAW_DECL_CANONICALIZE_FILE_NAME
175 _GL_WARN_ON_USE (canonicalize_file_name, "canonicalize_file_name is unportable - "
176 "use gnulib module canonicalize-lgpl for portability");
180 #if @GNULIB_GETLOADAVG@
181 /* Store max(NELEM,3) load average numbers in LOADAVG[].
182 The three numbers are the load average of the last 1 minute, the last 5
183 minutes, and the last 15 minutes, respectively.
184 LOADAVG is an array of NELEM numbers. */
185 # if !@HAVE_DECL_GETLOADAVG@
186 _GL_FUNCDECL_SYS (getloadavg, int, (double loadavg[], int nelem)
187 _GL_ARG_NONNULL ((1)));
189 _GL_CXXALIAS_SYS (getloadavg, int, (double loadavg[], int nelem));
190 _GL_CXXALIASWARN (getloadavg);
191 #elif defined GNULIB_POSIXCHECK
193 # if HAVE_RAW_DECL_GETLOADAVG
194 _GL_WARN_ON_USE (getloadavg, "getloadavg is not portable - "
195 "use gnulib module getloadavg for portability");
199 #if @GNULIB_GETSUBOPT@
200 /* Assuming *OPTIONP is a comma separated list of elements of the form
201 "token" or "token=value", getsubopt parses the first of these elements.
202 If the first element refers to a "token" that is member of the given
203 NULL-terminated array of tokens:
204 - It replaces the comma with a NUL byte, updates *OPTIONP to point past
205 the first option and the comma, sets *VALUEP to the value of the
206 element (or NULL if it doesn't contain an "=" sign),
207 - It returns the index of the "token" in the given array of tokens.
208 Otherwise it returns -1, and *OPTIONP and *VALUEP are undefined.
209 For more details see the POSIX:2001 specification.
210 http://www.opengroup.org/susv3xsh/getsubopt.html */
211 # if !@HAVE_GETSUBOPT@
212 _GL_FUNCDECL_SYS (getsubopt, int,
213 (char **optionp, char *const *tokens, char **valuep)
214 _GL_ARG_NONNULL ((1, 2, 3)));
216 _GL_CXXALIAS_SYS (getsubopt, int,
217 (char **optionp, char *const *tokens, char **valuep));
218 _GL_CXXALIASWARN (getsubopt);
219 #elif defined GNULIB_POSIXCHECK
221 # if HAVE_RAW_DECL_GETSUBOPT
222 _GL_WARN_ON_USE (getsubopt, "getsubopt is unportable - "
223 "use gnulib module getsubopt for portability");
228 /* Change the ownership and access permission of the slave side of the
229 pseudo-terminal whose master side is specified by FD. */
231 _GL_FUNCDECL_SYS (grantpt, int, (int fd));
233 _GL_CXXALIAS_SYS (grantpt, int, (int fd));
234 _GL_CXXALIASWARN (grantpt);
235 #elif defined GNULIB_POSIXCHECK
237 # if HAVE_RAW_DECL_GRANTPT
238 _GL_WARN_ON_USE (ptsname, "grantpt is not portable - "
239 "use gnulib module grantpt for portability");
243 #if @GNULIB_MALLOC_POSIX@
244 # if @REPLACE_MALLOC@
245 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
247 # define malloc rpl_malloc
249 _GL_FUNCDECL_RPL (malloc, void *, (size_t size));
250 _GL_CXXALIAS_RPL (malloc, void *, (size_t size));
252 _GL_CXXALIAS_SYS (malloc, void *, (size_t size));
254 _GL_CXXALIASWARN (malloc);
255 #elif defined GNULIB_POSIXCHECK
257 /* Assume malloc is always declared. */
258 _GL_WARN_ON_USE (malloc, "malloc is not POSIX compliant everywhere - "
259 "use gnulib module malloc-posix for portability");
263 /* Create a unique temporary directory from TEMPLATE.
264 The last six characters of TEMPLATE must be "XXXXXX";
265 they are replaced with a string that makes the directory name unique.
266 Returns TEMPLATE, or a null pointer if it cannot get a unique name.
267 The directory is created mode 700. */
269 _GL_FUNCDECL_SYS (mkdtemp, char *, (char * /*template*/) _GL_ARG_NONNULL ((1)));
271 _GL_CXXALIAS_SYS (mkdtemp, char *, (char * /*template*/));
272 _GL_CXXALIASWARN (mkdtemp);
273 #elif defined GNULIB_POSIXCHECK
275 # if HAVE_RAW_DECL_MKDTEMP
276 _GL_WARN_ON_USE (mkdtemp, "mkdtemp is unportable - "
277 "use gnulib module mkdtemp for portability");
281 #if @GNULIB_MKOSTEMP@
282 /* Create a unique temporary file from TEMPLATE.
283 The last six characters of TEMPLATE must be "XXXXXX";
284 they are replaced with a string that makes the file name unique.
285 The flags are a bitmask, possibly including O_CLOEXEC (defined in <fcntl.h>)
286 and O_TEXT, O_BINARY (defined in "binary-io.h").
287 The file is then created, with the specified flags, ensuring it didn't exist
289 The file is created read-write (mask at least 0600 & ~umask), but it may be
290 world-readable and world-writable (mask 0666 & ~umask), depending on the
292 Returns the open file descriptor if successful, otherwise -1 and errno
294 # if !@HAVE_MKOSTEMP@
295 _GL_FUNCDECL_SYS (mkostemp, int, (char * /*template*/, int /*flags*/)
296 _GL_ARG_NONNULL ((1)));
298 _GL_CXXALIAS_SYS (mkostemp, int, (char * /*template*/, int /*flags*/));
299 _GL_CXXALIASWARN (mkostemp);
300 #elif defined GNULIB_POSIXCHECK
302 # if HAVE_RAW_DECL_MKOSTEMP
303 _GL_WARN_ON_USE (mkostemp, "mkostemp is unportable - "
304 "use gnulib module mkostemp for portability");
308 #if @GNULIB_MKOSTEMPS@
309 /* Create a unique temporary file from TEMPLATE.
310 The last six characters of TEMPLATE before a suffix of length
311 SUFFIXLEN must be "XXXXXX";
312 they are replaced with a string that makes the file name unique.
313 The flags are a bitmask, possibly including O_CLOEXEC (defined in <fcntl.h>)
314 and O_TEXT, O_BINARY (defined in "binary-io.h").
315 The file is then created, with the specified flags, ensuring it didn't exist
317 The file is created read-write (mask at least 0600 & ~umask), but it may be
318 world-readable and world-writable (mask 0666 & ~umask), depending on the
320 Returns the open file descriptor if successful, otherwise -1 and errno
322 # if !@HAVE_MKOSTEMPS@
323 _GL_FUNCDECL_SYS (mkostemps, int,
324 (char * /*template*/, int /*suffixlen*/, int /*flags*/)
325 _GL_ARG_NONNULL ((1)));
327 _GL_CXXALIAS_SYS (mkostemps, int,
328 (char * /*template*/, int /*suffixlen*/, int /*flags*/));
329 _GL_CXXALIASWARN (mkostemps);
330 #elif defined GNULIB_POSIXCHECK
332 # if HAVE_RAW_DECL_MKOSTEMPS
333 _GL_WARN_ON_USE (mkostemps, "mkostemps is unportable - "
334 "use gnulib module mkostemps for portability");
339 /* Create a unique temporary file from TEMPLATE.
340 The last six characters of TEMPLATE must be "XXXXXX";
341 they are replaced with a string that makes the file name unique.
342 The file is then created, ensuring it didn't exist before.
343 The file is created read-write (mask at least 0600 & ~umask), but it may be
344 world-readable and world-writable (mask 0666 & ~umask), depending on the
346 Returns the open file descriptor if successful, otherwise -1 and errno
348 # if @REPLACE_MKSTEMP@
349 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
350 # define mkstemp rpl_mkstemp
352 _GL_FUNCDECL_RPL (mkstemp, int, (char * /*template*/) _GL_ARG_NONNULL ((1)));
353 _GL_CXXALIAS_RPL (mkstemp, int, (char * /*template*/));
355 # if ! @HAVE_MKSTEMP@
356 _GL_FUNCDECL_SYS (mkstemp, int, (char * /*template*/) _GL_ARG_NONNULL ((1)));
358 _GL_CXXALIAS_SYS (mkstemp, int, (char * /*template*/));
360 _GL_CXXALIASWARN (mkstemp);
361 #elif defined GNULIB_POSIXCHECK
363 # if HAVE_RAW_DECL_MKSTEMP
364 _GL_WARN_ON_USE (mkstemp, "mkstemp is unportable - "
365 "use gnulib module mkstemp for portability");
369 #if @GNULIB_MKSTEMPS@
370 /* Create a unique temporary file from TEMPLATE.
371 The last six characters of TEMPLATE prior to a suffix of length
372 SUFFIXLEN must be "XXXXXX";
373 they are replaced with a string that makes the file name unique.
374 The file is then created, ensuring it didn't exist before.
375 The file is created read-write (mask at least 0600 & ~umask), but it may be
376 world-readable and world-writable (mask 0666 & ~umask), depending on the
378 Returns the open file descriptor if successful, otherwise -1 and errno
380 # if !@HAVE_MKSTEMPS@
381 _GL_FUNCDECL_SYS (mkstemps, int, (char * /*template*/, int /*suffixlen*/)
382 _GL_ARG_NONNULL ((1)));
384 _GL_CXXALIAS_SYS (mkstemps, int, (char * /*template*/, int /*suffixlen*/));
385 _GL_CXXALIASWARN (mkstemps);
386 #elif defined GNULIB_POSIXCHECK
388 # if HAVE_RAW_DECL_MKSTEMPS
389 _GL_WARN_ON_USE (mkstemps, "mkstemps is unportable - "
390 "use gnulib module mkstemps for portability");
395 /* Return the pathname of the pseudo-terminal slave associated with
396 the master FD is open on, or NULL on errors. */
398 _GL_FUNCDECL_SYS (ptsname, char *, (int fd));
400 _GL_CXXALIAS_SYS (ptsname, char *, (int fd));
401 _GL_CXXALIASWARN (ptsname);
402 #elif defined GNULIB_POSIXCHECK
404 # if HAVE_RAW_DECL_PTSNAME
405 _GL_WARN_ON_USE (ptsname, "ptsname is not portable - "
406 "use gnulib module ptsname for portability");
411 # if @REPLACE_PUTENV@
412 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
414 # define putenv rpl_putenv
416 _GL_FUNCDECL_RPL (putenv, int, (char *string) _GL_ARG_NONNULL ((1)));
417 _GL_CXXALIAS_RPL (putenv, int, (char *string));
419 _GL_CXXALIAS_SYS (putenv, int, (char *string));
421 _GL_CXXALIASWARN (putenv);
425 #if @GNULIB_RANDOM_R@
426 # if !@HAVE_RANDOM_R@
428 # define RAND_MAX 2147483647
433 #if @GNULIB_RANDOM_R@
434 # if !@HAVE_RANDOM_R@
435 _GL_FUNCDECL_SYS (random_r, int, (struct random_data *buf, int32_t *result)
436 _GL_ARG_NONNULL ((1, 2)));
438 _GL_CXXALIAS_SYS (random_r, int, (struct random_data *buf, int32_t *result));
439 _GL_CXXALIASWARN (random_r);
440 #elif defined GNULIB_POSIXCHECK
442 # if HAVE_RAW_DECL_RANDOM_R
443 _GL_WARN_ON_USE (random_r, "random_r is unportable - "
444 "use gnulib module random_r for portability");
448 #if @GNULIB_RANDOM_R@
449 # if !@HAVE_RANDOM_R@
450 _GL_FUNCDECL_SYS (srandom_r, int,
451 (unsigned int seed, struct random_data *rand_state)
452 _GL_ARG_NONNULL ((2)));
454 _GL_CXXALIAS_SYS (srandom_r, int,
455 (unsigned int seed, struct random_data *rand_state));
456 _GL_CXXALIASWARN (srandom_r);
457 #elif defined GNULIB_POSIXCHECK
459 # if HAVE_RAW_DECL_SRANDOM_R
460 _GL_WARN_ON_USE (srandom_r, "srandom_r is unportable - "
461 "use gnulib module random_r for portability");
465 #if @GNULIB_RANDOM_R@
466 # if !@HAVE_RANDOM_R@
467 _GL_FUNCDECL_SYS (initstate_r, int,
468 (unsigned int seed, char *buf, size_t buf_size,
469 struct random_data *rand_state)
470 _GL_ARG_NONNULL ((2, 4)));
472 _GL_CXXALIAS_SYS (initstate_r, int,
473 (unsigned int seed, char *buf, size_t buf_size,
474 struct random_data *rand_state));
475 _GL_CXXALIASWARN (initstate_r);
476 #elif defined GNULIB_POSIXCHECK
478 # if HAVE_RAW_DECL_INITSTATE_R
479 _GL_WARN_ON_USE (initstate_r, "initstate_r is unportable - "
480 "use gnulib module random_r for portability");
484 #if @GNULIB_RANDOM_R@
485 # if !@HAVE_RANDOM_R@
486 _GL_FUNCDECL_SYS (setstate_r, int,
487 (char *arg_state, struct random_data *rand_state)
488 _GL_ARG_NONNULL ((1, 2)));
490 _GL_CXXALIAS_SYS (setstate_r, int,
491 (char *arg_state, struct random_data *rand_state));
492 _GL_CXXALIASWARN (setstate_r);
493 #elif defined GNULIB_POSIXCHECK
495 # if HAVE_RAW_DECL_SETSTATE_R
496 _GL_WARN_ON_USE (setstate_r, "setstate_r is unportable - "
497 "use gnulib module random_r for portability");
502 #if @GNULIB_REALLOC_POSIX@
503 # if @REPLACE_REALLOC@
504 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
506 # define realloc rpl_realloc
508 _GL_FUNCDECL_RPL (realloc, void *, (void *ptr, size_t size));
509 _GL_CXXALIAS_RPL (realloc, void *, (void *ptr, size_t size));
511 _GL_CXXALIAS_SYS (realloc, void *, (void *ptr, size_t size));
513 _GL_CXXALIASWARN (realloc);
514 #elif defined GNULIB_POSIXCHECK
516 /* Assume realloc is always declared. */
517 _GL_WARN_ON_USE (realloc, "realloc is not POSIX compliant everywhere - "
518 "use gnulib module realloc-posix for portability");
521 #if @GNULIB_REALPATH@
522 # if @REPLACE_REALPATH@
523 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
524 # define realpath rpl_realpath
526 _GL_FUNCDECL_RPL (realpath, char *, (const char *name, char *resolved)
527 _GL_ARG_NONNULL ((1)));
528 _GL_CXXALIAS_RPL (realpath, char *, (const char *name, char *resolved));
530 # if !@HAVE_REALPATH@
531 _GL_FUNCDECL_SYS (realpath, char *, (const char *name, char *resolved)
532 _GL_ARG_NONNULL ((1)));
534 _GL_CXXALIAS_SYS (realpath, char *, (const char *name, char *resolved));
536 _GL_CXXALIASWARN (realpath);
537 #elif defined GNULIB_POSIXCHECK
539 # if HAVE_RAW_DECL_REALPATH
540 _GL_WARN_ON_USE (realpath, "realpath is unportable - use gnulib module "
541 "canonicalize or canonicalize-lgpl for portability");
546 /* Test a user response to a question.
547 Return 1 if it is affirmative, 0 if it is negative, or -1 if not clear. */
549 _GL_FUNCDECL_SYS (rpmatch, int, (const char *response) _GL_ARG_NONNULL ((1)));
551 _GL_CXXALIAS_SYS (rpmatch, int, (const char *response));
552 _GL_CXXALIASWARN (rpmatch);
553 #elif defined GNULIB_POSIXCHECK
555 # if HAVE_RAW_DECL_RPMATCH
556 _GL_WARN_ON_USE (rpmatch, "rpmatch is unportable - "
557 "use gnulib module rpmatch for portability");
562 /* Set NAME to VALUE in the environment.
563 If REPLACE is nonzero, overwrite an existing value. */
564 # if @REPLACE_SETENV@
565 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
567 # define setenv rpl_setenv
569 _GL_FUNCDECL_RPL (setenv, int,
570 (const char *name, const char *value, int replace)
571 _GL_ARG_NONNULL ((1)));
572 _GL_CXXALIAS_RPL (setenv, int,
573 (const char *name, const char *value, int replace));
576 _GL_FUNCDECL_SYS (setenv, int,
577 (const char *name, const char *value, int replace)
578 _GL_ARG_NONNULL ((1)));
580 _GL_CXXALIAS_SYS (setenv, int,
581 (const char *name, const char *value, int replace));
583 _GL_CXXALIASWARN (setenv);
584 #elif defined GNULIB_POSIXCHECK
586 # if HAVE_RAW_DECL_SETENV
587 _GL_WARN_ON_USE (setenv, "setenv is unportable - "
588 "use gnulib module setenv for portability");
593 /* Parse a double from STRING, updating ENDP if appropriate. */
594 # if @REPLACE_STRTOD@
595 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
596 # define strtod rpl_strtod
598 _GL_FUNCDECL_RPL (strtod, double, (const char *str, char **endp)
599 _GL_ARG_NONNULL ((1)));
600 _GL_CXXALIAS_RPL (strtod, double, (const char *str, char **endp));
603 _GL_FUNCDECL_SYS (strtod, double, (const char *str, char **endp)
604 _GL_ARG_NONNULL ((1)));
606 _GL_CXXALIAS_SYS (strtod, double, (const char *str, char **endp));
608 _GL_CXXALIASWARN (strtod);
609 #elif defined GNULIB_POSIXCHECK
611 # if HAVE_RAW_DECL_STRTOD
612 _GL_WARN_ON_USE (strtod, "strtod is unportable - "
613 "use gnulib module strtod for portability");
618 /* Parse a signed integer whose textual representation starts at STRING.
619 The integer is expected to be in base BASE (2 <= BASE <= 36); if BASE == 0,
620 it may be decimal or octal (with prefix "0") or hexadecimal (with prefix
622 If ENDPTR is not NULL, the address of the first byte after the integer is
624 Upon overflow, the return value is LLONG_MAX or LLONG_MIN, and errno is set
627 _GL_FUNCDECL_SYS (strtoll, long long,
628 (const char *string, char **endptr, int base)
629 _GL_ARG_NONNULL ((1)));
631 _GL_CXXALIAS_SYS (strtoll, long long,
632 (const char *string, char **endptr, int base));
633 _GL_CXXALIASWARN (strtoll);
634 #elif defined GNULIB_POSIXCHECK
636 # if HAVE_RAW_DECL_STRTOLL
637 _GL_WARN_ON_USE (strtoll, "strtoll is unportable - "
638 "use gnulib module strtoll for portability");
642 #if @GNULIB_STRTOULL@
643 /* Parse an unsigned integer whose textual representation starts at STRING.
644 The integer is expected to be in base BASE (2 <= BASE <= 36); if BASE == 0,
645 it may be decimal or octal (with prefix "0") or hexadecimal (with prefix
647 If ENDPTR is not NULL, the address of the first byte after the integer is
649 Upon overflow, the return value is ULLONG_MAX, and errno is set to
651 # if !@HAVE_STRTOULL@
652 _GL_FUNCDECL_SYS (strtoull, unsigned long long,
653 (const char *string, char **endptr, int base)
654 _GL_ARG_NONNULL ((1)));
656 _GL_CXXALIAS_SYS (strtoull, unsigned long long,
657 (const char *string, char **endptr, int base));
658 _GL_CXXALIASWARN (strtoull);
659 #elif defined GNULIB_POSIXCHECK
661 # if HAVE_RAW_DECL_STRTOULL
662 _GL_WARN_ON_USE (strtoull, "strtoull is unportable - "
663 "use gnulib module strtoull for portability");
667 #if @GNULIB_UNLOCKPT@
668 /* Unlock the slave side of the pseudo-terminal whose master side is specified
669 by FD, so that it can be opened. */
670 # if !@HAVE_UNLOCKPT@
671 _GL_FUNCDECL_SYS (unlockpt, int, (int fd));
673 _GL_CXXALIAS_SYS (unlockpt, int, (int fd));
674 _GL_CXXALIASWARN (unlockpt);
675 #elif defined GNULIB_POSIXCHECK
677 # if HAVE_RAW_DECL_UNLOCKPT
678 _GL_WARN_ON_USE (ptsname, "unlockpt is not portable - "
679 "use gnulib module unlockpt for portability");
683 #if @GNULIB_UNSETENV@
684 /* Remove the variable NAME from the environment. */
685 # if @REPLACE_UNSETENV@
686 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
688 # define unsetenv rpl_unsetenv
690 _GL_FUNCDECL_RPL (unsetenv, int, (const char *name) _GL_ARG_NONNULL ((1)));
691 _GL_CXXALIAS_RPL (unsetenv, int, (const char *name));
693 # if !@HAVE_UNSETENV@
694 _GL_FUNCDECL_SYS (unsetenv, int, (const char *name) _GL_ARG_NONNULL ((1)));
696 _GL_CXXALIAS_SYS (unsetenv, int, (const char *name));
698 _GL_CXXALIASWARN (unsetenv);
699 #elif defined GNULIB_POSIXCHECK
701 # if HAVE_RAW_DECL_UNSETENV
702 _GL_WARN_ON_USE (unsetenv, "unsetenv is unportable - "
703 "use gnulib module unsetenv for portability");
708 #endif /* _GL_STDLIB_H */
709 #endif /* _GL_STDLIB_H */