Re: pread() and pwrite()

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: pread() and pwrite()
Дата
Msg-id 20181105155918.jg36uj4rtnxwqtzt@alvherre.pgsql
обсуждение исходный текст
Ответ на Re: pread() and pwrite()  (Thomas Munro <thomas.munro@enterprisedb.com>)
Ответы Re: pread() and pwrite()  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
On 2018-Nov-04, Thomas Munro wrote:

> Here's a patch to add Windows support by supplying
> src/backend/port/win32/pread.c.  Thoughts?

Hmm, so how easy is to detect that somebody runs read/write on fds where
pread/pwrite have occurred?  I guess for data files it's easy to detect
since you'd quickly end up with corrupted files, but what about other
kinds of files?  I wonder if we should be worrying about using this
interface somewhere other than fd.c and forgetting about the limitation.
Say, what happens if we patch some place in xlog.c after this patch gets
in, using write() instead of pwrite()?

I suppose the safest approach is to use lseek (or whatever) to fix up
the position after the pread/pwrite -- but we don't want to pay the
price on an additional syscall.  Are there any other options?  Is there
a way to prevent read/write from being used on a file handle?

-- 
Álvaro Herrera                https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services


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

Предыдущее
От: Dmitry Dolgov
Дата:
Сообщение: Re: Flexible permissions for REFRESH MATERIALIZED VIEW
Следующее
От: "Bossart, Nathan"
Дата:
Сообщение: Re: New vacuum option to do only freezing