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 \ ...@@ -13436,7 +13436,7 @@ for ac_func in \
strtoll \ strtoll \
strtoull \ strtoull \
symlink \ symlink \
tcgetattr \ tcdrain \
thr_kill2 \ thr_kill2 \
timegm \ timegm \
usleep \ usleep \
......
...@@ -2063,7 +2063,7 @@ AC_CHECK_FUNCS(\ ...@@ -2063,7 +2063,7 @@ AC_CHECK_FUNCS(\
strtoll \ strtoll \
strtoull \ strtoull \
symlink \ symlink \
tcgetattr \ tcdrain \
thr_kill2 \ thr_kill2 \
timegm \ timegm \
usleep \ usleep \
......
...@@ -2777,14 +2777,7 @@ NTSTATUS WINAPI NtFlushBuffersFile( HANDLE hFile, IO_STATUS_BLOCK* IoStatusBlock ...@@ -2777,14 +2777,7 @@ NTSTATUS WINAPI NtFlushBuffersFile( HANDLE hFile, IO_STATUS_BLOCK* IoStatusBlock
if (!ret && type == FD_TYPE_SERIAL) if (!ret && type == FD_TYPE_SERIAL)
{ {
while (tcdrain( fd ) == -1) ret = COMM_FlushBuffersFile( fd );
{
if (errno != EINTR)
{
ret = FILE_GetNtStatus();
break;
}
}
} }
else else
{ {
......
...@@ -142,6 +142,7 @@ extern NTSTATUS TAPE_DeviceIoControl(HANDLE hDevice, ...@@ -142,6 +142,7 @@ extern NTSTATUS TAPE_DeviceIoControl(HANDLE hDevice,
ULONG IoControlCode, ULONG IoControlCode,
LPVOID lpInBuffer, DWORD nInBufferSize, LPVOID lpInBuffer, DWORD nInBufferSize,
LPVOID lpOutBuffer, DWORD nOutBufferSize) DECLSPEC_HIDDEN; LPVOID lpOutBuffer, DWORD nOutBufferSize) DECLSPEC_HIDDEN;
extern NTSTATUS COMM_FlushBuffersFile( int fd ) DECLSPEC_HIDDEN;
/* file I/O */ /* file I/O */
struct stat; struct stat;
......
...@@ -1342,3 +1342,29 @@ NTSTATUS COMM_DeviceIoControl(HANDLE hDevice, ...@@ -1342,3 +1342,29 @@ NTSTATUS COMM_DeviceIoControl(HANDLE hDevice,
lpOutBuffer, nOutBufferSize); lpOutBuffer, nOutBufferSize);
return status; 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 @@ ...@@ -1068,8 +1068,8 @@
/* Define to 1 if you have the <sys/wait.h> header file. */ /* Define to 1 if you have the <sys/wait.h> header file. */
#undef HAVE_SYS_WAIT_H #undef HAVE_SYS_WAIT_H
/* Define to 1 if you have the `tcgetattr' function. */ /* Define to 1 if you have the `tcdrain' function. */
#undef HAVE_TCGETATTR #undef HAVE_TCDRAIN
/* Define to 1 if you have the <termios.h> header file. */ /* Define to 1 if you have the <termios.h> header file. */
#undef HAVE_TERMIOS_H #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