[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
a patch to fix sh_stat on SunOS
From: |
Dmitry Goncharov |
Subject: |
a patch to fix sh_stat on SunOS |
Date: |
Tue, 9 Aug 2016 21:12:16 -0400 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
Good morning,
The following piece of shell code does not work on sunos.
mkfifo /tmp/pipe
cat < /tmp/pipe &
exec 6>/tmp/pipe
test -p /dev/fd/6 && echo pipe
The reason is on sunos /dev/fd/6 is a special character file, not a pipe
(unlike bsd), not a symlink (unlike linux, cygwin).
sh_stat ends up calling stat("/dev/fd/6", finfo) and obtains stat of /dev/fd/6
file rather than stat of the file pointed to by fd 6.
The patch in the attachment makes sh_stat always use fstat regardless of
HAVE_DEV_FD.
I've tested this patch on linux, sunos and aix.
regards, Dmitry
devfd2.diff
Description: Text document
- a patch to fix sh_stat on SunOS,
Dmitry Goncharov <=
- Re: a patch to fix sh_stat on SunOS, Chet Ramey, 2016/08/10
- Re: a patch to fix sh_stat on SunOS, Dmitry Goncharov, 2016/08/10
- Re: a patch to fix sh_stat on SunOS, Chet Ramey, 2016/08/10
- Re: a patch to fix sh_stat on SunOS, Dmitry Goncharov, 2016/08/10
- Re: a patch to fix sh_stat on SunOS, Chet Ramey, 2016/08/11
- Re: a patch to fix sh_stat on SunOS, Dmitry Goncharov, 2016/08/20
- Re: a patch to fix sh_stat on SunOS, Chet Ramey, 2016/08/21
- Re: a patch to fix sh_stat on SunOS, Dmitry Goncharov, 2016/08/21
- Re: a patch to fix sh_stat on SunOS, Chet Ramey, 2016/08/22
- Message not available
- Re: a patch to fix sh_stat on SunOS, Chet Ramey, 2016/08/24