Commit f21961cc authored by Alexandre Julliard's avatar Alexandre Julliard

ntdll: Add a configure check for the tcdrain function.

Also remove the tcgetattr check that is no longer used.
parent 050a46f3
......@@ -13436,7 +13436,7 @@ for ac_func in \
strtoll \
strtoull \
symlink \
tcgetattr \
tcdrain \
thr_kill2 \
timegm \
usleep \
......
......@@ -2063,7 +2063,7 @@ AC_CHECK_FUNCS(\
strtoll \
strtoull \
symlink \
tcgetattr \
tcdrain \
thr_kill2 \
timegm \
usleep \
......
......@@ -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
{
......
......@@ -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;
......
......@@ -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
}
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment