[Cialug] Include file needed on FreeBSD but not Linux
Jonathan A. Kollasch
jakllsch at kollasch.net
Mon Oct 30 01:08:26 UTC 2017
On Sun, Oct 29, 2017 at 07:10:32PM -0500, Brian Wood wrote:
> Hi. I made a change recently to this file:
> https://github.com/Ebenezer-group/onwards/blob/master/File.hh#L4
>
> and tested it on Linux, but not on FreeBSD. Today I tried it on
> FreeBSD and it didn't compile. I had to add an include for
> sys/stat.h to get it to compile on FreeBSD. The error message
> had to do with not finding constants like S_IRUSR. Does anyone
> know if FreeBSD is right or wrong in this? Thanks in advance.
FreeBSD is not wrong here.
http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/sys_stat.h.html
Or: if you need to ensure the visibility of the S_IRUSR constant you
need to #include <sys/stat.h>.
Jonathan Kollasch
More information about the Cialug
mailing list