]> git.ipfire.org Git - thirdparty/man-pages.git/commitdiff
crypt.3, encrypt.3: Add notes about _XOPEN_CRYPT
authorCarlos O'Donell <carlos@redhat.com>
Thu, 12 Apr 2018 19:05:40 +0000 (14:05 -0500)
committerMichael Kerrisk <mtk.manpages@gmail.com>
Fri, 13 Apr 2018 15:02:28 +0000 (17:02 +0200)
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>
man3/crypt.3
man3/encrypt.3

index 3e6552ad8a0643219b297ca49fb6c6c04ff48c5f..58c62d93d8fdbede68c116f708104a38271b2b9f 100644 (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
index 3a1cf95983399b64f7855e04e70bfa0024715f42..3df4870c38f05efc4e349655d08091718bdc16ff 100644 (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