ntdll: Use struct mtget.mt_blksiz on systems featuring this.

Work around using struct mtget.mt_gstat on systems lacking this.
This commit is contained in:
Gerald Pfeifer 2006-02-05 13:51:03 +01:00 committed by Alexandre Julliard
parent 8800352477
commit 36bdc64e39
4 changed files with 252 additions and 0 deletions

228
configure vendored
View File

@ -18074,6 +18074,234 @@ _ACEOF
fi
echo "$as_me:$LINENO: checking for struct mtget.mt_blksiz" >&5
echo $ECHO_N "checking for struct mtget.mt_blksiz... $ECHO_C" >&6
if test "${ac_cv_member_struct_mtget_mt_blksiz+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#ifdef HAVE_SYS_MTIO_H
#include <sys/mtio.h>
#endif
int
main ()
{
static struct mtget ac_aggr;
if (ac_aggr.mt_blksiz)
return 0;
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
(eval $ac_compile) 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; } &&
{ ac_try='test -s conftest.$ac_objext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_cv_member_struct_mtget_mt_blksiz=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#ifdef HAVE_SYS_MTIO_H
#include <sys/mtio.h>
#endif
int
main ()
{
static struct mtget ac_aggr;
if (sizeof ac_aggr.mt_blksiz)
return 0;
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
(eval $ac_compile) 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; } &&
{ ac_try='test -s conftest.$ac_objext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_cv_member_struct_mtget_mt_blksiz=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_cv_member_struct_mtget_mt_blksiz=no
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: $ac_cv_member_struct_mtget_mt_blksiz" >&5
echo "${ECHO_T}$ac_cv_member_struct_mtget_mt_blksiz" >&6
if test $ac_cv_member_struct_mtget_mt_blksiz = yes; then
cat >>confdefs.h <<_ACEOF
#define HAVE_STRUCT_MTGET_MT_BLKSIZ 1
_ACEOF
fi
echo "$as_me:$LINENO: checking for struct mtget.mt_gstat" >&5
echo $ECHO_N "checking for struct mtget.mt_gstat... $ECHO_C" >&6
if test "${ac_cv_member_struct_mtget_mt_gstat+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#ifdef HAVE_SYS_MTIO_H
#include <sys/mtio.h>
#endif
int
main ()
{
static struct mtget ac_aggr;
if (ac_aggr.mt_gstat)
return 0;
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
(eval $ac_compile) 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; } &&
{ ac_try='test -s conftest.$ac_objext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_cv_member_struct_mtget_mt_gstat=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#ifdef HAVE_SYS_MTIO_H
#include <sys/mtio.h>
#endif
int
main ()
{
static struct mtget ac_aggr;
if (sizeof ac_aggr.mt_gstat)
return 0;
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
(eval $ac_compile) 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; } &&
{ ac_try='test -s conftest.$ac_objext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_cv_member_struct_mtget_mt_gstat=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_cv_member_struct_mtget_mt_gstat=no
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: $ac_cv_member_struct_mtget_mt_gstat" >&5
echo "${ECHO_T}$ac_cv_member_struct_mtget_mt_gstat" >&6
if test $ac_cv_member_struct_mtget_mt_gstat = yes; then
cat >>confdefs.h <<_ACEOF
#define HAVE_STRUCT_MTGET_MT_GSTAT 1
_ACEOF
fi
echo "$as_me:$LINENO: checking for struct option.name" >&5
echo $ECHO_N "checking for struct option.name... $ECHO_C" >&6
if test "${ac_cv_member_struct_option_name+set}" = set; then

View File

@ -1427,6 +1427,12 @@ AC_CHECK_MEMBERS([scsireq_t.cmd, sg_io_hdr_t.interface_id],,,
dnl Check for siginfo_t members
AC_CHECK_MEMBERS([siginfo_t.si_fd],,,[#include <signal.h>])
dnl Check for struct mtget members
AC_CHECK_MEMBERS([struct mtget.mt_blksiz, struct mtget.mt_gstat],,,
[#ifdef HAVE_SYS_MTIO_H
#include <sys/mtio.h>
#endif])
dnl Check for struct option
AC_CHECK_MEMBERS([struct option.name],,,
[#ifdef HAVE_GETOPT_H

View File

@ -177,7 +177,11 @@ static NTSTATUS TAPE_GetDriveParams( int fd, TAPE_GET_DRIVE_PARAMETERS *data )
data->Compression = FALSE;
data->DataPadding = FALSE;
data->ReportSetmarks = FALSE;
#ifdef HAVE_STRUCT_MTGET_MT_BLKSIZ
data->DefaultBlockSize = get.mt_blksiz;
#else
data->DefaultBlockSize = get.mt_dsreg & MT_ST_BLKSIZE_MASK;
#endif
data->MaximumBlockSize = data->DefaultBlockSize;
data->MinimumBlockSize = data->DefaultBlockSize;
data->MaximumPartitionCount = 1;
@ -208,9 +212,17 @@ static NTSTATUS TAPE_GetMediaParams( int fd, TAPE_GET_MEDIA_PARAMETERS *data )
data->Capacity.u.LowPart = 1024 * 1024 * 1024;
data->Remaining.u.LowPart = 1024 * 1024 * 1024;
#ifdef HAVE_STRUCT_MTGET_MT_BLKSIZ
data->BlockSize = get.mt_blksiz;
#else
data->BlockSize = get.mt_dsreg & MT_ST_BLKSIZE_MASK;
#endif
data->PartitionCount = 1;
#ifdef HAVE_STRUCT_MTGET_GSTAT
data->WriteProtected = GMT_WR_PROT(get.mt_gstat);
#else
data->WriteProtected = 0;
#endif
return status;
#else

View File

@ -614,6 +614,12 @@
/* Define to 1 if `msg_accrights' is member of `struct msghdr'. */
#undef HAVE_STRUCT_MSGHDR_MSG_ACCRIGHTS
/* Define to 1 if `mt_blksiz' is member of `struct mtget'. */
#undef HAVE_STRUCT_MTGET_MT_BLKSIZ
/* Define to 1 if `mt_gstat' is member of `struct mtget'. */
#undef HAVE_STRUCT_MTGET_MT_GSTAT
/* Define to 1 if `name' is member of `struct option'. */
#undef HAVE_STRUCT_OPTION_NAME