+setsid()
+{
+ register struct proc *p = u.u_procp;
+
+ if ((p->p_pgid == p->p_pid) || pgfind(p->p_pid))
+ u.u_error = EPERM;
+ else {
+ pgmv(p, p->p_pid, 1);
+ u.u_r.r_val1 = p->p_pid;
+ }
+ return;
+}
+
+/*
+ * set process group
+ *
+ * if target pid != caller's pid
+ * pid must be an inferior
+ * pid must be in same session
+ * pid can't have done an exec
+ * there must exist a pid with pgid in same session
+ * pid must not be session leader
+ */