Exemplo n.º 1
0
void
__utrap_kill_self(int sig)
{
	int berrno;

	berrno = errno;
	__sys_kill(__sys_getpid(), sig);
	errno = berrno;
}
Exemplo n.º 2
0
/*
 * Optimize getpid() if it is called a lot.  We have to be careful when
 * getpid() is called in a vfork child prior to exec as the shared area
 * is still the parent's shared area.
 */
pid_t
__getpid(void)
{
	if (fast_getpid_state == 0 && fast_getpid_count++ >= 10) {
		__upmap_map(&pidp, &fast_getpid_state, UPTYPE_PID);
		__upmap_map(&invforkp, &fast_getpid_state, UPTYPE_INVFORK);
		__upmap_map(NULL, &fast_getpid_state, 0);
	}
	if (fast_getpid_state > 0 && *invforkp == 0)
		return(*pidp);
	else
		return(__sys_getpid());
}
Exemplo n.º 3
0
pid_t
xxx_getpid(void)
{
	return(__sys_getpid());
}