Cygwin: introduce fhandler_process_fd and add stat(2) handling

move special fd symlink code into own fhandler_process_fd class
to simplify further additions to /proc/PID/fd/DESCRIPTOR symlink
handling.

Add a method to handle stat(2) on such a proc fd symlink by handle.
This allows correct reply from stat(2) if the target file has been
deleted.  This eventually fixes `awk -f /dev/fd/3 3<<eof'.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
This commit is contained in:
Corinna Vinschen
2019-01-06 20:18:14 +01:00
parent ba12614f79
commit 7aca27b4fe
6 changed files with 189 additions and 164 deletions

View File

@ -552,9 +552,11 @@ fh_alloc (path_conv& pc)
fh = cnew (fhandler_registry);
break;
case FH_PROCESS:
case FH_PROCESSFD:
fh = cnew (fhandler_process);
break;
case FH_PROCESSFD:
fh = cnew (fhandler_process_fd);
break;
case FH_PROCNET:
fh = cnew (fhandler_procnet);
break;