From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nathan Lynch Subject: Re: [PATCH user-cr 2/2] add nsexeccwp to test clone-with-pids Date: Sun, 15 Nov 2009 16:45:56 -0600 Message-ID: <1258325156.4031.3.camel@localhost.localdomain> References: <1258089886-10034-1-git-send-email-serue@us.ibm.com> <1258089886-10034-3-git-send-email-serue@us.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1258089886-10034-3-git-send-email-serue-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: containers-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org Errors-To: containers-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org To: serue-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org Cc: containers-qjLDD68F18O7TbgM5vRIOg@public.gmane.org List-Id: containers.vger.kernel.org On Thu, 2009-11-12 at 23:24 -0600, serue-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org wrote: > + if (use_clone) { > + int stacksize = 4*getpagesize(); > + void *stack = malloc(stacksize); > + > + if (!stack) { > + perror("malloc"); > + return -1; > + } > + > + printf("about to clone with %lx\n", flags); > + if (chosen_pid) > + printf("Will choose pid %d\n", chosen_pid); > + flags |= SIGCHLD; > + pid = clone_with_pids(do_child, stack, flags, &pid_set, > + (void *)argv); The stack argument should be adjusted with the usual stack += stacksize - 1 or similar, right?