| delorie.com/archives/browse.cgi | search |
| DMARC-Filter: | OpenDMARC Filter v1.4.2 delorie.com 68P8xHpl504913 |
| Authentication-Results: | delorie.com; dmarc=pass (p=none dis=none) header.from=cygwin.com |
| Authentication-Results: | delorie.com; spf=pass smtp.mailfrom=cygwin.com |
| DKIM-Filter: | OpenDKIM Filter v2.11.0 delorie.com 68P8xHpl504913 |
| Authentication-Results: | delorie.com; |
| dkim=pass (1024-bit key, unprotected) header.d=cygwin.com header.i=@cygwin.com header.a=rsa-sha256 header.s=default header.b=TEsw+KZX | |
| X-Recipient: | archive-cygwin AT delorie DOT com |
| DKIM-Filter: | OpenDKIM Filter v2.11.0 sourceware.org 2CA8C4BB589B |
| DKIM-Signature: | v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com; |
| s=default; t=1790326740; | |
| bh=1WUggzcie62BE1RQspHfhpDiYpyV+SbpWK1WLvdVTsA=; | |
| h=Date:Subject:To:References:In-Reply-To:List-Id:List-Unsubscribe: | |
| List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: | |
| From; | |
| b=TEsw+KZX5GsxsZOSm02dmGGq+5P632SOmEhIO4Oa/9m0Two0n1vcAetCEB4clkSc8 | |
| 23SzwEecKzVHhw2sAf78voi3+UYHj+T65tj3v1C/y4/xikakPtcXHeUDasVfw3MVRK | |
| xl5VZFdGbhnDgB3kya8w9Puh01jSD8lGww9MrUsc= | |
| X-Original-To: | cygwin AT cygwin DOT com |
| Delivered-To: | cygwin AT cygwin DOT com |
| DMARC-Filter: | OpenDMARC Filter v1.4.2 sourceware.org F23614BB58C6 |
| ARC-Filter: | OpenARC Filter v1.0.0 sourceware.org F23614BB58C6 |
| ARC-Seal: | i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1790326719; cv=none; |
| b=IolEUqFaR7fV8ndXE+07nfbfIIwqw5S1/8SiSyhn2oc0Yl/RYGbnQMyIT5kkyl1hIhtC8gFvhvzVPWP/o0hng99Mu6WzsM+hMJEHto7JVYUrG0f8ou9MsIm9yS6Vf++x6h4eWnzvpinWjePe2fbzriaPwocP7Pcwgou0LgxkQtA= | |
| ARC-Message-Signature: | i=1; a=rsa-sha256; d=sourceware.org; s=key; |
| t=1790326719; c=relaxed/simple; | |
| bh=BshMa/wUnjDyNWlQNHVGi2ffUzhEK68P2sp0mnDiQHs=; | |
| h=Message-ID:Date:MIME-Version:From:Subject:To:DKIM-Signature; | |
| b=dycOxiwTkW/nokQ2/AKvfKU8Cwo+kMsfi77uou14VAIEIjgpdmALBZeOXSmmsDO1sHm+AGUUfr9X9fHlFpPadr616LuXwfF6rqoAnKLgUcs+5Ot9W3mFe0mHZyUi6uNWaV+qn+RKFU/y95yQDMn7bBNNS9ziIsS8bR75MRMilME= | |
| ARC-Authentication-Results: | i=1; sourceware.org; |
| dkim=pass (2048-bit key, unprotected) | |
| header.d=systematicsw.ab.ca header.i=@systematicsw.ab.ca header.a=rsa-sha256 | |
| header.s=he header.b=liAzoDaL | |
| DKIM-Filter: | OpenDKIM Filter v2.11.0 sourceware.org F23614BB58C6 |
| Message-ID: | <93034881-2976-4dfa-8d78-00d1aa737c7f@systematicsw.ab.ca> |
| Date: | Fri, 25 Sep 2026 02:58:35 -0600 |
| MIME-Version: | 1.0 |
| User-Agent: | Mozilla Thunderbird |
| Subject: | Re: fstatat of symlink to fifo gets st_mode from symlink, not from |
| fifo | |
| To: | cygwin AT cygwin DOT com |
| References: | <ap5MnTuoylBGxwBm AT raf DOT org> |
| <224c2a02-7ab6-48a7-b84f-bf5236799883 AT maxrnd DOT com> | |
| <24003746-3fa8-4322-b07e-a018dd18d890 AT maxrnd DOT com> | |
| <3e4cd77c-6d5a-1a47-ba4d-5f9d350ba41d AT wisemo DOT com> | |
| Organization: | Systematic Software |
| In-Reply-To: | <3e4cd77c-6d5a-1a47-ba4d-5f9d350ba41d@wisemo.com> |
| X-Rspamd-Queue-Id: | 1BA9A2000E |
| X-Stat-Signature: | jbseghxfjagtzfcwwthatort3eem7ym3 |
| X-Rspamd-Server: | rspamout03 |
| X-Session-Marker: | 427269616E2E496E676C69734053797374656D6174696353572E61622E6361 |
| X-Session-ID: | U2FsdGVkX190HJ88bjfg/lSEDIy+VZWI/b3FbnpucKg= |
| X-HE-Tag: | 1790326716-4970 |
| X-HE-Meta: | U2FsdGVkX1+VKTmf0JyH9SS+ZmifLFTTZUteKgqItM3pG6PCl0ZmL+LlEqMhbFJ0xbT7jsWSYuVaXE2hyNSS73SBPfVSBFdSWHeIuxXJYpMEPG90MWlm4orY8byIcA6RzNqOPxxoqyAo7NdshuW8qOR138UxjZCRMZ9Pnshs2wCROaR23Ozlpk0XEVwuv73hOIM7YN0dxuidflS3Suh345ErtUJlaCstxAihvdq7n+MmvFJggpmqQeq89hINp68oduToWNI7yZoeqPKx+Ls2BkI85nC0D6bs0IjlVl6kZCUmlwn6n3N7MeAlp+Sjdy7WQMFFK/XQgo65JPOFNkkNrPO9Te4qeAWx |
| X-BeenThere: | cygwin AT cygwin DOT com |
| X-Mailman-Version: | 2.1.30 |
| List-Id: | General Cygwin discussions and problem reports <cygwin.cygwin.com> |
| List-Unsubscribe: | <https://cygwin.com/mailman/options/cygwin>, |
| <mailto:cygwin-request AT cygwin DOT com?subject=unsubscribe> | |
| List-Archive: | <https://cygwin.com/pipermail/cygwin/> |
| List-Post: | <mailto:cygwin AT cygwin DOT com> |
| List-Help: | <mailto:cygwin-request AT cygwin DOT com?subject=help> |
| List-Subscribe: | <https://cygwin.com/mailman/listinfo/cygwin>, |
| <mailto:cygwin-request AT cygwin DOT com?subject=subscribe> | |
| From: | Brian Inglis via Cygwin <cygwin AT cygwin DOT com> |
| Reply-To: | Brian DOT Inglis AT SystematicSW DOT ab DOT ca |
| Errors-To: | cygwin-bounces~archive-cygwin=delorie DOT com AT cygwin DOT com |
| Sender: | "Cygwin" <cygwin-bounces~archive-cygwin=delorie DOT com AT cygwin DOT com> |
| X-MIME-Autoconverted: | from base64 to 8bit by delorie.com id 68P8xHpl504913 |
On 2026-09-25 02:22, Jakob Bohm via Cygwin wrote:
> On 25/09/2026 02:26, Mark Geisert via Cygwin wrote:
>> Replying to myself, I write:
>>
>> On 9/12/2026 2:50 AM, Mark Geisert via Cygwin wrote:
>>> Hello raf,
>>>
>>> On 9/6/2026 10:33 PM, raf via Cygwin wrote:
>>>> Hi,
>>>>
>>>> This is on Win10.
>>>>
>>>> I have a seemingly impossible problem with fstatat following a symlink to
>>>> a fifo. Most of the resulting struct stat correctly contains details of the
>>>> fifo except for the st_mode field. It contains the type and permissions
>>>> of the symlink itself.
>>>>
>>>> I assume I must be doing something wrong but the same code works on
>>>> six other operating systems.
>>>>
>>>> Any idea what the cause might be? My tests relating to this have been
>>>> failing for ages, and I just accepted that this wierd little case just
>>>> might not work on Cygwin, but looking into it closely shows that it
>>>> almost does work, just not quite.
>>>>
>>>> Actually, the same problem happens with stat(1), not just my program.
>>>> Here's a demonstration:
>>>>
>>>> mkdir t
>>>> cd t
>>>> mkfifo fifo
>>>> sleep 5
>>>> ln -s fifo symfifo
>>>> stat symfifo fifo
>>>> stat -L symfifo
>>>> cd ..
>>>> rm -r t
>>>>
>>>> The above commands show this ouptut:
>>>>
>>>> $ stat symfifo fifo
>>>> File: symfifo -> fifo
>>>> Size: 4 Blocks: 0 IO Block: 65536 symbolic link
>>>> Device: 15518,20572 Inode: 7599824372130494 Links: 1
>>>> Access: (0777/lrwxrwxrwx) Uid: (197609/ john) Gid: (197121/ None)
>>>> Access: 2026-09-07 15:25:50.209111800 +1000
>>>> Modify: 2026-09-07 15:25:50.209111800 +1000
>>>> Change: 2026-09-07 15:25:50.209111800 +1000
>>>> Birth: 2026-09-07 15:25:50.209111800 +1000
>>>> File: fifo
>>>> Size: 0 Blocks: 1 IO Block: 65536 fifo
>>>> Device: 0,196 Inode: 8162774325551800 Links: 1
>>>> Access: (0666/prw-rw-rw-) Uid: (197609/ john) Gid: (197121/ None)
>>>> Access: 2026-09-07 15:25:49.754243600 +1000
>>>> Modify: 2026-09-07 15:25:43.732451800 +1000
>>>> Change: 2026-09-07 15:25:43.732451800 +1000
>>>> Birth: 2026-09-07 15:25:43.732451800 +1000
>>>> $ stat -L symfifo
>>>> File: symfifo -> fifo
>>>> Size: 4294953488 Blocks: 1 IO Block: 65536 symbolic link
>>>> Device: 0,196 Inode: 8162774325551800 Links: 1
>>>> Access: (0777/lrwxrwxrwx) Uid: (197609/ john) Gid: (197121/ None)
>>>> Access: 2026-09-07 15:25:53.970058800 +1000
>>>> Modify: 2026-09-07 15:25:43.732451800 +1000
>>>> Change: 2026-09-07 15:25:43.732451800 +1000
>>>> Birth: 2026-09-07 15:25:43.732451800 +1000
>>>>
>>>> Note that the last command that follows the symlink
>>>> states that the fifo is a "symbolic link" rather than "fifo"
>>>> and permissions "0777/lrwxrwxrwx" rather than "0666/prw-rw-rw-".
>>>>
>>>> Is this fixable? Or is it just this pc?
>>>
>>> I've reproduced this locally, so it's not your pc ;-). What version of
>>> Cygwin are you running on your Windows 10 machine?
>>>
>>> I've also reproduced this on Cygwin 3.3.6, which is pretty old. You may have
>>> just run into a bug that has gone undiscovered for a long time. I'll look
>>> into investigating and patching this issue.
>>> Thanks for the report,
>>
>> This appears to be due to Cygwin fifos being represented in the Windows
>> filesystem as symlinks. That is, if you list the contents of your 't'
>> directory in a Command Prompt window, you'll see 'fifo.lnk' instead of
>> 'fifo'. So your 'symfifo' turns out to be a symlink to a symlink.
>>
>> I will continue to investigate whether that can be adjusted within Cygwin to
>> match behavior of other Unix derivatives like Linux. This may take a while.
>> Thanks again for the report!
>>
> Note that using "Application icon links" (file extension .LNK), which are
> equivalent to GNOME "desktop files", to represent actual symlinks in some Cygwin
> configurations is problematic in other ways compared to using the actual WinNT
> Symlink mechanisms shared with the POSIX/Interix/Whatever subsystem . There is
> also the Cygwin/Ming32 configuration where a Cygwin symlink is stored as a
> special file with the same and a rare combination of FAT-like attributes, thus
> speeding up checks if a Windows plain file is Cygwin symlink or other special file.
>
> On a more fundamental level, it is a question if a Cygwin FIFO could be
> represented as one of the Win32 special file types from the "named pipe"
> category, either as a symlink to such a pipe or by having a pipe in the other-
> obhect name space have a specilly formatted name that maps 1:1 to the Win32 path
> of the file system location where Cygwin sees the fifo special file. Similarly,
> most Cygwin "device special files" could become symlinks to actual NT namespace
> device files such as L"\Device\HarddiskVolume2" or "\GLOBAL??\NUL" etc. etc. Or
> the Cygwin "/dev/" dir could become entirely synthetic like "/proc/", with "/
> dev/NT/" being an alias for "\Device\" without renames to POSIX traditions.
Check out `/proc/sys/` on your own or work system or CI:
$ l /proc/sys/
ArcName/ MicrosoftMalwareProtectionControlPortWD
BaseNamedObjects/ MicrosoftMalwareProtectionPortWD
BindFltPort MicrosoftMalwareProtectionRemoteIoPortWD
Callback/ MicrosoftMalwareProtectionVeryLowIoPortWD
CLDMSGPORT NLS/
clfs Ntfs
CsrSbSyncEvent ObjectTypes/
Device/ OSDataRoot
Dfs PdcPort
DosDevices/ PendingRenameMutex
Driver/ PowerMonitorPort
DriverData/ PowerPort
DriverStores/ REGISTRY
DSYSDBG.Debug.Trace.Memory.3f4 RPC Control/
EFSInitEvent SAM_SERVICE_STARTED
Fat Security/
FatCdrom SeLsaCommandPort
FileSystem/ SeRmCommandPort
GLOBAL??/ Sessions/
KernelObjects/ SmApiPort
KnownDlls/ SmSsWinStationApiPort
KnownDlls32/ storqosfltport
LanmanServerAnnounceEvent SystemRoot/
LsaPerformance ThemeApiPort
MicrosoftDataLossPreventionAsyncPort UMDFCommunicationPorts/
MicrosoftDataLossPreventionControlPort UniqueInteractiveSessionIdEvent
MicrosoftDataLossPreventionPort WcifsPort
MicrosoftDataLossPreventionRemoteIoPort Win32kCrossSessionGlobals
MicrosoftDataLossPreventionVeryLowIoPort Windows/
MicrosoftMalwareProtectionAsyncPortWD
--
Take care. Thanks, Brian Inglis Calgary, Alberta, Canada
La perfection est atteinte Perfection is achieved
non pas lorsqu'il n'y a plus rien à ajouter not when there is no more to add
mais lorsqu'il n'y a plus rien à retrancher but when there is no more to cut
-- Antoine de Saint-Exupéry
--
Problem reports: https://cygwin.com/problems.html
FAQ: https://cygwin.com/faq/
Documentation: https://cygwin.com/docs.html
Unsubscribe info: https://cygwin.com/ml/#unsubscribe-simple
| webmaster | delorie software privacy |
| Copyright © 2026 by DJ Delorie | Updated Sep 20 2026 |