From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp1.atof.net (smtp1.atof.net [52.86.233.228]) by sourceware.org (Postfix) with ESMTPS id 19A1E3858D1E for ; Wed, 21 Dec 2022 11:15:36 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 19A1E3858D1E Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=gluelogic.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gluelogic.com X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-Spam-Language: en X-Spam-Relay-Country: X-Spam-DCC: B=; R=smtp1.atof.net 1102; Body=1 Fuz1=1 Fuz2=1 X-Spam-RBL: X-Spam-PYZOR: Reported 0 times. Date: Wed, 21 Dec 2022 06:15:27 -0500 From: gs-cygwin.com@gluelogic.com To: cygwin@cygwin.com Subject: open /dev/null O_NOFOLLOW fails with ELOOP Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,KAM_DMARC_STATUS,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 List-Id: open /dev/null O_NOFOLLOW fails with ELOOP Windows 10, 64-bit cygwin Failed with my existing install, then I ran setup.exe, updated to latest, and my tests still failed. a.c --- #include #include #include int main (void) { int fd = open("/dev/null", O_RDWR | O_NOFOLLOW, 0); if (fd < 0) perror("open(/dev/null)"); return fd; } $ gcc a.c ; ./a.exe open(/dev/null): Too many levels of symbolic links While troubleshooting this, there were times where it succeeded and then times where it failed, though it failed most of the time. It did not fail (or succeed) randomly, but seemingly in streaks. Trying to start lighttpd seems to run into this bug reliably, $ /usr/sbin/lighttpd -D -f /etc/lighttpd/lighttpd.conf In the next release of lighttpd, I may end up omitting O_NOFOLLOW if __CYGWIN__ is defined. Cheers, Glenn