Re: ncurses getch SIGWINCH
From: DINH Viet Hoa (dinh.viet.hoa_at_free.fr)
Date: 01/27/05
- Next message: James Vanns: "Re: execve with daemon process"
- Previous message: Farhan: "Re: How full is a UDP socket buffer"
- In reply to: Average Joe: "ncurses getch SIGWINCH"
- Next in thread: alexs: "Re: ncurses getch SIGWINCH"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Thu, 27 Jan 2005 10:12:07 +0100
Average Joe wrote :
> My program sits in a blocking ncurses getch() call. When I receive the
> signal SIGWINCH (screen resize), how do I inject a character into the
> stdin so that getch will wake up?
>
> I know I can use a non-blocking getch() call but it rails the CPU, and
> sleeping is inefficient.
use select() with a timeout of 0.1 sec (sufficient most of time for
user interface) before getch()
-- DINH V. Hoa, "Paraît-il que c'est ce que recherchent la majorité des djeunz. Il n'y a plus aucun attrait pour les métiers scientifiques ni techniques. Ils veulent être chanteur, acteur ou fonctionnaire. C'est désépérant..." -- Emmanuel Delahaye
- Next message: James Vanns: "Re: execve with daemon process"
- Previous message: Farhan: "Re: How full is a UDP socket buffer"
- In reply to: Average Joe: "ncurses getch SIGWINCH"
- Next in thread: alexs: "Re: ncurses getch SIGWINCH"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|