Re: Permission denied on fsync / Win32 (was right

Поиск
Список
Период
Сортировка
От Magnus Hagander
Тема Re: Permission denied on fsync / Win32 (was right
Дата
Msg-id 6BCB9D8A16AC4241919521715F4D8BCEA0F91B@algol.sollentuna.se
обсуждение исходный текст
Ответы Re: Permission denied on fsync / Win32 (was right  ("Peter Brant" <Peter.Brant@wicourts.gov>)
Список pgsql-bugs
> It happens often enough and the episodes last long enough=20
> that grabbing a handle dump while this is going on should be=20
> easily done.
>=20
> Regarding the Win32 error code, backend/storage/file/fd.c=20
> calls _commit().=20
> http://msdn2.microsoft.com/en-us/library/17618685(VS.80).aspx=20
>   It looks
> like it is already using errno to report errors.  Will=20
> GetLastError() return something useful there?

Good point.
Ran a quick test. If I open the file read-only and then fsync, I get
errno=3D9 (EBADF) and GetLastError()=3D5.  Which explains the fact that we
got the wrong error-code. The *underlying API call* to _commit() returns
access denied...

Looking at the source to _commit(), if the call to FlushFileBuffers()
returns an error, it will set _doserrno to that value,and then return
with errno=3DEBADF.

So, this basicalliyu means that FlushFileBuffers() returns ACCESS
DENIED.

//Magnus

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Permission denied on fsync / Win32 (was right
Следующее
От: Tom Lane
Дата:
Сообщение: Re: [Win32] Problem with rename()