Blame lib/atfork.h

Packit aea12f
/*
Packit aea12f
 * Copyright (C) 2014 Red Hat
Packit aea12f
 *
Packit aea12f
 * Author: Nikos Mavrogiannopoulos
Packit aea12f
 *
Packit aea12f
 * This file is part of GnuTLS.
Packit aea12f
 *
Packit aea12f
 * The GnuTLS is free software; you can redistribute it and/or
Packit aea12f
 * modify it under the terms of the GNU Lesser General Public License
Packit aea12f
 * as published by the Free Software Foundation; either version 2.1 of
Packit aea12f
 * the License, or (at your option) any later version.
Packit aea12f
 *
Packit aea12f
 * This library is distributed in the hope that it will be useful, but
Packit aea12f
 * WITHOUT ANY WARRANTY; without even the implied warranty of
Packit aea12f
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit aea12f
 * Lesser General Public License for more details.
Packit aea12f
 *
Packit aea12f
 * You should have received a copy of the GNU Lesser General Public License
Packit aea12f
 * along with this program.  If not, see <https://www.gnu.org/licenses/>
Packit aea12f
 *
Packit aea12f
 */
Packit aea12f
Packit aea12f
#ifndef GNUTLS_LIB_ATFORK_H
Packit aea12f
#define GNUTLS_LIB_ATFORK_H
Packit aea12f
Packit aea12f
#include <config.h>
Packit aea12f
#include "gnutls_int.h"
Packit aea12f
Packit aea12f
extern unsigned int _gnutls_forkid;
Packit aea12f
Packit aea12f
#if defined(HAVE___REGISTER_ATFORK)
Packit aea12f
# define HAVE_ATFORK
Packit aea12f
#endif
Packit aea12f
Packit aea12f
#ifndef _WIN32
Packit aea12f
Packit aea12f
/* API */
Packit aea12f
int _gnutls_register_fork_handler(void); /* global init */
Packit aea12f
Packit aea12f
# if defined(HAVE_ATFORK)
Packit aea12f
inline static int _gnutls_detect_fork(unsigned int forkid)
Packit aea12f
{
Packit aea12f
	if (forkid == _gnutls_forkid)
Packit aea12f
		return 0;
Packit aea12f
	return 1;
Packit aea12f
}
Packit aea12f
Packit aea12f
inline static unsigned int _gnutls_get_forkid(void)
Packit aea12f
{
Packit aea12f
	return _gnutls_forkid;
Packit aea12f
}
Packit aea12f
# else
Packit aea12f
int _gnutls_detect_fork(unsigned int forkid);
Packit aea12f
unsigned int _gnutls_get_forkid(void);
Packit aea12f
# endif
Packit aea12f
Packit aea12f
#else
Packit aea12f
Packit aea12f
# define _gnutls_detect_fork(x) 0
Packit aea12f
# define _gnutls_get_forkid() 0
Packit aea12f
Packit aea12f
#endif
Packit aea12f
Packit aea12f
#endif /* GNUTLS_LIB_ATFORK_H */