ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/libptytty/ptytty.m4
Revision: 1.19
Committed: Sun Mar 28 08:39:34 2010 UTC (14 years, 2 months ago) by sf-exg
Branch: MAIN
Changes since 1.18: +0 -11 lines
Log Message:
Remove unneeded code (according to docs found in gnulib openpty module).

File Contents

# User Rev Content
1 root 1.2 dnl this file is part of libptytty, do not make local modifications
2     dnl http://software.schmorp.de/pkg/libptytty
3    
4 ayin 1.1 AC_DEFUN([PTY_CHECK],
5     [
6     AC_CHECK_HEADERS( \
7     pty.h \
8     util.h \
9     libutil.h \
10     sys/ioctl.h \
11     sys/stropts.h \
12 root 1.17 stropts.h \
13 ayin 1.1 )
14    
15     AC_CHECK_FUNCS( \
16     revoke \
17     _getpty \
18     getpt \
19     posix_openpt \
20     isastream \
21 root 1.7 setuid \
22     seteuid \
23     setreuid \
24     setresuid \
25 ayin 1.1 )
26    
27     have_clone=no
28    
29     AC_MSG_CHECKING(for /dev/ptc)
30     if test -e /dev/ptc; then
31     AC_MSG_RESULT(yes)
32     AC_DEFINE(CLONE_DEVICE, "/dev/ptc", [clone device filename])
33     have_clone=yes
34     else
35     AC_MSG_RESULT(no)
36     fi
37    
38     case $host in
39     *-*-cygwin*)
40     have_clone=yes
41     AC_DEFINE(CLONE_DEVICE, "/dev/ptmx", [clone device filename])
42     ;;
43     *)
44     AC_MSG_CHECKING(for /dev/ptmx)
45     if test -e /dev/ptmx; then
46     AC_MSG_RESULT(yes)
47     AC_DEFINE(HAVE_DEV_PTMX, 1, [Define to 1 if you have /dev/ptmx])
48     AC_DEFINE(CLONE_DEVICE, "/dev/ptmx", [clone device filename])
49     have_clone=yes
50     else
51     AC_MSG_RESULT(no)
52     fi
53     ;;
54     esac
55    
56     if test x$ac_cv_func_getpt = xyes -o x$ac_cv_func_posix_openpt = xyes -o x$have_clone = xyes; then
57     AC_MSG_CHECKING(for UNIX98 ptys)
58 ayin 1.16 AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <stdlib.h>]],
59     [[grantpt(0);unlockpt(0);ptsname(0);]])],
60 ayin 1.1 [unix98_pty=yes
61     AC_DEFINE(UNIX98_PTY, 1, "")
62     AC_MSG_RESULT(yes)],
63     [AC_MSG_RESULT(no)])
64     fi
65    
66     if test -z "$unix98_pty"; then
67     AC_CHECK_FUNCS(openpty, [], [AC_CHECK_LIB(util, openpty, [AC_DEFINE(HAVE_OPENPTY) LIBS="$LIBS -lutil"])])
68     fi
69     ])
70    
71     AC_DEFUN([UTMP_CHECK],
72     [
73 ayin 1.5 support_utmp=yes
74     support_wtmp=yes
75     support_lastlog=yes
76    
77 ayin 1.4 AC_ARG_ENABLE(utmp,
78 ayin 1.11 [AS_HELP_STRING([--enable-utmp],[enable utmp (utmpx) support])],
79 ayin 1.4 [if test x$enableval = xyes -o x$enableval = xno; then
80     support_utmp=$enableval
81     fi])
82    
83     AC_ARG_ENABLE(wtmp,
84 ayin 1.11 [AS_HELP_STRING([--enable-wtmp],[enable wtmp (wtmpx) support (requires --enable-utmp)])],
85 ayin 1.4 [if test x$enableval = xyes -o x$enableval = xno; then
86     support_wtmp=$enableval
87     fi])
88    
89     AC_ARG_ENABLE(lastlog,
90 ayin 1.11 [AS_HELP_STRING([--enable-lastlog],[enable lastlog support (requires --enable-utmp)])],
91 ayin 1.4 [if test x$enableval = xyes -o x$enableval = xno; then
92     support_lastlog=$enableval
93     fi])
94    
95     if test x$support_utmp = xyes; then
96     AC_DEFINE(UTMP_SUPPORT, 1, Define if you want to have utmp/utmpx support)
97     fi
98     if test x$support_wtmp = xyes; then
99     AC_DEFINE(WTMP_SUPPORT, 1, Define if you want to have wtmp support when utmp/utmpx is enabled)
100     fi
101     if test x$support_lastlog = xyes; then
102     AC_DEFINE(LASTLOG_SUPPORT, 1, Define if you want to have lastlog support when utmp/utmpx is enabled)
103     fi
104    
105 ayin 1.1 AC_CHECK_FUNCS( \
106     updwtmp \
107     updwtmpx \
108 ayin 1.12 updlastlogx \
109 ayin 1.1 )
110    
111 ayin 1.15 AC_CHECK_HEADERS(lastlog.h)
112 ayin 1.1
113     dnl# --------------------------------------------------------------------------
114     dnl# DO ALL UTMP AND WTMP CHECKING
115     dnl# --------------------------------------------------------------------------
116     dnl# check for host field in utmp structure
117    
118     dnl# --------------------------------------------
119 ayin 1.15 AC_CHECK_HEADERS(utmp.h,
120 sf-exg 1.18 [AC_CACHE_CHECK([for struct utmp], pt_cv_struct_utmp,
121 ayin 1.1 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
122 sf-exg 1.18 #include <utmp.h>]], [[struct utmp ut;]])],[pt_cv_struct_utmp=yes],[pt_cv_struct_utmp=no])])
123     if test x$pt_cv_struct_utmp = xyes; then
124 ayin 1.1 AC_DEFINE(HAVE_STRUCT_UTMP, 1, Define if utmp.h has struct utmp)
125     fi
126     ]
127    
128 sf-exg 1.18 AC_CACHE_CHECK(for ut_host in utmp struct, pt_cv_struct_utmp_host,
129 ayin 1.1 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
130 sf-exg 1.18 #include <utmp.h>]], [[struct utmp ut; ut.ut_host;]])],[pt_cv_struct_utmp_host=yes],[pt_cv_struct_utmp_host=no])])
131     if test x$pt_cv_struct_utmp_host = xyes; then
132 ayin 1.1 AC_DEFINE(HAVE_UTMP_HOST, 1, Define if struct utmp contains ut_host)
133     fi
134    
135 sf-exg 1.18 AC_CACHE_CHECK(for ut_pid in utmp struct, pt_cv_struct_utmp_pid,
136 ayin 1.1 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
137 sf-exg 1.18 #include <utmp.h>]], [[struct utmp ut; ut.ut_pid;]])],[pt_cv_struct_utmp_pid=yes],[pt_cv_struct_utmp_pid=no])])
138     if test x$pt_cv_struct_utmp_pid = xyes; then
139 ayin 1.1 AC_DEFINE(HAVE_UTMP_PID, 1, Define if struct utmp contains ut_pid)
140     fi
141 ayin 1.15 ) dnl# AC_CHECK_HEADERS(utmp.h
142 ayin 1.1
143     dnl# --------------------------------------------
144    
145 ayin 1.15 AC_CHECK_HEADERS(utmpx.h,
146 sf-exg 1.18 [AC_CACHE_CHECK([for struct utmpx], pt_cv_struct_utmpx,
147 ayin 1.1 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
148 sf-exg 1.18 #include <utmpx.h>]], [[struct utmpx ut;]])],[pt_cv_struct_utmpx=yes],[pt_cv_struct_utmpx=no])])
149     if test x$pt_cv_struct_utmpx = xyes; then
150 ayin 1.1 AC_DEFINE(HAVE_STRUCT_UTMPX, 1, Define if utmpx.h has struct utmpx)
151     fi
152     ]
153    
154 sf-exg 1.18 AC_CACHE_CHECK(for host in utmpx struct, pt_cv_struct_utmpx_host,
155 ayin 1.1 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
156 sf-exg 1.18 #include <utmpx.h>]], [[struct utmpx utx; utx.ut_host;]])],[pt_cv_struct_utmpx_host=yes],[pt_cv_struct_utmpx_host=no])])
157     if test x$pt_cv_struct_utmpx_host = xyes; then
158 ayin 1.1 AC_DEFINE(HAVE_UTMPX_HOST, 1, Define if struct utmpx contains ut_host)
159     fi
160    
161 sf-exg 1.18 AC_CACHE_CHECK(for session in utmpx struct, pt_cv_struct_utmpx_session,
162 ayin 1.16 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
163 sf-exg 1.18 #include <utmpx.h>]], [[struct utmpx utx; utx.ut_session;]])],[pt_cv_struct_utmpx_session=yes],[pt_cv_struct_utmpx_session=no])])
164     if test x$pt_cv_struct_utmpx_session = xyes; then
165 ayin 1.1 AC_DEFINE(HAVE_UTMPX_SESSION, 1, Define if struct utmpx contains ut_session)
166     fi
167 ayin 1.15 ) dnl# AC_CHECK_HEADERS(utmpx.h
168 ayin 1.1
169     dnl# --------------------------------------------------------------------------
170     dnl# check for struct lastlog
171 sf-exg 1.18 AC_CACHE_CHECK(for struct lastlog, pt_cv_struct_lastlog,
172 ayin 1.1 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
173     #include <utmp.h>
174     #ifdef HAVE_LASTLOG_H
175     #include <lastlog.h>
176     #endif
177 sf-exg 1.18 ]], [[struct lastlog ll;]])],[pt_cv_struct_lastlog=yes],[pt_cv_struct_lastlog=no])])
178     if test x$pt_cv_struct_lastlog = xyes; then
179 ayin 1.1 AC_DEFINE(HAVE_STRUCT_LASTLOG, 1, Define if utmp.h or lastlog.h has struct lastlog)
180     fi
181    
182     dnl# check for struct lastlogx
183 sf-exg 1.18 AC_CACHE_CHECK(for struct lastlogx, pt_cv_struct_lastlogx,
184 ayin 1.1 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
185     #include <utmpx.h>
186     #ifdef HAVE_LASTLOG_H
187     #include <lastlog.h>
188     #endif
189 sf-exg 1.18 ]], [[struct lastlogx ll;]])],[pt_cv_struct_lastlogx=yes],[pt_cv_struct_lastlogx=no])])
190     if test x$pt_cv_struct_lastlogx = xyes; then
191 ayin 1.1 AC_DEFINE(HAVE_STRUCT_LASTLOGX, 1, Define if utmpx.h or lastlog.h has struct lastlogx)
192     fi
193    
194     dnl# --------------------------------------------------------------------------
195     dnl# FIND FILES
196     dnl# --------------------------------------------------------------------------
197    
198     dnl# find utmp
199 sf-exg 1.18 AC_CACHE_CHECK(where utmp is located, pt_cv_path_utmp,
200 ayin 1.1 [AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <stdio.h>
201 ayin 1.9 #include <stdlib.h>
202 ayin 1.1 #include <sys/types.h>
203     #include <utmp.h>
204     #include <errno.h>
205     main()
206     {
207     char **u, *utmplist[] = {
208     "/var/run/utmp", "/var/adm/utmp", "/etc/utmp", "/usr/etc/utmp", "/usr/adm/utmp", NULL };
209     FILE *a, *f=fopen("conftestval", "w");
210     if (!f) exit(1);
211     #ifdef UTMP_FILE
212     fprintf(f, "%s\n", UTMP_FILE);
213     exit(0);
214     #endif
215     #ifdef _PATH_UTMP
216     fprintf(f, "%s\n", _PATH_UTMP);
217     exit(0);
218     #endif
219     for (u = utmplist; *u; u++) {
220     if ((a = fopen(*u, "r")) != NULL || errno == EACCES) {
221     fprintf(f, "%s\n", *u);
222     exit(0);
223     }
224     }
225     exit(0);
226 sf-exg 1.18 }]])],[pt_cv_path_utmp=`cat conftestval`],[pt_cv_path_utmp=],[dnl
227 ayin 1.1 AC_MSG_WARN(Define UTMP_FILE in config.h manually)])])
228 sf-exg 1.18 if test x$pt_cv_path_utmp != x; then
229     AC_DEFINE_UNQUOTED(UTMP_FILE, "$pt_cv_path_utmp", Define location of utmp)
230 ayin 1.1 fi
231    
232     dnl# --------------------------------------------------------------------------
233    
234     dnl# find utmpx - if a utmp file exists at the same location and is more than
235     dnl# a day newer, then dump the utmpx. People leave lots of junk around.
236 sf-exg 1.18 AC_CACHE_CHECK(where utmpx is located, pt_cv_path_utmpx,
237 ayin 1.1 [AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <stdio.h>
238 ayin 1.9 #include <stdlib.h>
239 ayin 1.1 #include <sys/types.h>
240     #include <utmpx.h>
241     #include <errno.h>
242     #include <sys/stat.h>
243     #ifdef HAVE_STRING_H
244     #include <string.h>
245     #endif
246     main()
247     {
248     char **u, *p, *utmplist[] = {
249     #ifdef UTMPX_FILE
250     UTMPX_FILE,
251     #endif
252     #ifdef _PATH_UTMPX
253     _PATH_UTMPX,
254     #endif
255     "/var/adm/utmpx", "/etc/utmpx", NULL };
256     FILE *a, *f=fopen("conftestval", "w");
257     struct stat statu, statux;
258     if (!f) exit(1);
259     for (u = utmplist; *u; u++) {
260     if ((a = fopen(*u, "r")) != NULL || errno == EACCES) {
261     if (stat(*u, &statux) < 0)
262     continue;
263     p = strdup(*u);
264     p[strlen(p) - 1] = '\0';
265     if (stat(p, &statu) >= 0
266     && (statu.st_mtime - statux.st_mtime > 86400))
267     continue;
268     fprintf(f, "%s\n", *u);
269     exit(0);
270     }
271     }
272     exit(0);
273 sf-exg 1.18 }]])],[pt_cv_path_utmpx=`cat conftestval`],[pt_cv_path_utmpx=],[dnl
274 ayin 1.1 AC_MSG_WARN(Define UTMPX_FILE in config.h manually)])])
275 sf-exg 1.18 if test x$pt_cv_path_utmpx != x; then
276     AC_DEFINE_UNQUOTED(UTMPX_FILE, "$pt_cv_path_utmpx", Define location of utmpx)
277 ayin 1.1 fi
278    
279     dnl# --------------------------------------------------------------------------
280    
281     dnl# find wtmp
282 sf-exg 1.18 AC_CACHE_CHECK(where wtmp is located, pt_cv_path_wtmp,
283 ayin 1.1 [AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <stdio.h>
284 ayin 1.9 #include <stdlib.h>
285 ayin 1.1 #include <sys/types.h>
286     #ifdef HAVE_UTMP_H
287     #include <utmp.h>
288     #endif
289     #include <errno.h>
290     main()
291     {
292     char **w, *wtmplist[] = {
293 ayin 1.10 "/var/log/wtmp", "/var/adm/wtmp", "/etc/wtmp", "/usr/etc/wtmp", "/usr/adm/wtmp", NULL };
294 ayin 1.1 FILE *a, *f=fopen("conftestval", "w");
295     if (!f) exit(1);
296     #ifdef WTMP_FILE
297     fprintf(f, "%s\n", WTMP_FILE);
298     exit(0);
299     #endif
300     #ifdef _PATH_WTMP
301     fprintf(f, "%s\n", _PATH_WTMP);
302     exit(0);
303     #endif
304     for (w = wtmplist; *w; w++) {
305     if ((a = fopen(*w, "r")) != NULL || errno == EACCES) {
306     fprintf(f, "%s\n", *w);
307     exit(0);
308     }
309     }
310     exit(0);
311 sf-exg 1.18 }]])],[pt_cv_path_wtmp=`cat conftestval`],[pt_cv_path_wtmp=],[dnl
312 ayin 1.1 AC_MSG_WARN(Define WTMP_FILE in config.h manually)])])
313 sf-exg 1.18 if test x$pt_cv_path_wtmp != x; then
314     AC_DEFINE_UNQUOTED(WTMP_FILE, "$pt_cv_path_wtmp", Define location of wtmp)
315 ayin 1.1 fi
316     dnl# --------------------------------------------------------------------------
317    
318     dnl# find wtmpx
319 sf-exg 1.18 AC_CACHE_CHECK(where wtmpx is located, pt_cv_path_wtmpx,
320 ayin 1.1 [AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <stdio.h>
321 ayin 1.9 #include <stdlib.h>
322 ayin 1.1 #ifdef HAVE_UTMPX_H
323     #include <utmpx.h>
324     #endif
325     #include <errno.h>
326     main()
327     {
328     char **w, *wtmplist[] = {
329 ayin 1.10 "/var/log/wtmpx", "/var/adm/wtmpx", NULL };
330 ayin 1.1 FILE *a, *f=fopen("conftestval", "w");
331     if (!f) exit(1);
332     #ifdef WTMPX_FILE
333     fprintf(f, "%s\n", WTMPX_FILE);
334     exit(0);
335     #endif
336     #ifdef _PATH_WTMPX
337     fprintf(f, "%s\n", _PATH_WTMPX);
338     exit(0);
339     #endif
340     for (w = wtmplist; *w; w++) {
341     if ((a = fopen(*w, "r")) != NULL || errno == EACCES) {
342     fprintf(f, "%s\n", *w);
343     exit(0);
344     }
345     }
346     exit(0);
347 sf-exg 1.18 }]])],[pt_cv_path_wtmpx=`cat conftestval`],[pt_cv_path_wtmpx=],[dnl
348 ayin 1.1 AC_MSG_WARN(Define WTMPX_FILE in config.h manually)])])
349 sf-exg 1.18 if test x$pt_cv_path_wtmpx != x; then
350     AC_DEFINE_UNQUOTED(WTMPX_FILE, "$pt_cv_path_wtmpx", Define location of wtmpx)
351 ayin 1.1 fi
352     dnl# --------------------------------------------------------------------------
353    
354     dnl# find lastlog
355 sf-exg 1.18 AC_CACHE_CHECK(where lastlog is located, pt_cv_path_lastlog,
356 ayin 1.1 [AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <stdio.h>
357 ayin 1.9 #include <stdlib.h>
358 ayin 1.1 #include <sys/types.h>
359     #ifdef HAVE_UTMPX_H
360     #include <utmpx.h>
361     #elif defined(HAVE_UTMP_H)
362     #include <utmp.h>
363     #endif
364     #ifdef HAVE_LASTLOG_H
365     #include <lastlog.h>
366     #endif
367     #include <errno.h>
368     main()
369     {
370     char **w, *lastloglist[] = { "/var/log/lastlog", NULL };
371     FILE *a, *f=fopen("conftestval", "w");
372     if (!f) exit(1);
373     #ifdef LASTLOG_FILE
374     fprintf(f, "%s\n", LASTLOG_FILE);
375     exit(0);
376     #endif
377     #ifdef _PATH_LASTLOG
378     fprintf(f, "%s\n", _PATH_LASTLOG);
379     exit(0);
380     #endif
381     for (w = lastloglist; *w; w++) {
382     if ((a = fopen(*w, "r")) != NULL || errno == EACCES) {
383     fprintf(f, "%s\n", *w);
384     exit(0);
385     }
386     }
387     exit(0);
388 sf-exg 1.18 }]])],[pt_cv_path_lastlog=`cat conftestval`],[pt_cv_path_lastlog=],[dnl
389 ayin 1.1 AC_MSG_WARN(Define LASTLOG_FILE in config.h manually)])])
390 sf-exg 1.18 if test x$pt_cv_path_lastlog != x; then
391     AC_DEFINE_UNQUOTED(LASTLOG_FILE, "$pt_cv_path_lastlog", Define location of lastlog)
392 ayin 1.1 fi
393     dnl# --------------------------------------------------------------------------
394    
395     dnl# find lastlogx
396 sf-exg 1.18 AC_CACHE_CHECK(where lastlogx is located, pt_cv_path_lastlogx,
397 ayin 1.1 [AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <stdio.h>
398 ayin 1.9 #include <stdlib.h>
399 ayin 1.1 #ifdef HAVE_UTMPX_H
400     #include <utmpx.h>
401     #endif
402     #include <errno.h>
403     main()
404     {
405     char **w, *wtmplist[] = { "/var/log/lastlogx", "/var/adm/lastlogx", NULL };
406     FILE *a, *f=fopen("conftestval", "w");
407     if (!f) exit(1);
408     #ifdef LASTLOGX_FILE
409     fprintf(f, "%s\n", LASTLOGX_FILE);
410     exit(0);
411     #endif
412     #ifdef _PATH_LASTLOGX
413     fprintf(f, "%s\n", _PATH_LASTLOGX);
414     exit(0);
415     #endif
416     for (w = wtmplist; *w; w++) {
417     if ((a = fopen(*w, "r")) != NULL || errno == EACCES) {
418     fprintf(f, "%s\n", *w);
419     exit(0);
420     }
421     }
422     exit(0);
423 sf-exg 1.18 }]])],[pt_cv_path_lastlogx=`cat conftestval`],[pt_cv_path_lastlogx=],[dnl
424 ayin 1.1 AC_MSG_WARN(Define LASTLOGX_FILE in config.h manually)])])
425 sf-exg 1.18 if test x$pt_cv_path_lastlogx != x; then
426     AC_DEFINE_UNQUOTED(LASTLOGX_FILE, "$pt_cv_path_lastlogx", Define location of lastlogx)
427 ayin 1.1 fi
428     ])
429    
430     AC_DEFUN([SCM_RIGHTS_CHECK],
431     [
432 sf-exg 1.18 AC_CACHE_CHECK(for unix-compliant filehandle passing ability, pt_cv_can_pass_fds,
433 ayin 1.16 [AC_LINK_IFELSE([AC_LANG_PROGRAM([[
434 root 1.6 #include <cstddef> // broken bsds (is that redundant?) need this
435 ayin 1.1 #include <sys/types.h>
436     #include <sys/socket.h>
437     #include <sys/uio.h>
438 ayin 1.16 ]], [[
439 ayin 1.1 {
440     msghdr msg;
441     iovec iov;
442     char buf [100];
443     char data = 0;
444    
445     iov.iov_base = &data;
446     iov.iov_len = 1;
447    
448     msg.msg_iov = &iov;
449     msg.msg_iovlen = 1;
450     msg.msg_control = buf;
451     msg.msg_controllen = sizeof buf;
452    
453     cmsghdr *cmsg = CMSG_FIRSTHDR (&msg);
454     cmsg->cmsg_level = SOL_SOCKET;
455     cmsg->cmsg_type = SCM_RIGHTS;
456     cmsg->cmsg_len = 100;
457    
458     *(int *)CMSG_DATA (cmsg) = 5;
459    
460     return sendmsg (3, &msg, 0);
461     }
462 sf-exg 1.18 ]])],[pt_cv_can_pass_fds=yes],[pt_cv_can_pass_fds=no])])
463     if test x$pt_cv_can_pass_fds = xyes; then
464 ayin 1.1 AC_DEFINE(HAVE_UNIX_FDPASS, 1, Define if sys/socket.h defines the necessary macros/functions for file handle passing)
465     else
466     AC_MSG_ERROR([libptytty requires unix-compliant filehandle passing ability])
467     fi
468     ])
469 ayin 1.3
470     AC_DEFUN([TTY_GROUP_CHECK],
471     [
472 sf-exg 1.18 AC_CACHE_CHECK([for tty group], pt_cv_tty_group,
473 ayin 1.16 [AC_RUN_IFELSE([AC_LANG_SOURCE([[
474 ayin 1.3 #include <sys/types.h>
475     #include <sys/stat.h>
476     #include <unistd.h>
477     #include <grp.h>
478    
479     main()
480     {
481     struct stat st;
482     struct group *gr;
483     char *tty;
484     gr = getgrnam("tty");
485     tty = ttyname(0);
486     if (gr != 0
487     && tty != 0
488     && (stat(tty, &st)) == 0
489     && st.st_gid == gr->gr_gid)
490     return 0;
491     else
492     return 1;
493 sf-exg 1.18 }]])],[pt_cv_tty_group=yes],[pt_cv_tty_group=no],[pt_cv_tty_group=no])])
494     if test x$pt_cv_tty_group = xyes; then
495 ayin 1.3 AC_DEFINE(TTY_GID_SUPPORT, 1, "")
496     fi])
497