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

[Truffle] Minimal Java POSIX #3615

Merged
merged 15 commits into from
Jan 27, 2016
Merged

[Truffle] Minimal Java POSIX #3615

merged 15 commits into from
Jan 27, 2016

Conversation

chrisseaton
Copy link
Contributor

When we adopted Rubinius' kernel, we lost the ability to run without a real native implementation of POSIX. This is some work towards getting that ability back, by using knowledge of what Rubinius really tries to do with POSIX to provide a Java emulation that will work for us.

This PR gets us as far as loading, but not doing puts.

@nirvdrum

@chrisseaton chrisseaton added this to the truffle-dev milestone Jan 26, 2016
@chrisseaton chrisseaton self-assigned this Jan 26, 2016

@Override
public int getpid() {
return context.hashCode();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks odd to me.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is how JRuby does it. There doesn't appear to be any other way to get the PID, and at least the may deconflict between multiple contexts in the same VM.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there's an ugly way to read and parse from a management bean ... assuming that is fine to pull in jmx

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes thanks, but the point of this little project is to be totally pure Java and I think that bean name is implementation defined. We'll only use this in very limited cases - we normally require a native POSIX and won't run with the fallback.

@nirvdrum
Copy link
Contributor

What does this gain us over just using the Java layer already in jnr-posix? Just faster turnaround?

@chrisseaton
Copy link
Contributor Author

The existing JavaPOSIX doesn't support calls like fcntl, but given we know what Rubinius is calling them for and what results will work for it, we can give them a meaningful implementation.

Basically we can't boot with JavaPOSIX but we can boot with this.

@headius
Copy link
Member

headius commented Jan 26, 2016 via email

@chrisseaton
Copy link
Contributor Author

I'm not sure all the changes I'll make will be safe for general use - they might be quite tied to what the Rubinius code runs. When I get everything I need running I'll reconsider and put stuff back into jar-posix where I can.

@eregon
Copy link
Member

eregon commented Jan 26, 2016

So far it looks like most of this stuff (except probably getpid but then we could special-case that one) would be fine for JavaPOSIX, it's already doing this kind of "best-effort" implementation from what I recall.

chrisseaton added a commit that referenced this pull request Jan 27, 2016
@chrisseaton chrisseaton merged commit 95956f0 into master Jan 27, 2016
@chrisseaton chrisseaton deleted the truffle-minimal-java-posix branch January 27, 2016 21:03
@enebo enebo added this to the Non-Release milestone Dec 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants