[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1158166a0906300510w5b03adb9k7368a049a2bec263@mail.gmail.com>
Date: Tue, 30 Jun 2009 14:10:15 +0200
From: Denys Vlasenko <vda.linux@...glemail.com>
To: Alan Cox <alan@...rguk.ukuu.org.uk>
Cc: Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Al Viro <viro@...iv.linux.org.uk>,
Andrew Morton <akpm@...ux-foundation.org>,
Mike Frysinger <vapier@...too.org>
Subject: Re: [PATCH] make execve(NULL) re-execute current binary
On Tue, Jun 30, 2009 at 12:27 AM, Alan Cox<alan@...rguk.ukuu.org.uk> wrote:
> On Tue, 30 Jun 2009 00:03:39 +0200
> Denys Vlasenko <vda.linux@...glemail.com> wrote:
>
>> Hi Al, Andrew, folks,
>>
>> This is a version 2 of re-execution patch.
>>
>> I replaced hardcoded "/proc/self/exe" with execve(NULL)
>
> So you add hacks to sys_execve, which means hacks on every system that
> doesn't need it
Yes.
> and also undefined behaviour if you use the feature when
> it isn't present.
The behavior of execve(NULL) is not undefined. It returns EFAULT.
The idea was that application will do:
/* Try traditional way */
execv("/proc/self/exe", argv);
/* Try Linux specific extension (only new kernels have it) */
execv(NULL, argv);
/* Give up */
printf("Can't re-exec myself\n");
exit(1);
which is safe on older kernels as well.
> Please implement sys_reexec() as was suggested before.
Ok.
--
vda
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists