.\" DO NOT MODIFY THIS FILE! It was generated by gdoc. .TH "gnutls_global_init" 3 "2.4.2" "gnutls" "gnutls" .SH NAME gnutls_global_init \- initialize the global data to defaults. .SH SYNOPSIS .B #include .sp .BI "int gnutls_global_init( " void ");" .SH ARGUMENTS .IP " void" 12 .SH "DESCRIPTION" This function initializes the global data to defaults. Every gnutls application has a global data which holds common parameters shared by gnutls session structures. You should call \fBgnutls_global_deinit()\fP when gnutls usage is no longer needed Note that this function will also initialize libgcrypt, if it has not been initialized before. Thus if you want to manually initialize libgcrypt you must do it before calling this function. This is useful in cases you want to disable libgcrypt's internal lockings etc. This function increment a global counter, so that \fBgnutls_global_deinit()\fP only releases resources when it has been called as many times as \fBgnutls_global_init()\fP. This is useful when GnuTLS is used by more than one library in an application. This function can be called many times, but will only do something the first time. Note! This function is not thread safe. If two threads call this function simultaneously, they can cause a race between checking the global counter and incrementing it, causing both threads to execute the library initialization code. That would lead to a memory leak. To handle this, your application could invoke this function after aquiring a thread mutex. To ignore the potential memory leak is also an option. .SH "RETURNS" On success, \fBGNUTLS_E_SUCCESS\fP (zero) is returned, otherwise an error code is returned. .SH "REPORTING BUGS" Report bugs to . .SH COPYRIGHT Copyright \(co 2008 Free Software Foundation. .br Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice are preserved on all copies. .SH "SEE ALSO" The full documentation for .B gnutls is maintained as a Texinfo manual. If the .B info and .B gnutls programs are properly installed at your site, the command .IP .B info gnutls .PP should give you access to the complete manual.