Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755964AbZA3N4s (ORCPT ); Fri, 30 Jan 2009 08:56:48 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753055AbZA3N4k (ORCPT ); Fri, 30 Jan 2009 08:56:40 -0500 Received: from sovereign.computergmbh.de ([85.214.69.204]:40141 "EHLO sovereign.computergmbh.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753053AbZA3N4j (ORCPT ); Fri, 30 Jan 2009 08:56:39 -0500 Date: Fri, 30 Jan 2009 14:56:37 +0100 (CET) From: Jan Engelhardt To: Nathanael Hoyle cc: Linux Kernel Mailing List Subject: Re: scheduler nice 19 versus 'idle' behavior / static low-priority scheduling In-Reply-To: <1233303396.17301.30.camel@localhost> Message-ID: References: <1233294584.28741.2.camel@localhost> <1233297635.17301.11.camel@localhost> <1233302349.17301.27.camel@localhost> <1233303396.17301.30.camel@localhost> User-Agent: Alpine 2.00 (LSU 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1034 Lines: 31 On Friday 2009-01-30 09:16, Nathanael Hoyle wrote: >formatting for mail client> > >extern char **environ; >[...] > if(argc==2) { > if(execve(argv[1], NULL, environ) == -1) { > perror("Failed to execve target!"); > } > } else { > if(execve(argv[1], argv+1, environ) == -1) { > perror("Failed to execve target!"); > } > } Are you sure your first execve even works? I would have used if (execvp(argv[1], &argv[1]) < 0) ... just so (a) I do not have to deal with the ugly 'extern char **environ' [such should have been in a libc header imho] or use int main(int argc, char **argv, char **envp); (b) execvp so that it looks through $PATH, just as /bin/su (resp. the shell it starts) would do. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/