ntdll: Add a configure check for the tcdrain function.
Also remove the tcgetattr check that is no longer used.
This commit is contained in:
parent
050a46f30f
commit
f21961cc14
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue