5 my_getpass (char **lineptr
, size_t *n
, FILE *stream
)
7 struct termios old
, new;
10 /* Turn echoing off and fail if we can't. */
11 if (tcgetattr (fileno (stream
), &old
) != 0)
15 if (tcsetattr (fileno (stream
), TCSAFLUSH
, &new) != 0)
18 /* Read the password. */
19 nread
= getline (lineptr
, n
, stream
);
21 /* Restore terminal. */
22 (void) tcsetattr (fileno (stream
), TCSAFLUSH
, &old
);