From mboxrd@z Thu Jan 1 00:00:00 1970 MIME-Version: 1.0 In-Reply-To: <20150627203011.GB2121@ananda.local> References: <20150627203011.GB2121@ananda.local> Date: Sat, 27 Jun 2015 21:58:47 +0100 Message-ID: From: Charles Forsyth To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> Content-Type: multipart/alternative; boundary=f46d0442724e7759940519861f99 Subject: Re: [9fans] Help with interrupting fgetc() Topicbox-Message-UUID: 5c456634-ead9-11e9-9d60-3106f5b1d025 --f46d0442724e7759940519861f99 Content-Type: text/plain; charset=UTF-8 On 27 June 2015 at 21:30, Nils M Holm wrote: > It should > keep echoing after printing "oopsie", but it just exits instead. > What am I missing? > if interrupted, fgetc returns EOF because the underlying read system call returns -1 (with error string "interrupted"). System calls are interrupted by a note (see notify(2)). Your loop will therefore stop and exit. Also, see /sys/doc/comp.ms for some other details of the Plan 9 C environment. For instance, main is void main(int, char**); and you need an explicit call to exits [sic] at the end of main, not a return 0 (or you'll get an error status "main" returned to the shell). --f46d0442724e7759940519861f99 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable

= On 27 June 2015 at 21:30, Nils M Holm <nmh@t3x.org> wrote:
It should
keep echoing after printing "oopsie", but it just exits instead.<= br> What am I missing?

if interrupted, fgetc return= s EOF because the underlying read system call returns -1 (with error string= "interrupted").
System calls are= interrupted by a note (see notify(2)). Your loop will therefore stop and e= xit.

Also, see /sys/doc/comp.ms for some other= details of the Plan 9 C environment. For instance, main is
=C2=A0 =C2=A0 =C2=A0 void main(int, char**);
and you need an explicit call to exits [sic] at the end = of main, not a return 0 (or you'll get an error status "main"=
returned to the shell).
--f46d0442724e7759940519861f99--