Cygwin: FIFO: improve raw_write

Don't set the write end of the pipe to non-blocking mode if the FIFO
is opened in blocking mode.

In fhandler_fifo::raw_write in blocking mode, wait for the write to
complete rather than returning -1 with EAGAIN.

If the amount to write is large, write in smaller chunks (of size
determined by a new data member max_atomic_write), as in
fhandler_base_overlapped.

For convenience, add two new NTSTATUS codes, STATUS_THREAD_SIGNALED
and STATUS_THREAD_CANCELED, to ntdll.h.
This commit is contained in:
Ken Brown
2019-04-15 15:43:57 +00:00
committed by Corinna Vinschen
parent a7d08b3ecd
commit bb46627871
3 changed files with 82 additions and 22 deletions

View File

@ -15,7 +15,9 @@
extern GUID __cygwin_socket_guid;
#define CYGWIN_SOCKET_GUID (&__cygwin_socket_guid)
/* custom status code: */
/* Custom Cygwin-only status codes. */
#define STATUS_THREAD_SIGNALED ((NTSTATUS)0xe0000001)
#define STATUS_THREAD_CANCELED ((NTSTATUS)0xe0000002)
#define STATUS_ILLEGAL_DLL_PSEUDO_RELOCATION ((NTSTATUS) 0xe0000269)
/* Simplify checking for a transactional error code. */