diff --git a/configure b/configure index 943d4c5d8f4..2d92f52b4c6 100755 --- a/configure +++ b/configure @@ -7589,7 +7589,7 @@ fi -for ac_header in sys/mount.h sys/statfs.h sys/user.h sys/vfs.h +for ac_header in sys/conf.h sys/mount.h sys/statfs.h sys/user.h sys/vfs.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "#include diff --git a/configure.ac b/configure.ac index 923d5e3b0f3..666219f5f36 100644 --- a/configure.ac +++ b/configure.ac @@ -540,7 +540,7 @@ AC_HEADER_STAT() dnl **** Checks for headers that depend on other ones **** -AC_CHECK_HEADERS([sys/mount.h sys/statfs.h sys/user.h sys/vfs.h],,, +AC_CHECK_HEADERS([sys/conf.h sys/mount.h sys/statfs.h sys/user.h sys/vfs.h],,, [#include #ifdef HAVE_SYS_PARAM_H # include diff --git a/dlls/ntdll/unix/file.c b/dlls/ntdll/unix/file.c index d12a3ffb119..d6a7b0c1550 100644 --- a/dlls/ntdll/unix/file.c +++ b/dlls/ntdll/unix/file.c @@ -99,6 +99,9 @@ #ifdef HAVE_SYS_PARAM_H #include #endif +#ifdef HAVE_SYS_CONF_H +#include +#endif #ifdef HAVE_SYS_MOUNT_H #include #endif @@ -6065,6 +6068,31 @@ static NTSTATUS get_device_info( int fd, FILE_FS_DEVICE_INFORMATION *info ) info->DeviceType = FILE_DEVICE_TAPE; break; } +#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__APPLE__) + { + int d_type; + if (ioctl(fd, FIODTYPE, &d_type) == 0) + { + switch(d_type) + { + case D_TAPE: + info->DeviceType = FILE_DEVICE_TAPE; + break; + case D_DISK: + info->DeviceType = FILE_DEVICE_DISK; + break; + case D_TTY: + info->DeviceType = FILE_DEVICE_SERIAL_PORT; + break; +#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) + case D_MEM: + info->DeviceType = FILE_DEVICE_NULL; + break; +#endif + } + /* no special d_type for parallel ports */ + } + } #endif } else if (S_ISBLK( st.st_mode )) diff --git a/include/config.h.in b/include/config.h.in index 4adb6325e14..9b52424ae85 100644 --- a/include/config.h.in +++ b/include/config.h.in @@ -1001,6 +1001,9 @@ /* Define to 1 if you have the header file. */ #undef HAVE_SYS_CDIO_H +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_CONF_H + /* Define to 1 if you have the header file. */ #undef HAVE_SYS_EPOLL_H