Blame lib/atfork.h

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