-/*
+/* -*- buffer-read-only: t -*-
+ *
* reentr.h
*
- * Copyright (c) 1997-2002, Larry Wall
+ * Copyright (C) 2002, 2003, 2005, 2006 by Larry Wall and others
*
* You may distribute under the terms of either the GNU General Public
* License or the Artistic License, as specified in the README file.
*
* !!!!!!! DO NOT EDIT THIS FILE !!!!!!!
- * This file is built by reentrl.pl from data in reentr.pl.
+ * This file is built by reentr.pl from data in reentr.pl.
*/
#ifndef REENTR_H
-#define REENTR_H
+#define REENTR_H
+
+/* If compiling for a threaded perl, we will macro-wrap the system/library
+ * interfaces (e.g. getpwent()) which have threaded versions
+ * (e.g. getpwent_r()), which will handle things correctly for
+ * the Perl interpreter, but otherwise (for XS) the wrapping does
+ * not take place. See L<perlxs/Thread-aware system interfaces>.
+ */
+
+#ifndef PERL_REENTR_API
+# if defined(PERL_CORE) || defined(PERL_EXT)
+# define PERL_REENTR_API 1
+# else
+# define PERL_REENTR_API 0
+# endif
+#endif
#ifdef USE_REENTRANT_API
* but they are declared obsolete and are not to be used. Often this
* means that the platform has threadsafed the interfaces (hopefully).
* All this is OS version dependent, so we are of course fooling ourselves.
- * If you know of more deprecations on some platforms, please add your own. */
+ * If you know of more deprecations on some platforms, please add your own
+ * (by editing reentr.pl, mind!) */
#ifdef __hpux
# undef HAS_CRYPT_R
# undef HAS_DRAND48_R
+# undef HAS_ENDGRENT_R
+# undef HAS_ENDPWENT_R
# undef HAS_GETGRENT_R
# undef HAS_GETPWENT_R
# undef HAS_SETLOCALE_R
# define NETDB_R_OBSOLETE
#endif
+/*
+ * As of OpenBSD 3.7, reentrant functions are now working, they just are
+ * incompatible with everyone else. To make OpenBSD happy, we have to
+ * memzero out certain structures before calling the functions.
+ */
+#if defined(__OpenBSD__)
+# define REENTR_MEMZERO(a,b) memzero(a,b),
+#else
+# define REENTR_MEMZERO(a,b)
+#endif
+
#ifdef NETDB_R_OBSOLETE
# undef HAS_ENDHOSTENT_R
# undef HAS_ENDNETENT_R
#define REENTRANT_PROTO_B_B 1
#define REENTRANT_PROTO_B_BI 2
#define REENTRANT_PROTO_B_BW 3
-#define REENTRANT_PROTO_B_CCS 4
-#define REENTRANT_PROTO_B_IBI 5
-#define REENTRANT_PROTO_B_IBW 6
-#define REENTRANT_PROTO_B_SB 7
-#define REENTRANT_PROTO_B_SBI 8
-#define REENTRANT_PROTO_I_BI 9
-#define REENTRANT_PROTO_I_BW 10
-#define REENTRANT_PROTO_I_CCSBWR 11
-#define REENTRANT_PROTO_I_CCSD 12
-#define REENTRANT_PROTO_I_CII 13
-#define REENTRANT_PROTO_I_CIISD 14
-#define REENTRANT_PROTO_I_CSBI 15
-#define REENTRANT_PROTO_I_CSBIR 16
-#define REENTRANT_PROTO_I_CSBWR 17
-#define REENTRANT_PROTO_I_CSBWRE 18
-#define REENTRANT_PROTO_I_CSD 19
-#define REENTRANT_PROTO_I_CWISBWRE 20
-#define REENTRANT_PROTO_I_CWISD 21
-#define REENTRANT_PROTO_I_H 22
-#define REENTRANT_PROTO_I_IBI 23
-#define REENTRANT_PROTO_I_IBW 24
-#define REENTRANT_PROTO_I_ICBI 25
-#define REENTRANT_PROTO_I_ICSBWR 26
-#define REENTRANT_PROTO_I_ICSD 27
-#define REENTRANT_PROTO_I_ID 28
-#define REENTRANT_PROTO_I_IISD 29
-#define REENTRANT_PROTO_I_ISBWR 30
-#define REENTRANT_PROTO_I_ISD 31
-#define REENTRANT_PROTO_I_LISBI 32
-#define REENTRANT_PROTO_I_LISD 33
-#define REENTRANT_PROTO_I_LS 34
-#define REENTRANT_PROTO_I_S 35
-#define REENTRANT_PROTO_I_SB 36
-#define REENTRANT_PROTO_I_SBI 37
-#define REENTRANT_PROTO_I_SBIE 38
-#define REENTRANT_PROTO_I_SBIH 39
-#define REENTRANT_PROTO_I_SBIR 40
-#define REENTRANT_PROTO_I_SBWR 41
-#define REENTRANT_PROTO_I_SBWRE 42
-#define REENTRANT_PROTO_I_SD 43
-#define REENTRANT_PROTO_I_ST 44
-#define REENTRANT_PROTO_I_TISD 45
-#define REENTRANT_PROTO_I_TS 46
-#define REENTRANT_PROTO_I_TSBI 47
-#define REENTRANT_PROTO_I_TSBIR 48
-#define REENTRANT_PROTO_I_TSBWR 49
-#define REENTRANT_PROTO_I_TSR 50
-#define REENTRANT_PROTO_I_UISBWRE 51
-#define REENTRANT_PROTO_S_CBI 52
-#define REENTRANT_PROTO_S_CCSBI 53
-#define REENTRANT_PROTO_S_CIISBIE 54
-#define REENTRANT_PROTO_S_CSBI 55
-#define REENTRANT_PROTO_S_CSBIE 56
-#define REENTRANT_PROTO_S_CWISBIE 57
-#define REENTRANT_PROTO_S_CWISBWIE 58
-#define REENTRANT_PROTO_S_ICSBI 59
-#define REENTRANT_PROTO_S_ISBI 60
-#define REENTRANT_PROTO_S_LISBI 61
-#define REENTRANT_PROTO_S_SBI 62
-#define REENTRANT_PROTO_S_SBIE 63
-#define REENTRANT_PROTO_S_SBW 64
-#define REENTRANT_PROTO_S_TISBI 65
-#define REENTRANT_PROTO_S_TS 66
-#define REENTRANT_PROTO_S_TSBI 67
-#define REENTRANT_PROTO_S_TSBIE 68
-#define REENTRANT_PROTO_S_TWISBIE 69
-#define REENTRANT_PROTO_V_H 70
-#define REENTRANT_PROTO_V_ID 71
-#define REENTRANT_PROTO_V_S 72
+#define REENTRANT_PROTO_B_CCD 4
+#define REENTRANT_PROTO_B_CCS 5
+#define REENTRANT_PROTO_B_IBI 6
+#define REENTRANT_PROTO_B_IBW 7
+#define REENTRANT_PROTO_B_SB 8
+#define REENTRANT_PROTO_B_SBI 9
+#define REENTRANT_PROTO_I_BI 10
+#define REENTRANT_PROTO_I_BW 11
+#define REENTRANT_PROTO_I_CCSBWR 12
+#define REENTRANT_PROTO_I_CCSD 13
+#define REENTRANT_PROTO_I_CII 14
+#define REENTRANT_PROTO_I_CIISD 15
+#define REENTRANT_PROTO_I_CSBI 16
+#define REENTRANT_PROTO_I_CSBIR 17
+#define REENTRANT_PROTO_I_CSBWR 18
+#define REENTRANT_PROTO_I_CSBWRE 19
+#define REENTRANT_PROTO_I_CSD 20
+#define REENTRANT_PROTO_I_CWISBWRE 21
+#define REENTRANT_PROTO_I_CWISD 22
+#define REENTRANT_PROTO_I_D 23
+#define REENTRANT_PROTO_I_H 24
+#define REENTRANT_PROTO_I_IBI 25
+#define REENTRANT_PROTO_I_IBW 26
+#define REENTRANT_PROTO_I_ICBI 27
+#define REENTRANT_PROTO_I_ICSBWR 28
+#define REENTRANT_PROTO_I_ICSD 29
+#define REENTRANT_PROTO_I_ID 30
+#define REENTRANT_PROTO_I_IISD 31
+#define REENTRANT_PROTO_I_ISBWR 32
+#define REENTRANT_PROTO_I_ISD 33
+#define REENTRANT_PROTO_I_LISBI 34
+#define REENTRANT_PROTO_I_LISD 35
+#define REENTRANT_PROTO_I_LS 36
+#define REENTRANT_PROTO_I_SB 37
+#define REENTRANT_PROTO_I_SBI 38
+#define REENTRANT_PROTO_I_SBIE 39
+#define REENTRANT_PROTO_I_SBIH 40
+#define REENTRANT_PROTO_I_SBIR 41
+#define REENTRANT_PROTO_I_SBWR 42
+#define REENTRANT_PROTO_I_SBWRE 43
+#define REENTRANT_PROTO_I_SD 44
+#define REENTRANT_PROTO_I_ST 45
+#define REENTRANT_PROTO_I_St 46
+#define REENTRANT_PROTO_I_TISD 47
+#define REENTRANT_PROTO_I_TS 48
+#define REENTRANT_PROTO_I_TSBI 49
+#define REENTRANT_PROTO_I_TSBIR 50
+#define REENTRANT_PROTO_I_TSBWR 51
+#define REENTRANT_PROTO_I_TSR 52
+#define REENTRANT_PROTO_I_TsISBWRE 53
+#define REENTRANT_PROTO_I_UISBWRE 54
+#define REENTRANT_PROTO_I_iS 55
+#define REENTRANT_PROTO_I_lS 56
+#define REENTRANT_PROTO_I_uISBWRE 57
+#define REENTRANT_PROTO_S_CBI 58
+#define REENTRANT_PROTO_S_CCSBI 59
+#define REENTRANT_PROTO_S_CIISBIE 60
+#define REENTRANT_PROTO_S_CSBI 61
+#define REENTRANT_PROTO_S_CSBIE 62
+#define REENTRANT_PROTO_S_CWISBIE 63
+#define REENTRANT_PROTO_S_CWISBWIE 64
+#define REENTRANT_PROTO_S_ICSBI 65
+#define REENTRANT_PROTO_S_ISBI 66
+#define REENTRANT_PROTO_S_LISBI 67
+#define REENTRANT_PROTO_S_SBI 68
+#define REENTRANT_PROTO_S_SBIE 69
+#define REENTRANT_PROTO_S_SBW 70
+#define REENTRANT_PROTO_S_TISBI 71
+#define REENTRANT_PROTO_S_TS 72
+#define REENTRANT_PROTO_S_TSBI 73
+#define REENTRANT_PROTO_S_TSBIE 74
+#define REENTRANT_PROTO_S_TWISBIE 75
+#define REENTRANT_PROTO_V_D 76
+#define REENTRANT_PROTO_V_H 77
+#define REENTRANT_PROTO_V_ID 78
/* Defines for indicating which special features are supported. */
+/* The getgrent getgrgid getgrnam using buffer? */
+
+#if defined(HAS_GETGRENT_R) && (GETGRENT_R_PROTO == REENTRANT_PROTO_I_SBWR || GETGRENT_R_PROTO == REENTRANT_PROTO_I_SBIR || GETGRENT_R_PROTO == REENTRANT_PROTO_S_SBW || GETGRENT_R_PROTO == REENTRANT_PROTO_S_SBI || GETGRENT_R_PROTO == REENTRANT_PROTO_I_SBI || GETGRENT_R_PROTO == REENTRANT_PROTO_I_SBIH)
+# define GETGRENT_R_HAS_BUFFER
+#else
+# undef GETGRENT_R_HAS_BUFFER
+#endif
+#if defined(HAS_GETGRGID_R) && (GETGRGID_R_PROTO == REENTRANT_PROTO_I_TSBWR || GETGRGID_R_PROTO == REENTRANT_PROTO_I_TSBIR || GETGRGID_R_PROTO == REENTRANT_PROTO_I_TSBI || GETGRGID_R_PROTO == REENTRANT_PROTO_S_TSBI)
+# define GETGRGID_R_HAS_BUFFER
+#else
+# undef GETGRGID_R_HAS_BUFFER
+#endif
+#if defined(HAS_GETGRNAM_R) && (GETGRNAM_R_PROTO == REENTRANT_PROTO_I_CSBWR || GETGRNAM_R_PROTO == REENTRANT_PROTO_I_CSBIR || GETGRNAM_R_PROTO == REENTRANT_PROTO_S_CBI || GETGRNAM_R_PROTO == REENTRANT_PROTO_I_CSBI || GETGRNAM_R_PROTO == REENTRANT_PROTO_S_CSBI)
+# define GETGRNAM_R_HAS_BUFFER
+#else
+# undef GETGRNAM_R_HAS_BUFFER
+#endif
+
+/* Any of the getgrent getgrgid getgrnam using buffer? */
+
+#if (defined(GETGRENT_R_HAS_BUFFER) || defined(GETGRGID_R_HAS_BUFFER) || defined(GETGRNAM_R_HAS_BUFFER))
+# define USE_GRENT_BUFFER
+#else
+# undef USE_GRENT_BUFFER
+#endif
+
/* The getgrent getgrgid getgrnam using ptr? */
#if defined(HAS_GETGRENT_R) && (GETGRENT_R_PROTO == REENTRANT_PROTO_I_SBWR || GETGRENT_R_PROTO == REENTRANT_PROTO_I_SBIR)
/* Any of the getgrent getgrgid getgrnam using ptr? */
#if (defined(GETGRENT_R_HAS_PTR) || defined(GETGRGID_R_HAS_PTR) || defined(GETGRNAM_R_HAS_PTR))
-# define USE_GETGRENT_PTR
+# define USE_GRENT_PTR
#else
-# undef USE_GETGRENT_PTR
+# undef USE_GRENT_PTR
#endif
/* The getpwent getpwnam getpwuid using ptr? */
/* Any of the getpwent getpwnam getpwuid using ptr? */
#if (defined(GETPWENT_R_HAS_PTR) || defined(GETPWNAM_R_HAS_PTR) || defined(GETPWUID_R_HAS_PTR))
-# define USE_GETPWENT_PTR
+# define USE_PWENT_PTR
#else
-# undef USE_GETPWENT_PTR
+# undef USE_PWENT_PTR
#endif
/* The getspent getspnam using ptr? */
/* Any of the getspent getspnam using ptr? */
#if (defined(GETSPENT_R_HAS_PTR) || defined(GETSPNAM_R_HAS_PTR))
-# define USE_GETSPENT_PTR
+# define USE_SPENT_PTR
#else
-# undef USE_GETSPENT_PTR
+# undef USE_SPENT_PTR
#endif
-/* The getgrent getgrgid getgrnam using fptr? */
+/* The getgrent getgrgid getgrnam setgrent endgrent using fptr? */
#if defined(HAS_GETGRENT_R) && (GETGRENT_R_PROTO == REENTRANT_PROTO_I_SBIH)
# define GETGRENT_R_HAS_FPTR
#else
# undef GETGRENT_R_HAS_FPTR
#endif
+#if defined(HAS_SETGRENT_R) && (SETGRENT_R_PROTO == REENTRANT_PROTO_I_H || SETGRENT_R_PROTO == REENTRANT_PROTO_V_H)
+# define SETGRENT_R_HAS_FPTR
+#else
+# undef SETGRENT_R_HAS_FPTR
+#endif
+#if defined(HAS_ENDGRENT_R) && (ENDGRENT_R_PROTO == REENTRANT_PROTO_I_H || ENDGRENT_R_PROTO == REENTRANT_PROTO_V_H)
+# define ENDGRENT_R_HAS_FPTR
+#else
+# undef ENDGRENT_R_HAS_FPTR
+#endif
-/* Any of the getgrent getgrgid getgrnam using fptr? */
+/* Any of the getgrent getgrgid getgrnam setgrent endgrent using fptr? */
-#if (defined(GETGRENT_R_HAS_FPTR) || defined(GETGRGID_R_HAS_FPTR) || defined(GETGRNAM_R_HAS_FPTR))
-# define USE_GETGRENT_FPTR
+#if (defined(GETGRENT_R_HAS_FPTR) || defined(GETGRGID_R_HAS_FPTR) || defined(GETGRNAM_R_HAS_FPTR) || defined(SETGRENT_R_HAS_FPTR) || defined(ENDGRENT_R_HAS_FPTR))
+# define USE_GRENT_FPTR
#else
-# undef USE_GETGRENT_FPTR
+# undef USE_GRENT_FPTR
#endif
-/* The getpwent getpwnam getpwuid using fptr? */
+/* The getpwent getpwnam getpwuid setpwent endpwent using fptr? */
#if defined(HAS_GETPWENT_R) && (GETPWENT_R_PROTO == REENTRANT_PROTO_I_SBIH)
# define GETPWENT_R_HAS_FPTR
#else
# undef GETPWENT_R_HAS_FPTR
#endif
+#if defined(HAS_SETPWENT_R) && (SETPWENT_R_PROTO == REENTRANT_PROTO_I_H || SETPWENT_R_PROTO == REENTRANT_PROTO_V_H)
+# define SETPWENT_R_HAS_FPTR
+#else
+# undef SETPWENT_R_HAS_FPTR
+#endif
+#if defined(HAS_ENDPWENT_R) && (ENDPWENT_R_PROTO == REENTRANT_PROTO_I_H || ENDPWENT_R_PROTO == REENTRANT_PROTO_V_H)
+# define ENDPWENT_R_HAS_FPTR
+#else
+# undef ENDPWENT_R_HAS_FPTR
+#endif
-/* Any of the getpwent getpwnam getpwuid using fptr? */
+/* Any of the getpwent getpwnam getpwuid setpwent endpwent using fptr? */
-#if (defined(GETPWENT_R_HAS_FPTR) || defined(GETPWNAM_R_HAS_FPTR) || defined(GETPWUID_R_HAS_FPTR))
-# define USE_GETPWENT_FPTR
+#if (defined(GETPWENT_R_HAS_FPTR) || defined(GETPWNAM_R_HAS_FPTR) || defined(GETPWUID_R_HAS_FPTR) || defined(SETPWENT_R_HAS_FPTR) || defined(ENDPWENT_R_HAS_FPTR))
+# define USE_PWENT_FPTR
#else
-# undef USE_GETPWENT_FPTR
+# undef USE_PWENT_FPTR
+#endif
+
+/* The getpwent getpwgid getpwnam using buffer? */
+
+#if defined(HAS_GETPWENT_R) && (GETPWENT_R_PROTO == REENTRANT_PROTO_I_SBWR || GETPWENT_R_PROTO == REENTRANT_PROTO_I_SBIR || GETPWENT_R_PROTO == REENTRANT_PROTO_S_SBW || GETPWENT_R_PROTO == REENTRANT_PROTO_S_SBI || GETPWENT_R_PROTO == REENTRANT_PROTO_I_SBI || GETPWENT_R_PROTO == REENTRANT_PROTO_I_SBIH)
+# define GETPWENT_R_HAS_BUFFER
+#else
+# undef GETPWENT_R_HAS_BUFFER
+#endif
+#if defined(HAS_GETPWNAM_R) && (GETPWNAM_R_PROTO == REENTRANT_PROTO_I_CSBWR || GETPWNAM_R_PROTO == REENTRANT_PROTO_I_CSBIR || GETPWNAM_R_PROTO == REENTRANT_PROTO_S_CSBI || GETPWNAM_R_PROTO == REENTRANT_PROTO_I_CSBI)
+# define GETPWNAM_R_HAS_BUFFER
+#else
+# undef GETPWNAM_R_HAS_BUFFER
+#endif
+
+/* Any of the getpwent getpwgid getpwnam using buffer? */
+
+#if (defined(GETPWENT_R_HAS_BUFFER) || defined(GETPWGID_R_HAS_BUFFER) || defined(GETPWNAM_R_HAS_BUFFER))
+# define USE_PWENT_BUFFER
+#else
+# undef USE_PWENT_BUFFER
#endif
/* The gethostent gethostbyaddr gethostbyname using ptr? */
#else
# undef GETHOSTENT_R_HAS_PTR
#endif
-#if defined(HAS_GETHOSTBYADDR_R) && (GETHOSTBYADDR_R_PROTO == REENTRANT_PROTO_I_CWISBWRE)
+#if defined(HAS_GETHOSTBYADDR_R) && (GETHOSTBYADDR_R_PROTO == REENTRANT_PROTO_I_CWISBWRE || GETHOSTBYADDR_R_PROTO == REENTRANT_PROTO_I_TsISBWRE)
# define GETHOSTBYADDR_R_HAS_PTR
#else
# undef GETHOSTBYADDR_R_HAS_PTR
/* Any of the gethostent gethostbyaddr gethostbyname using ptr? */
#if (defined(GETHOSTENT_R_HAS_PTR) || defined(GETHOSTBYADDR_R_HAS_PTR) || defined(GETHOSTBYNAME_R_HAS_PTR))
-# define USE_GETHOSTENT_PTR
+# define USE_HOSTENT_PTR
#else
-# undef USE_GETHOSTENT_PTR
+# undef USE_HOSTENT_PTR
#endif
/* The getnetent getnetbyaddr getnetbyname using ptr? */
#else
# undef GETNETENT_R_HAS_PTR
#endif
-#if defined(HAS_GETNETBYADDR_R) && (GETNETBYADDR_R_PROTO == REENTRANT_PROTO_I_UISBWRE)
+#if defined(HAS_GETNETBYADDR_R) && (GETNETBYADDR_R_PROTO == REENTRANT_PROTO_I_UISBWRE || GETNETBYADDR_R_PROTO == REENTRANT_PROTO_I_uISBWRE)
# define GETNETBYADDR_R_HAS_PTR
#else
# undef GETNETBYADDR_R_HAS_PTR
/* Any of the getnetent getnetbyaddr getnetbyname using ptr? */
#if (defined(GETNETENT_R_HAS_PTR) || defined(GETNETBYADDR_R_HAS_PTR) || defined(GETNETBYNAME_R_HAS_PTR))
-# define USE_GETNETENT_PTR
+# define USE_NETENT_PTR
#else
-# undef USE_GETNETENT_PTR
+# undef USE_NETENT_PTR
#endif
/* The getprotoent getprotobyname getprotobynumber using ptr? */
/* Any of the getprotoent getprotobyname getprotobynumber using ptr? */
#if (defined(GETPROTOENT_R_HAS_PTR) || defined(GETPROTOBYNAME_R_HAS_PTR) || defined(GETPROTOBYNUMBER_R_HAS_PTR))
-# define USE_GETPROTOENT_PTR
+# define USE_PROTOENT_PTR
#else
-# undef USE_GETPROTOENT_PTR
+# undef USE_PROTOENT_PTR
#endif
/* The getservent getservbyname getservbyport using ptr? */
/* Any of the getservent getservbyname getservbyport using ptr? */
#if (defined(GETSERVENT_R_HAS_PTR) || defined(GETSERVBYNAME_R_HAS_PTR) || defined(GETSERVBYPORT_R_HAS_PTR))
-# define USE_GETSERVENT_PTR
+# define USE_SERVENT_PTR
+#else
+# undef USE_SERVENT_PTR
+#endif
+
+/* The gethostent gethostbyaddr gethostbyname using buffer? */
+
+#if defined(HAS_GETHOSTENT_R) && (GETHOSTENT_R_PROTO == REENTRANT_PROTO_I_SBWRE || GETHOSTENT_R_PROTO == REENTRANT_PROTO_I_SBIE || GETHOSTENT_R_PROTO == REENTRANT_PROTO_S_SBIE || GETHOSTENT_R_PROTO == REENTRANT_PROTO_S_SBI || GETHOSTENT_R_PROTO == REENTRANT_PROTO_I_SBI)
+# define GETHOSTENT_R_HAS_BUFFER
+#else
+# undef GETHOSTENT_R_HAS_BUFFER
+#endif
+#if defined(HAS_GETHOSTBYADDR_R) && (GETHOSTBYADDR_R_PROTO == REENTRANT_PROTO_I_CWISBWRE || GETHOSTBYADDR_R_PROTO == REENTRANT_PROTO_S_CWISBWIE || GETHOSTBYADDR_R_PROTO == REENTRANT_PROTO_S_CWISBIE || GETHOSTBYADDR_R_PROTO == REENTRANT_PROTO_S_TWISBIE || GETHOSTBYADDR_R_PROTO == REENTRANT_PROTO_S_CIISBIE || GETHOSTBYADDR_R_PROTO == REENTRANT_PROTO_S_CSBIE || GETHOSTBYADDR_R_PROTO == REENTRANT_PROTO_S_TSBIE || GETHOSTBYADDR_R_PROTO == REENTRANT_PROTO_I_TsISBWRE)
+# define GETHOSTBYADDR_R_HAS_BUFFER
+#else
+# undef GETHOSTBYADDR_R_HAS_BUFFER
+#endif
+#if defined(HAS_GETHOSTBYNAME_R) && (GETHOSTBYNAME_R_PROTO == REENTRANT_PROTO_I_CSBWRE || GETHOSTBYNAME_R_PROTO == REENTRANT_PROTO_S_CSBIE)
+# define GETHOSTBYNAME_R_HAS_BUFFER
+#else
+# undef GETHOSTBYNAME_R_HAS_BUFFER
+#endif
+
+/* Any of the gethostent gethostbyaddr gethostbyname using buffer? */
+
+#if (defined(GETHOSTENT_R_HAS_BUFFER) || defined(GETHOSTBYADDR_R_HAS_BUFFER) || defined(GETHOSTBYNAME_R_HAS_BUFFER))
+# define USE_HOSTENT_BUFFER
+#else
+# undef USE_HOSTENT_BUFFER
+#endif
+
+/* The getnetent getnetbyaddr getnetbyname using buffer? */
+
+#if defined(HAS_GETNETENT_R) && (GETNETENT_R_PROTO == REENTRANT_PROTO_I_SBWRE || GETNETENT_R_PROTO == REENTRANT_PROTO_I_SBIE || GETNETENT_R_PROTO == REENTRANT_PROTO_S_SBIE || GETNETENT_R_PROTO == REENTRANT_PROTO_S_SBI || GETNETENT_R_PROTO == REENTRANT_PROTO_I_SBI)
+# define GETNETENT_R_HAS_BUFFER
+#else
+# undef GETNETENT_R_HAS_BUFFER
+#endif
+#if defined(HAS_GETNETBYADDR_R) && (GETNETBYADDR_R_PROTO == REENTRANT_PROTO_I_UISBWRE || GETNETBYADDR_R_PROTO == REENTRANT_PROTO_I_LISBI || GETNETBYADDR_R_PROTO == REENTRANT_PROTO_S_TISBI || GETNETBYADDR_R_PROTO == REENTRANT_PROTO_S_LISBI || GETNETBYADDR_R_PROTO == REENTRANT_PROTO_I_uISBWRE)
+# define GETNETBYADDR_R_HAS_BUFFER
+#else
+# undef GETNETBYADDR_R_HAS_BUFFER
+#endif
+#if defined(HAS_GETNETBYNAME_R) && (GETNETBYNAME_R_PROTO == REENTRANT_PROTO_I_CSBWRE || GETNETBYNAME_R_PROTO == REENTRANT_PROTO_I_CSBI || GETNETBYNAME_R_PROTO == REENTRANT_PROTO_S_CSBI)
+# define GETNETBYNAME_R_HAS_BUFFER
#else
-# undef USE_GETSERVENT_PTR
+# undef GETNETBYNAME_R_HAS_BUFFER
+#endif
+
+/* Any of the getnetent getnetbyaddr getnetbyname using buffer? */
+
+#if (defined(GETNETENT_R_HAS_BUFFER) || defined(GETNETBYADDR_R_HAS_BUFFER) || defined(GETNETBYNAME_R_HAS_BUFFER))
+# define USE_NETENT_BUFFER
+#else
+# undef USE_NETENT_BUFFER
+#endif
+
+/* The getprotoent getprotobyname getprotobynumber using buffer? */
+
+#if defined(HAS_GETPROTOENT_R) && (GETPROTOENT_R_PROTO == REENTRANT_PROTO_I_SBWR || GETPROTOENT_R_PROTO == REENTRANT_PROTO_I_SBI || GETPROTOENT_R_PROTO == REENTRANT_PROTO_S_SBI)
+# define GETPROTOENT_R_HAS_BUFFER
+#else
+# undef GETPROTOENT_R_HAS_BUFFER
+#endif
+#if defined(HAS_GETPROTOBYNAME_R) && (GETPROTOBYNAME_R_PROTO == REENTRANT_PROTO_I_CSBWR || GETPROTOBYNAME_R_PROTO == REENTRANT_PROTO_S_CSBI)
+# define GETPROTOBYNAME_R_HAS_BUFFER
+#else
+# undef GETPROTOBYNAME_R_HAS_BUFFER
+#endif
+#if defined(HAS_GETPROTOBYNUMBER_R) && (GETPROTOBYNUMBER_R_PROTO == REENTRANT_PROTO_I_ISBWR || GETPROTOBYNUMBER_R_PROTO == REENTRANT_PROTO_S_ISBI)
+# define GETPROTOBYNUMBER_R_HAS_BUFFER
+#else
+# undef GETPROTOBYNUMBER_R_HAS_BUFFER
+#endif
+
+/* Any of the getprotoent getprotobyname getprotobynumber using buffer? */
+
+#if (defined(GETPROTOENT_R_HAS_BUFFER) || defined(GETPROTOBYNAME_R_HAS_BUFFER) || defined(GETPROTOBYNUMBER_R_HAS_BUFFER))
+# define USE_PROTOENT_BUFFER
+#else
+# undef USE_PROTOENT_BUFFER
+#endif
+
+/* The getservent getservbyname getservbyport using buffer? */
+
+#if defined(HAS_GETSERVENT_R) && (GETSERVENT_R_PROTO == REENTRANT_PROTO_I_SBWR || GETSERVENT_R_PROTO == REENTRANT_PROTO_I_SBI || GETSERVENT_R_PROTO == REENTRANT_PROTO_S_SBI)
+# define GETSERVENT_R_HAS_BUFFER
+#else
+# undef GETSERVENT_R_HAS_BUFFER
+#endif
+#if defined(HAS_GETSERVBYNAME_R) && (GETSERVBYNAME_R_PROTO == REENTRANT_PROTO_I_CCSBWR || GETSERVBYNAME_R_PROTO == REENTRANT_PROTO_S_CCSBI)
+# define GETSERVBYNAME_R_HAS_BUFFER
+#else
+# undef GETSERVBYNAME_R_HAS_BUFFER
+#endif
+#if defined(HAS_GETSERVBYPORT_R) && (GETSERVBYPORT_R_PROTO == REENTRANT_PROTO_I_ICSBWR || GETSERVBYPORT_R_PROTO == REENTRANT_PROTO_S_ICSBI)
+# define GETSERVBYPORT_R_HAS_BUFFER
+#else
+# undef GETSERVBYPORT_R_HAS_BUFFER
+#endif
+
+/* Any of the getservent getservbyname getservbyport using buffer? */
+
+#if (defined(GETSERVENT_R_HAS_BUFFER) || defined(GETSERVBYNAME_R_HAS_BUFFER) || defined(GETSERVBYPORT_R_HAS_BUFFER))
+# define USE_SERVENT_BUFFER
+#else
+# undef USE_SERVENT_BUFFER
#endif
/* The gethostent gethostbyaddr gethostbyname using errno? */
#else
# undef GETHOSTENT_R_HAS_ERRNO
#endif
-#if defined(HAS_GETHOSTBYADDR_R) && (GETHOSTBYADDR_R_PROTO == REENTRANT_PROTO_I_CWISBWRE || GETHOSTBYADDR_R_PROTO == REENTRANT_PROTO_S_CWISBWIE || GETHOSTBYADDR_R_PROTO == REENTRANT_PROTO_S_CWISBIE || GETHOSTBYADDR_R_PROTO == REENTRANT_PROTO_S_TWISBIE || GETHOSTBYADDR_R_PROTO == REENTRANT_PROTO_S_CIISBIE || GETHOSTBYADDR_R_PROTO == REENTRANT_PROTO_S_CSBIE || GETHOSTBYADDR_R_PROTO == REENTRANT_PROTO_S_TSBIE)
+#if defined(HAS_GETHOSTBYADDR_R) && (GETHOSTBYADDR_R_PROTO == REENTRANT_PROTO_I_CWISBWRE || GETHOSTBYADDR_R_PROTO == REENTRANT_PROTO_S_CWISBWIE || GETHOSTBYADDR_R_PROTO == REENTRANT_PROTO_S_CWISBIE || GETHOSTBYADDR_R_PROTO == REENTRANT_PROTO_S_TWISBIE || GETHOSTBYADDR_R_PROTO == REENTRANT_PROTO_S_CIISBIE || GETHOSTBYADDR_R_PROTO == REENTRANT_PROTO_S_CSBIE || GETHOSTBYADDR_R_PROTO == REENTRANT_PROTO_S_TSBIE || GETHOSTBYADDR_R_PROTO == REENTRANT_PROTO_I_TsISBWRE)
# define GETHOSTBYADDR_R_HAS_ERRNO
#else
# undef GETHOSTBYADDR_R_HAS_ERRNO
/* Any of the gethostent gethostbyaddr gethostbyname using errno? */
#if (defined(GETHOSTENT_R_HAS_ERRNO) || defined(GETHOSTBYADDR_R_HAS_ERRNO) || defined(GETHOSTBYNAME_R_HAS_ERRNO))
-# define USE_GETHOSTENT_ERRNO
+# define USE_HOSTENT_ERRNO
#else
-# undef USE_GETHOSTENT_ERRNO
+# undef USE_HOSTENT_ERRNO
#endif
/* The getnetent getnetbyaddr getnetbyname using errno? */
#else
# undef GETNETENT_R_HAS_ERRNO
#endif
-#if defined(HAS_GETNETBYADDR_R) && (GETNETBYADDR_R_PROTO == REENTRANT_PROTO_I_UISBWRE)
+#if defined(HAS_GETNETBYADDR_R) && (GETNETBYADDR_R_PROTO == REENTRANT_PROTO_I_UISBWRE || GETNETBYADDR_R_PROTO == REENTRANT_PROTO_I_uISBWRE)
# define GETNETBYADDR_R_HAS_ERRNO
#else
# undef GETNETBYADDR_R_HAS_ERRNO
/* Any of the getnetent getnetbyaddr getnetbyname using errno? */
#if (defined(GETNETENT_R_HAS_ERRNO) || defined(GETNETBYADDR_R_HAS_ERRNO) || defined(GETNETBYNAME_R_HAS_ERRNO))
-# define USE_GETNETENT_ERRNO
+# define USE_NETENT_ERRNO
#else
-# undef USE_GETNETENT_ERRNO
+# undef USE_NETENT_ERRNO
#endif
size_t _asctime_size;
#endif /* HAS_ASCTIME_R */
#ifdef HAS_CRYPT_R
- struct crypt_data _crypt_struct;
+#if CRYPT_R_PROTO == REENTRANT_PROTO_B_CCD
+ CRYPTD* _crypt_data;
+#else
+ struct crypt_data *_crypt_struct_buffer;
+#endif
#endif /* HAS_CRYPT_R */
#ifdef HAS_CTIME_R
char* _ctime_buffer;
double _drand48_double;
#endif /* HAS_DRAND48_R */
#ifdef HAS_GETGRNAM_R
- struct group _getgrent_struct;
- char* _getgrent_buffer;
- size_t _getgrent_size;
-# ifdef USE_GETGRENT_PTR
- struct group* _getgrent_ptr;
+ struct group _grent_struct;
+ char* _grent_buffer;
+ size_t _grent_size;
+# ifdef USE_GRENT_PTR
+ struct group* _grent_ptr;
# endif
-# ifdef USE_GETGRENT_FPTR
- FILE* _getgrent_fptr;
+# ifdef USE_GRENT_FPTR
+ FILE* _grent_fptr;
# endif
#endif /* HAS_GETGRNAM_R */
#ifdef HAS_GETHOSTBYNAME_R
- struct hostent _gethostent_struct;
+ struct hostent _hostent_struct;
# if GETHOSTBYNAME_R_PROTO == REENTRANT_PROTO_I_CSD
- struct hostent_data* _gethostent_data;
+ struct hostent_data _hostent_data;
# else
- char* _gethostent_buffer;
- size_t _gethostent_size;
+ char* _hostent_buffer;
+ size_t _hostent_size;
# endif
-# ifdef USE_GETHOSTENT_PTR
- struct hostent* _gethostent_ptr;
+# ifdef USE_HOSTENT_PTR
+ struct hostent* _hostent_ptr;
# endif
-# ifdef USE_GETHOSTENT_ERRNO
- int _gethostent_errno;
+# ifdef USE_HOSTENT_ERRNO
+ int _hostent_errno;
# endif
#endif /* HAS_GETHOSTBYNAME_R */
#ifdef HAS_GETLOGIN_R
size_t _getlogin_size;
#endif /* HAS_GETLOGIN_R */
#ifdef HAS_GETNETBYNAME_R
- struct netent _getnetent_struct;
+ struct netent _netent_struct;
# if GETNETBYNAME_R_PROTO == REENTRANT_PROTO_I_CSD
- struct netent_data* _getnetent_data;
+ struct netent_data _netent_data;
# else
- char* _getnetent_buffer;
- size_t _getnetent_size;
+ char* _netent_buffer;
+ size_t _netent_size;
# endif
-# ifdef USE_GETNETENT_PTR
- struct netent* _getnetent_ptr;
+# ifdef USE_NETENT_PTR
+ struct netent* _netent_ptr;
# endif
-# ifdef USE_GETNETENT_ERRNO
- int _getnetent_errno;
+# ifdef USE_NETENT_ERRNO
+ int _netent_errno;
# endif
#endif /* HAS_GETNETBYNAME_R */
#ifdef HAS_GETPROTOBYNAME_R
- struct protoent _getprotoent_struct;
+ struct protoent _protoent_struct;
# if GETPROTOBYNAME_R_PROTO == REENTRANT_PROTO_I_CSD
- struct protoent_data* _getprotoent_data;
+ struct protoent_data _protoent_data;
# else
- char* _getprotoent_buffer;
- size_t _getprotoent_size;
+ char* _protoent_buffer;
+ size_t _protoent_size;
# endif
-# ifdef USE_GETPROTOENT_PTR
- struct protoent* _getprotoent_ptr;
+# ifdef USE_PROTOENT_PTR
+ struct protoent* _protoent_ptr;
# endif
-# ifdef USE_GETPROTOENT_ERRNO
- int _getprotoent_errno;
+# ifdef USE_PROTOENT_ERRNO
+ int _protoent_errno;
# endif
#endif /* HAS_GETPROTOBYNAME_R */
#ifdef HAS_GETPWNAM_R
- struct passwd _getpwent_struct;
- char* _getpwent_buffer;
- size_t _getpwent_size;
-# ifdef USE_GETPWENT_PTR
- struct passwd* _getpwent_ptr;
+ struct passwd _pwent_struct;
+ char* _pwent_buffer;
+ size_t _pwent_size;
+# ifdef USE_PWENT_PTR
+ struct passwd* _pwent_ptr;
# endif
-# ifdef USE_GETPWENT_FPTR
- FILE* _getpwent_fptr;
+# ifdef USE_PWENT_FPTR
+ FILE* _pwent_fptr;
# endif
#endif /* HAS_GETPWNAM_R */
#ifdef HAS_GETSERVBYNAME_R
- struct servent _getservent_struct;
+ struct servent _servent_struct;
# if GETSERVBYNAME_R_PROTO == REENTRANT_PROTO_I_CCSD
- struct servent_data* _getservent_data;
+ struct servent_data _servent_data;
# else
- char* _getservent_buffer;
- size_t _getservent_size;
+ char* _servent_buffer;
+ size_t _servent_size;
# endif
-# ifdef USE_GETSERVENT_PTR
- struct servent* _getservent_ptr;
+# ifdef USE_SERVENT_PTR
+ struct servent* _servent_ptr;
# endif
-# ifdef USE_GETSERVENT_ERRNO
- int _getservent_errno;
+# ifdef USE_SERVENT_ERRNO
+ int _servent_errno;
# endif
#endif /* HAS_GETSERVBYNAME_R */
#ifdef HAS_GETSPNAM_R
- struct spwd _getspent_struct;
- char* _getspent_buffer;
- size_t _getspent_size;
-# ifdef USE_GETSPENT_PTR
- struct spwd* _getspent_ptr;
+ struct spwd _spent_struct;
+ char* _spent_buffer;
+ size_t _spent_size;
+# ifdef USE_SPENT_PTR
+ struct spwd* _spent_ptr;
+# endif
+# ifdef USE_SPENT_FPTR
+ FILE* _spent_fptr;
# endif
#endif /* HAS_GETSPNAM_R */
#ifdef HAS_GMTIME_R
#endif /* HAS_LOCALTIME_R */
#ifdef HAS_RANDOM_R
struct random_data _random_struct;
+# if RANDOM_R_PROTO == REENTRANT_PROTO_I_iS
+ int _random_retval;
+# endif
+# if RANDOM_R_PROTO == REENTRANT_PROTO_I_lS
+ long _random_retval;
+# endif
+# if RANDOM_R_PROTO == REENTRANT_PROTO_I_St
+ int32_t _random_retval;
+# endif
#endif /* HAS_RANDOM_R */
#ifdef HAS_READDIR_R
struct dirent* _readdir_struct;
char* _setlocale_buffer;
size_t _setlocale_size;
#endif /* HAS_SETLOCALE_R */
+#ifdef HAS_SRANDOM_R
+ struct random_data _srandom_struct;
+#endif /* HAS_SRANDOM_R */
#ifdef HAS_STRERROR_R
char* _strerror_buffer;
size_t _strerror_size;
size_t _ttyname_size;
#endif /* HAS_TTYNAME_R */
+ int dummy; /* cannot have empty structs */
} REENTR;
/* The wrappers. */
#ifdef HAS_ASCTIME_R
+# if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1)
# undef asctime
# if !defined(asctime) && ASCTIME_R_PROTO == REENTRANT_PROTO_B_SB
# define asctime(a) asctime_r(a, PL_reentrant_buffer->_asctime_buffer)
-# endif
+# endif /* if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1) */
# if !defined(asctime) && ASCTIME_R_PROTO == REENTRANT_PROTO_B_SBI
# define asctime(a) asctime_r(a, PL_reentrant_buffer->_asctime_buffer, PL_reentrant_buffer->_asctime_size)
-# endif
+# endif /* if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1) */
# if !defined(asctime) && ASCTIME_R_PROTO == REENTRANT_PROTO_I_SB
-# define asctime(a) (((errno = asctime_r(a, PL_reentrant_buffer->_asctime_buffer))) == 0 ? PL_reentrant_buffer->_asctime_buffer : 0)
-# endif
+# define asctime(a) (asctime_r(a, PL_reentrant_buffer->_asctime_buffer) == 0 ? PL_reentrant_buffer->_asctime_buffer : 0)
+# endif /* if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1) */
# if !defined(asctime) && ASCTIME_R_PROTO == REENTRANT_PROTO_I_SBI
-# define asctime(a) (((errno = asctime_r(a, PL_reentrant_buffer->_asctime_buffer, PL_reentrant_buffer->_asctime_size))) == 0 ? PL_reentrant_buffer->_asctime_buffer : 0)
-# endif
+# define asctime(a) (asctime_r(a, PL_reentrant_buffer->_asctime_buffer, PL_reentrant_buffer->_asctime_size) == 0 ? PL_reentrant_buffer->_asctime_buffer : 0)
+# endif /* if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1) */
+# endif /* HAS_ASCTIME */
#endif /* HAS_ASCTIME_R */
#ifdef HAS_CRYPT_R
+# if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1)
# undef crypt
# if !defined(crypt) && CRYPT_R_PROTO == REENTRANT_PROTO_B_CCS
-# define crypt(a, b) crypt_r(a, b, &PL_reentrant_buffer->_crypt_struct)
-# endif
+# define crypt(a, b) crypt_r(a, b, PL_reentrant_buffer->_crypt_struct_buffer)
+# endif /* if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1) */
+# if !defined(crypt) && CRYPT_R_PROTO == REENTRANT_PROTO_B_CCD
+# define crypt(a, b) crypt_r(a, b, &PL_reentrant_buffer->_crypt_data)
+# endif /* if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1) */
+# endif /* HAS_CRYPT */
#endif /* HAS_CRYPT_R */
#ifdef HAS_CTERMID_R
+# if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1)
# undef ctermid
# if !defined(ctermid) && CTERMID_R_PROTO == REENTRANT_PROTO_B_B
# define ctermid(a) ctermid_r(a)
-# endif
+# endif /* if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1) */
+# endif /* HAS_CTERMID */
#endif /* HAS_CTERMID_R */
#ifdef HAS_CTIME_R
+# if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1)
# undef ctime
# if !defined(ctime) && CTIME_R_PROTO == REENTRANT_PROTO_B_SB
# define ctime(a) ctime_r(a, PL_reentrant_buffer->_ctime_buffer)
-# endif
+# endif /* if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1) */
# if !defined(ctime) && CTIME_R_PROTO == REENTRANT_PROTO_B_SBI
# define ctime(a) ctime_r(a, PL_reentrant_buffer->_ctime_buffer, PL_reentrant_buffer->_ctime_size)
-# endif
+# endif /* if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1) */
# if !defined(ctime) && CTIME_R_PROTO == REENTRANT_PROTO_I_SB
-# define ctime(a) (((errno = ctime_r(a, PL_reentrant_buffer->_ctime_buffer))) == 0 ? PL_reentrant_buffer->_ctime_buffer : 0)
-# endif
+# define ctime(a) (ctime_r(a, PL_reentrant_buffer->_ctime_buffer) == 0 ? PL_reentrant_buffer->_ctime_buffer : 0)
+# endif /* if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1) */
# if !defined(ctime) && CTIME_R_PROTO == REENTRANT_PROTO_I_SBI
-# define ctime(a) (((errno = ctime_r(a, PL_reentrant_buffer->_ctime_buffer, PL_reentrant_buffer->_ctime_size))) == 0 ? PL_reentrant_buffer->_ctime_buffer : 0)
-# endif
+# define ctime(a) (ctime_r(a, PL_reentrant_buffer->_ctime_buffer, PL_reentrant_buffer->_ctime_size) == 0 ? PL_reentrant_buffer->_ctime_buffer : 0)
+# endif /* if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1) */
+# endif /* HAS_CTIME */
#endif /* HAS_CTIME_R */
#ifdef HAS_DRAND48_R
+# if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1)
# undef drand48
# if !defined(drand48) && DRAND48_R_PROTO == REENTRANT_PROTO_I_ST
-# define drand48() (((errno = drand48_r(&PL_reentrant_buffer->_drand48_struct, &PL_reentrant_buffer->_drand48_double))) == 0 ? PL_reentrant_buffer->_drand48_double : 0)
-# endif
+# define drand48() (drand48_r(&PL_reentrant_buffer->_drand48_struct, &PL_reentrant_buffer->_drand48_double) == 0 ? PL_reentrant_buffer->_drand48_double : 0)
+# endif /* if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1) */
+# endif /* HAS_DRAND48 */
#endif /* HAS_DRAND48_R */
#ifdef HAS_ENDGRENT_R
+# if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1)
# undef endgrent
# if !defined(endgrent) && ENDGRENT_R_PROTO == REENTRANT_PROTO_I_H
-# define endgrent() (((errno = endgrent_r(&PL_reentrant_buffer->_getgrent_fptr))) == 0 ? 1 : 0)
-# endif
+# define endgrent() (endgrent_r(&PL_reentrant_buffer->_grent_fptr) == 0 ? 1 : 0)
+# endif /* if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1) */
# if !defined(endgrent) && ENDGRENT_R_PROTO == REENTRANT_PROTO_V_H
-# define endgrent() endgrent_r(&PL_reentrant_buffer->_getgrent_fptr)
-# endif
+# define endgrent() endgrent_r(&PL_reentrant_buffer->_grent_fptr)
+# endif /* if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1) */
+# endif /* HAS_ENDGRENT */
#endif /* HAS_ENDGRENT_R */
#ifdef HAS_ENDHOSTENT_R
+# if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1)
# undef endhostent
-# if !defined(endhostent) && ENDHOSTENT_R_PROTO == REENTRANT_PROTO_I_S
-# define endhostent() (((errno = endhostent_r(&PL_reentrant_buffer->_gethostent_struct))) == 0 ? &PL_reentrant_buffer->_gethostent_struct : 0)
-# endif
-# if !defined(endhostent) && ENDHOSTENT_R_PROTO == REENTRANT_PROTO_V_S
-# define endhostent() endhostent_r(&PL_reentrant_buffer->_gethostent_struct)
-# endif
+# if !defined(endhostent) && ENDHOSTENT_R_PROTO == REENTRANT_PROTO_I_D
+# define endhostent() (endhostent_r(&PL_reentrant_buffer->_hostent_data) == 0 ? 1 : 0)
+# endif /* if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1) */
+# if !defined(endhostent) && ENDHOSTENT_R_PROTO == REENTRANT_PROTO_V_D
+# define endhostent() endhostent_r(&PL_reentrant_buffer->_hostent_data)
+# endif /* if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1) */
+# endif /* HAS_ENDHOSTENT */
#endif /* HAS_ENDHOSTENT_R */
#ifdef HAS_ENDNETENT_R
+# if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1)
# undef endnetent
-# if !defined(endnetent) && ENDNETENT_R_PROTO == REENTRANT_PROTO_I_S
-# define endnetent() (((errno = endnetent_r(&PL_reentrant_buffer->_getnetent_struct))) == 0 ? &PL_reentrant_buffer->_getnetent_struct : 0)
-# endif
-# if !defined(endnetent) && ENDNETENT_R_PROTO == REENTRANT_PROTO_V_S
-# define endnetent() endnetent_r(&PL_reentrant_buffer->_getnetent_struct)
-# endif
+# if !defined(endnetent) && ENDNETENT_R_PROTO == REENTRANT_PROTO_I_D
+# define endnetent() (endnetent_r(&PL_reentrant_buffer->_netent_data) == 0 ? 1 : 0)
+# endif /* if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1) */
+# if !defined(endnetent) && ENDNETENT_R_PROTO == REENTRANT_PROTO_V_D
+# define endnetent() endnetent_r(&PL_reentrant_buffer->_netent_data)
+# endif /* if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1) */
+# endif /* HAS_ENDNETENT */
#endif /* HAS_ENDNETENT_R */
#ifdef HAS_ENDPROTOENT_R
+# if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1)
# undef endprotoent
-# if !defined(endprotoent) && ENDPROTOENT_R_PROTO == REENTRANT_PROTO_I_S
-# define endprotoent() (((errno = endprotoent_r(&PL_reentrant_buffer->_getprotoent_struct))) == 0 ? &PL_reentrant_buffer->_getprotoent_struct : 0)
-# endif
-# if !defined(endprotoent) && ENDPROTOENT_R_PROTO == REENTRANT_PROTO_V_S
-# define endprotoent() endprotoent_r(&PL_reentrant_buffer->_getprotoent_struct)
-# endif
+# if !defined(endprotoent) && ENDPROTOENT_R_PROTO == REENTRANT_PROTO_I_D
+# define endprotoent() (endprotoent_r(&PL_reentrant_buffer->_protoent_data) == 0 ? 1 : 0)
+# endif /* if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1) */
+# if !defined(endprotoent) && ENDPROTOENT_R_PROTO == REENTRANT_PROTO_V_D
+# define endprotoent() endprotoent_r(&PL_reentrant_buffer->_protoent_data)
+# endif /* if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1) */
+# endif /* HAS_ENDPROTOENT */
#endif /* HAS_ENDPROTOENT_R */
#ifdef HAS_ENDPWENT_R
+# if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1)
# undef endpwent
# if !defined(endpwent) && ENDPWENT_R_PROTO == REENTRANT_PROTO_I_H
-# define endpwent() (((errno = endpwent_r(&PL_reentrant_buffer->_getpwent_fptr))) == 0 ? 1 : 0)
-# endif
+# define endpwent() (endpwent_r(&PL_reentrant_buffer->_pwent_fptr) == 0 ? 1 : 0)
+# endif /* if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1) */
# if !defined(endpwent) && ENDPWENT_R_PROTO == REENTRANT_PROTO_V_H
-# define endpwent() endpwent_r(&PL_reentrant_buffer->_getpwent_fptr)
-# endif
+# define endpwent() endpwent_r(&PL_reentrant_buffer->_pwent_fptr)
+# endif /* if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1) */
+# endif /* HAS_ENDPWENT */
#endif /* HAS_ENDPWENT_R */
#ifdef HAS_ENDSERVENT_R
+# if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1)
# undef endservent
-# if !defined(endservent) && ENDSERVENT_R_PROTO == REENTRANT_PROTO_I_S
-# define endservent() (((errno = endservent_r(&PL_reentrant_buffer->_getservent_struct))) == 0 ? &PL_reentrant_buffer->_getservent_struct : 0)
-# endif
-# if !defined(endservent) && ENDSERVENT_R_PROTO == REENTRANT_PROTO_V_S
-# define endservent() endservent_r(&PL_reentrant_buffer->_getservent_struct)
-# endif
+# if !defined(endservent) && ENDSERVENT_R_PROTO == REENTRANT_PROTO_I_D
+# define endservent() (endservent_r(&PL_reentrant_buffer->_servent_data) == 0 ? 1 : 0)
+# endif /* if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1) */
+# if !defined(endservent) && ENDSERVENT_R_PROTO == REENTRANT_PROTO_V_D
+# define endservent() endservent_r(&PL_reentrant_buffer->_servent_data)
+# endif /* if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1) */
+# endif /* HAS_ENDSERVENT */
#endif /* HAS_ENDSERVENT_R */
#ifdef HAS_GETGRENT_R
+# if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1)
# undef getgrent
# if !defined(getgrent) && GETGRENT_R_PROTO == REENTRANT_PROTO_I_SBWR
-# define getgrent() (((errno = getgrent_r(&PL_reentrant_buffer->_getgrent_struct, PL_reentrant_buffer->_getgrent_buffer, PL_reentrant_buffer->_getgrent_size, &PL_reentrant_buffer->_getgrent_ptr))) == 0 ? PL_reentrant_buffer->_getgrent_ptr : 0)
-# endif
+# define getgrent() ((PL_reentrant_retint = getgrent_r(&PL_reentrant_buffer->_grent_struct, PL_reentrant_buffer->_grent_buffer, PL_reentrant_buffer->_grent_size, &PL_reentrant_buffer->_grent_ptr)) == 0 ? PL_reentrant_buffer->_grent_ptr : ((PL_reentrant_retint == ERANGE) ? (struct group *) Perl_reentrant_retry("getgrent") : 0))
+# endif /* if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1) */
# if !defined(getgrent) && GETGRENT_R_PROTO == REENTRANT_PROTO_I_SBIR
-# define getgrent() (((errno = getgrent_r(&PL_reentrant_buffer->_getgrent_struct, PL_reentrant_buffer->_getgrent_buffer, PL_reentrant_buffer->_getgrent_size, &PL_reentrant_buffer->_getgrent_ptr))) == 0 ? PL_reentrant_buffer->_getgrent_ptr : 0)
-# endif
+# define getgrent() ((PL_reentrant_retint = getgrent_r(&PL_reentrant_buffer->_grent_struct, PL_reentrant_buffer->_grent_buffer, PL_reentrant_buffer->_grent_size, &PL_reentrant_buffer->_grent_ptr)) == 0 ? PL_reentrant_buffer->_grent_ptr : ((PL_reentrant_retint == ERANGE) ? (struct group *) Perl_reentrant_retry("getgrent") : 0))
+# endif /* if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1) */
# if !defined(getgrent) && GETGRENT_R_PROTO == REENTRANT_PROTO_S_SBW
-# define getgrent() (getgrent_r(&PL_reentrant_buffer->_getgrent_struct, PL_reentrant_buffer->_getgrent_buffer, PL_reentrant_buffer->_getgrent_size) ? &PL_reentrant_buffer->_getgrent_struct : 0)
-# endif
+# define getgrent() (getgrent_r(&PL_reentrant_buffer->_grent_struct, PL_reentrant_buffer->_grent_buffer, PL_reentrant_buffer->_grent_size) ? &PL_reentrant_buffer->_grent_struct : ((errno == ERANGE) ? (struct group *) Perl_reentrant_retry("getgrent") : 0))
+# endif /* if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1) */
# if !defined(getgrent) && GETGRENT_R_PROTO == REENTRANT_PROTO_S_SBI
-# define getgrent() (getgrent_r(&PL_reentrant_buffer->_getgrent_struct, PL_reentrant_buffer->_getgrent_buffer, PL_reentrant_buffer->_getgrent_size) ? &PL_reentrant_buffer->_getgrent_struct : 0)
-# endif
+# define getgrent() (getgrent_r(&PL_reentrant_buffer->_grent_struct, PL_reentrant_buffer->_grent_buffer, PL_reentrant_buffer->_grent_size) ? &PL_reentrant_buffer->_grent_struct : ((errno == ERANGE) ? (struct group *) Perl_reentrant_retry("getgrent") : 0))
+# endif /* if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1) */
# if !defined(getgrent) && GETGRENT_R_PROTO == REENTRANT_PROTO_I_SBI
-# define getgrent() (((errno = getgrent_r(&PL_reentrant_buffer->_getgrent_struct, PL_reentrant_buffer->_getgrent_buffer, PL_reentrant_buffer->_getgrent_size))) == 0 ? &PL_reentrant_buffer->_getgrent_struct : 0)
-# endif
+# define getgrent() ((PL_reentrant_retint = getgrent_r(&PL_reentrant_buffer->_grent_struct, PL_reentrant_buffer->_grent_buffer, PL_reentrant_buffer->_grent_size)) == 0 ? &PL_reentrant_buffer->_grent_struct : ((PL_reentrant_retint == ERANGE) ? (struct group *) Perl_reentrant_retry("getgrent") : 0))
+# endif /* if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1) */
# if !defined(getgrent) && GETGRENT_R_PROTO == REENTRANT_PROTO_I_SBIH
-# define getgrent() (((errno = getgrent_r(&PL_reentrant_buffer->_getgrent_struct, PL_reentrant_buffer->_getgrent_buffer, PL_reentrant_buffer->_getgrent_size, &PL_reentrant_buffer->_getgrent_fptr))) == 0 ? &PL_reentrant_buffer->_getgrent_struct : 0)
-# endif
+# define getgrent() ((PL_reentrant_retint = getgrent_r(&PL_reentrant_buffer->_grent_struct, PL_reentrant_buffer->_grent_buffer, PL_reentrant_buffer->_grent_size, &PL_reentrant_buffer->_grent_fptr)) == 0 ? &PL_reentrant_buffer->_grent_struct : ((PL_reentrant_retint == ERANGE) ? (struct group *) Perl_reentrant_retry("getgrent") : 0))
+# endif /* if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1) */
+# endif /* HAS_GETGRENT */
#endif /* HAS_GETGRENT_R */
#ifdef HAS_GETGRGID_R
+# if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1)
# undef getgrgid
# if !defined(getgrgid) && GETGRGID_R_PROTO == REENTRANT_PROTO_I_TSBWR
-# define getgrgid(a) (((errno = getgrgid_r(a, &PL_reentrant_buffer->_getgrent_struct, PL_reentrant_buffer->_getgrent_buffer, PL_reentrant_buffer->_getgrent_size, &PL_reentrant_buffer->_getgrent_ptr))) == 0 ? PL_reentrant_buffer->_getgrent_ptr : 0)
-# endif
+# define getgrgid(a) ((PL_reentrant_retint = getgrgid_r(a, &PL_reentrant_buffer->_grent_struct, PL_reentrant_buffer->_grent_buffer, PL_reentrant_buffer->_grent_size, &PL_reentrant_buffer->_grent_ptr)) == 0 ? PL_reentrant_buffer->_grent_ptr : ((PL_reentrant_retint == ERANGE) ? (struct group *) Perl_reentrant_retry("getgrgid", a) : 0))
+# endif /* if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1) */
# if !defined(getgrgid) && GETGRGID_R_PROTO == REENTRANT_PROTO_I_TSBIR
-# define getgrgid(a) (((errno = getgrgid_r(a, &PL_reentrant_buffer->_getgrent_struct, PL_reentrant_buffer->_getgrent_buffer, PL_reentrant_buffer->_getgrent_size, &PL_reentrant_buffer->_getgrent_ptr))) == 0 ? PL_reentrant_buffer->_getgrent_ptr : 0)
-# endif
+# define getgrgid(a) ((PL_reentrant_retint = getgrgid_r(a, &PL_reentrant_buffer->_grent_struct, PL_reentrant_buffer->_grent_buffer, PL_reentrant_buffer->_grent_size, &PL_reentrant_buffer->_grent_ptr)) == 0 ? PL_reentrant_buffer->_grent_ptr : ((PL_reentrant_retint == ERANGE) ? (struct group *) Perl_reentrant_retry("getgrgid", a) : 0))
+# endif /* if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1) */
# if !defined(getgrgid) && GETGRGID_R_PROTO == REENTRANT_PROTO_I_TSBI
-# define getgrgid(a) (((errno = getgrgid_r(a, &PL_reentrant_buffer->_getgrent_struct, PL_reentrant_buffer->_getgrent_buffer, PL_reentrant_buffer->_getgrent_size))) == 0 ? &PL_reentrant_buffer->_getgrent_struct : 0)
-# endif
+# define getgrgid(a) ((PL_reentrant_retint = getgrgid_r(a, &PL_reentrant_buffer->_grent_struct, PL_reentrant_buffer->_grent_buffer, PL_reentrant_buffer->_grent_size)) == 0 ? &PL_reentrant_buffer->_grent_struct : ((PL_reentrant_retint == ERANGE) ? (struct group *) Perl_reentrant_retry("getgrgid", a) : 0))
+# endif /* if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1) */
# if !defined(getgrgid) && GETGRGID_R_PROTO == REENTRANT_PROTO_S_TSBI
-# define getgrgid(a) (getgrgid_r(a, &PL_reentrant_buffer->_getgrent_struct, PL_reentrant_buffer->_getgrent_buffer, PL_reentrant_buffer->_getgrent_size) ? &PL_reentrant_buffer->_getgrent_struct : 0)
-# endif
+# define getgrgid(a) (getgrgid_r(a, &PL_reentrant_buffer->_grent_struct, PL_reentrant_buffer->_grent_buffer, PL_reentrant_buffer->_grent_size) ? &PL_reentrant_buffer->_grent_struct : ((errno == ERANGE) ? (struct group *) Perl_reentrant_retry("getgrgid", a) : 0))
+# endif /* if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1) */
+# endif /* HAS_GETGRGID */
#endif /* HAS_GETGRGID_R */
#ifdef HAS_GETGRNAM_R
+# if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1)
# undef getgrnam
# if !defined(getgrnam) && GETGRNAM_R_PROTO == REENTRANT_PROTO_I_CSBWR
-# define getgrnam(a) (((errno = getgrnam_r(a, &PL_reentrant_buffer->_getgrent_struct, PL_reentrant_buffer->_getgrent_buffer, PL_reentrant_buffer->_getgrent_size, &PL_reentrant_buffer->_getgrent_ptr))) == 0 ? PL_reentrant_buffer->_getgrent_ptr : 0)
-# endif
+# define getgrnam(a) ((PL_reentrant_retint = getgrnam_r(a, &PL_reentrant_buffer->_grent_struct, PL_reentrant_buffer->_grent_buffer, PL_reentrant_buffer->_grent_size, &PL_reentrant_buffer->_grent_ptr)) == 0 ? PL_reentrant_buffer->_grent_ptr : ((PL_reentrant_retint == ERANGE) ? (struct group *) Perl_reentrant_retry("getgrnam", a) : 0))
+# endif /* if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1) */
# if !defined(getgrnam) && GETGRNAM_R_PROTO == REENTRANT_PROTO_I_CSBIR
-# define getgrnam(a) (((errno = getgrnam_r(a, &PL_reentrant_buffer->_getgrent_struct, PL_reentrant_buffer->_getgrent_buffer, PL_reentrant_buffer->_getgrent_size, &PL_reentrant_buffer->_getgrent_ptr))) == 0 ? PL_reentrant_buffer->_getgrent_ptr : 0)
-# endif
+# define getgrnam(a) ((PL_reentrant_retint = getgrnam_r(a, &PL_reentrant_buffer->_grent_struct, PL_reentrant_buffer->_grent_buffer, PL_reentrant_buffer->_grent_size, &PL_reentrant_buffer->_grent_ptr)) == 0 ? PL_reentrant_buffer->_grent_ptr : ((PL_reentrant_retint == ERANGE) ? (struct group *) Perl_reentrant_retry("getgrnam", a) : 0))
+# endif /* if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1) */
# if !defined(getgrnam) && GETGRNAM_R_PROTO == REENTRANT_PROTO_S_CBI
-# define getgrnam(a) (getgrnam_r(a, PL_reentrant_buffer->_getgrent_buffer, PL_reentrant_buffer->_getgrent_size) ? PL_reentrant_buffer->_getgrent_buffer : 0)
-# endif
+# define getgrnam(a) (getgrnam_r(a, PL_reentrant_buffer->_grent_buffer, PL_reentrant_buffer->_grent_size) ? PL_reentrant_buffer->_grent_buffer : ((errno == ERANGE) ? (struct group *) Perl_reentrant_retry("getgrnam", a) : 0))
+# endif /* if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1) */
# if !defined(getgrnam) && GETGRNAM_R_PROTO == REENTRANT_PROTO_I_CSBI
-# define getgrnam(a) (((errno = getgrnam_r(a, &PL_reentrant_buffer->_getgrent_struct, PL_reentrant_buffer->_getgrent_buffer, PL_reentrant_buffer->_getgrent_size))) == 0 ? &PL_reentrant_buffer->_getgrent_struct : 0)
-# endif
+# define getgrnam(a) ((PL_reentrant_retint = getgrnam_r(a, &PL_reentrant_buffer->_grent_struct, PL_reentrant_buffer->_grent_buffer, PL_reentrant_buffer->_grent_size)) == 0 ? &PL_reentrant_buffer->_grent_struct : ((PL_reentrant_retint == ERANGE) ? (struct group *) Perl_reentrant_retry("getgrnam", a) : 0))
+# endif /* if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1) */
# if !defined(getgrnam) && GETGRNAM_R_PROTO == REENTRANT_PROTO_S_CSBI
-# define getgrnam(a) (getgrnam_r(a, &PL_reentrant_buffer->_getgrent_struct, PL_reentrant_buffer->_getgrent_buffer, PL_reentrant_buffer->_getgrent_size) ? &PL_reentrant_buffer->_getgrent_struct : 0)
-# endif
+# define getgrnam(a) (getgrnam_r(a, &PL_reentrant_buffer->_grent_struct, PL_reentrant_buffer->_grent_buffer, PL_reentrant_buffer->_grent_size) ? &PL_reentrant_buffer->_grent_struct : ((errno == ERANGE) ? (struct group *) Perl_reentrant_retry("getgrnam", a) : 0))
+# endif /* if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1) */
+# endif /* HAS_GETGRNAM */
#endif /* HAS_GETGRNAM_R */
#ifdef HAS_GETHOSTBYADDR_R
+# if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1)
# undef gethostbyaddr
# if !defined(gethostbyaddr) && GETHOSTBYADDR_R_PROTO == REENTRANT_PROTO_I_CWISBWRE
-# define gethostbyaddr(a, b, c) (((errno = gethostbyaddr_r(a, b, c, &PL_reentrant_buffer->_gethostent_struct, PL_reentrant_buffer->_gethostent_buffer, PL_reentrant_buffer->_gethostent_size, &PL_reentrant_buffer->_gethostent_ptr, &PL_reentrant_buffer->_gethostent_errno))) == 0 ? PL_reentrant_buffer->_gethostent_ptr : 0)
-# endif
+# define gethostbyaddr(a, b, c) ((PL_reentrant_retint = gethostbyaddr_r(a, b, c, &PL_reentrant_buffer->_hostent_struct, PL_reentrant_buffer->_hostent_buffer, PL_reentrant_buffer->_hostent_size, &PL_reentrant_buffer->_hostent_ptr, &PL_reentrant_buffer->_hostent_errno)) == 0 ? PL_reentrant_buffer->_hostent_ptr : ((PL_reentrant_retint == ERANGE) ? (struct hostent *) Perl_reentrant_retry("gethostbyaddr", a, b, c) : 0))
+# endif /* if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1) */
# if !defined(gethostbyaddr) && GETHOSTBYADDR_R_PROTO == REENTRANT_PROTO_S_CWISBWIE
-# define gethostbyaddr(a, b, c) (gethostbyaddr_r(a, b, c, &PL_reentrant_buffer->_gethostent_struct, PL_reentrant_buffer->_gethostent_buffer, PL_reentrant_buffer->_gethostent_size, PL_reentrant_buffer->_gethostent_size, &PL_reentrant_buffer->_gethostent_errno) ? &PL_reentrant_buffer->_gethostent_struct : 0)
-# endif
+# define gethostbyaddr(a, b, c) (gethostbyaddr_r(a, b, c, &PL_reentrant_buffer->_hostent_struct, PL_reentrant_buffer->_hostent_buffer, PL_reentrant_buffer->_hostent_size, PL_reentrant_buffer->_hostent_size, &PL_reentrant_buffer->_hostent_errno) ? &PL_reentrant_buffer->_hostent_struct : ((errno == ERANGE) ? (struct hostent *) Perl_reentrant_retry("gethostbyaddr", a, b, c) : 0))
+# endif /* if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1) */
# if !defined(gethostbyaddr) && GETHOSTBYADDR_R_PROTO == REENTRANT_PROTO_S_CWISBIE
-# define gethostbyaddr(a, b, c) (gethostbyaddr_r(a, b, c, &PL_reentrant_buffer->_gethostent_struct, PL_reentrant_buffer->_gethostent_buffer, PL_reentrant_buffer->_gethostent_size, &PL_reentrant_buffer->_gethostent_errno) ? &PL_reentrant_buffer->_gethostent_struct : 0)
-# endif
+# define gethostbyaddr(a, b, c) (gethostbyaddr_r(a, b, c, &PL_reentrant_buffer->_hostent_struct, PL_reentrant_buffer->_hostent_buffer, PL_reentrant_buffer->_hostent_size, &PL_reentrant_buffer->_hostent_errno) ? &PL_reentrant_buffer->_hostent_struct : ((errno == ERANGE) ? (struct hostent *) Perl_reentrant_retry("gethostbyaddr", a, b, c) : 0))
+# endif /* if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1) */
# if !defined(gethostbyaddr) && GETHOSTBYADDR_R_PROTO == REENTRANT_PROTO_S_TWISBIE
-# define gethostbyaddr(a, b, c) (gethostbyaddr_r(a, b, c, &PL_reentrant_buffer->_gethostent_struct, PL_reentrant_buffer->_gethostent_buffer, PL_reentrant_buffer->_gethostent_size, &PL_reentrant_buffer->_gethostent_errno) ? &PL_reentrant_buffer->_gethostent_struct : 0)
-# endif
+# define gethostbyaddr(a, b, c) (gethostbyaddr_r(a, b, c, &PL_reentrant_buffer->_hostent_struct, PL_reentrant_buffer->_hostent_buffer, PL_reentrant_buffer->_hostent_size, &PL_reentrant_buffer->_hostent_errno) ? &PL_reentrant_buffer->_hostent_struct : ((errno == ERANGE) ? (struct hostent *) Perl_reentrant_retry("gethostbyaddr", a, b, c) : 0))
+# endif /* if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1) */
# if !defined(gethostbyaddr) && GETHOSTBYADDR_R_PROTO == REENTRANT_PROTO_S_CIISBIE
-# define gethostbyaddr(a, b, c) (gethostbyaddr_r(a, b, c, &PL_reentrant_buffer->_gethostent_struct, PL_reentrant_buffer->_gethostent_buffer, PL_reentrant_buffer->_gethostent_size, &PL_reentrant_buffer->_gethostent_errno) ? &PL_reentrant_buffer->_gethostent_struct : 0)
-# endif
+# define gethostbyaddr(a, b, c) (gethostbyaddr_r(a, b, c, &PL_reentrant_buffer->_hostent_struct, PL_reentrant_buffer->_hostent_buffer, PL_reentrant_buffer->_hostent_size, &PL_reentrant_buffer->_hostent_errno) ? &PL_reentrant_buffer->_hostent_struct : ((errno == ERANGE) ? (struct hostent *) Perl_reentrant_retry("gethostbyaddr", a, b, c) : 0))
+# endif /* if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1) */
# if !defined(gethostbyaddr) && GETHOSTBYADDR_R_PROTO == REENTRANT_PROTO_S_CSBIE
-# define gethostbyaddr(a, b, c) (gethostbyaddr_r(a, b, c, PL_reentrant_buffer->_gethostent_size, &PL_reentrant_buffer->_gethostent_errno) ? 1 : 0)
-# endif
+# define gethostbyaddr(a, b, c) (gethostbyaddr_r(a, b, c, PL_reentrant_buffer->_hostent_size, &PL_reentrant_buffer->_hostent_errno) ? 1 : ((errno == ERANGE) ? (struct hostent *) Perl_reentrant_retry("gethostbyaddr", a, b, c) : 0))
+# endif /* if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1) */
# if !defined(gethostbyaddr) && GETHOSTBYADDR_R_PROTO == REENTRANT_PROTO_S_TSBIE
-# define gethostbyaddr(a, b, c) (gethostbyaddr_r(a, b, c, PL_reentrant_buffer->_gethostent_size, &PL_reentrant_buffer->_gethostent_errno) ? 1 : 0)
-# endif
+# define gethostbyaddr(a, b, c) (gethostbyaddr_r(a, b, c, PL_reentrant_buffer->_hostent_size, &PL_reentrant_buffer->_hostent_errno) ? 1 : ((errno == ERANGE) ? (struct hostent *) Perl_reentrant_retry("gethostbyaddr", a, b, c) : 0))
+# endif /* if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1) */
# if !defined(gethostbyaddr) && GETHOSTBYADDR_R_PROTO == REENTRANT_PROTO_I_CWISD
-# define gethostbyaddr(a, b, c) (((errno = gethostbyaddr_r(a, b, c, &PL_reentrant_buffer->_gethostent_struct, &PL_reentrant_buffer->_gethostent_data))) == 0 ? &PL_reentrant_buffer->_gethostent_struct : 0)
-# endif
+# define gethostbyaddr(a, b, c) ((PL_reentrant_retint = gethostbyaddr_r(a, b, c, &PL_reentrant_buffer->_hostent_struct, &PL_reentrant_buffer->_hostent_data)) == 0 ? &PL_reentrant_buffer->_hostent_struct : ((PL_reentrant_retint == ERANGE) ? (struct hostent *) Perl_reentrant_retry("gethostbyaddr", a, b, c) : 0))
+# endif /* if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1) */
# if !defined(gethostbyaddr) && GETHOSTBYADDR_R_PROTO == REENTRANT_PROTO_I_CIISD
-# define gethostbyaddr(a, b, c) (((errno = gethostbyaddr_r(a, b, c, &PL_reentrant_buffer->_gethostent_struct, &PL_reentrant_buffer->_gethostent_data))) == 0 ? &PL_reentrant_buffer->_gethostent_struct : 0)
-# endif
+# define gethostbyaddr(a, b, c) ((PL_reentrant_retint = gethostbyaddr_r(a, b, c, &PL_reentrant_buffer->_hostent_struct, &PL_reentrant_buffer->_hostent_data)) == 0 ? &PL_reentrant_buffer->_hostent_struct : ((PL_reentrant_retint == ERANGE) ? (struct hostent *) Perl_reentrant_retry("gethostbyaddr", a, b, c) : 0))
+# endif /* if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1) */
# if !defined(gethostbyaddr) && GETHOSTBYADDR_R_PROTO == REENTRANT_PROTO_I_CII
-# define gethostbyaddr(a, b, c) (((errno = gethostbyaddr_r(a, b, c))) == 0 ? 1 : 0)
-# endif
+# define gethostbyaddr(a, b, c) ((PL_reentrant_retint = gethostbyaddr_r(a, b, c)) == 0 ? 1 : ((PL_reentrant_retint == ERANGE) ? (struct hostent *) Perl_reentrant_retry("gethostbyaddr", a, b, c) : 0))
+# endif /* if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1) */
+# if !defined(gethostbyaddr) && GETHOSTBYADDR_R_PROTO == REENTRANT_PROTO_I_TsISBWRE
+# define gethostbyaddr(a, b, c) ((PL_reentrant_retint = gethostbyaddr_r(a, b, c, &PL_reentrant_buffer->_hostent_struct, PL_reentrant_buffer->_hostent_buffer, PL_reentrant_buffer->_hostent_size, &PL_reentrant_buffer->_hostent_ptr, &PL_reentrant_buffer->_hostent_errno)) == 0 ? PL_reentrant_buffer->_hostent_ptr : ((PL_reentrant_retint == ERANGE) ? (struct hostent *) Perl_reentrant_retry("gethostbyaddr", a, b, c) : 0))
+# endif /* if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1) */
+# endif /* HAS_GETHOSTBYADDR */
#endif /* HAS_GETHOSTBYADDR_R */
#ifdef HAS_GETHOSTBYNAME_R
+# if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1)
# undef gethostbyname
# if !defined(gethostbyname) && GETHOSTBYNAME_R_PROTO == REENTRANT_PROTO_I_CSBWRE
-# define gethostbyname(a) (((errno = gethostbyname_r(a, &PL_reentrant_buffer->_gethostent_struct, PL_reentrant_buffer->_gethostent_buffer, PL_reentrant_buffer->_gethostent_size, &PL_reentrant_buffer->_gethostent_ptr, &PL_reentrant_buffer->_gethostent_errno))) == 0 ? PL_reentrant_buffer->_gethostent_ptr : 0)
-# endif
+# define gethostbyname(a) ((PL_reentrant_retint = gethostbyname_r(a, &PL_reentrant_buffer->_hostent_struct, PL_reentrant_buffer->_hostent_buffer, PL_reentrant_buffer->_hostent_size, &PL_reentrant_buffer->_hostent_ptr, &PL_reentrant_buffer->_hostent_errno)) == 0 ? PL_reentrant_buffer->_hostent_ptr : ((PL_reentrant_retint == ERANGE) ? (struct hostent *) Perl_reentrant_retry("gethostbyname", a) : 0))
+# endif /* if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1) */
# if !defined(gethostbyname) && GETHOSTBYNAME_R_PROTO == REENTRANT_PROTO_S_CSBIE
-# define gethostbyname(a) (gethostbyname_r(a, &PL_reentrant_buffer->_gethostent_struct, PL_reentrant_buffer->_gethostent_buffer, PL_reentrant_buffer->_gethostent_size, &PL_reentrant_buffer->_gethostent_errno) ? &PL_reentrant_buffer->_gethostent_struct : 0)
-# endif
+# define gethostbyname(a) (gethostbyname_r(a, &PL_reentrant_buffer->_hostent_struct, PL_reentrant_buffer->_hostent_buffer, PL_reentrant_buffer->_hostent_size, &PL_reentrant_buffer->_hostent_errno) ? &PL_reentrant_buffer->_hostent_struct : ((errno == ERANGE) ? (struct hostent *) Perl_reentrant_retry("gethostbyname", a) : 0))
+# endif /* if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1) */
# if !defined(gethostbyname) && GETHOSTBYNAME_R_PROTO == REENTRANT_PROTO_I_CSD
-# define gethostbyname(a) (((errno = gethostbyname_r(a, &PL_reentrant_buffer->_gethostent_struct, &PL_reentrant_buffer->_gethostent_data))) == 0 ? &PL_reentrant_buffer->_gethostent_struct : 0)
-# endif
+# define gethostbyname(a) ((PL_reentrant_retint = gethostbyname_r(a, &PL_reentrant_buffer->_hostent_struct, &PL_reentrant_buffer->_hostent_data)) == 0 ? &PL_reentrant_buffer->_hostent_struct : ((PL_reentrant_retint == ERANGE) ? (struct hostent *) Perl_reentrant_retry("gethostbyname", a) : 0))
+# endif /* if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1) */
+# endif /* HAS_GETHOSTBYNAME */
#endif /* HAS_GETHOSTBYNAME_R */
#ifdef HAS_GETHOSTENT_R
+# if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1)
# undef gethostent
# if !defined(gethostent) && GETHOSTENT_R_PROTO == REENTRANT_PROTO_I_SBWRE
-# define gethostent() (((errno = gethostent_r(&PL_reentrant_buffer->_gethostent_struct, PL_reentrant_buffer->_gethostent_buffer, PL_reentrant_buffer->_gethostent_size, &PL_reentrant_buffer->_gethostent_ptr, &PL_reentrant_buffer->_gethostent_errno))) == 0 ? PL_reentrant_buffer->_gethostent_ptr : 0)
-# endif
+# define gethostent() ((PL_reentrant_retint = gethostent_r(&PL_reentrant_buffer->_hostent_struct, PL_reentrant_buffer->_hostent_buffer, PL_reentrant_buffer->_hostent_size, &PL_reentrant_buffer->_hostent_ptr, &PL_reentrant_buffer->_hostent_errno)) == 0 ? PL_reentrant_buffer->_hostent_ptr : ((PL_reentrant_retint == ERANGE) ? (struct hostent *) Perl_reentrant_retry("gethostent") : 0))
+# endif /* if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1) */
# if !defined(gethostent) && GETHOSTENT_R_PROTO == REENTRANT_PROTO_I_SBIE
-# define gethostent() (((errno = gethostent_r(&PL_reentrant_buffer->_gethostent_struct, PL_reentrant_buffer->_gethostent_buffer, PL_reentrant_buffer->_gethostent_size, &PL_reentrant_buffer->_gethostent_errno))) == 0 ? &PL_reentrant_buffer->_gethostent_struct : 0)
-# endif
+# define gethostent() ((PL_reentrant_retint = gethostent_r(&PL_reentrant_buffer->_hostent_struct, PL_reentrant_buffer->_hostent_buffer, PL_reentrant_buffer->_hostent_size, &PL_reentrant_buffer->_hostent_errno)) == 0 ? &PL_reentrant_buffer->_hostent_struct : ((PL_reentrant_retint == ERANGE) ? (struct hostent *) Perl_reentrant_retry("gethostent") : 0))
+# endif /* if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1) */
# if !defined(gethostent) && GETHOSTENT_R_PROTO == REENTRANT_PROTO_S_SBIE
-# define gethostent() (gethostent_r(&PL_reentrant_buffer->_gethostent_struct, PL_reentrant_buffer->_gethostent_buffer, PL_reentrant_buffer->_gethostent_size, &PL_reentrant_buffer->_gethostent_errno) ? &PL_reentrant_buffer->_gethostent_struct : 0)
-# endif
+# define gethostent() (gethostent_r(&PL_reentrant_buffer->_hostent_struct, PL_reentrant_buffer->_hostent_buffer, PL_reentrant_buffer->_hostent_size, &PL_reentrant_buffer->_hostent_errno) ? &PL_reentrant_buffer->_hostent_struct : ((errno == ERANGE) ? (struct hostent *) Perl_reentrant_retry("gethostent") : 0))
+# endif /* if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1) */
# if !defined(gethostent) && GETHOSTENT_R_PROTO == REENTRANT_PROTO_S_SBI
-# define gethostent() (gethostent_r(&PL_reentrant_buffer->_gethostent_struct, PL_reentrant_buffer->_gethostent_buffer, PL_reentrant_buffer->_gethostent_size) ? &PL_reentrant_buffer->_gethostent_struct : 0)
-# endif
+# define gethostent() (gethostent_r(&PL_reentrant_buffer->_hostent_struct, PL_reentrant_buffer->_hostent_buffer, PL_reentrant_buffer->_hostent_size) ? &PL_reentrant_buffer->_hostent_struct : ((errno == ERANGE) ? (struct hostent *) Perl_reentrant_retry("gethostent") : 0))
+# endif /* if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1) */
# if !defined(gethostent) && GETHOSTENT_R_PROTO == REENTRANT_PROTO_I_SBI
-# define gethostent() (((errno = gethostent_r(&PL_reentrant_buffer->_gethostent_struct, PL_reentrant_buffer->_gethostent_buffer, PL_reentrant_buffer->_gethostent_size))) == 0 ? &PL_reentrant_buffer->_gethostent_struct : 0)
-# endif
+# define gethostent() ((PL_reentrant_retint = gethostent_r(&PL_reentrant_buffer->_hostent_struct, PL_reentrant_buffer->_hostent_buffer, PL_reentrant_buffer->_hostent_size)) == 0 ? &PL_reentrant_buffer->_hostent_struct : ((PL_reentrant_retint == ERANGE) ? (struct hostent *) Perl_reentrant_retry("gethostent") : 0))
+# endif /* if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1) */
# if !defined(gethostent) && GETHOSTENT_R_PROTO == REENTRANT_PROTO_I_SD
-# define gethostent() (((errno = gethostent_r(&PL_reentrant_buffer->_gethostent_struct, &PL_reentrant_buffer->_gethostent_data))) == 0 ? &PL_reentrant_buffer->_gethostent_struct : 0)
-# endif
+# define gethostent() ((PL_reentrant_retint = gethostent_r(&PL_reentrant_buffer->_hostent_struct, &PL_reentrant_buffer->_hostent_data)) == 0 ? &PL_reentrant_buffer->_hostent_struct : ((PL_reentrant_retint == ERANGE) ? (struct hostent *) Perl_reentrant_retry("gethostent") : 0))
+# endif /* if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1) */
+# endif /* HAS_GETHOSTENT */
#endif /* HAS_GETHOSTENT_R */
#ifdef HAS_GETLOGIN_R
+# if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1)
# undef getlogin
# if !defined(getlogin) && GETLOGIN_R_PROTO == REENTRANT_PROTO_I_BW
-# define getlogin() (((errno = getlogin_r(PL_reentrant_buffer->_getlogin_buffer, PL_reentrant_buffer->_getlogin_size))) == 0 ? PL_reentrant_buffer->_getlogin_buffer : 0)
-# endif
+# define getlogin() ((PL_reentrant_retint = getlogin_r(PL_reentrant_buffer->_getlogin_buffer, PL_reentrant_buffer->_getlogin_size)) == 0 ? PL_reentrant_buffer->_getlogin_buffer : ((PL_reentrant_retint == ERANGE) ? (char *) Perl_reentrant_retry("getlogin") : 0))
+# endif /* if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1) */
# if !defined(getlogin) && GETLOGIN_R_PROTO == REENTRANT_PROTO_I_BI
-# define getlogin() (((errno = getlogin_r(PL_reentrant_buffer->_getlogin_buffer, PL_reentrant_buffer->_getlogin_size))) == 0 ? PL_reentrant_buffer->_getlogin_buffer : 0)
-# endif
+# define getlogin() ((PL_reentrant_retint = getlogin_r(PL_reentrant_buffer->_getlogin_buffer, PL_reentrant_buffer->_getlogin_size)) == 0 ? PL_reentrant_buffer->_getlogin_buffer : ((PL_reentrant_retint == ERANGE) ? (char *) Perl_reentrant_retry("getlogin") : 0))
+# endif /* if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1) */
# if !defined(getlogin) && GETLOGIN_R_PROTO == REENTRANT_PROTO_B_BW
# define getlogin() getlogin_r(PL_reentrant_buffer->_getlogin_buffer, PL_reentrant_buffer->_getlogin_size)
-# endif
+# endif /* if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1) */
# if !defined(getlogin) && GETLOGIN_R_PROTO == REENTRANT_PROTO_B_BI
# define getlogin() getlogin_r(PL_reentrant_buffer->_getlogin_buffer, PL_reentrant_buffer->_getlogin_size)
-# endif
+# endif /* if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1) */
+# endif /* HAS_GETLOGIN */
#endif /* HAS_GETLOGIN_R */
#ifdef HAS_GETNETBYADDR_R
+# if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1)
# undef getnetbyaddr
# if !defined(getnetbyaddr) && GETNETBYADDR_R_PROTO == REENTRANT_PROTO_I_UISBWRE
-# define getnetbyaddr(a, b) (((errno = getnetbyaddr_r(a, b, &PL_reentrant_buffer->_getnetent_struct, PL_reentrant_buffer->_getnetent_buffer, PL_reentrant_buffer->_getnetent_size, &PL_reentrant_buffer->_getnetent_ptr, &PL_reentrant_buffer->_getnetent_errno))) == 0 ? PL_reentrant_buffer->_getnetent_ptr : 0)
-# endif
+# define getnetbyaddr(a, b) ((PL_reentrant_retint = getnetbyaddr_r(a, b, &PL_reentrant_buffer->_netent_struct, PL_reentrant_buffer->_netent_buffer, PL_reentrant_buffer->_netent_size, &PL_reentrant_buffer->_netent_ptr, &PL_reentrant_buffer->_netent_errno)) == 0 ? PL_reentrant_buffer->_netent_ptr : ((PL_reentrant_retint == ERANGE) ? (struct netent *) Perl_reentrant_retry("getnetbyaddr", a, b) : 0))
+# endif /* if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1) */
# if !defined(getnetbyaddr) && GETNETBYADDR_R_PROTO == REENTRANT_PROTO_I_LISBI
-# define getnetbyaddr(a, b) (((errno = getnetbyaddr_r(a, b, &PL_reentrant_buffer->_getnetent_struct, PL_reentrant_buffer->_getnetent_buffer, PL_reentrant_buffer->_getnetent_size))) == 0 ? &PL_reentrant_buffer->_getnetent_struct : 0)
-# endif
+# define getnetbyaddr(a, b) ((PL_reentrant_retint = getnetbyaddr_r(a, b, &PL_reentrant_buffer->_netent_struct, PL_reentrant_buffer->_netent_buffer, PL_reentrant_buffer->_netent_size)) == 0 ? &PL_reentrant_buffer->_netent_struct : ((PL_reentrant_retint == ERANGE) ? (struct netent *) Perl_reentrant_retry("getnetbyaddr", a, b) : 0))
+# endif /* if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1) */
# if !defined(getnetbyaddr) && GETNETBYADDR_R_PROTO == REENTRANT_PROTO_S_TISBI
-# define getnetbyaddr(a, b) (getnetbyaddr_r(a, b, &PL_reentrant_buffer->_getnetent_struct, PL_reentrant_buffer->_getnetent_buffer, PL_reentrant_buffer->_getnetent_size) ? &PL_reentrant_buffer->_getnetent_struct : 0)
-# endif
+# define getnetbyaddr(a, b) (getnetbyaddr_r(a, b, &PL_reentrant_buffer->_netent_struct, PL_reentrant_buffer->_netent_buffer, PL_reentrant_buffer->_netent_size) ? &PL_reentrant_buffer->_netent_struct : ((errno == ERANGE) ? (struct netent *) Perl_reentrant_retry("getnetbyaddr", a, b) : 0))
+# endif /* if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1) */
# if !defined(getnetbyaddr) && GETNETBYADDR_R_PROTO == REENTRANT_PROTO_S_LISBI
-# define getnetbyaddr(a, b) (getnetbyaddr_r(a, b, &PL_reentrant_buffer->_getnetent_struct, PL_reentrant_buffer->_getnetent_buffer, PL_reentrant_buffer->_getnetent_size) ? &PL_reentrant_buffer->_getnetent_struct : 0)
-# endif
+# define getnetbyaddr(a, b) (getnetbyaddr_r(a, b, &PL_reentrant_buffer->_netent_struct, PL_reentrant_buffer->_netent_buffer, PL_reentrant_buffer->_netent_size) ? &PL_reentrant_buffer->_netent_struct : ((errno == ERANGE) ? (struct netent *) Perl_reentrant_retry("getnetbyaddr", a, b) : 0))
+# endif /* if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1) */
# if !defined(getnetbyaddr) && GETNETBYADDR_R_PROTO == REENTRANT_PROTO_I_TISD
-# define getnetbyaddr(a, b) (((errno = getnetbyaddr_r(a, b, &PL_reentrant_buffer->_getnetent_struct, &PL_reentrant_buffer->_getnetent_data))) == 0 ? &PL_reentrant_buffer->_getnetent_struct : 0)
-# endif
+# define getnetbyaddr(a, b) ((PL_reentrant_retint = getnetbyaddr_r(a, b, &PL_reentrant_buffer->_netent_struct, &PL_reentrant_buffer->_netent_data)) == 0 ? &PL_reentrant_buffer->_netent_struct : ((PL_reentrant_retint == ERANGE) ? (struct netent *) Perl_reentrant_retry("getnetbyaddr", a, b) : 0))
+# endif /* if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1) */
# if !defined(getnetbyaddr) && GETNETBYADDR_R_PROTO == REENTRANT_PROTO_I_LISD
-# define getnetbyaddr(a, b) (((errno = getnetbyaddr_r(a, b, &PL_reentrant_buffer->_getnetent_struct, &PL_reentrant_buffer->_getnetent_data))) == 0 ? &PL_reentrant_buffer->_getnetent_struct : 0)
-# endif
+# define getnetbyaddr(a, b) ((PL_reentrant_retint = getnetbyaddr_r(a, b, &PL_reentrant_buffer->_netent_struct, &PL_reentrant_buffer->_netent_data)) == 0 ? &PL_reentrant_buffer->_netent_struct : ((PL_reentrant_retint == ERANGE) ? (struct netent *) Perl_reentrant_retry("getnetbyaddr", a, b) : 0))
+# endif /* if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1) */
# if !defined(getnetbyaddr) && GETNETBYADDR_R_PROTO == REENTRANT_PROTO_I_IISD
-# define getnetbyaddr(a, b) (((errno = getnetbyaddr_r(a, b, &PL_reentrant_buffer->_getnetent_struct, &PL_reentrant_buffer->_getnetent_data))) == 0 ? &PL_reentrant_buffer->_getnetent_struct : 0)
-# endif
+# define getnetbyaddr(a, b) ((PL_reentrant_retint = getnetbyaddr_r(a, b, &PL_reentrant_buffer->_netent_struct, &PL_reentrant_buffer->_netent_data)) == 0 ? &PL_reentrant_buffer->_netent_struct : ((PL_reentrant_retint == ERANGE) ? (struct netent *) Perl_reentrant_retry("getnetbyaddr", a, b) : 0))
+# endif /* if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1) */
+# if !defined(getnetbyaddr) && GETNETBYADDR_R_PROTO == REENTRANT_PROTO_I_uISBWRE
+# define getnetbyaddr(a, b) ((PL_reentrant_retint = getnetbyaddr_r(a, b, &PL_reentrant_buffer->_netent_struct, PL_reentrant_buffer->_netent_buffer, PL_reentrant_buffer->_netent_size, &PL_reentrant_buffer->_netent_ptr, &PL_reentrant_buffer->_netent_errno)) == 0 ? PL_reentrant_buffer->_netent_ptr : ((PL_reentrant_retint == ERANGE) ? (struct netent *) Perl_reentrant_retry("getnetbyaddr", a, b) : 0))
+# endif /* if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1) */
+# endif /* HAS_GETNETBYADDR */
#endif /* HAS_GETNETBYADDR_R */
#ifdef HAS_GETNETBYNAME_R
+# if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1)
# undef getnetbyname
# if !defined(getnetbyname) && GETNETBYNAME_R_PROTO == REENTRANT_PROTO_I_CSBWRE
-# define getnetbyname(a) (((errno = getnetbyname_r(a, &PL_reentrant_buffer->_getnetent_struct, PL_reentrant_buffer->_getnetent_buffer, PL_reentrant_buffer->_getnetent_size, &PL_reentrant_buffer->_getnetent_ptr, &PL_reentrant_buffer->_getnetent_errno))) == 0 ? PL_reentrant_buffer->_getnetent_ptr : 0)
-# endif
+# define getnetbyname(a) ((PL_reentrant_retint = getnetbyname_r(a, &PL_reentrant_buffer->_netent_struct, PL_reentrant_buffer->_netent_buffer, PL_reentrant_buffer->_netent_size, &PL_reentrant_buffer->_netent_ptr, &PL_reentrant_buffer->_netent_errno)) == 0 ? PL_reentrant_buffer->_netent_ptr : ((PL_reentrant_retint == ERANGE) ? (struct netent *) Perl_reentrant_retry("getnetbyname", a) : 0))
+# endif /* if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1) */
# if !defined(getnetbyname) && GETNETBYNAME_R_PROTO == REENTRANT_PROTO_I_CSBI
-# define getnetbyname(a) (((errno = getnetbyname_r(a, &PL_reentrant_buffer->_getnetent_struct, PL_reentrant_buffer->_getnetent_buffer, PL_reentrant_buffer->_getnetent_size))) == 0 ? &PL_reentrant_buffer->_getnetent_struct : 0)
-# endif
+# define getnetbyname(a) ((PL_reentrant_retint = getnetbyname_r(a, &PL_reentrant_buffer->_netent_struct, PL_reentrant_buffer->_netent_buffer, PL_reentrant_buffer->_netent_size)) == 0 ? &PL_reentrant_buffer->_netent_struct : ((PL_reentrant_retint == ERANGE) ? (struct netent *) Perl_reentrant_retry("getnetbyname", a) : 0))
+# endif /* if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1) */
# if !defined(getnetbyname) && GETNETBYNAME_R_PROTO == REENTRANT_PROTO_S_CSBI
-# define getnetbyname(a) (getnetbyname_r(a, &PL_reentrant_buffer->_getnetent_struct, PL_reentrant_buffer->_getnetent_buffer, PL_reentrant_buffer->_getnetent_size) ? &PL_reentrant_buffer->_getnetent_struct : 0)
-# endif
+# define getnetbyname(a) (getnetbyname_r(a, &PL_reentrant_buffer->_netent_struct, PL_reentrant_buffer->_netent_buffer, PL_reentrant_buffer->_netent_size) ? &PL_reentrant_buffer->_netent_struct : ((errno == ERANGE) ? (struct netent *) Perl_reentrant_retry("getnetbyname", a) : 0))
+# endif /* if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1) */
# if !defined(getnetbyname) && GETNETBYNAME_R_PROTO == REENTRANT_PROTO_I_CSD
-# define getnetbyname(a) (((errno = getnetbyname_r(a, &PL_reentrant_buffer->_getnetent_struct, &PL_reentrant_buffer->_getnetent_data))) == 0 ? &PL_reentrant_buffer->_getnetent_struct : 0)
-# endif
+# define getnetbyname(a) ((PL_reentrant_retint = getnetbyname_r(a, &PL_reentrant_buffer->_netent_struct, &PL_reentrant_buffer->_netent_data)) == 0 ? &PL_reentrant_buffer->_netent_struct : ((PL_reentrant_retint == ERANGE) ? (struct netent *) Perl_reentrant_retry("getnetbyname", a) : 0))
+# endif /* if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1) */
+# endif /* HAS_GETNETBYNAME */
#endif /* HAS_GETNETBYNAME_R */
#ifdef HAS_GETNETENT_R
+# if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1)
# undef getnetent
# if !defined(getnetent) && GETNETENT_R_PROTO == REENTRANT_PROTO_I_SBWRE
-# define getnetent() (((errno = getnetent_r(&PL_reentrant_buffer->_getnetent_struct, PL_reentrant_buffer->_getnetent_buffer, PL_reentrant_buffer->_getnetent_size, &PL_reentrant_buffer->_getnetent_ptr, &PL_reentrant_buffer->_getnetent_errno))) == 0 ? PL_reentrant_buffer->_getnetent_ptr : 0)
-# endif
+# define getnetent() ((PL_reentrant_retint = getnetent_r(&PL_reentrant_buffer->_netent_struct, PL_reentrant_buffer->_netent_buffer, PL_reentrant_buffer->_netent_size, &PL_reentrant_buffer->_netent_ptr, &PL_reentrant_buffer->_netent_errno)) == 0 ? PL_reentrant_buffer->_netent_ptr : ((PL_reentrant_retint == ERANGE) ? (struct netent *) Perl_reentrant_retry("getnetent") : 0))
+# endif /* if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1) */
# if !defined(getnetent) && GETNETENT_R_PROTO == REENTRANT_PROTO_I_SBIE
-# define getnetent() (((errno = getnetent_r(&PL_reentrant_buffer->_getnetent_struct, PL_reentrant_buffer->_getnetent_buffer, PL_reentrant_buffer->_getnetent_size, &PL_reentrant_buffer->_getnetent_errno))) == 0 ? &PL_reentrant_buffer->_getnetent_struct : 0)
-# endif
+# define getnetent() ((PL_reentrant_retint = getnetent_r(&PL_reentrant_buffer->_netent_struct, PL_reentrant_buffer->_netent_buffer, PL_reentrant_buffer->_netent_size, &PL_reentrant_buffer->_netent_errno)) == 0 ? &PL_reentrant_buffer->_netent_struct : ((PL_reentrant_retint == ERANGE) ? (struct netent *) Perl_reentrant_retry("getnetent") : 0))
+# endif /* if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1) */
# if !defined(getnetent) && GETNETENT_R_PROTO == REENTRANT_PROTO_S_SBIE
-# define getnetent() (getnetent_r(&PL_reentrant_buffer->_getnetent_struct, PL_reentrant_buffer->_getnetent_buffer, PL_reentrant_buffer->_getnetent_size, &PL_reentrant_buffer->_getnetent_errno) ? &PL_reentrant_buffer->_getnetent_struct : 0)
-# endif
+# define getnetent() (getnetent_r(&PL_reentrant_buffer->_netent_struct, PL_reentrant_buffer->_netent_buffer, PL_reentrant_buffer->_netent_size, &PL_reentrant_buffer->_netent_errno) ? &PL_reentrant_buffer->_netent_struct : ((errno == ERANGE) ? (struct netent *) Perl_reentrant_retry("getnetent") : 0))
+# endif /* if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1) */
# if !defined(getnetent) && GETNETENT_R_PROTO == REENTRANT_PROTO_S_SBI
-# define getnetent() (getnetent_r(&PL_reentrant_buffer->_getnetent_struct, PL_reentrant_buffer->_getnetent_buffer, PL_reentrant_buffer->_getnetent_size) ? &PL_reentrant_buffer->_getnetent_struct : 0)
-# endif
+# define getnetent() (getnetent_r(&PL_reentrant_buffer->_netent_struct, PL_reentrant_buffer->_netent_buffer, PL_reentrant_buffer->_netent_size) ? &PL_reentrant_buffer->_netent_struct : ((errno == ERANGE) ? (struct netent *) Perl_reentrant_retry("getnetent") : 0))
+# endif /* if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1) */
# if !defined(getnetent) && GETNETENT_R_PROTO == REENTRANT_PROTO_I_SBI
-# define getnetent() (((errno = getnetent_r(&PL_reentrant_buffer->_getnetent_struct, PL_reentrant_buffer->_getnetent_buffer, PL_reentrant_buffer->_getnetent_size))) == 0 ? &PL_reentrant_buffer->_getnetent_struct : 0)
-# endif
+# define getnetent() ((PL_reentrant_retint = getnetent_r(&PL_reentrant_buffer->_netent_struct, PL_reentrant_buffer->_netent_buffer, PL_reentrant_buffer->_netent_size)) == 0 ? &PL_reentrant_buffer->_netent_struct : ((PL_reentrant_retint == ERANGE) ? (struct netent *) Perl_reentrant_retry("getnetent") : 0))
+# endif /* if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1) */
# if !defined(getnetent) && GETNETENT_R_PROTO == REENTRANT_PROTO_I_SD
-# define getnetent() (((errno = getnetent_r(&PL_reentrant_buffer->_getnetent_struct, &PL_reentrant_buffer->_getnetent_data))) == 0 ? &PL_reentrant_buffer->_getnetent_struct : 0)
-# endif
+# define getnetent() ((PL_reentrant_retint = getnetent_r(&PL_reentrant_buffer->_netent_struct, &PL_reentrant_buffer->_netent_data)) == 0 ? &PL_reentrant_buffer->_netent_struct : ((PL_reentrant_retint == ERANGE) ? (struct netent *) Perl_reentrant_retry("getnetent") : 0))
+# endif /* if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1) */
+# endif /* HAS_GETNETENT */
#endif /* HAS_GETNETENT_R */
#ifdef HAS_GETPROTOBYNAME_R
+# if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1)
# undef getprotobyname
# if !defined(getprotobyname) && GETPROTOBYNAME_R_PROTO == REENTRANT_PROTO_I_CSBWR
-# define getprotobyname(a) (((errno = getprotobyname_r(a, &PL_reentrant_buffer->_getprotoent_struct, PL_reentrant_buffer->_getprotoent_buffer, PL_reentrant_buffer->_getprotoent_size, &PL_reentrant_buffer->_getprotoent_ptr))) == 0 ? PL_reentrant_buffer->_getprotoent_ptr : 0)
-# endif
+# define getprotobyname(a) ((PL_reentrant_retint = getprotobyname_r(a, &PL_reentrant_buffer->_protoent_struct, PL_reentrant_buffer->_protoent_buffer, PL_reentrant_buffer->_protoent_size, &PL_reentrant_buffer->_protoent_ptr)) == 0 ? PL_reentrant_buffer->_protoent_ptr : ((PL_reentrant_retint == ERANGE) ? (struct protoent *) Perl_reentrant_retry("getprotobyname", a) : 0))
+# endif /* if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1) */
# if !defined(getprotobyname) && GETPROTOBYNAME_R_PROTO == REENTRANT_PROTO_S_CSBI
-# define getprotobyname(a) (getprotobyname_r(a, &PL_reentrant_buffer->_getprotoent_struct, PL_reentrant_buffer->_getprotoent_buffer, PL_reentrant_buffer->_getprotoent_size) ? &PL_reentrant_buffer->_getprotoent_struct : 0)
-# endif
+# define getprotobyname(a) (getprotobyname_r(a, &PL_reentrant_buffer->_protoent_struct, PL_reentrant_buffer->_protoent_buffer, PL_reentrant_buffer->_protoent_size) ? &PL_reentrant_buffer->_protoent_struct : ((errno == ERANGE) ? (struct protoent *) Perl_reentrant_retry("getprotobyname", a) : 0))
+# endif /* if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1) */
# if !defined(getprotobyname) && GETPROTOBYNAME_R_PROTO == REENTRANT_PROTO_I_CSD
-# define getprotobyname(a) (((errno = getprotobyname_r(a, &PL_reentrant_buffer->_getprotoent_struct, &PL_reentrant_buffer->_getprotoent_data))) == 0 ? &PL_reentrant_buffer->_getprotoent_struct : 0)
-# endif
+# define getprotobyname(a) (REENTR_MEMZERO(&PL_reentrant_buffer->_protoent_data, sizeof(PL_reentrant_buffer->_protoent_data))(PL_reentrant_retint = getprotobyname_r(a, &PL_reentrant_buffer->_protoent_struct, &PL_reentrant_buffer->_protoent_data)) == 0 ? &PL_reentrant_buffer->_protoent_struct : ((PL_reentrant_retint == ERANGE) ? (struct protoent *) Perl_reentrant_retry("getprotobyname", a) : 0))
+# endif /* if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1) */
+# endif /* HAS_GETPROTOBYNAME */
#endif /* HAS_GETPROTOBYNAME_R */
#ifdef HAS_GETPROTOBYNUMBER_R
+# if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1)
# undef getprotobynumber
# if !defined(getprotobynumber) && GETPROTOBYNUMBER_R_PROTO == REENTRANT_PROTO_I_ISBWR
-# define getprotobynumber(a) (((errno = getprotobynumber_r(a, &PL_reentrant_buffer->_getprotoent_struct, PL_reentrant_buffer->_getprotoent_buffer, PL_reentrant_buffer->_getprotoent_size, &PL_reentrant_buffer->_getprotoent_ptr))) == 0 ? PL_reentrant_buffer->_getprotoent_ptr : 0)
-# endif
+# define getprotobynumber(a) ((PL_reentrant_retint = getprotobynumber_r(a, &PL_reentrant_buffer->_protoent_struct, PL_reentrant_buffer->_protoent_buffer, PL_reentrant_buffer->_protoent_size, &PL_reentrant_buffer->_protoent_ptr)) == 0 ? PL_reentrant_buffer->_protoent_ptr : ((PL_reentrant_retint == ERANGE) ? (struct protoent *) Perl_reentrant_retry("getprotobynumber", a) : 0))
+# endif /* if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1) */
# if !defined(getprotobynumber) && GETPROTOBYNUMBER_R_PROTO == REENTRANT_PROTO_S_ISBI
-# define getprotobynumber(a) (getprotobynumber_r(a, &PL_reentrant_buffer->_getprotoent_struct, PL_reentrant_buffer->_getprotoent_buffer, PL_reentrant_buffer->_getprotoent_size) ? &PL_reentrant_buffer->_getprotoent_struct : 0)
-# endif
+# define getprotobynumber(a) (getprotobynumber_r(a, &PL_reentrant_buffer->_protoent_struct, PL_reentrant_buffer->_protoent_buffer, PL_reentrant_buffer->_protoent_size) ? &PL_reentrant_buffer->_protoent_struct : ((errno == ERANGE) ? (struct protoent *) Perl_reentrant_retry("getprotobynumber", a) : 0))
+# endif /* if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1) */
# if !defined(getprotobynumber) && GETPROTOBYNUMBER_R_PROTO == REENTRANT_PROTO_I_ISD
-# define getprotobynumber(a) (((errno = getprotobynumber_r(a, &PL_reentrant_buffer->_getprotoent_struct, &PL_reentrant_buffer->_getprotoent_data))) == 0 ? &PL_reentrant_buffer->_getprotoent_struct : 0)
-# endif
+# define getprotobynumber(a) (REENTR_MEMZERO(&PL_reentrant_buffer->_protoent_data, sizeof(PL_reentrant_buffer->_protoent_data))(PL_reentrant_retint = getprotobynumber_r(a, &PL_reentrant_buffer->_protoent_struct, &PL_reentrant_buffer->_protoent_data)) == 0 ? &PL_reentrant_buffer->_protoent_struct : ((PL_reentrant_retint == ERANGE) ? (struct protoent *) Perl_reentrant_retry("getprotobynumber", a) : 0))
+# endif /* if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1) */
+# endif /* HAS_GETPROTOBYNUMBER */
#endif /* HAS_GETPROTOBYNUMBER_R */
#ifdef HAS_GETPROTOENT_R
+# if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1)
# undef getprotoent
# if !defined(getprotoent) && GETPROTOENT_R_PROTO == REENTRANT_PROTO_I_SBWR
-# define getprotoent() (((errno = getprotoent_r(&PL_reentrant_buffer->_getprotoent_struct, PL_reentrant_buffer->_getprotoent_buffer, PL_reentrant_buffer->_getprotoent_size, &PL_reentrant_buffer->_getprotoent_ptr))) == 0 ? PL_reentrant_buffer->_getprotoent_ptr : 0)
-# endif
+# define getprotoent() ((PL_reentrant_retint = getprotoent_r(&PL_reentrant_buffer->_protoent_struct, PL_reentrant_buffer->_protoent_buffer, PL_reentrant_buffer->_protoent_size, &PL_reentrant_buffer->_protoent_ptr)) == 0 ? PL_reentrant_buffer->_protoent_ptr : ((PL_reentrant_retint == ERANGE) ? (struct protoent *) Perl_reentrant_retry("getprotoent") : 0))
+# endif /* if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1) */
# if !defined(getprotoent) && GETPROTOENT_R_PROTO == REENTRANT_PROTO_I_SBI
-# define getprotoent() (((errno = getprotoent_r(&PL_reentrant_buffer->_getprotoent_struct, PL_reentrant_buffer->_getprotoent_buffer, PL_reentrant_buffer->_getprotoent_size))) == 0 ? &PL_reentrant_buffer->_getprotoent_struct : 0)
-# endif
+# define getprotoent() ((PL_reentrant_retint = getprotoent_r(&PL_reentrant_buffer->_protoent_struct, PL_reentrant_buffer->_protoent_buffer, PL_reentrant_buffer->_protoent_size)) == 0 ? &PL_reentrant_buffer->_protoent_struct : ((PL_reentrant_retint == ERANGE) ? (struct protoent *) Perl_reentrant_retry("getprotoent") : 0))
+# endif /* if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1) */
# if !defined(getprotoent) && GETPROTOENT_R_PROTO == REENTRANT_PROTO_S_SBI
-# define getprotoent() (getprotoent_r(&PL_reentrant_buffer->_getprotoent_struct, PL_reentrant_buffer->_getprotoent_buffer, PL_reentrant_buffer->_getprotoent_size) ? &PL_reentrant_buffer->_getprotoent_struct : 0)
-# endif
+# define getprotoent() (getprotoent_r(&PL_reentrant_buffer->_protoent_struct, PL_reentrant_buffer->_protoent_buffer, PL_reentrant_buffer->_protoent_size) ? &PL_reentrant_buffer->_protoent_struct : ((errno == ERANGE) ? (struct protoent *) Perl_reentrant_retry("getprotoent") : 0))
+# endif /* if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1) */
# if !defined(getprotoent) && GETPROTOENT_R_PROTO == REENTRANT_PROTO_I_SD
-# define getprotoent() (((errno = getprotoent_r(&PL_reentrant_buffer->_getprotoent_struct, &PL_reentrant_buffer->_getprotoent_data))) == 0 ? &PL_reentrant_buffer->_getprotoent_struct : 0)
-# endif
+# define getprotoent() (REENTR_MEMZERO(&PL_reentrant_buffer->_protoent_data, sizeof(PL_reentrant_buffer->_protoent_data))(PL_reentrant_retint = getprotoent_r(&PL_reentrant_buffer->_protoent_struct, &PL_reentrant_buffer->_protoent_data)) == 0 ? &PL_reentrant_buffer->_protoent_struct : ((PL_reentrant_retint == ERANGE) ? (struct protoent *) Perl_reentrant_retry("getprotoent") : 0))
+# endif /* if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1) */
+# endif /* HAS_GETPROTOENT */
#endif /* HAS_GETPROTOENT_R */
#ifdef HAS_GETPWENT_R
+# if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1)
# undef getpwent
# if !defined(getpwent) && GETPWENT_R_PROTO == REENTRANT_PROTO_I_SBWR
-# define getpwent() (((errno = getpwent_r(&PL_reentrant_buffer->_getpwent_struct, PL_reentrant_buffer->_getpwent_buffer, PL_reentrant_buffer->_getpwent_size, &PL_reentrant_buffer->_getpwent_ptr))) == 0 ? PL_reentrant_buffer->_getpwent_ptr : 0)
-# endif
+# define getpwent() ((PL_reentrant_retint = getpwent_r(&PL_reentrant_buffer->_pwent_struct, PL_reentrant_buffer->_pwent_buffer, PL_reentrant_buffer->_pwent_size, &PL_reentrant_buffer->_pwent_ptr)) == 0 ? PL_reentrant_buffer->_pwent_ptr : ((PL_reentrant_retint == ERANGE) ? (struct passwd *) Perl_reentrant_retry("getpwent") : 0))
+# endif /* if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1) */
# if !defined(getpwent) && GETPWENT_R_PROTO == REENTRANT_PROTO_I_SBIR
-# define getpwent() (((errno = getpwent_r(&PL_reentrant_buffer->_getpwent_struct, PL_reentrant_buffer->_getpwent_buffer, PL_reentrant_buffer->_getpwent_size, &PL_reentrant_buffer->_getpwent_ptr))) == 0 ? PL_reentrant_buffer->_getpwent_ptr : 0)
-# endif
+# define getpwent() ((PL_reentrant_retint = getpwent_r(&PL_reentrant_buffer->_pwent_struct, PL_reentrant_buffer->_pwent_buffer, PL_reentrant_buffer->_pwent_size, &PL_reentrant_buffer->_pwent_ptr)) == 0 ? PL_reentrant_buffer->_pwent_ptr : ((PL_reentrant_retint == ERANGE) ? (struct passwd *) Perl_reentrant_retry("getpwent") : 0))
+# endif /* if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1) */
# if !defined(getpwent) && GETPWENT_R_PROTO == REENTRANT_PROTO_S_SBW
-# define getpwent() (getpwent_r(&PL_reentrant_buffer->_getpwent_struct, PL_reentrant_buffer->_getpwent_buffer, PL_reentrant_buffer->_getpwent_size) ? &PL_reentrant_buffer->_getpwent_struct : 0)
-# endif
+# define getpwent() (getpwent_r(&PL_reentrant_buffer->_pwent_struct, PL_reentrant_buffer->_pwent_buffer, PL_reentrant_buffer->_pwent_size) ? &PL_reentrant_buffer->_pwent_struct : ((errno == ERANGE) ? (struct passwd *) Perl_reentrant_retry("getpwent") : 0))
+# endif /* if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1) */
# if !defined(getpwent) && GETPWENT_R_PROTO == REENTRANT_PROTO_S_SBI
-# define getpwent() (getpwent_r(&PL_reentrant_buffer->_getpwent_struct, PL_reentrant_buffer->_getpwent_buffer, PL_reentrant_buffer->_getpwent_size) ? &PL_reentrant_buffer->_getpwent_struct : 0)
-# endif
+# define getpwent() (getpwent_r(&PL_reentrant_buffer->_pwent_struct, PL_reentrant_buffer->_pwent_buffer, PL_reentrant_buffer->_pwent_size) ? &PL_reentrant_buffer->_pwent_struct : ((errno == ERANGE) ? (struct passwd *) Perl_reentrant_retry("getpwent") : 0))
+# endif /* if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1) */
# if !defined(getpwent) && GETPWENT_R_PROTO == REENTRANT_PROTO_I_SBI
-# define getpwent() (((errno = getpwent_r(&PL_reentrant_buffer->_getpwent_struct, PL_reentrant_buffer->_getpwent_buffer, PL_reentrant_buffer->_getpwent_size))) == 0 ? &PL_reentrant_buffer->_getpwent_struct : 0)
-# endif
+# define getpwent() ((PL_reentrant_retint = getpwent_r(&PL_reentrant_buffer->_pwent_struct, PL_reentrant_buffer->_pwent_buffer, PL_reentrant_buffer->_pwent_size)) == 0 ? &PL_reentrant_buffer->_pwent_struct : ((PL_reentrant_retint == ERANGE) ? (struct passwd *) Perl_reentrant_retry("getpwent") : 0))
+# endif /* if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1) */
# if !defined(getpwent) && GETPWENT_R_PROTO == REENTRANT_PROTO_I_SBIH
-# define getpwent() (((errno = getpwent_r(&PL_reentrant_buffer->_getpwent_struct, PL_reentrant_buffer->_getpwent_buffer, PL_reentrant_buffer->_getpwent_size, &PL_reentrant_buffer->_getpwent_fptr))) == 0 ? &PL_reentrant_buffer->_getpwent_struct : 0)
-# endif
+# define getpwent() ((PL_reentrant_retint = getpwent_r(&PL_reentrant_buffer->_pwent_struct, PL_reentrant_buffer->_pwent_buffer, PL_reentrant_buffer->_pwent_size, &PL_reentrant_buffer->_pwent_fptr)) == 0 ? &PL_reentrant_buffer->_pwent_struct : ((PL_reentrant_retint == ERANGE) ? (struct passwd *) Perl_reentrant_retry("getpwent") : 0))
+# endif /* if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1) */
+# endif /* HAS_GETPWENT */
#endif /* HAS_GETPWENT_R */
#ifdef HAS_GETPWNAM_R
+# if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1)
# undef getpwnam
# if !defined(getpwnam) && GETPWNAM_R_PROTO == REENTRANT_PROTO_I_CSBWR
-# define getpwnam(a) (((errno = getpwnam_r(a, &PL_reentrant_buffer->_getpwent_struct, PL_reentrant_buffer->_getpwent_buffer, PL_reentrant_buffer->_getpwent_size, &PL_reentrant_buffer->_getpwent_ptr))) == 0 ? PL_reentrant_buffer->_getpwent_ptr : 0)
-# endif
+# define getpwnam(a) ((PL_reentrant_retint = getpwnam_r(a, &PL_reentrant_buffer->_pwent_struct, PL_reentrant_buffer->_pwent_buffer, PL_reentrant_buffer->_pwent_size, &PL_reentrant_buffer->_pwent_ptr)) == 0 ? PL_reentrant_buffer->_pwent_ptr : ((PL_reentrant_retint == ERANGE) ? (struct passwd *) Perl_reentrant_retry("getpwnam", a) : 0))
+# endif /* if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1) */
# if !defined(getpwnam) && GETPWNAM_R_PROTO == REENTRANT_PROTO_I_CSBIR
-# define getpwnam(a) (((errno = getpwnam_r(a, &PL_reentrant_buffer->_getpwent_struct, PL_reentrant_buffer->_getpwent_buffer, PL_reentrant_buffer->_getpwent_size, &PL_reentrant_buffer->_getpwent_ptr))) == 0 ? PL_reentrant_buffer->_getpwent_ptr : 0)
-# endif
+# define getpwnam(a) ((PL_reentrant_retint = getpwnam_r(a, &PL_reentrant_buffer->_pwent_struct, PL_reentrant_buffer->_pwent_buffer, PL_reentrant_buffer->_pwent_size, &PL_reentrant_buffer->_pwent_ptr)) == 0 ? PL_reentrant_buffer->_pwent_ptr : ((PL_reentrant_retint == ERANGE) ? (struct passwd *) Perl_reentrant_retry("getpwnam", a) : 0))
+# endif /* if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1) */
# if !defined(getpwnam) && GETPWNAM_R_PROTO == REENTRANT_PROTO_S_CSBI
-# define getpwnam(a) (getpwnam_r(a, &PL_reentrant_buffer->_getpwent_struct, PL_reentrant_buffer->_getpwent_buffer, PL_reentrant_buffer->_getpwent_size) ? &PL_reentrant_buffer->_getpwent_struct : 0)
-# endif
+# define getpwnam(a) (getpwnam_r(a, &PL_reentrant_buffer->_pwent_struct, PL_reentrant_buffer->_pwent_buffer, PL_reentrant_buffer->_pwent_size) ? &PL_reentrant_buffer->_pwent_struct : ((errno == ERANGE) ? (struct passwd *) Perl_reentrant_retry("getpwnam", a) : 0))
+# endif /* if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1) */
# if !defined(getpwnam) && GETPWNAM_R_PROTO == REENTRANT_PROTO_I_CSBI
-# define getpwnam(a) (((errno = getpwnam_r(a, &PL_reentrant_buffer->_getpwent_struct, PL_reentrant_buffer->_getpwent_buffer, PL_reentrant_buffer->_getpwent_size))) == 0 ? &PL_reentrant_buffer->_getpwent_struct : 0)
-# endif
+# define getpwnam(a) ((PL_reentrant_retint = getpwnam_r(a, &PL_reentrant_buffer->_pwent_struct, PL_reentrant_buffer->_pwent_buffer, PL_reentrant_buffer->_pwent_size)) == 0 ? &PL_reentrant_buffer->_pwent_struct : ((PL_reentrant_retint == ERANGE) ? (struct passwd *) Perl_reentrant_retry("getpwnam", a) : 0))
+# endif /* if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1) */
+# endif /* HAS_GETPWNAM */
#endif /* HAS_GETPWNAM_R */
#ifdef HAS_GETPWUID_R
+# if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1)
# undef getpwuid
# if !defined(getpwuid) && GETPWUID_R_PROTO == REENTRANT_PROTO_I_TSBWR
-# define getpwuid(a) (((errno = getpwuid_r(a, &PL_reentrant_buffer->_getpwent_struct, PL_reentrant_buffer->_getpwent_buffer, PL_reentrant_buffer->_getpwent_size, &PL_reentrant_buffer->_getpwent_ptr))) == 0 ? PL_reentrant_buffer->_getpwent_ptr : 0)
-# endif
+# define getpwuid(a) ((PL_reentrant_retint = getpwuid_r(a, &PL_reentrant_buffer->_pwent_struct, PL_reentrant_buffer->_pwent_buffer, PL_reentrant_buffer->_pwent_size, &PL_reentrant_buffer->_pwent_ptr)) == 0 ? PL_reentrant_buffer->_pwent_ptr : ((PL_reentrant_retint == ERANGE) ? (struct passwd *) Perl_reentrant_retry("getpwuid", a) : 0))
+# endif /* if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1) */
# if !defined(getpwuid) && GETPWUID_R_PROTO == REENTRANT_PROTO_I_TSBIR
-# define getpwuid(a) (((errno = getpwuid_r(a, &PL_reentrant_buffer->_getpwent_struct, PL_reentrant_buffer->_getpwent_buffer, PL_reentrant_buffer->_getpwent_size, &PL_reentrant_buffer->_getpwent_ptr))) == 0 ? PL_reentrant_buffer->_getpwent_ptr : 0)
-# endif
+# define getpwuid(a) ((PL_reentrant_retint = getpwuid_r(a, &PL_reentrant_buffer->_pwent_struct, PL_reentrant_buffer->_pwent_buffer, PL_reentrant_buffer->_pwent_size, &PL_reentrant_buffer->_pwent_ptr)) == 0 ? PL_reentrant_buffer->_pwent_ptr : ((PL_reentrant_retint == ERANGE) ? (struct passwd *) Perl_reentrant_retry("getpwuid", a) : 0))
+# endif /* if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1) */
# if !defined(getpwuid) && GETPWUID_R_PROTO == REENTRANT_PROTO_I_TSBI
-# define getpwuid(a) (((errno = getpwuid_r(a, &PL_reentrant_buffer->_getpwent_struct, PL_reentrant_buffer->_getpwent_buffer, PL_reentrant_buffer->_getpwent_size))) == 0 ? &PL_reentrant_buffer->_getpwent_struct : 0)
-# endif
+# define getpwuid(a) ((PL_reentrant_retint = getpwuid_r(a, &PL_reentrant_buffer->_pwent_struct, PL_reentrant_buffer->_pwent_buffer, PL_reentrant_buffer->_pwent_size)) == 0 ? &PL_reentrant_buffer->_pwent_struct : ((PL_reentrant_retint == ERANGE) ? (struct passwd *) Perl_reentrant_retry("getpwuid", a) : 0))
+# endif /* if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1) */
# if !defined(getpwuid) && GETPWUID_R_PROTO == REENTRANT_PROTO_S_TSBI
-# define getpwuid(a) (getpwuid_r(a, &PL_reentrant_buffer->_getpwent_struct, PL_reentrant_buffer->_getpwent_buffer, PL_reentrant_buffer->_getpwent_size) ? &PL_reentrant_buffer->_getpwent_struct : 0)
-# endif
+# define getpwuid(a) (getpwuid_r(a, &PL_reentrant_buffer->_pwent_struct, PL_reentrant_buffer->_pwent_buffer, PL_reentrant_buffer->_pwent_size) ? &PL_reentrant_buffer->_pwent_struct : ((errno == ERANGE) ? (struct passwd *) Perl_reentrant_retry("getpwuid", a) : 0))
+# endif /* if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1) */
+# endif /* HAS_GETPWUID */
#endif /* HAS_GETPWUID_R */
#ifdef HAS_GETSERVBYNAME_R
+# if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1)
# undef getservbyname
# if !defined(getservbyname) && GETSERVBYNAME_R_PROTO == REENTRANT_PROTO_I_CCSBWR
-# define getservbyname(a, b) (((errno = getservbyname_r(a, b, &PL_reentrant_buffer->_getservent_struct, PL_reentrant_buffer->_getservent_buffer, PL_reentrant_buffer->_getservent_size, &PL_reentrant_buffer->_getservent_ptr))) == 0 ? PL_reentrant_buffer->_getservent_ptr : 0)
-# endif
+# define getservbyname(a, b) ((PL_reentrant_retint = getservbyname_r(a, b, &PL_reentrant_buffer->_servent_struct, PL_reentrant_buffer->_servent_buffer, PL_reentrant_buffer->_servent_size, &PL_reentrant_buffer->_servent_ptr)) == 0 ? PL_reentrant_buffer->_servent_ptr : ((PL_reentrant_retint == ERANGE) ? (struct servent *) Perl_reentrant_retry("getservbyname", a, b) : 0))
+# endif /* if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1) */
# if !defined(getservbyname) && GETSERVBYNAME_R_PROTO == REENTRANT_PROTO_S_CCSBI
-# define getservbyname(a, b) (getservbyname_r(a, b, &PL_reentrant_buffer->_getservent_struct, PL_reentrant_buffer->_getservent_buffer, PL_reentrant_buffer->_getservent_size) ? &PL_reentrant_buffer->_getservent_struct : 0)
-# endif
+# define getservbyname(a, b) (getservbyname_r(a, b, &PL_reentrant_buffer->_servent_struct, PL_reentrant_buffer->_servent_buffer, PL_reentrant_buffer->_servent_size) ? &PL_reentrant_buffer->_servent_struct : ((errno == ERANGE) ? (struct servent *) Perl_reentrant_retry("getservbyname", a, b) : 0))
+# endif /* if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1) */
# if !defined(getservbyname) && GETSERVBYNAME_R_PROTO == REENTRANT_PROTO_I_CCSD
-# define getservbyname(a, b) (((errno = getservbyname_r(a, b, &PL_reentrant_buffer->_getservent_struct, &PL_reentrant_buffer->_getservent_data))) == 0 ? &PL_reentrant_buffer->_getservent_struct : 0)
-# endif
+# define getservbyname(a, b) (REENTR_MEMZERO(&PL_reentrant_buffer->_servent_data, sizeof(PL_reentrant_buffer->_servent_data))(PL_reentrant_retint = getservbyname_r(a, b, &PL_reentrant_buffer->_servent_struct, &PL_reentrant_buffer->_servent_data)) == 0 ? &PL_reentrant_buffer->_servent_struct : ((PL_reentrant_retint == ERANGE) ? (struct servent *) Perl_reentrant_retry("getservbyname", a, b) : 0))
+# endif /* if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1) */
+# endif /* HAS_GETSERVBYNAME */
#endif /* HAS_GETSERVBYNAME_R */
#ifdef HAS_GETSERVBYPORT_R
+# if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1)
# undef getservbyport
# if !defined(getservbyport) && GETSERVBYPORT_R_PROTO == REENTRANT_PROTO_I_ICSBWR
-# define getservbyport(a, b) (((errno = getservbyport_r(a, b, &PL_reentrant_buffer->_getservent_struct, PL_reentrant_buffer->_getservent_buffer, PL_reentrant_buffer->_getservent_size, &PL_reentrant_buffer->_getservent_ptr))) == 0 ? PL_reentrant_buffer->_getservent_ptr : 0)
-# endif
+# define getservbyport(a, b) ((PL_reentrant_retint = getservbyport_r(a, b, &PL_reentrant_buffer->_servent_struct, PL_reentrant_buffer->_servent_buffer, PL_reentrant_buffer->_servent_size, &PL_reentrant_buffer->_servent_ptr)) == 0 ? PL_reentrant_buffer->_servent_ptr : ((PL_reentrant_retint == ERANGE) ? (struct servent *) Perl_reentrant_retry("getservbyport", a, b) : 0))
+# endif /* if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1) */
# if !defined(getservbyport) && GETSERVBYPORT_R_PROTO == REENTRANT_PROTO_S_ICSBI
-# define getservbyport(a, b) (getservbyport_r(a, b, &PL_reentrant_buffer->_getservent_struct, PL_reentrant_buffer->_getservent_buffer, PL_reentrant_buffer->_getservent_size) ? &PL_reentrant_buffer->_getservent_struct : 0)
-# endif
+# define getservbyport(a, b) (getservbyport_r(a, b, &PL_reentrant_buffer->_servent_struct, PL_reentrant_buffer->_servent_buffer, PL_reentrant_buffer->_servent_size) ? &PL_reentrant_buffer->_servent_struct : ((errno == ERANGE) ? (struct servent *) Perl_reentrant_retry("getservbyport", a, b) : 0))
+# endif /* if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1) */
# if !defined(getservbyport) && GETSERVBYPORT_R_PROTO == REENTRANT_PROTO_I_ICSD
-# define getservbyport(a, b) (((errno = getservbyport_r(a, b, &PL_reentrant_buffer->_getservent_struct, &PL_reentrant_buffer->_getservent_data))) == 0 ? &PL_reentrant_buffer->_getservent_struct : 0)
-# endif
+# define getservbyport(a, b) (REENTR_MEMZERO(&PL_reentrant_buffer->_servent_data, sizeof(PL_reentrant_buffer->_servent_data))(PL_reentrant_retint = getservbyport_r(a, b, &PL_reentrant_buffer->_servent_struct, &PL_reentrant_buffer->_servent_data)) == 0 ? &PL_reentrant_buffer->_servent_struct : ((PL_reentrant_retint == ERANGE) ? (struct servent *) Perl_reentrant_retry("getservbyport", a, b) : 0))
+# endif /* if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1) */
+# endif /* HAS_GETSERVBYPORT */
#endif /* HAS_GETSERVBYPORT_R */
#ifdef HAS_GETSERVENT_R
+# if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1)
# undef getservent
# if !defined(getservent) && GETSERVENT_R_PROTO == REENTRANT_PROTO_I_SBWR
-# define getservent() (((errno = getservent_r(&PL_reentrant_buffer->_getservent_struct, PL_reentrant_buffer->_getservent_buffer, PL_reentrant_buffer->_getservent_size, &PL_reentrant_buffer->_getservent_ptr))) == 0 ? PL_reentrant_buffer->_getservent_ptr : 0)
-# endif
+# define getservent() ((PL_reentrant_retint = getservent_r(&PL_reentrant_buffer->_servent_struct, PL_reentrant_buffer->_servent_buffer, PL_reentrant_buffer->_servent_size, &PL_reentrant_buffer->_servent_ptr)) == 0 ? PL_reentrant_buffer->_servent_ptr : ((PL_reentrant_retint == ERANGE) ? (struct servent *) Perl_reentrant_retry("getservent") : 0))
+# endif /* if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1) */
# if !defined(getservent) && GETSERVENT_R_PROTO == REENTRANT_PROTO_I_SBI
-# define getservent() (((errno = getservent_r(&PL_reentrant_buffer->_getservent_struct, PL_reentrant_buffer->_getservent_buffer, PL_reentrant_buffer->_getservent_size))) == 0 ? &PL_reentrant_buffer->_getservent_struct : 0)
-# endif
+# define getservent() ((PL_reentrant_retint = getservent_r(&PL_reentrant_buffer->_servent_struct, PL_reentrant_buffer->_servent_buffer, PL_reentrant_buffer->_servent_size)) == 0 ? &PL_reentrant_buffer->_servent_struct : ((PL_reentrant_retint == ERANGE) ? (struct servent *) Perl_reentrant_retry("getservent") : 0))
+# endif /* if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1) */
# if !defined(getservent) && GETSERVENT_R_PROTO == REENTRANT_PROTO_S_SBI
-# define getservent() (getservent_r(&PL_reentrant_buffer->_getservent_struct, PL_reentrant_buffer->_getservent_buffer, PL_reentrant_buffer->_getservent_size) ? &PL_reentrant_buffer->_getservent_struct : 0)
-# endif
+# define getservent() (getservent_r(&PL_reentrant_buffer->_servent_struct, PL_reentrant_buffer->_servent_buffer, PL_reentrant_buffer->_servent_size) ? &PL_reentrant_buffer->_servent_struct : ((errno == ERANGE) ? (struct servent *) Perl_reentrant_retry("getservent") : 0))
+# endif /* if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1) */
# if !defined(getservent) && GETSERVENT_R_PROTO == REENTRANT_PROTO_I_SD
-# define getservent() (((errno = getservent_r(&PL_reentrant_buffer->_getservent_struct, &PL_reentrant_buffer->_getservent_data))) == 0 ? &PL_reentrant_buffer->_getservent_struct : 0)
-# endif
+# define getservent() (REENTR_MEMZERO(&PL_reentrant_buffer->_servent_data, sizeof(PL_reentrant_buffer->_servent_data))(PL_reentrant_retint = getservent_r(&PL_reentrant_buffer->_servent_struct, &PL_reentrant_buffer->_servent_data)) == 0 ? &PL_reentrant_buffer->_servent_struct : ((PL_reentrant_retint == ERANGE) ? (struct servent *) Perl_reentrant_retry("getservent") : 0))
+# endif /* if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1) */
+# endif /* HAS_GETSERVENT */
#endif /* HAS_GETSERVENT_R */
#ifdef HAS_GETSPNAM_R
+# if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1)
# undef getspnam
# if !defined(getspnam) && GETSPNAM_R_PROTO == REENTRANT_PROTO_I_CSBWR
-# define getspnam(a) (((errno = getspnam_r(a, &PL_reentrant_buffer->_getspent_struct, PL_reentrant_buffer->_getspent_buffer, PL_reentrant_buffer->_getspent_size, &PL_reentrant_buffer->_getspent_ptr))) == 0 ? PL_reentrant_buffer->_getspent_ptr : 0)
-# endif
+# define getspnam(a) ((PL_reentrant_retint = getspnam_r(a, &PL_reentrant_buffer->_spent_struct, PL_reentrant_buffer->_spent_buffer, PL_reentrant_buffer->_spent_size, &PL_reentrant_buffer->_spent_ptr)) == 0 ? PL_reentrant_buffer->_spent_ptr : ((PL_reentrant_retint == ERANGE) ? (struct spwd *) Perl_reentrant_retry("getspnam", a) : 0))
+# endif /* if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1) */
# if !defined(getspnam) && GETSPNAM_R_PROTO == REENTRANT_PROTO_S_CSBI
-# define getspnam(a) (getspnam_r(a, &PL_reentrant_buffer->_getspent_struct, PL_reentrant_buffer->_getspent_buffer, PL_reentrant_buffer->_getspent_size) ? &PL_reentrant_buffer->_getspent_struct : 0)
-# endif
+# define getspnam(a) (getspnam_r(a, &PL_reentrant_buffer->_spent_struct, PL_reentrant_buffer->_spent_buffer, PL_reentrant_buffer->_spent_size) ? &PL_reentrant_buffer->_spent_struct : ((errno == ERANGE) ? (struct spwd *) Perl_reentrant_retry("getspnam", a) : 0))
+# endif /* if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1) */
+# endif /* HAS_GETSPNAM */
#endif /* HAS_GETSPNAM_R */
#ifdef HAS_GMTIME_R
+# if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1)
# undef gmtime
# if !defined(gmtime) && GMTIME_R_PROTO == REENTRANT_PROTO_S_TS
# define gmtime(a) (gmtime_r(a, &PL_reentrant_buffer->_gmtime_struct) ? &PL_reentrant_buffer->_gmtime_struct : 0)
-# endif
+# endif /* if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1) */
# if !defined(gmtime) && GMTIME_R_PROTO == REENTRANT_PROTO_I_TS
-# define gmtime(a) (((errno = gmtime_r(a, &PL_reentrant_buffer->_gmtime_struct))) == 0 ? &PL_reentrant_buffer->_gmtime_struct : 0)
-# endif
+# define gmtime(a) (gmtime_r(a, &PL_reentrant_buffer->_gmtime_struct) == 0 ? &PL_reentrant_buffer->_gmtime_struct : 0)
+# endif /* if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1) */
+# endif /* HAS_GMTIME */
#endif /* HAS_GMTIME_R */
#ifdef HAS_LOCALTIME_R
+# if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1)
# undef localtime
# if !defined(localtime) && LOCALTIME_R_PROTO == REENTRANT_PROTO_S_TS
-# define localtime(a) (localtime_r(a, &PL_reentrant_buffer->_localtime_struct) ? &PL_reentrant_buffer->_localtime_struct : 0)
-# endif
+# define localtime(a) (L_R_TZSET localtime_r(a, &PL_reentrant_buffer->_localtime_struct) ? &PL_reentrant_buffer->_localtime_struct : 0)
+# endif /* if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1) */
# if !defined(localtime) && LOCALTIME_R_PROTO == REENTRANT_PROTO_I_TS
-# define localtime(a) (((errno = localtime_r(a, &PL_reentrant_buffer->_localtime_struct))) == 0 ? &PL_reentrant_buffer->_localtime_struct : 0)
-# endif
+# define localtime(a) (L_R_TZSET localtime_r(a, &PL_reentrant_buffer->_localtime_struct) == 0 ? &PL_reentrant_buffer->_localtime_struct : 0)
+# endif /* if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1) */
+# endif /* HAS_LOCALTIME */
#endif /* HAS_LOCALTIME_R */
#ifdef HAS_RANDOM_R
+# if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1)
# undef random
-# if !defined(random) && RANDOM_R_PROTO == REENTRANT_PROTO_I_TS
-# define random() (((errno = random_r(T, &PL_reentrant_buffer->_random_struct))) == 0 ? &PL_reentrant_buffer->_random_struct : 0)
-# endif
+# if !defined(random) && RANDOM_R_PROTO == REENTRANT_PROTO_I_iS
+# define random() (random_r(&PL_reentrant_buffer->_random_retval, &PL_reentrant_buffer->_random_struct) == 0 ? PL_reentrant_buffer->_random_retval : 0)
+# endif /* if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1) */
+# if !defined(random) && RANDOM_R_PROTO == REENTRANT_PROTO_I_lS
+# define random() (random_r(&PL_reentrant_buffer->_random_retval, &PL_reentrant_buffer->_random_struct) == 0 ? PL_reentrant_buffer->_random_retval : 0)
+# endif /* if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1) */
+# if !defined(random) && RANDOM_R_PROTO == REENTRANT_PROTO_I_St
+# define random() (random_r(&PL_reentrant_buffer->_random_struct, &PL_reentrant_buffer->_random_retval) == 0 ? PL_reentrant_buffer->_random_retval : 0)
+# endif /* if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1) */
+# endif /* HAS_RANDOM */
#endif /* HAS_RANDOM_R */
#ifdef HAS_READDIR_R
+# if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1)
# undef readdir
# if !defined(readdir) && READDIR_R_PROTO == REENTRANT_PROTO_I_TSR
-# define readdir(a) (((errno = readdir_r(a, PL_reentrant_buffer->_readdir_struct, &PL_reentrant_buffer->_readdir_ptr))) == 0 ? PL_reentrant_buffer->_readdir_ptr : 0)
-# endif
+# define readdir(a) (readdir_r(a, PL_reentrant_buffer->_readdir_struct, &PL_reentrant_buffer->_readdir_ptr) == 0 ? PL_reentrant_buffer->_readdir_ptr : 0)
+# endif /* if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1) */
# if !defined(readdir) && READDIR_R_PROTO == REENTRANT_PROTO_I_TS
-# define readdir(a) (((errno = readdir_r(a, PL_reentrant_buffer->_readdir_struct))) == 0 ? PL_reentrant_buffer->_readdir_struct : 0)
-# endif
+# define readdir(a) (readdir_r(a, PL_reentrant_buffer->_readdir_struct) == 0 ? PL_reentrant_buffer->_readdir_struct : 0)
+# endif /* if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1) */
+# endif /* HAS_READDIR */
#endif /* HAS_READDIR_R */
#ifdef HAS_READDIR64_R
+# if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1)
# undef readdir64
# if !defined(readdir64) && READDIR64_R_PROTO == REENTRANT_PROTO_I_TSR
-# define readdir64(a) (((errno = readdir64_r(a, PL_reentrant_buffer->_readdir64_struct, &PL_reentrant_buffer->_readdir64_ptr))) == 0 ? PL_reentrant_buffer->_readdir64_ptr : 0)
-# endif
+# define readdir64(a) (readdir64_r(a, PL_reentrant_buffer->_readdir64_struct, &PL_reentrant_buffer->_readdir64_ptr) == 0 ? PL_reentrant_buffer->_readdir64_ptr : 0)
+# endif /* if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1) */
# if !defined(readdir64) && READDIR64_R_PROTO == REENTRANT_PROTO_I_TS
-# define readdir64(a) (((errno = readdir64_r(a, PL_reentrant_buffer->_readdir64_struct))) == 0 ? PL_reentrant_buffer->_readdir64_struct : 0)
-# endif
+# define readdir64(a) (readdir64_r(a, PL_reentrant_buffer->_readdir64_struct) == 0 ? PL_reentrant_buffer->_readdir64_struct : 0)
+# endif /* if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1) */
+# endif /* HAS_READDIR64 */
#endif /* HAS_READDIR64_R */
#ifdef HAS_SETGRENT_R
+# if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1)
# undef setgrent
# if !defined(setgrent) && SETGRENT_R_PROTO == REENTRANT_PROTO_I_H
-# define setgrent() (((errno = setgrent_r(&PL_reentrant_buffer->_getgrent_fptr))) == 0 ? 1 : 0)
-# endif
+# define setgrent() (setgrent_r(&PL_reentrant_buffer->_grent_fptr) == 0 ? 1 : 0)
+# endif /* if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1) */
# if !defined(setgrent) && SETGRENT_R_PROTO == REENTRANT_PROTO_V_H
-# define setgrent() setgrent_r(&PL_reentrant_buffer->_getgrent_fptr)
-# endif
+# define setgrent() setgrent_r(&PL_reentrant_buffer->_grent_fptr)
+# endif /* if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1) */
+# endif /* HAS_SETGRENT */
#endif /* HAS_SETGRENT_R */
#ifdef HAS_SETHOSTENT_R
+# if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1)
# undef sethostent
# if !defined(sethostent) && SETHOSTENT_R_PROTO == REENTRANT_PROTO_I_ID
-# define sethostent(a) (((errno = sethostent_r(a, &PL_reentrant_buffer->_gethostent_data))) == 0 ? 1 : 0)
-# endif
+# define sethostent(a) (sethostent_r(a, &PL_reentrant_buffer->_hostent_data) == 0 ? 1 : 0)
+# endif /* if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1) */
# if !defined(sethostent) && SETHOSTENT_R_PROTO == REENTRANT_PROTO_V_ID
-# define sethostent(a) sethostent_r(a, &PL_reentrant_buffer->_gethostent_data)
-# endif
+# define sethostent(a) sethostent_r(a, &PL_reentrant_buffer->_hostent_data)
+# endif /* if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1) */
+# endif /* HAS_SETHOSTENT */
#endif /* HAS_SETHOSTENT_R */
#ifdef HAS_SETLOCALE_R
+# if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1)
# undef setlocale
# if !defined(setlocale) && SETLOCALE_R_PROTO == REENTRANT_PROTO_I_ICBI
-# define setlocale(a, b) (((errno = setlocale_r(a, b, PL_reentrant_buffer->_setlocale_buffer, PL_reentrant_buffer->_setlocale_size))) == 0 ? PL_reentrant_buffer->_setlocale_buffer : 0)
-# endif
+# define setlocale(a, b) (setlocale_r(a, b, PL_reentrant_buffer->_setlocale_buffer, PL_reentrant_buffer->_setlocale_size) == 0 ? PL_reentrant_buffer->_setlocale_buffer : 0)
+# endif /* if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1) */
+# endif /* HAS_SETLOCALE */
#endif /* HAS_SETLOCALE_R */
#ifdef HAS_SETNETENT_R
+# if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1)
# undef setnetent
# if !defined(setnetent) && SETNETENT_R_PROTO == REENTRANT_PROTO_I_ID
-# define setnetent(a) (((errno = setnetent_r(a, &PL_reentrant_buffer->_getnetent_data))) == 0 ? 1 : 0)
-# endif
+# define setnetent(a) (setnetent_r(a, &PL_reentrant_buffer->_netent_data) == 0 ? 1 : 0)
+# endif /* if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1) */
# if !defined(setnetent) && SETNETENT_R_PROTO == REENTRANT_PROTO_V_ID
-# define setnetent(a) setnetent_r(a, &PL_reentrant_buffer->_getnetent_data)
-# endif
+# define setnetent(a) setnetent_r(a, &PL_reentrant_buffer->_netent_data)
+# endif /* if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1) */
+# endif /* HAS_SETNETENT */
#endif /* HAS_SETNETENT_R */
#ifdef HAS_SETPROTOENT_R
+# if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1)
# undef setprotoent
# if !defined(setprotoent) && SETPROTOENT_R_PROTO == REENTRANT_PROTO_I_ID
-# define setprotoent(a) (((errno = setprotoent_r(a, &PL_reentrant_buffer->_getprotoent_data))) == 0 ? 1 : 0)
-# endif
+# define setprotoent(a) (setprotoent_r(a, &PL_reentrant_buffer->_protoent_data) == 0 ? 1 : 0)
+# endif /* if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1) */
# if !defined(setprotoent) && SETPROTOENT_R_PROTO == REENTRANT_PROTO_V_ID
-# define setprotoent(a) setprotoent_r(a, &PL_reentrant_buffer->_getprotoent_data)
-# endif
+# define setprotoent(a) setprotoent_r(a, &PL_reentrant_buffer->_protoent_data)
+# endif /* if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1) */
+# endif /* HAS_SETPROTOENT */
#endif /* HAS_SETPROTOENT_R */
#ifdef HAS_SETPWENT_R
+# if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1)
# undef setpwent
# if !defined(setpwent) && SETPWENT_R_PROTO == REENTRANT_PROTO_I_H
-# define setpwent() (((errno = setpwent_r(&PL_reentrant_buffer->_getpwent_fptr))) == 0 ? 1 : 0)
-# endif
+# define setpwent() (setpwent_r(&PL_reentrant_buffer->_pwent_fptr) == 0 ? 1 : 0)
+# endif /* if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1) */
# if !defined(setpwent) && SETPWENT_R_PROTO == REENTRANT_PROTO_V_H
-# define setpwent() setpwent_r(&PL_reentrant_buffer->_getpwent_fptr)
-# endif
+# define setpwent() setpwent_r(&PL_reentrant_buffer->_pwent_fptr)
+# endif /* if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1) */
+# endif /* HAS_SETPWENT */
#endif /* HAS_SETPWENT_R */
#ifdef HAS_SETSERVENT_R
+# if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1)
# undef setservent
# if !defined(setservent) && SETSERVENT_R_PROTO == REENTRANT_PROTO_I_ID
-# define setservent(a) (((errno = setservent_r(a, &PL_reentrant_buffer->_getservent_data))) == 0 ? 1 : 0)
-# endif
+# define setservent(a) (setservent_r(a, &PL_reentrant_buffer->_servent_data) == 0 ? 1 : 0)
+# endif /* if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1) */
# if !defined(setservent) && SETSERVENT_R_PROTO == REENTRANT_PROTO_V_ID
-# define setservent(a) setservent_r(a, &PL_reentrant_buffer->_getservent_data)
-# endif
+# define setservent(a) setservent_r(a, &PL_reentrant_buffer->_servent_data)
+# endif /* if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1) */
+# endif /* HAS_SETSERVENT */
#endif /* HAS_SETSERVENT_R */
#ifdef HAS_SRAND48_R
+# if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1)
# undef srand48
# if !defined(srand48) && SRAND48_R_PROTO == REENTRANT_PROTO_I_LS
-# define srand48(a) (((errno = srand48_r(a, &PL_reentrant_buffer->_drand48_struct))) == 0 ? &PL_reentrant_buffer->_drand48_struct : 0)
-# endif
+# define srand48(a) (srand48_r(a, &PL_reentrant_buffer->_drand48_struct) == 0 ? &PL_reentrant_buffer->_drand48_struct : 0)
+# endif /* if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1) */
+# endif /* HAS_SRAND48 */
#endif /* HAS_SRAND48_R */
#ifdef HAS_SRANDOM_R
+# if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1)
# undef srandom
# if !defined(srandom) && SRANDOM_R_PROTO == REENTRANT_PROTO_I_TS
-# define srandom(a) (((errno = srandom_r(a, &PL_reentrant_buffer->_srandom_struct))) == 0 ? &PL_reentrant_buffer->_srandom_struct : 0)
-# endif
+# define srandom(a) (srandom_r(a, &PL_reentrant_buffer->_srandom_struct) == 0 ? &PL_reentrant_buffer->_srandom_struct : 0)
+# endif /* if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1) */
+# endif /* HAS_SRANDOM */
#endif /* HAS_SRANDOM_R */
#ifdef HAS_STRERROR_R
+# if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1)
# undef strerror
# if !defined(strerror) && STRERROR_R_PROTO == REENTRANT_PROTO_I_IBW
-# define strerror(a) (((errno = strerror_r(a, PL_reentrant_buffer->_strerror_buffer, PL_reentrant_buffer->_strerror_size))) == 0 ? PL_reentrant_buffer->_strerror_buffer : 0)
-# endif
+# define strerror(a) (strerror_r(a, PL_reentrant_buffer->_strerror_buffer, PL_reentrant_buffer->_strerror_size) == 0 ? PL_reentrant_buffer->_strerror_buffer : 0)
+# endif /* if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1) */
# if !defined(strerror) && STRERROR_R_PROTO == REENTRANT_PROTO_I_IBI
-# define strerror(a) (((errno = strerror_r(a, PL_reentrant_buffer->_strerror_buffer, PL_reentrant_buffer->_strerror_size))) == 0 ? PL_reentrant_buffer->_strerror_buffer : 0)
-# endif
+# define strerror(a) (strerror_r(a, PL_reentrant_buffer->_strerror_buffer, PL_reentrant_buffer->_strerror_size) == 0 ? PL_reentrant_buffer->_strerror_buffer : 0)
+# endif /* if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1) */
# if !defined(strerror) && STRERROR_R_PROTO == REENTRANT_PROTO_B_IBW
# define strerror(a) strerror_r(a, PL_reentrant_buffer->_strerror_buffer, PL_reentrant_buffer->_strerror_size)
-# endif
+# endif /* if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1) */
+# endif /* HAS_STRERROR */
#endif /* HAS_STRERROR_R */
#ifdef HAS_TMPNAM_R
+# if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1)
# undef tmpnam
# if !defined(tmpnam) && TMPNAM_R_PROTO == REENTRANT_PROTO_B_B
# define tmpnam(a) tmpnam_r(a)
-# endif
+# endif /* if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1) */
+# endif /* HAS_TMPNAM */
#endif /* HAS_TMPNAM_R */
#ifdef HAS_TTYNAME_R
+# if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1)
# undef ttyname
# if !defined(ttyname) && TTYNAME_R_PROTO == REENTRANT_PROTO_I_IBW
-# define ttyname(a) (((errno = ttyname_r(a, PL_reentrant_buffer->_ttyname_buffer, PL_reentrant_buffer->_ttyname_size))) == 0 ? PL_reentrant_buffer->_ttyname_buffer : 0)
-# endif
+# define ttyname(a) (ttyname_r(a, PL_reentrant_buffer->_ttyname_buffer, PL_reentrant_buffer->_ttyname_size) == 0 ? PL_reentrant_buffer->_ttyname_buffer : 0)
+# endif /* if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1) */
# if !defined(ttyname) && TTYNAME_R_PROTO == REENTRANT_PROTO_I_IBI
-# define ttyname(a) (((errno = ttyname_r(a, PL_reentrant_buffer->_ttyname_buffer, PL_reentrant_buffer->_ttyname_size))) == 0 ? PL_reentrant_buffer->_ttyname_buffer : 0)
-# endif
+# define ttyname(a) (ttyname_r(a, PL_reentrant_buffer->_ttyname_buffer, PL_reentrant_buffer->_ttyname_size) == 0 ? PL_reentrant_buffer->_ttyname_buffer : 0)
+# endif /* if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1) */
# if !defined(ttyname) && TTYNAME_R_PROTO == REENTRANT_PROTO_B_IBI
# define ttyname(a) ttyname_r(a, PL_reentrant_buffer->_ttyname_buffer, PL_reentrant_buffer->_ttyname_size)
-# endif
+# endif /* if defined(PERL_REENTR_API) && (PERL_REENTR_API+0 == 1) */
+# endif /* HAS_TTYNAME */
#endif /* HAS_TTYNAME_R */
+
#endif /* USE_REENTRANT_API */
#endif
+/* ex: set ro: */