From owner-freebsd-questions Thu Sep 14 17:29:46 2000 Delivered-To: freebsd-questions@freebsd.org Received: from guru.mired.org (zoom0-089.telepath.com [216.14.0.89]) by hub.freebsd.org (Postfix) with SMTP id 1CA0F37B423 for ; Thu, 14 Sep 2000 17:29:23 -0700 (PDT) Received: (qmail 78200 invoked by uid 100); 15 Sep 2000 00:29:08 -0000 From: Mike Meyer MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <14785.27988.529047.912155@guru.mired.org> Date: Thu, 14 Sep 2000 19:29:08 -0500 (CDT) To: Zhiui Zhang Cc: questions@freebsd.org Subject: Re: write to terminal in a background process In-Reply-To: <125711520@toto.iv> X-Mailer: VM 6.72 under 21.1 (patch 10) "Capitol Reef" XEmacs Lucid X-face: "5Mnwy%?j>IIV\)A=):rjWL~NB2aH[}Yq8Z=u~vJ`"(,&SiLvbbz2W`;h9L,Yg`+vb1>RG% *h+%X^n0EZd>TM8_IB;a8F?(Fb"lw'IgCoyM.[Lg#r\ Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Zhiui Zhang writes: > I thought a background process can not write to terminal. It will get a > signal if trying to do so. But someone presents me a small program: No, it *may* not be able to write to the terminal, depending on the terminals modes. See "man stty", particularly the "tostop" option. > #include > main() > { > printf("printing\n"); > } > > $ a.out & > > and it does print. Can anyone explain this to me? Thanks. Try $ stty tostop $ a.out & and see what it does (or maybe it's "stty -tostop").