#include "threads.h"

int	jaz_fork()
{
	fflush(stdout);
	fflush(stderr);
	return fork();
}

int	jaz_child_fork()
{
	pid_t	pid;

	pid = jaz_fork();

	/* ignore SIGCHLD to avoid problems with exiting scripts in zbx_execute() and other cases */
	if (0 == pid)
		signal(SIGCHLD, SIG_DFL);

	return pid;
}

long int	jaz_get_thread_id()
{
	return (long int)getpid();
}