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

@@ -2005,7 +2005,8 @@ extern "C" int
stat64 (const char *__restrict name, struct stat *__restrict buf)
{
syscall_printf ("entering");
path_conv pc (name, PC_SYM_FOLLOW | PC_POSIX | PC_KEEP_HANDLE,
path_conv pc (name, PC_SYM_FOLLOW | PC_POSIX | PC_KEEP_HANDLE
| PC_SYM_NOFOLLOW_PROCFD,
stat_suffixes);
return stat_worker (pc, buf);
}