From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 95687 invoked by alias); 20 Jul 2018 13:36:05 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 95679 invoked by uid 89); 20 Jul 2018 13:36:04 -0000 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 Received: from mail-oi0-f48.google.com (HELO mail-oi0-f48.google.com) (209.85.218.48) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 20 Jul 2018 13:36:03 +0000 Received: by mail-oi0-f48.google.com with SMTP id s198-v6so21352822oih.11 for ; Fri, 20 Jul 2018 06:36:03 -0700 (PDT) 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 Received: by 2002:a9d:507:0:0:0:0:0 with HTTP; Fri, 20 Jul 2018 06:35:21 -0700 (PDT) From: =?UTF-8?Q?Jo=C3=A3o_Eiras?= Date: Fri, 20 Jul 2018 16:08:00 -0000 Message-ID: Subject: Freeze opening /dev/stdout To: cygwin@cygwin.com Content-Type: text/plain; charset="UTF-8" X-IsSubscribed: yes X-SW-Source: 2018-07/txt/msg00199.txt.bz2 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