shithub: riscv

ref: 8188b4f4f0e07b6669e6ae3c6c1099af917eaab4
dir: /sys/src/ape/lib/ap/plan9/setsid.c/

View raw version
#include "lib.h"
#include <unistd.h>
#include "sys9.h"

pid_t
setsid(void)
{
	if(_RFORK(RFNAMEG|RFNOTEG) < 0){
		_syserrno();
		return -1;
	}
	_sessleader = 1;
	return getpgrp();
}