Detect support for doors & event ports in a proper autoconf way.

This commit is contained in:
Brian Cox 2017-08-31 18:50:02 -07:00
parent 5a34e6f48c
commit 7fe1e4f79a
4 changed files with 72 additions and 4 deletions

View File

@ -24,6 +24,12 @@
/* Has /dev/urandom */
#undef HAVE_DEV_URANDOM
/* Define to 1 if you have the `door_create' function. */
#undef HAVE_DOOR_CREATE
/* Define to 1 if you have the <door.h> header file. */
#undef HAVE_DOOR_H
/* Define to 1 if you have the <fcntl.h> header file. */
#undef HAVE_FCNTL_H
@ -63,6 +69,12 @@
/* Define to 1 if you have the <openssl/sha.h> header file. */
#undef HAVE_OPENSSL_SHA_H
/* Define to 1 if you have the `port_create' function. */
#undef HAVE_PORT_CREATE
/* Define to 1 if you have the <port.h> header file. */
#undef HAVE_PORT_H
/* Define to 1 if you have the `posix_fadvise' function. */
#undef HAVE_POSIX_FADVISE

46
configure vendored
View File

@ -6214,6 +6214,52 @@ done
fi
for ac_header in door.h
do :
ac_fn_c_check_header_mongrel "$LINENO" "door.h" "ac_cv_header_door_h" "$ac_includes_default"
if test "x$ac_cv_header_door_h" = xyes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_DOOR_H 1
_ACEOF
for ac_func in door_create
do :
ac_fn_c_check_func "$LINENO" "door_create" "ac_cv_func_door_create"
if test "x$ac_cv_func_door_create" = xyes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_DOOR_CREATE 1
_ACEOF
fi
done
fi
done
for ac_header in port.h
do :
ac_fn_c_check_header_mongrel "$LINENO" "port.h" "ac_cv_header_port_h" "$ac_includes_default"
if test "x$ac_cv_header_port_h" = xyes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_PORT_H 1
_ACEOF
for ac_func in port_create
do :
ac_fn_c_check_func "$LINENO" "port_create" "ac_cv_func_port_create"
if test "x$ac_cv_func_port_create" = xyes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_PORT_CREATE 1
_ACEOF
fi
done
fi
done
if test -c "/dev/random"; then

View File

@ -150,6 +150,12 @@ then
AC_CHECK_HEADERS(CommonCrypto/CommonDigest.h)
fi
dnl check for door support (Solaris)
AC_CHECK_HEADERS(door.h, [AC_CHECK_FUNCS(door_create)])
dnl check for event port support (Solaris)
AC_CHECK_HEADERS(port.h, [AC_CHECK_FUNCS(port_create)])
dnl ##############################################
dnl check for various RNG/PRNG devices
dnl ##############################################

View File

@ -365,10 +365,12 @@ void cUnixFSServices::Stat( const TSTRING& strNameC, cFSStatArgs& stat) const
#ifdef S_ISSOCK
else if(S_ISSOCK(statbuf.st_mode)) stat.mFileType = cFSStatArgs::TY_SOCK;
#endif
#ifdef S_IFDOOR
#if HAVE_DOOR_CREATE
else if(S_ISDOOR(statbuf.st_mode)) stat.mFileType = cFSStatArgs::TY_DOOR;
#endif
#ifdef S_ISPORT
#if HAVE_PORT_CREATE
else if(S_ISPORT(statbuf.st_mode)) stat.mFileType = cFSStatArgs::TY_PORT;
#endif
@ -594,12 +596,14 @@ void cUnixFSServices::ConvertModeToString( uint64 perm, TSTRING& tstrPerm ) cons
case S_IFLNK:
szPerm[0] = _T('l');
break;
#ifdef S_IFDOOR
#if HAVE_DOOR_CREATE // Solaris doors
case S_IFDOOR:
szPerm[0] = _T('D');
break;
#endif
#ifdef S_ISPORT
#if HAVE_PORT_CREATE // Solaris event ports
case S_IFPORT:
szPerm[0] = _T('P');
break;