[PATCH] default ps -W process start time to system boot time when inaccessible, 0, -1

2019-03-22 Thread Brian Inglis
diff --git a/winsup/utils/ps.cc b/winsup/utils/ps.cc index 4fce3e0b3..c81805ab6 100644 --- a/winsup/utils/ps.cc +++ b/winsup/utils/ps.cc @@ -337,6 +337,17 @@ main (int argc, char *argv[]) p->start_time = to_time_t (); CloseHandle (h); } + if (!h

[PATCH fifo 4/8] Cygwin: FIFO: improve EOF detection

2019-03-22 Thread Ken Brown
Add a hit_eof method that tries to detect whether any clients are connected. Before concluding that there are none, it gives the listen_client thread time to update the client data. --- winsup/cygwin/fhandler.h | 1 + winsup/cygwin/fhandler_fifo.cc | 21 - 2 files

[PATCH fifo 6/8] Cygwin: FIFO: update fixup_after_fork

2019-03-22 Thread Ken Brown
Fixup each client. Reset listen_client_thr and lct_termination_evt. --- winsup/cygwin/fhandler_fifo.cc | 9 + 1 file changed, 9 insertions(+) diff --git a/winsup/cygwin/fhandler_fifo.cc b/winsup/cygwin/fhandler_fifo.cc index c295c2393..7a592aa0d 100644 ---

[PATCH fifo 8/8] Cygwin: FIFO: update select

2019-03-22 Thread Ken Brown
Add static functions peek_fifo, thread_fifo, start_thread_fifo, and fifo_cleanup to select.cc. These are based on the corresponding pipe functions, the main difference being that peek_fifo loops through the connected clients to see if any of them have data available for reading. Add the

[PATCH fifo 5/8] Cygwin: FIFO: update clone and dup

2019-03-22 Thread Ken Brown
Deal with all clients. --- winsup/cygwin/fhandler.h | 8 +--- winsup/cygwin/fhandler_fifo.cc | 25 + 2 files changed, 30 insertions(+), 3 deletions(-) diff --git a/winsup/cygwin/fhandler.h b/winsup/cygwin/fhandler.h index af5f500bf..0ebc44e0d 100644 ---

[PATCH fifo 3/8] Cygwin: FIFO: add a spinlock

2019-03-22 Thread Ken Brown
Don't let listen_client_thread and raw_read access the client list simultaneously. --- winsup/cygwin/fhandler.h | 3 +++ winsup/cygwin/fhandler_fifo.cc | 34 +- 2 files changed, 28 insertions(+), 9 deletions(-) diff --git a/winsup/cygwin/fhandler.h

[PATCH fifo 0/8] Allow a FIFO to have multiple writers

2019-03-22 Thread Ken Brown
Currently a FIFO can have only one writer. A second attempt to open the FIFO for writing blocks while fhandler_fifo::open waits for the read_ready event to be signalled. This patch series tries to fix the problem by having the reader open multiple instances of the Windows named pipe underlying

[PATCH fifo 1/8] Cygwin: FIFO: stop using overlapped I/O

2019-03-22 Thread Ken Brown
Make fhandler_fifo a derived class of fhandler_base instead of fhandler_base_overlapped. Replace the create_pipe macro, which is based on fhandler_pipe::create, by new create_pipe and open_pipe methods. These use NT functions instead of Win32 functions. Replace fifo_name by get_pipe_name, which