ntdll: Add a configure check for the tcdrain function.

Also remove the tcgetattr check that is no longer used.
This commit is contained in:
Alexandre Julliard 2013-09-05 00:10:19 +02:00
parent 050a46f30f
commit f21961cc14
6 changed files with 32 additions and 12 deletions

2
configure vendored
View File

@ -13436,7 +13436,7 @@ for ac_func in \
strtoll \
strtoull \
symlink \
tcgetattr \
tcdrain \
thr_kill2 \
timegm \
usleep \

View File

@ -2063,7 +2063,7 @@ AC_CHECK_FUNCS(\
strtoll \
strtoull \
symlink \
tcgetattr \
tcdrain \
thr_kill2 \
timegm \
usleep \

View File

@ -2777,14 +2777,7 @@ NTSTATUS WINAPI NtFlushBuffersFile( HANDLE hFile, IO_STATUS_BLOCK* IoStatusBlock
if (!ret && type == FD_TYPE_SERIAL)
{
while (tcdrain( fd ) == -1)
{
if (errno != EINTR)
{
ret = FILE_GetNtStatus();
break;
}
}
ret = COMM_FlushBuffersFile( fd );
}
else
{

View File

@ -142,6 +142,7 @@ extern NTSTATUS TAPE_DeviceIoControl(HANDLE hDevice,
ULONG IoControlCode,
LPVOID lpInBuffer, DWORD nInBufferSize,
LPVOID lpOutBuffer, DWORD nOutBufferSize) DECLSPEC_HIDDEN;
extern NTSTATUS COMM_FlushBuffersFile( int fd ) DECLSPEC_HIDDEN;
/* file I/O */
struct stat;

View File

@ -1342,3 +1342,29 @@ NTSTATUS COMM_DeviceIoControl(HANDLE hDevice,
lpOutBuffer, nOutBufferSize);
return status;
}
NTSTATUS COMM_FlushBuffersFile( int fd )
{
#ifdef HAVE_TCDRAIN
while (tcdrain( fd ) == -1)
{
if (errno != EINTR) return FILE_GetNtStatus();
}
return STATUS_SUCCESS;
#elif defined(TIOCDRAIN)
while (ioctl( fd, TIOCDRAIN ) == -1)
{
if (errno != EINTR) return FILE_GetNtStatus();
}
return STATUS_SUCCESS;
#elif defined(TCSBRK)
while (ioctl( fd, TCSBRK, 1 ) == -1)
{
if (errno != EINTR) return FILE_GetNtStatus();
}
return STATUS_SUCCESS;
#else
ERR( "not supported\n" );
return STATUS_NOT_IMPLEMENTED;
#endif
}

View File

@ -1068,8 +1068,8 @@
/* Define to 1 if you have the <sys/wait.h> header file. */
#undef HAVE_SYS_WAIT_H
/* Define to 1 if you have the `tcgetattr' function. */
#undef HAVE_TCGETATTR
/* Define to 1 if you have the `tcdrain' function. */
#undef HAVE_TCDRAIN
/* Define to 1 if you have the <termios.h> header file. */
#undef HAVE_TERMIOS_H