From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29897 invoked by alias); 19 Dec 2008 20:35:12 -0000 Received: (qmail 29889 invoked by uid 22791); 19 Dec 2008 20:35:12 -0000 X-SWARE-Spam-Status: No, hits=-1.5 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from mail-gx0-f10.google.com (HELO mail-gx0-f10.google.com) (209.85.217.10) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 19 Dec 2008 20:34:25 +0000 Received: by gxk3 with SMTP id 3so1001402gxk.2 for ; Fri, 19 Dec 2008 12:34:23 -0800 (PST) Received: by 10.150.96.10 with SMTP id t10mr1810543ybb.128.1229718862909; Fri, 19 Dec 2008 12:34:22 -0800 (PST) Received: from ?10.10.10.134? (208-46-64-1.dia.static.qwest.net [208.46.64.1]) by mx.google.com with ESMTPS id m30sm6383471elf.12.2008.12.19.12.34.15 (version=SSLv3 cipher=RC4-MD5); Fri, 19 Dec 2008 12:34:19 -0800 (PST) Message-ID: <494C0540.5000404@rettc.com> Date: Fri, 19 Dec 2008 20:35:00 -0000 From: Alex Martin User-Agent: Thunderbird 2.0.0.18 (Windows/20081105) MIME-Version: 1.0 To: cygwin@cygwin.com Subject: Re: printf goes to serial port? References: <494BE168.1020600@rettc.com> <17393e3e0812191135v64035dfq1e8f25c2a352872@mail.gmail.com> In-Reply-To: <17393e3e0812191135v64035dfq1e8f25c2a352872@mail.gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes 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 X-SW-Source: 2008-12/txt/msg00494.txt.bz2 Matt Wozniski wrote: > On Fri, Dec 19, 2008 at 2:30 PM, Gary R. Van Sickle wrote: >>> From: Alex Martin >>> >>> Hello, >>> >>> I have a cygwin environment, running some software I am >>> writing to talk to some serial devices. >>> >>> Somehow, trying to debug why I could not see printf output to >>> console, I ran a serial port sniffer and voila all of my >>> printf commands are writing on the serial port. >>> >> I can't say that it would cross my mind to look for my missing printf output >> on a serial port, even if I was using a serial port in other parts of the >> program to talk to something. Whatever it was that gave you the hunch to do >> that is probably at the core of your problem. > > My slightly wild guess is that you do an open() on the serial device > without a controlling terminal and without passing the O_NOCTTY flag, > causing the serial device to become your controlling terminal. > > ~Matt > Hello, I do this: //snip if (port == 1) { fd = ::open("/dev/ttyS0", O_NONBLOCK | O_RDWR | O_NOCTTY ); } //snip Can you point me to some info about "controlling terminal"? I have been living in a strict c++/cygwin/fox-toolkit world and I am not familiar with terminals and things. If I try to run my .exe from a cygwin prompt, it doesnt start up. If I run my exe from a cmd.exe window, it starts up my app but then returns to a prompt instead of staying open to catch printfs and such. Any ideas? Thanks for your help. Alex Martin -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/