getpass(3) Library Functions Manual getpass(3) getpass - C (libc, -lc) #include [[deprecated]] char *getpass(const char *prompt); glibc (. feature_test_macros(7)): getpass(): Since glibc 2.2.2: _XOPEN_SOURCE && ! (_POSIX_C_SOURCE >= 200112L) || /* glibc >= 2.19: */ _DEFAULT_SOURCE || /* glibc <= 2.19: */ _BSD_SOURCE Before glibc 2.2.2: none This function is obsolete. Do not use it. See NOTES. If you want to read input without terminal echoing enabled, see the description of the ECHO flag in termios(3). getpass() /dev/tty ( ), prompt, , (<<>>), /dev/tty. The function getpass() returns a pointer to a static buffer containing (the first PASS_MAX bytes of) the password without the trailing newline, terminated by a null byte ('\0'). This buffer may be overwritten by a following call. On error, the terminal state is restored, errno is set to indicate the error, and NULL is returned. ENXIO . /dev/tty attributes(7). +----------------------------+----------------------------------------------------------+--------------------------+ | | | | +----------------------------+----------------------------------------------------------+--------------------------+ |getpass() | | MT-Unsafe term | +----------------------------+----------------------------------------------------------+--------------------------+ . Version 7 AT&T UNIX. Present in SUSv2, but marked LEGACY. Removed in POSIX.1-2001. You should use instead readpassphrase(3bsd), provided by libbsd. GNU C, /dev/tty , stderr, stdin. . SUSv2 PASS_MAX , 8, sysconf(_SC_PASS_MAX). , POSIX.2 PASS_MAX, _SC_PASS_MAX getpass() . glibc _SC_PASS_MAX BUFSIZ (, 8192). . crypt(3) () Azamat Hackimov , Dmitry Bolkhovskikh , Vladislav , Yuri Kozlov , Kirill Rekhov ; GNU (GNU General Public License - GPL, 3 ) , - . - , , () () () <>. Linux 6.9.1 15 2024 . getpass(3)