From 7dcb43b38499ba441244a3955ce7b082f8691824 Mon Sep 17 00:00:00 2001 From: =?utf8?q?C=C3=A9dric=20Villemain?= Date: Wed, 10 Aug 2011 17:15:10 +0200 Subject: [PATCH] Add support for *BSD and maybe other platforms where mincore() is present and POSIX_FADVISE absent. --- pgfincore.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/pgfincore.c b/pgfincore.c index 1842ceb..975afc1 100644 --- a/pgfincore.c +++ b/pgfincore.c @@ -181,6 +181,7 @@ pgsysconf(PG_FUNCTION_ARGS) PG_RETURN_DATUM( HeapTupleGetDatum(tuple) ); } +#ifdef FIO_HAVE_FADVISE /* * pgfadvise_file */ @@ -278,6 +279,14 @@ pgfadvise_file(char *filename, int advice, pgfadviseStruct *pgfdv) return 0; } +#else +static int +pgfadvise_file(char *filename, int advice, pgfadviseStruct *pgfdv) +{ + elog(ERROR, "POSIX_FADVISE UNSUPPORTED on your platform"); + return 9; +} +#endif /* * pgfadvise is a function that handle the process to have a sharelock @@ -430,6 +439,7 @@ pgfadvise(PG_FUNCTION_ARGS) } } +#ifdef FIO_HAVE_FADVISE /* * pgfadvise_file */ @@ -551,6 +561,16 @@ pgfadvise_loader_file(char *filename, return 0; } +#else +static int +pgfadvise_loader_file(char *filename, + bool willneed, bool dontneed, VarBit *databit, + pgfloaderStruct *pgfloader) +{ + elog(ERROR, "POSIX_FADVISE UNSUPPORTED on your platform"); + return 9; +} +#endif /* * -- 2.39.5