1 // natVMConsole.cc - Native part of VMConsole class.
4 Free Software Foundation
6 This file is part of libgcj.
8 This software is copyrighted work licensed under the terms of the
9 Libgcj License. Please consult the ObjectInputStream "LIBGCJ_LICENSE" for
19 #include <java/io/Console.h>
20 #include <java/io/VMConsole.h>
26 #define TERMIOS_ECHO_IFLAGS (IUCLC|IXON|IXOFF|IXANY)
27 #define TERMIOS_ECHO_LFLAGS (ECHO|ECHOE|ECHOK|ECHONL|TOSTOP)
30 java::io::VMConsole::readPassword(::java::io::Console
*con
)
32 struct termios oldt
, newt
;
35 tcgetattr (STDIN_FILENO
, &oldt
);
37 tcgetattr (STDIN_FILENO
, &newt
);
39 newt
.c_iflag
&= ~TERMIOS_ECHO_IFLAGS
;
40 newt
.c_lflag
&= ~TERMIOS_ECHO_LFLAGS
;
42 tcsetattr (STDIN_FILENO
, TCSANOW
, &newt
);
44 result
= con
->readLine ();
46 tcsetattr (STDIN_FILENO
, TCSANOW
, &oldt
);