Mailing-List: contact cygwin-developers-help AT sourceware DOT cygnus DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-developers-owner AT sources DOT redhat DOT com Delivered-To: mailing list cygwin-developers AT sources DOT redhat DOT com From: Chris Faylor Date: Fri, 15 Sep 2000 11:30:36 -0400 To: cygwin-developers AT sourceware DOT cygnus DOT com Subject: Re: EINTR after SIGSTOP/SIGCONT Message-ID: <20000915113036.A4739@cygnus.com> Reply-To: cygwin-developers AT sources DOT redhat DOT com Mail-Followup-To: cygwin-developers AT sourceware DOT cygnus DOT com References: <18275375909 DOT 20000915165822 AT logos-m DOT ru> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.3.6i In-Reply-To: <18275375909.20000915165822@logos-m.ru>; from deo@logos-m.ru on Fri, Sep 15, 2000 at 04:58:22PM +0400 Cygwin does not have "restartable" I/O. That means that reads on "slow" devices like pipes or ttys will be interrupted by a signal. cgf On Fri, Sep 15, 2000 at 04:58:22PM +0400, Egor Duda wrote: >Hi! > > this program: > >=================================================================== >#include >#include >#include > >int main ( int argc, char** argv ) >{ > char buf[10]; > int pid; > int a[2]; > int rc; > > pipe ( a ); > pid = fork (); > if ( pid == 0 ) > { > rc = read ( a[0], buf, 1 ); > if ( rc < 0 ) perror ( "error reading from pipe" ); > } > else > { > kill ( pid, SIGSTOP ); > sleep(1); > kill ( pid, SIGCONT ); > sleep(1); > write ( a[1], buf, 1 ); > waitpid ( pid ); > } >} >=================================================================== > >prints `error reading from pipe: Interrupted system call' on cygwin >and none on linux. is it intended behavior, or cygwin shouldn't post >"signal_arrived" event on SIGCONT signal? > >Egor. mailto:deo AT logos-m DOT ru ICQ 5165414 FidoNet 2:5020/496.19 > -- cgf AT cygnus DOT com Cygnus Solutions, a Red Hat company http://sourceware.cygnus.com/ http://www.redhat.com/