3 ?RCS: Copyright (c) 1999 Jarkko Hietaniemi
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.
8 ?MAKE:d_ttyname_r ttyname_r_proto: Inlibc Protochk i_systypes i_unistd
11 ?S: This variable conditionally defines the HAS_TTYNAME_R symbol,
12 ?S: which indicates to the C prospam that the ttyname_r()
13 ?S: routine is available.
16 ?S: This variable encodes the prototype of ttyname_r.
19 ?C: This symbol, if defined, indicates that the ttyname_r routine
20 ?C: is available to ttyname re-entrantly.
23 ?C: This symbol encodes the prototype of ttyname_r.
24 ?C: 13 int ttyname_r(int, char *, int)
25 ?C: 14 char* ttyname_r(int, char *, int)
26 ?C: 21 int ttyname_r(int, char *, size_t)
27 ?C: The 21 is preferred since it's the SUSv3/POSIX 1001.3-2001 one.
29 ?H:#$d_ttyname_r HAS_TTYNAME_R /**/
30 ?H:#define TTYNAME_R_PROTO $ttyname_r_proto /**/
34 : see if ttyname_r exists
35 set ttyname_r d_ttyname_r
37 case "$d_ttyname_r" in
39 hdrs="$i_systypes sys/types.h $i_unistd unistd.h"
40 try='extern int ttyname_r(int, char *, size_t);'
41 if ./protochk "$try" $hdrs; then
42 echo "Your system has $try"
45 try='extern int ttyname_r(int, char *, int);'
46 if ./protochk "$try" $hdrs; then
47 echo "Your system has $try"
50 try='extern char* ttyname_r(int, char *, int);'
51 if ./protochk "$try" $hdrs; then
52 echo "Your system has $try"
55 echo "I do not recognize the prototype of your ttyname_r, not using it." >&4
63 *) ttyname_r_proto=0 ;;