Coder Social home page Coder Social logo

Comments (9)

vext01 avatar vext01 commented on August 18, 2024

I am also having difficulty with jnr-posix, albeit with the jar that is distributed with jython. It seems that FileStat sometimes reports paths which are not a symlink as a symlink. Looking at OpenBSDFileStat.java I think the interface needs to be reviewed. For example:

  • time_t is certainly not a signed 32 any more (as pointed out by Jeremy). You may need to do a sizeof check, as there will be many OpenBSD systems in the wild still running time32.
  • On my amd64 system, a ino_t is an unsigned 64 (not a unsigned 32).

You may find that these types vary from arch to arch(?)

In other words, OpenBSD support needs some love.

from jnr-posix.

vext01 avatar vext01 commented on August 18, 2024

I confirm that the patch Jeremy posted, when applied to jnr-posix-2.4 (the version jython uses) fixes the problems I am seeing with symlinks/stat.

from jnr-posix.

enebo avatar enebo commented on August 18, 2024

@wmeissner Talking to @jeremyevans on irc he pointed out this only works OpenBSD >5.4, We should be able to conditionalize loading a second OpenBSD Libc right? Have you thought about this particular issue past 32/64 bit differences?

from jnr-posix.

 avatar commented on August 18, 2024

We don't have to load a different lib, just define different structures, correct?

Worst case, when we detect OpenBSD, we can just look at the output from uname -r, and use the new structs when we detect release > 5.4.

i.e. I'd rename the existing OpenBSD structs to OldOpenBSDFoo, and use them when uname -r <= "5.4", otherwise use the new structs/calls.

from jnr-posix.

enebo avatar enebo commented on August 18, 2024

yeah that seems reasonable. thanks @wmeissner.

from jnr-posix.

vext01 avatar vext01 commented on August 18, 2024

Are you able to do something equivalent to sizeof on C?
On 9 Oct 2013 21:34, "Wayne Meissner" [email protected] wrote:

We don't have to load a different lib, just define different structures,
correct?

Worst case, when we detect OpenBSD, we can just look at the output from uname
-r, and use the new structs when we detect release > 5.4.

i.e. I'd rename the existing OpenBSD structs to OldOpenBSDFoo, and use
them when uname -r <= "5.4", otherwise use the new structs/calls.


Reply to this email directly or view it on GitHubhttps://github.com//issues/15#issuecomment-26006155
.

from jnr-posix.

 avatar commented on August 18, 2024

Are you able to do something equivalent to sizeof on C?

No - we don't call the compiler at all during runtime linking. That will probably change in future versions of jnr-ffi (using clang), but it isn't an option right now (other than shelling out to the C compiler to compile a small C program that prints out all the sizes).

jnr-ffi does contain a table of common types, but the OpenBSD table was built for an older version of OpenBSD.

from jnr-posix.

jasperla avatar jasperla commented on August 18, 2024

Has there been any work done in this direction? The new puppetserver project is utilising jnr-posix and it fails to run, most likely due to this very issue.

from jnr-posix.

jeremyevans avatar jeremyevans commented on August 18, 2024

Fixed by #36.

from jnr-posix.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.