From owner-p4-projects@FreeBSD.ORG Sat Oct 14 10:21:29 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 603C616A416; Sat, 14 Oct 2006 10:21:29 +0000 (UTC) X-Original-To: perforce@FreeBSD.org Delivered-To: perforce@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1985616A412 for ; Sat, 14 Oct 2006 10:21:29 +0000 (UTC) (envelope-from rdivacky@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id D3EB543D66 for ; Sat, 14 Oct 2006 10:21:28 +0000 (GMT) (envelope-from rdivacky@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id k9EALSJd069994 for ; Sat, 14 Oct 2006 10:21:28 GMT (envelope-from rdivacky@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k9EALS8d069991 for perforce@freebsd.org; Sat, 14 Oct 2006 10:21:28 GMT (envelope-from rdivacky@FreeBSD.org) Date: Sat, 14 Oct 2006 10:21:28 GMT Message-Id: <200610141021.k9EALS8d069991@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to rdivacky@FreeBSD.org using -f From: Roman Divacky To: Perforce Change Reviews Cc: Subject: PERFORCE change 107871 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Oct 2006 10:21:29 -0000 http://perforce.freebsd.org/chv.cgi?CH=107871 Change 107871 by rdivacky@rdivacky_witten on 2006/10/14 10:20:41 Partially implement prctl() syscall. Affected files ... .. //depot/projects/linuxolator/src/sys/compat/linux/linux_misc.c#7 edit .. //depot/projects/linuxolator/src/sys/compat/linux/linux_misc.h#1 add Differences ... ==== //depot/projects/linuxolator/src/sys/compat/linux/linux_misc.c#7 (text+ko) ==== @@ -1549,4 +1549,33 @@ int linux_prctl(struct thread *td, struct linux_prctl_args *args) { + int error = 0; + struct proc *p = td->td_proc; + char comm[LINUX_MAX_COMM_LEN]; + + switch (args->options) { + case LINUX_PR_SET_PDEATHSIG: + if (!LINUX_SIG_VALID(args->arg2)) + return (EINVAL); + PROC_LOCK(p); + p->p_sigparent = args->arg2; + PROC_UNLOCK(p); + break; + case LINUX_PR_GET_PDEATHSIG: + error = copyout(&p->p_sigparent, (void *) args->arg2, sizeof(p->p_sigparent)); + break; + case LINUX_PR_SET_NAME: + comm[LINUX_MAX_COMM_LEN-1] = 0; + error = copyin(comm, (void *) args->arg2, LINUX_MAX_COMM_LEN-1); + if (error) + return (error); + /* XXX: no locking needed? */ + strcpy(p->p_comm, comm); + break; + case LINUX_PR_GET_NAME: + error = copyout(&p->p_comm, (void *) args->arg2, MAXCOMLEN+1); + break; + } + + return (error); }