Re: scheduler nice 19 versus 'idle' behavior / static low-priorityscheduling
From: Jan Engelhardt
Date: Fri Jan 30 2009 - 08:56:50 EST
On Friday 2009-01-30 09:16, Nathanael Hoyle wrote:
><snipped old version, because of a fixed goof, and this has better
>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@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/