This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
metaconfig unit changes in preparation of reentrancy changes.
[metaconfig.git] / U / threads / d_getpwuid_r.U
1 ?RCS: $Id$
2 ?RCS:
3 ?RCS: Copyright (c) 1999 Jarkko Hietaniemi
4 ?RCS:
5 ?RCS: You may distribute under the terms of either the GNU General Public
6 ?RCS: License or the Artistic License, as specified in the README file.
7 ?RCS:
8 ?MAKE:d_getpwuid_r getpwuid_r_proto: Inlibc Protochk i_systypes i_pwd uidtype
9 ?MAKE:  -pick add $@ %<
10 ?S:d_getpwuid_r:
11 ?S:     This variable conditionally defines the HAS_GETPWUID_R symbol,
12 ?S:     which indicates to the C propwam that the getpwuid_r()
13 ?S:     routine is available.
14 ?S:.
15 ?S:getpwuid_r_proto:
16 ?S:     This variable encodes the prototype of getpwuid_r.
17 ?S:.
18 ?C:HAS_GETPWUID_R:
19 ?C:     This symbol, if defined, indicates that the getpwuid_r routine
20 ?C:     is available to getpwuid re-entrantly.
21 ?C:.
22 ?C:GETPWUID_R_PROTO:
23 ?C:     This symbol encodes the prototype of getpwuid_r.
24 ?C:      13     int   getpwuid_r(char*, struct passwd*, char*, int)
25 ?C:      15     struct passwd* getpwuid_r(char*, struct passwd*, char*, int)
26 ?C:      45     int   getpwuid_r(char*, struct passwd*, char*, int, struct passwd**)
27 ?C:      53     int   getpwuid_r(char*, struct passwd*, char*, size_t, struct passwd**)
28 ?C:     The 53 is preferred since it's the SUSv3/POSIX 1001.3-2001 one.
29 ?C:.
30 ?H:#$d_getpwuid_r HAS_GETPWUID_R                /**/
31 ?H:#define GETPWUID_R_PROTO $getpwuid_r_proto   /**/
32 ?H:.
33 ?T:try hdrs
34 ?LINT:set d_getpwuid_r
35 : see if getpwuid_r exists
36 set getpwuid_r d_getpwuid_r
37 eval $inlibc
38 case "$d_getpwuid_r" in
39 "$define")
40         hdrs="$i_systypes sys/types.h $i_pwd pwd.h"
41         try="extern char* getpwuid_r($uidtype, struct passwd*, char*, size_t, struct passwd**);"
42         if ./protochk $try $hdrs; then
43                 echo "Your system has $try"
44                 getpwuid_r_proto=53
45         else
46                 try="extern char* getpwuid_r($uidtype, struct passwd*, char*, size_t, struct passwd**);"
47                 if ./protochk $try $hdrs; then
48                         echo "Your system has $try"
49                         getpwuid_r_proto=45
50                 else
51                         try="extern int getpwuid_r($uidtype, struct passwd*, char*, size_t);"
52                         if ./protochk $try $hdrs; then
53                                 echo "Your system has $try"
54                                 getpwuid_r_proto=13
55                         else
56                                 try="extern struct passwd* getpwuid_r($uidtype, struct passwd*, char*, size_t);"
57                                 if ./protochk $try $hdrs; then
58                                         echo "Your system has $try"
59                                         getpwuid_r_proto=15
60                                 else
61                                         echo "I do not recognize the prototype of your getpwuid_r, not using it." >&4
62                                         d_getpwuid_r="$undef"
63                                         getpwuid_r_proto=0
64                                 fi
65                         fi
66                 fi
67         fi
68         ;;
69 *)      getpwuid_r_proto=0 ;;
70 esac
71