1 dnl $Heimdal: krb-func-getcwd-broken.m4 15455 2005-06-16 21:03:43Z lha $
5 dnl test for broken getcwd in (SunOS braindamage)
8 AC_DEFUN([AC_KRB_FUNC_GETCWD_BROKEN], [
9 if test "$ac_cv_func_getcwd" = yes; then
10 AC_MSG_CHECKING(if getcwd is broken)
11 AC_CACHE_VAL(ac_cv_func_getcwd_broken, [
12 ac_cv_func_getcwd_broken=no
14 AC_RUN_IFELSE([AC_LANG_SOURCE([[
16 char *getcwd(char*, int);
18 void *popen(char *cmd, char *mode)
24 int main(int argc, char **argv)
27 ret = getcwd(0, 1024);
28 if(ret == 0 && errno == ENOTTY)
32 ]])], [ac_cv_func_getcwd_broken=yes],[:],[:])
34 if test "$ac_cv_func_getcwd_broken" = yes; then
35 AC_DEFINE(BROKEN_GETCWD, 1, [Define if getcwd is broken (like in SunOS 4).])dnl
37 AC_MSG_RESULT($ac_cv_func_getcwd_broken)
39 AC_MSG_RESULT([seems ok])