[Libreoffice-commits] core.git: sal/osl
Chris Sherlock
chris.sherlock79 at gmail.com
Fri Jun 23 09:41:51 UTC 2017
sal/osl/unx/file.cxx | 5 -----
1 file changed, 5 deletions(-)
New commits:
commit 718477e21f09d111161fd04083ac8fc909d2b9b8
Author: Chris Sherlock <chris.sherlock79 at gmail.com>
Date: Fri Jun 23 02:42:32 2017 +1000
osl: getpagesize() uses sysconf(_SC_PAGESIZE) on all BSDs
OpenBSD, FreeBSD, OS X, NetBSD and DragonflyBSD all now use POSIX
sysconf, so there isn't any need to use the BSD getpagesize() anymore.
Looking at the FreeBSD source in their VCS, it appears it sysconf
support for _SC_PAGESIZE was introduced in the following commit on
March 4, 1998:
https://svnweb.freebsd.org/base/head/lib/libc/gen/sysconf.c?r1=12674&r2=34030
The man page for sysconf(3) says it has been available since BSD4.4
And it looks like OSX has supported this at least as far back as 10.6.2.
Change-Id: Id8c188c00a8d87dbd8056635b5bf7f5940508ab1
Reviewed-on: https://gerrit.libreoffice.org/39120
Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin at collabora.co.uk>
diff --git a/sal/osl/unx/file.cxx b/sal/osl/unx/file.cxx
index c8dcd3543e22..f631a424d353 100644
--- a/sal/osl/unx/file.cxx
+++ b/sal/osl/unx/file.cxx
@@ -278,12 +278,7 @@ void FileHandle_Impl::operator delete (void * p)
size_t FileHandle_Impl::getpagesize()
{
-#if defined(FREEBSD) || defined(NETBSD) || defined(MACOSX) || \
- defined(OPENBSD) || defined(DRAGONFLY)
- return sal::static_int_cast< size_t >(::getpagesize());
-#else /* POSIX */
return sal::static_int_cast< size_t >(::sysconf(_SC_PAGESIZE));
-#endif /* xBSD || POSIX */
}
sal_uInt64 FileHandle_Impl::getPos() const
More information about the Libreoffice-commits
mailing list