Re: O_DIRECT on macOS
| От | Justin Pryzby |
|---|---|
| Тема | Re: O_DIRECT on macOS |
| Дата | |
| Msg-id | 20210530161912.GN2082@telsasoft.com обсуждение исходный текст |
| Ответ на | O_DIRECT on macOS (Thomas Munro <thomas.munro@gmail.com>) |
| Ответы |
Re: O_DIRECT on macOS
|
| Список | pgsql-hackers |
On Sun, May 30, 2021 at 04:39:48PM +1200, Thomas Munro wrote:
> +BasicOpenFilePermDirect(const char *fileName, int fileFlags, mode_t fileMode,
> + bool direct)
> ...
> +#if !defined(O_DIRECT) && defined(F_NOCACHE)
> + /* macOS requires an extra step. */
> + if (direct && fcntl(fd, F_NOCACHE, 1) < 0)
> + {
> + int save_errno = errno;
> +
> + close(fd);
> + errno = save_errno;
> + ereport(ERROR,
> + (errcode_for_file_access(),
> + errmsg("could not disable kernel file caching for file \"%s\": %m",
> + fileName)));
> + }
> +#endif
Should there be an "else" to warn/error in the case that "direct" is requested
but not supported?
--
Justin
В списке pgsql-hackers по дате отправления: