delorie.com/archives/browse.cgi | search |
X-Recipient: | archive-cygwin AT delorie DOT com |
DKIM-Filter: | OpenDKIM Filter v2.11.0 sourceware.org 53661385C301 |
DKIM-Signature: | v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com; |
s=default; t=1692745583; | |
bh=9AhIEC2FbkH/BPuSBFpsK9eRRWYwwTdERIYAEf0uewU=; | |
h=References:In-Reply-To:Date:Subject:To:List-Id:List-Unsubscribe: | |
List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: | |
From; | |
b=VIafKSQ8lJuJGEnyStFf9MHsbuh2p5rxmgd2prNxumrs68YcicfIaO9ZS8mH1bYlE | |
V20r+wppFn1TyocdEkuVMNt1rAtl4KbHivgC04f16d10YOtIIY9OgwypCaL8xAcb5w | |
FclkYLCtBFa7JWXhskO4EHsYqKa1kvX630kONRgU= | |
X-Original-To: | cygwin AT cygwin DOT com |
Delivered-To: | cygwin AT cygwin DOT com |
DMARC-Filter: | OpenDMARC Filter v1.4.2 sourceware.org B8C153858D37 |
X-Google-DKIM-Signature: | v=1; a=rsa-sha256; c=relaxed/relaxed; |
d=1e100.net; s=20221208; t=1692745563; x=1693350363; | |
h=content-transfer-encoding:to:subject:message-id:date:from | |
:in-reply-to:references:mime-version:x-gm-message-state:from:to:cc | |
:subject:date:message-id:reply-to; | |
bh=suE9etNBtpAe0tussga90Le18hxiwWkjpFCZ5MMzxpg=; | |
b=TgriBoscNz3zUJE2M9cHvvh4RcA7NMn+39JpK2sOFlCGMuLivcf+xFJ/YhVrX9O/w8 | |
Zc6CwI6k6uNC+3oMHnORnX3GMdoGul/hhSY0v2jOfDFraY0ak0/EcgzBRKEKJzX8gM89 | |
jl/txDNdoSIua+MLab+p0KEscr1cnUiyh1Huymv8z7ffqBFPSar4YOM4HW5OziTX9W4w | |
BYdx5d9xIkhrYWed5bbYtKrtv7rwCpOWGJJrBWapuSlwvvATx+4r+kwwmL8x2LtJDKCl | |
mL2D5uKqnUtwZ9d+SiyoEyECdSYX3mFDYZjoUhr7Euf41xh2y/cJWqTDiR2/XgxYxIS8 | |
t0+g== | |
X-Gm-Message-State: | AOJu0YxFc6Wa0RUBqfsWR0hO0rx+DfsArFauuGNlNJpuohGNH/unvz6d |
1Wn2vuyyfpo10KrxqrphFCmDnyE+PZFXRpR44BuQoaE2sN0= | |
X-Google-Smtp-Source: | AGHT+IGOEVYo6BNqSwdjwzh0nb5JCXXQHKgO1EEVlEKkLCnKs5St0F5kFK7YmMqVw0PpBQxY/AQofDReeLJmMorQrxE= |
X-Received: | by 2002:a6b:620d:0:b0:786:f4a0:d37e with SMTP id |
f13-20020a6b620d000000b00786f4a0d37emr1095446iog.4.1692745562584; Tue, 22 Aug | |
2023 16:06:02 -0700 (PDT) | |
MIME-Version: | 1.0 |
References: | <CANH4o6O-8O-iMaHowDuy0y7H=pVfZ-3EvubDmTdjGVSST8FkAQ AT mail DOT gmail DOT com> |
<CANH4o6MnH7gWj7d0vmkhCL5N0BTbkrbtGZGtso43MVZBJLBGtw AT mail DOT gmail DOT com> | |
<ZN8tK/mATx6KbQWk AT calimero DOT vinschen DOT de> | |
<CALXu0UcByeJHfBWSPEZkmfMqSKkmRT_5ZkxLc25EyhJzN9FUtA AT mail DOT gmail DOT com> | |
<ZOMiYcQfb7i8Kc8i AT calimero DOT vinschen DOT de> | |
<DM8PR09MB70950FABA8C4DAD80B0EA189A51FA AT DM8PR09MB7095 DOT namprd09 DOT prod DOT outlook DOT com> | |
In-Reply-To: | <DM8PR09MB70950FABA8C4DAD80B0EA189A51FA@DM8PR09MB7095.namprd09.prod.outlook.com> |
Date: | Wed, 23 Aug 2023 01:05:36 +0200 |
Message-ID: | <CAKAoaQkPovkZhVVnkDB3wXKdHejqwKmG7vG38rfy2rtjsGV-uQ@mail.gmail.com> |
Subject: | How to fix |mkfifo()| failure if |pathname| is on NFS ? / was: Re: |
[EXTERNAL] Re: mkfifo: cannot set permissions of 'x.fifo': Not a directory | |
To: | "cygwin AT cygwin DOT com" <cygwin AT cygwin DOT com> |
X-Spam-Status: | No, score=-1.4 required=5.0 tests=BAYES_00, |
FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, | |
KAM_DMARC_STATUS, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, | |
SPF_PASS, TXREP autolearn=no autolearn_force=no version=3.4.6 | |
X-Spam-Checker-Version: | SpamAssassin 3.4.6 (2021-04-09) on |
server2.sourceware.org | |
X-BeenThere: | cygwin AT cygwin DOT com |
X-Mailman-Version: | 2.1.29 |
List-Id: | General Cygwin discussions and problem reports <cygwin.cygwin.com> |
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: | Roland Mainz via Cygwin <cygwin AT cygwin DOT com> |
Reply-To: | Roland Mainz <roland DOT mainz AT nrubsig DOT org> |
Sender: | "Cygwin" <cygwin-bounces+archive-cygwin=delorie DOT com AT cygwin DOT com> |
X-MIME-Autoconverted: | from base64 to 8bit by delorie.com id 37MN6NVd027960 |
On Tue, Aug 22, 2023 at 4:52 PM Lavrentiev, Anton (NIH/NLM/NCBI) [C] via Cygwin <cygwin AT cygwin DOT com> wrote: > > FIFOs which don't make *any* sense > > ... FWIW, a remote NFS fileystem. > > I got an impression that the OP is trying to deploy something (maybe the entire Cygwin) onto an > NFS share. So the named FIFO "file" is also created in there. I agree with that impression. This is basically what large sites (universities etc) do with UNIX and Linux: The machines mount an user's ${HOMR} directory via automounter over NFS, and users are discouraged (e.g. grumpy admin visiting you in person, blocking all escape routes... =:-) ) from using the machine's local filesystems (in Cygwin's case that includes "C:"!). In that case people want to use |mkfifo()|/|mkfifoat()| and/or /usr/bin/mkfifo in their home directory, and don't expect that it does not work. But that is what happens on Cygwin 3.4.8 right now, if someone tries to do a |mkfifo()| on a NFS home directory (tested with MS NFSv3 and CITI NFSv4 clients): |mkfifo()| succeeds, but the resulting inode is *NOT* a FIFO as requested Example (/cygdrive/h/ is my home directory shared from my Linux machine): ---- snip ---- roland_mainz AT winkrakra1 /cygdrive/h/work/cygwin_mkfifo_on_nfs $ uname -a CYGWIN_NT-10.0-19045 winkrakra1 3.4.8-1.x86_64 2023-08-17 17:02 UTC x86_64 Cygwin roland_mainz AT winkrakra1 /cygdrive/h/work/cygwin_mkfifo_on_nfs $ mount C:/cygwin64/bin on /usr/bin type ntfs (binary,auto) C:/cygwin64/lib on /usr/lib type ntfs (binary,auto) C:/cygwin64 on / type ntfs (binary,auto) C: on /cygdrive/c type ntfs (binary,posix=0,user,noumount,auto) H: on /cygdrive/h type nfs (binary,posix=0,user,noumount,auto) roland_mainz AT winkrakra1 /cygdrive/h/work/cygwin_mkfifo_on_nfs $ ls -l total 1 -rw-rw-rw- 1 Unix_User+0 Unix_Group+0 330 Aug 22 23:58 cygwin_mkfifo_on_nfs.c roland_mainz AT winkrakra1 /cygdrive/h/work/cygwin_mkfifo_on_nfs $ cat -n cygwin_mkfifo_on_nfs.c 1 #include <stdlib.h> 2 #include <stdio.h> 3 #include <stdio.h> 4 #include <errno.h> 5 #include <sys/types.h> 6 #include <sys/stat.h> 7 8 int main(int ac, char *av[]) 9 { 10 (void)puts("# start"); 11 12 if (mkfifo("/cygdrive/h/work/cygwin_mkfifo_on_nfs/myfifo.fifo", 0) != 0) 13 perror("mkfifo failed"); 14 (void)puts("# done."); 15 return EXIT_SUCCESS; 16 } 17 roland_mainz AT winkrakra1 /cygdrive/h/work/cygwin_mkfifo_on_nfs $ gcc -g cygwin_mkfifo_on_nfs.c roland_mainz AT winkrakra1 /cygdrive/h/work/cygwin_mkfifo_on_nfs $ ./a # start # done. roland_mainz AT winkrakra1 /cygdrive/h/work/cygwin_mkfifo_on_nfs $ ls -l total 68 -rwxr-xr-x 1 Unix_User+0 Unix_Group+0 66951 Aug 23 00:12 a.exe -rw-rw-rw- 1 Unix_User+0 Unix_Group+0 330 Aug 22 23:58 cygwin_mkfifo_on_nfs.c lrwxrwxrwx 1 Unix_User+0 Unix_Group+0 11 Aug 23 00:12 myfifo.fifo -> ':\0:c4:1000' roland_mainz AT winkrakra1 /cygdrive/h/work/cygwin_mkfifo_on_nfs $ cat <myfifo.fifo -bash: myfifo.fifo: No such file or directory ---- snip ---- Note that Cygwin does not interpret the file |myfifo.fifo| as FIFO, instead it comes back as a symlink "myfifo.fifo -> ':\0:c4:1000'". AFAIK there are (at least) these two options to fix the problems: 1. Check whether the filesystem for the fifos path is NFS (cgywin.dll's |fs.fs_is_nfs()|), and if it is a symlink check if it starts with ':\0:c4:' (assuming "c4" is the prefix for inodes created with |mkfifo()|). If this condition is |true|, then cygwin |stat()|, |open()| etc. should treat this inode as FIFO. 2. Check whether the filesystem for the fifos path is NFS (cgywin.dll's |fs.fs_is_nfs()|), and then just refuse |mkfifo()| with |ENOSYS| (not implemented) Better algorithm for [1] might be to check whether the inode is a symlink, and then do a |fs.fs_is_nfs()| on the symlinks |pathname|, assuming this is more performant. > It's pointless to assume that the FIFO can be used as a communication > device between the hosts that can mount the share, but it can be quite > feasible to envision a scenario, in which the same host opens the FIFO > located on the share from two processes and establish the > communication using that special "file" (which is basically a special > data-less i-node). Well, this is what RFS (see https://en.wikipedia.org/wiki/Remote_File_Sharing) was doing - but it was removed in Solaris 2.4, because its complexity was too great (well, the original implementation was simple and clean, and then it grew all over the kernel just to handle all corner cases of POSIX&co.) - and it would be nice not to repeat the mistakes of the past. ---- Bye, Roland -- __ . . __ (o.\ \/ /.o) roland DOT mainz AT nrubsig DOT org \__\/\/__/ MPEG specialist, C&&JAVA&&Sun&&Unix programmer /O /==\ O\ TEL +49 641 3992797 (;O/ \/ \O;) -- 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 © 2019 by DJ Delorie | Updated Jul 2019 |