Re: execve() vs system() for chrooted filesystems in dbcommands.c

Поиск
Список
Период
Сортировка
От Magnus Hagander
Тема Re: execve() vs system() for chrooted filesystems in dbcommands.c
Дата
Msg-id 6BCB9D8A16AC4241919521715F4D8BCE4569F1@algol.sollentuna.se
обсуждение исходный текст
Ответ на execve() vs system() for chrooted filesystems in dbcommands.c  (Tom F <tom@printf.net>)
Список 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



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: libpq and prepared statements progress for 8.0
Следующее
От: Abhijit Menon-Sen
Дата:
Сообщение: Re: libpq and prepared statements progress for 8.0