lkml.org 
[lkml]   [2001]   [Apr]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Lost O_NONBLOCK (Bug?)

On 12 Apr 2001, Philippe Troin wrote:

> Apt I guess ? It has a very strange behavior when backgrounded...

Not really, just want it tries to run dpkg it hangs.

> > The last read was after the process was forgrounded. The read waits
> > forever, the non-block flag seems to have gone missing. It is also a
> > little odd I think that it repeated to get SIGTTIN which was never
> > actually delivered to the program.. Shouldn't SIGTTIN suspend the process?

> Strace can perturbate signal delivery, especially for terminal-related
> signals, I wouldn't trust it...

I know, the problem still happens without strace.

> O_NONBLOCK is not lost... Attempting to read from the controlling tty
> even from a O_NONBLOCK descriptor will trigger SIGTTIN.

I don't really care about the SIGTTIN, what bugs me is that the read that
happens after the process has been foregrounded blocks - and that should
not be.

> Why not use tcflush(STDIN_FILENO, TCIFLUSH) rather than using
> O_NONBLOCK ?

Mm, thats probably better.

> But why would you want to flush stdin if you're in the background ?

Well, overall, I don't even want to fork if I'm in the background. Getting
suspsended before forking is perfectly fine.

Jason

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:25    [W:0.048 / U:0.576 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site