Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
syslog FFI constants not generated for Syslog class on FreeBSD #1605
Causing of course a message saying that 'syslog is not supported on this platform' when syslog is required.
I'm assuming this is something related to the new libc link loader script confusing the FFI framework at the time the Rake job is run to produce the platform specific constants for the FFI pieces.
My Monkey patch over on ffi/ffi does resolve the issue with FFI being able to use libc on FreeBSD 10 but I think there is an official fix now ffi/ffi, I saw some related commits.
In the meantime I tested a manually produced syslog.rb constants file and the functionality does work on FreeBSD 10. I then had a joyous time Monkey patching FFI under Warbler so that the overall syslog.rb could find my definition on FreeBSD but that's another story.
The x86_64-freebsd/syslog.rb is as follows. For the time being on my project I had to resort to heinous use of LD_LIBRARY_PATH finding a symbolic link of libc.so to /lib/libc.so.7 to avoid errors with jffi but it did work after that. Constants here cribbed directly from the FBSD10 headers and the logging works well for me. I took the OpenBSD version then verified all the constants against the header by the way adding the missing ones that FreeBSD supported and checking the others for the correct values.
# This file hand crafted for FreeBSD, not via Rake module Syslog module Constants LOG_ALERT = 1 LOG_AUTH = 32 LOG_AUTHPRIV = 80 LOG_CONS = 2 LOG_CONSOLE = 112 LOG_CRIT = 2 LOG_CRON = 72 LOG_DAEMON = 24 LOG_DEBUG = 7 LOG_EMERG = 0 LOG_ERR = 3 LOG_FTP = 88 LOG_INFO = 6 LOG_KERN = 0 LOG_LOCAL0 = 128 LOG_LOCAL1 = 136 LOG_LOCAL2 = 144 LOG_LOCAL3 = 152 LOG_LOCAL4 = 160 LOG_LOCAL5 = 168 LOG_LOCAL6 = 176 LOG_LOCAL7 = 184 LOG_LPR = 48 LOG_MAIL = 16 LOG_NEWS = 56 LOG_NOTICE = 5 LOG_NOWAIT = 16 LOG_NTP = 96 LOG_ODELAY = 4 LOG_NDELAY = 8 LOG_PERROR = 32 LOG_PID = 1 LOG_SECURITY = 104 LOG_SYSLOG = 40 LOG_USER = 8 LOG_UUCP = 64 LOG_WARNING = 4 end end