Kaydet (Commit) 718477e2 authored tarafından Chris Sherlock's avatar Chris Sherlock Kaydeden (comit) Noel Grandin

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/39120Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
Tested-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst ab27953d
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment