crypt.3, encrypt.3: Add notes about _XOPEN_CRYPT

The distribution may choose not to support _XOPEN_CRYPT in the
case that the distribution has transitioned from glibc crypt to
libxcrypt.

Signed-off-by: Carlos O'Donell <carlos@redhat.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
This commit is contained in:
Carlos O'Donell 2018-04-12 14:05:40 -05:00 committed by Michael Kerrisk
parent 873727f44a
commit 629a86ecb7
2 changed files with 39 additions and 2 deletions

View File

@ -188,8 +188,26 @@ POSIX.1-2001, POSIX.1-2008, SVr4, 4.3BSD.
.BR crypt_r ()
is a GNU extension.
.SH NOTES
.SS Glibc notes
The glibc2 version of this function supports additional
.SS Availability in glibc
The
.BR crypt (),
.BR encrypt (),
and
.BR setkey ()
functions are part of the POSIX.1-2008 XSI Options Group for Encryption
and are optional. If the interfaces are not available then the symbolic
constant
.BR _XOPEN_CRYPT
is either not defined or defined to -1, and can be checked at runtime with
.BR sysconf ().
This may be the case if the downstream distribution has switched from glibc
crypt to libxcrypt. When recompiling applications in such distributions the
user must detect if
.BR _XOPEN_CRPYT
is not available and include crypt.h for the function prototypes; otherwise
libxcrypt is a ABI compatible drop-in replacement.
.SS Features in glibc
The glibc version of this function supports additional
encryption algorithms.
.PP
If

View File

@ -147,6 +147,25 @@ and
.BR setkey_r ()
are GNU extensions.
.SH NOTES
.SS Availability in glibc
The
.BR crypt (),
.BR encrypt (),
and
.BR setkey ()
functions are part of the POSIX.1-2008 XSI Options Group for Encryption
and are optional. If the interfaces are not available then the symbolic
constant
.BR _XOPEN_CRYPT
is either not defined or defined to -1, and can be checked at runtime with
.BR sysconf ().
This may be the case if the downstream distribution has switched from glibc
crypt to libxcrypt. When recompiling applications in such distributions the
user must detect if
.BR _XOPEN_CRPYT
is not available and include crypt.h for the function prototypes; otherwise
libxcrypt is a ABI compatible drop-in replacement.
.SS Features in glibc
In glibc 2.2, these functions use the DES algorithm.
.SH EXAMPLE
.EX