Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

syslog FFI constants not generated for Syslog class on FreeBSD #1605

iamasmith opened this issue Apr 2, 2014 · 2 comments

syslog FFI constants not generated for Syslog class on FreeBSD #1605

iamasmith opened this issue Apr 2, 2014 · 2 comments


Copy link

@iamasmith iamasmith commented Apr 2, 2014

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.

Copy link

@headius headius commented Apr 7, 2014

I don't have handy access to an FBSD10 machine. Can you just provide your syslog and we'll go with that for now?

We intend to merge our FFI impl and ffi/ffi "soon" so ideally we'll get the proper fix then.

Copy link

@iamasmith iamasmith commented Apr 7, 2014

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 to /lib/ 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_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
headius added a commit that referenced this issue Apr 7, 2014
Fixes #1605.
@headius headius closed this in ad98ff2 Apr 7, 2014
@headius headius added this to the JRuby 1.7.12 milestone Apr 7, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants