OPENSSL_fork_prepare.pod 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. =pod
  2. =head1 NAME
  3. OPENSSL_fork_prepare,
  4. OPENSSL_fork_parent,
  5. OPENSSL_fork_child
  6. - OpenSSL fork handlers
  7. =head1 SYNOPSIS
  8. #include <openssl/crypto.h>
  9. The following functions have been deprecated since OpenSSL 3.0, and can be
  10. hidden entirely by defining B<OPENSSL_API_COMPAT> with a suitable version value,
  11. see L<openssl_user_macros(7)>:
  12. void OPENSSL_fork_prepare(void);
  13. void OPENSSL_fork_parent(void);
  14. void OPENSSL_fork_child(void);
  15. =head1 DESCRIPTION
  16. These methods are currently unused, and as such, no replacement methods are
  17. required or planned.
  18. OpenSSL has state that should be reset when a process forks. For example,
  19. the entropy pool used to generate random numbers (and therefore encryption
  20. keys) should not be shared across multiple programs.
  21. The OPENSSL_fork_prepare(), OPENSSL_fork_parent(), and OPENSSL_fork_child()
  22. functions are used to reset this internal state.
  23. Platforms without fork(2) will probably not need to use these functions.
  24. Platforms with fork(2) but without pthread_atfork(3) will probably need
  25. to call them manually, as described in the following paragraph. Platforms
  26. such as Linux that have both functions will normally not need to call these
  27. functions as the OpenSSL library will do so automatically.
  28. L<OPENSSL_init_crypto(3)> will register these functions with the appropriate
  29. handler, when the B<OPENSSL_INIT_ATFORK> flag is used. For other
  30. applications, these functions can be called directly. They should be used
  31. according to the calling sequence described by the pthread_atfork(3)
  32. documentation, which is summarized here. OPENSSL_fork_prepare() should
  33. be called before a fork() is done. After the fork() returns, the parent
  34. process should call OPENSSL_fork_parent() and the child process should
  35. call OPENSSL_fork_child().
  36. =head1 RETURN VALUES
  37. OPENSSL_fork_prepare(), OPENSSL_fork_parent() and OPENSSL_fork_child() do not
  38. return values.
  39. =head1 SEE ALSO
  40. L<OPENSSL_init_crypto(3)>
  41. =head1 HISTORY
  42. These functions were added in OpenSSL 1.1.1.
  43. =head1 COPYRIGHT
  44. Copyright 2017-2020 The OpenSSL Project Authors. All Rights Reserved.
  45. Licensed under the Apache License 2.0 (the "License"). You may not use
  46. this file except in compliance with the License. You can obtain a copy
  47. in the file LICENSE in the source distribution or at
  48. L<https://www.openssl.org/source/license.html>.
  49. =cut