1gnutls_global_init(3)               gnutls               gnutls_global_init(3)
2
3
4

NAME

6       gnutls_global_init  -  This  function  initializes  the  global data to
7       defaults.
8

SYNOPSIS

10       #include <gnutls/gnutls.h>
11
12       int gnutls_global_init( void);
13

ARGUMENTS

15        void
16

DESCRIPTION

18       This function initializes the global data to  defaults.   Every  gnutls
19       application  has  a global data which holds common parameters shared by
20       gnutls session structures.  You must call  gnutls_global_deinit()  when
21       gnutls usage is no longer needed Returns zero on success.
22
23       Note  that  this function will also initialize libgcrypt, if it has not
24       been initialized before.  Thus  if  you  want  to  manually  initialize
25       libgcrypt  you  must do it before calling this function. This is useful
26       in cases you want to disable libgcrypt's internal lockings etc.
27
28       This    function    increment    a    global    counter,    so     that
29       gnutls_global_deinit()  only releases resources when it has been called
30       as many times as gnutls_global_init().  This is useful when  GnuTLS  is
31       used  by more than one library in an application.  This function can be
32       called many times, but will only do something the first time.
33
34       Note!  This function is not thread safe.   If  two  threads  call  this
35       function  simultaneously,  they  can  cause a race between checking the
36       global counter and incrementing it, causing both threads to execute the
37       library  initialization  code.   That  would lead to a memory leak.  To
38       handle this, your application could invoke this function after aquiring
39       a thread mutex.  To ignore the potential memory leak is also an option.
40

REPORTING BUGS

42       Report bugs to <bug-gnutls@gnu.org>.
43
45       Copyright © 2006 Free Software Foundation.
46       Permission  is  granted  to make and distribute verbatim copies of this
47       manual provided the copyright notice and  this  permission  notice  are
48       preserved on all copies.
49

SEE ALSO

51       The  full  documentation  for gnutls is maintained as a Texinfo manual.
52       If the info and gnutls programs are properly installed  at  your  site,
53       the command
54
55              info gnutls
56
57       should give you access to the complete manual.
58
59
60
61gnutls                               1.6.3               gnutls_global_init(3)
Impressum