*nix Documentation Project
·  Home
 +   man pages
·  Linux HOWTOs
·  FreeBSD Tips
·  *niX Forums

  man pages->Tru64 Unix man pages -> get_random_bytes (9r)              
Title
Content
Arch
Section
 

get_random_bytes(9r)

Contents


NAME    [Toc]    [Back]

       get_random_bytes  -  General: Returns the requested number
       of random bytes and stores them in a buffer.

SYNOPSIS    [Toc]    [Back]

       void get_random_bytes(
               void *buf,
               int nbytes );

ARGUMENTS    [Toc]    [Back]

       Specifies the address of the buffer in which the requested
       random  bytes  are stored.  Specifies the number of random
       bytes.

DESCRIPTION    [Toc]    [Back]

       The get_random_bytes() routine returns the requested  number
 of random bytes and stores them in a buffer. This routine
 is for kernel modules that cannot be in a wait state.

RETURN VALUES    [Toc]    [Back]

       Upon  successful  completion, get_random_bytes() returns a
       buffer filled with random bytes.

       ************Fran,  what  does  it  return  upon   failure,
       efault?

EXAMPLE    [Toc]    [Back]

       The  following  example  shows  how  to  use  the get_random_bytes()
 routine to generate a random DCE UUID:

       unsigned  char  uuid[16];  get_random_bytes(uuid,   sizeof
       (uuid));  uuid[6]  =  (uuid[6] & 0x0f) | 0x40;     /* UUID
       version 4 -- random genmeration */ uuid[8]  =  (uuid[8]  &
       0x3f) | 0x80;     /* UUID variant DCE */

       ************Fran, what does DCE UUID stand for?

SEE ALSO    [Toc]    [Back]

      
      
       Routines: get_random_bytes_wait(9r)

       Files: random(4) and urandom(4)



                                             get_random_bytes(9r)
[ Back ]
 Similar pages
Name OS Title
get_random_bytes_wait Tru64 General: Returns the requested number of random bytes and places them in a buffer.
BIO_ctrl_get_read_request Tru64 Find out how many bytes were requested from the BIO
msgdsize Tru64 STREAMS: Returns the number of bytes in a message
btop Tru64 General: Converts bytes to number of pages
strlen Tru64 General: Returns the number of characters in a
hz Tru64 Global Variable: Stores the number of clock ticks per second
unit IRIX Returns the status of a BUFFER IN or BUFFER OUT statement
XmGetPixmapByDepth Tru64 A pixmap caching function that generates a pixmap, stores it in a pixmap cache, and returns the pixm...
XmGetPixmap Tru64 A pixmap caching function that generates a pixmap, stores it in a pixmap cache, and returns the pixm...
bcopy Tru64 General: Copies a series of bytes with a specified limit
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service