Change default directory for storing the .rnd file on Windows
[openssl.git] / doc / crypto / RAND_load_file.pod
index debf06fa2e25bbe6ad93711608adae8ce5fbcefd..dd79af28ae374324424e6c357f151f17d9750d6e 100644 (file)
@@ -18,13 +18,21 @@ RAND_load_file, RAND_write_file, RAND_file_name - PRNG seed file
 
 RAND_file_name() generates a default path for the random seed
 file. B<buf> points to a buffer of size B<num> in which to store the
-filename. The seed file is $RANDFILE if that environment variable is
-set, $HOME/.rnd otherwise. If $HOME is not set either, or B<num> is
+filename.
+
+On Windows the seed file is %RANDFILE% if that environment variable is set.
+Otherwise the file is called ".rnd" in one of the following locations (in order
+of preference): %TMP%, %TEMP%, %USERPROFILE%, %SYSTEMROOT%, %HOME%, "C:".
+
+On all other systems the seed file is $RANDFILE if that environment variable is
+set, $HOME/.rnd otherwise.
+
+If $HOME (on non Windows systems) is not set either, or B<num> is
 too small for the path name, an error occurs.
 
 RAND_load_file() reads a number of bytes from file B<filename> and
 adds them to the PRNG. If B<max_bytes> is non-negative,
-up to to B<max_bytes> are read;
+up to B<max_bytes> are read;
 if B<max_bytes> is -1, the complete file is read.
 
 RAND_write_file() writes a number of random bytes (currently 1024) to
@@ -45,4 +53,13 @@ error.
 
 L<rand(3)>, L<RAND_add(3)>, L<RAND_cleanup(3)>
 
+=head1 COPYRIGHT
+
+Copyright 2000-2016 The OpenSSL Project Authors. All Rights Reserved.
+
+Licensed under the OpenSSL license (the "License").  You may not use
+this file except in compliance with the License.  You can obtain a copy
+in the file LICENSE in the source distribution or at
+L<https://www.openssl.org/source/license.html>.
+
 =cut