X-Recipient: archive-cygwin AT delorie DOT com DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:mime-version:from:date:message-id:subject:to :content-type; q=dns; s=default; b=fPwH6CxEFiGJpM48X2n4sMRUMhMr3 /6ow1JWZNLxWOWReFuTI9ZGaipSQywgvZNGixEaoji5YbIKH31c6MVLrluF6s87p TdfmEs1+gHBx431Wx1G978wZCBYWxQZkRJJ+Xh10sNM3BSyi1wuf6xad+qyzh3im rrUWPWfl0AGy7U= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:mime-version:from:date:message-id:subject:to :content-type; s=default; bh=4xF7LTqofR2pMZielvZ4DajUNGs=; b=v4W TZbVoDqyfVc6d29csgrg+xru6swJJB/PWfg4g+TROGWgTovYBPw72vpewU8U3Lav OOiZ9/LmZBdhV7t15JKRybVuYZIli9S2Jdaz+SJFxZpPEdUN98LPnJqvza6UzR2y 0V4qb+7/rIgUfKLips+udnY6JEsDqxKrns0mWsEk= 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 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-6.5 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,GIT_PATCH_2,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=freezes X-HELO: mail-oi0-f48.google.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=Zx7Qo2mPsbl0Eb6mHi3p4lRLODPT+pv1ozi5kmR1BWs=; b=m5aR3LSy70IHlMXkF0uPVfQgvkMhUmMrm2t0tk39GgHg6RxLRGrOGs6F2dR7isAEHb GG+FJkuG3OXW98RQOPbyVMRNfkHVNT0FzZYEoPjEko8YITOebJjh9IyZ/sgoZliFeFMP Ndd1gc7omOTPEycjxmEDzx3Vk/oXvBTtwZmlt+HsR24TTvUoAEOqoYAIzPPILxMtaDnU VRhZDihlFuf9lOk7R7XkRD9jQcCo+NnHHvW8z8BrJbUR9E4xt1O6YEzKlCTen4a+ABya u1Ayl0cRmYL6bxpuGFP1vk5JTKFDR6jy3ku6SKDvWzP/cMo3M2rqFqMPKkP3NnwMHk+w 5uow== MIME-Version: 1.0 From: =?UTF-8?Q?Jo=C3=A3o_Eiras?= Date: Fri, 20 Jul 2018 15:35:21 +0200 Message-ID: Subject: Freeze opening /dev/stdout To: cygwin AT cygwin DOT com Content-Type: text/plain; charset="UTF-8" X-IsSubscribed: yes Hi. On linux now and then I call a program passing "/dev/stdout" as output file parameter, so the data is output in the terminal. For instance, something tiny in C. #include #include int main () { int fd = open("/dev/stdout", O_WRONLY); printf("Opened stdout: %d\n", fd); return 0; } Unfortunately, this freezes. The problem (I think) is because /dev/stdout is a pipe, so the open() call waits forever until a reader() opens /dev/stdout, which in this case should be the terminal. Interestingly, this does not affect /dev/stderr which is a link to the console device. $ ls -la /dev/std* lrwxrwxrwx 1 user None 15 Sep 6 2017 /dev/stderr -> /proc/self/fd/2 prw------- 1 user None 0 Jun 4 15:54 /dev/stdin prw------- 1 user None 0 Jun 4 15:54 /dev/stdout I've just sent another thread about "/dev/stdin" always being a pipe, so I guess that is related. -- 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