"unable to set non-blocking on pty"

"unable to set non-blocking on pty"

Post by tuan » Fri, 04 Jul 2003 12:38:54



Help!!!
I have Tru64 unix v4.0f and having problem logon onto the unix beside
root account. When a different user logon, an message error display:
"unable to set non-blockin on pty". Any suggestion to resolved this
problem would be most appreciated. Thanks in advance.
 
 
 

1. "Raw" and "Non-blocking" terminal mode in Linux

I am porting my non-gui text editor to Linux.

On Sun Solaris, SGI IRIX, Sequent Unix the following code allows me
to put a terminal into "raw" mode, then set or unset non-blocking
termial reads at will.

On Linux this code does not work - the terminal wont go into non-blocking
read mode.
I have studied the man pages for ioctl, termio/termios, terminfo,
term and cannot find anything to give me a clue as to what I'm doing
wrong.

I have looked at example code (nvi), and it uses the termios struct in
place of termio struct, and
   tcsetattr(0,(struct termios *) &new_term))
in place of ioctl(), with everything alse the same, but this fails in a
different way, appearing to be cooking Ctrl-C (etc) when I have told it
not to.

If there is anyone who has written/ported code to do this on Linux I
would be most gratefull for any assistance.

#include <term.h>

static struct termio old_term;
static struct termio new_term;

/* put the terminal into "raw" mode with blocking terminals reads */
void set_raw()
{
new_term.c_iflag = new_term.c_iflag & ~IXON & ~BRKINT;
new_term.c_lflag = new_term.c_lflag & ~ECHO & ~ICANON & ~ISIG;
new_term.c_cc[4] = 1;
new_term.c_cc[5] = 0;

if (ioctl(0,TCSETA,(struct termio *) &new_term))
  fprintf(stderr,"\nUnable to setup terminal - ioctl() failed.\n");

/* setup non-blocking terminals reads */
void non_block_kb(int delay)
{
if (kb_blocking)
  {
  new_term.c_cc[4] = 0;
  new_term.c_cc[5] = delay;
  if (ioctl(0,TCSETA,(struct termio *) &new_term))
    fprintf(stderr,"Unable to setup non-blocking kb input: ioctl() failed.");
  }

Many thanks, Mark.

2. How to install a printer in Linux

3. GETSERVBYNAME()????????????????????"""""""""""""

4. Linksys EC2T Ethernet PCMCIA Linux problem

5. "Novell-like","non-TCP/IP","networking" OS to place Unix

6. help: rxvt can't show chop sign

7. Semantics of non-blocking "passive"-mode SOCK_STREAM sockets

8. Printing to a Cisco Router Async Port

9. recv on TCP non-blocking socket retured "Resource temporarily unavailable"

10. Executing a command in "non-blocking" mode?

11. """"""""My SoundBlast 16 pnp isn't up yet""""""""""""

12. Can "pppd" bind to a pty with "telnet" session over ethernet?

13. ERRORS: "telnetd: all network ports in use", "no ptys" etc