| От | Tom Lane |
|---|---|
| Тема | Re: Win32 question: getppid() with no parent? |
| Дата | |
| Msg-id | 17608.1085682628@sss.pgh.pa.us обсуждение |
| Ответ на | Re: Win32 question: getppid() with no parent? ("Magnus Hagander" <mha@sollentuna.net>) |
| Список | pgsql-hackers-win32 |
"Magnus Hagander" <mha@sollentuna.net> writes:
>>> (If we can't rely on that variable, we could do a win32 specific hack
>>> that passes the HANDLE of the postmaster down to the child on exec, I
>>> guess.)
>>
>> Is this just like passing a variable value, or is there some more
>> protection involved?
> It is passing a variable. *Before* you parse it, you have to make it
> inheritable by doing something along the line of:
> DuplicateHandle(GetCurrentProcess(), GetCurrentProcess(),
> GetCurrentProcess(), &targetHandle, 0, TRUE, DUPLICATE_SAME_ACCESS);
But you'd do that only once during postmaster start, right? It's
probably marginally faster/safer to do that than to fabricate a new
handle in each child based on PostmasterPid.
regards, tom lane
В списке pgsql-hackers-win32 по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера