fork: Resource temporarily unavailable errors after upgrading cygwin packages

Takashi Yano takashi.yano@nifty.ne.jp
Wed Feb 12 02:25:00 GMT 2020


On Tue, 11 Feb 2020 22:31:12 +0100
Peter Dons Tychsen wrote:
> On Tue, 2020-02-11 at 22:16 +0900, Takashi Yano wrote:
> > however, I found the real cause is that errno is accidentally set
> > by kill() in pty system calls. That is, the problem is not in the
> > kill() itself but in usage of it. Cygwin older than 3.1.0 does not
> > have these code in pty. 
> 
> OK, is there a fix for that or is that the fix you already pushed? And
> what is wrong with the usage of kill(). How can kill() be used
> incorrectly?

POSIX system calls set global variable errno to appropriate
value when the system calls fail.
http://man7.org/linux/man-pages/man3/errno.3.html

My failure in pty code was that I used kill() in pty system
calls. kill() can be used check if the process is still alive
by passing signal number of 0 to the second argument. It returns
-1 if the process already exited. However, in this case errno
is set to ESRCH. As a result, the errno value which pty system
call set is accidentally overwritten by kill().

The patch was already accepted and pushed to git repository.
I hope cygwin 3.1.3 which applied this patch will be released
shortly.

-- 
Takashi Yano <takashi.yano@nifty.ne.jp>

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple



More information about the Cygwin mailing list