The BSDs and sysconf()

Chris Sherlock chris.sherlock79 at gmail.com
Thu Jun 22 16:57:13 UTC 2017


Hi all, 

I’ve moved past signal handling for now and have reached file mapping for my book on the guts of LibreOffice - https://www.gitbook.com/book/chrissherlock1/inside-libreoffice/details <https://www.gitbook.com/book/chrissherlock1/inside-libreoffice/details>

As I’ve been reading through how we handle file mapping, I’ve noticed we do something a bit unusual for finding the page size on BSD systems. From what I can see, OpenBSD, NetBSD, FreeBSD, OS X and DragonflyBSD all supports sysconf() now. However, we have some special cased code in sal/osl/unx/file.cxx that is used by the file mapping API when it gets the pagesize of the system. Currently it is special casing out the BSDs to use getpagesize(), and everything else that is POSIX compliant uses sysconf(_SC_PAGESIZE). 

However, I checked out the latest man pages for all the BSDs, and they all seem to support sysconf(_SC_PAGESIZE). Is there any reason we are checking the platform and using getpagesize() for the BSDs now?

I’ve submitted a gerrit change in case there is no good reason:

https://gerrit.libreoffice.org/#/c/39120/ <https://gerrit.libreoffice.org/#/c/39120/>

If anyone would like to review it, would be great. 

Chris
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/libreoffice/attachments/20170623/4715acae/attachment.html>


More information about the LibreOffice mailing list