X-Recipient: archive-cygwin AT delorie DOT com X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,RFC_ABUSE_POST,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: sourceware.org MIME-Version: 1.0 Date: Tue, 19 Apr 2011 21:16:37 +0100 Message-ID: Subject: 0417 snapshot: exec() fails on /proc/self/exe From: Andy Koppe To: cygwin AT cygwin DOT com Content-Type: text/plain; charset=UTF-8 X-IsSubscribed: yes Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com With the latest snapshot, exec() fails on /proc/self/exe: $ cat test.c #include #include #include #include #include int main(int argc, char *argv[]) { if (argc > 1 && !fork()) { execl("/proc/self/exe", argv[0], (char *)0); puts(strerror(errno)); } return 0; } $ cc test.c $ ./a bla Bad file descriptor With 1.7.9, it prints nothing, which is the expected behaviour. Looking at POSIX, EBADF is not a valid errno for exec(). (The argument in the test is there as a way to stop it from becoming a fork bomb.) Andy -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple