From: | "Magnus Hagander" <mha(at)sollentuna(dot)net> |
---|---|
To: | "Tom F" <tom(at)printf(dot)net>, <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: execve() vs system() for chrooted filesystems in dbcommands.c |
Date: | 2004-09-20 07:54:23 |
Message-ID: | 6BCB9D8A16AC4241919521715F4D8BCE4569F1@algol.sollentuna.se |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
> The only argument against it, that I'm aware of, is that
> system() is ANSI, while execve() is POSIX: i.e.
> portability... does windows have execve()? That could be done
> the way the current preprocessor conditionals yield rmdir
> instead of rm.
Windows does have execve(), though it's named _execve(). Not sure if
that means it has slightly different behaviour than on Unix. See
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vclib/h
tml/_crt__execve.2c_._wexecve.asp.
But looking at the code you will notice that win32 already does not use
system() - copydir() is available to do it internally. Haven't looked at
the details, but perhaps this can just be used straight off on Unix as
well.
From what I can tell, rm is also handled in the rmtree() function, and
not by system(), since version 1.138 of dbcommands.c.
//Magnus
From | Date | Subject | |
---|---|---|---|
Next Message | Abhijit Menon-Sen | 2004-09-20 08:15:08 | Re: libpq and prepared statements progress for 8.0 |
Previous Message | Bruce Momjian | 2004-09-20 07:34:02 | Re: libpq and prepared statements progress for 8.0 |