[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [MiNT] read() and signals



On Sun, 2010-07-11 at 19:20 +0200, Vincent Rivière wrote:
> Alan Hourihane wrote:
> >> The Ctrl+C keystroke requires to press Enter to do its job, it may be related.
> >> Alan, by chance, have you investigated this issue ?
> >
> > I've seen the same problem, but not investigated yet.
> 
> I had a look at it, and I think I have found the cause of the bash problem.
> Basically, the read() function should fail with EINTR when a signal is 
> caught, but in MiNT it continues blocking.
> 
> The attached program is a very simple testcase.
> 
> On Linux and Cygwin, I get:
> $ ./mysig
> Please type ^C
> ^CSIGINT!
> ret = -1, errno = 4, msg = Interrupted system call
> 
> But on MiNT, I can type ^C several times, it does not exit:
> $ ./mysig
> Please type ^C
> SIGINT!
> SIGINT!
> SIGINT!
> SIGINT!
> 
> However it exits if I type a standard key, of course.
> 
> I don't know if the problem comes from the kernel or the MiNTLib.

Remember that bash 3.2 didn't have this problem, so it'd be worth
investigating what changed.

Alan.