This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

getpass and /dev/tty


Hello!

Would it be possible that getpass() first reads on /dev/tty before
defaulting to stdin?

% uname -a
CYGWIN_NT-5.1 edited 1.7.12(0.260/5/3) 2012-04-03 10:24 i686 Cygwin
% ls /dev/tt*
/dev/tty  /dev/ttyS0  /dev/ttyS2  /dev/ttyS3
% cat foo.c
#include <stdio.h>
#include <unistd.h>

int main () {
  fprintf (stderr, "Press <Return> to continue . . .\n");
  getpass ("");
  return 0;
};
% gcc -O -o ./foo foo.c
% ./foo
Press <Return> to continue . . .
[here you press Return]

% ./foo < /dev/null
Press <Return> to continue . . .

%

[for the second run of ./foo, you cannot press Return]



Regards,

Denis Excoffier.

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]