Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: jruby/jruby
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: ddf9daa915c4
Choose a base ref
...
head repository: jruby/jruby
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 7a5f633c4870
Choose a head ref
  • 6 commits
  • 2 files changed
  • 1 contributor

Commits on Jul 24, 2016

  1. Copy the full SHA
    0c4c1fa View commit details
  2. [Truffle] rb_io_t

    chrisseaton committed Jul 24, 2016
    Copy the full SHA
    76c25ff View commit details
  3. Copy the full SHA
    04c14a7 View commit details
  4. Copy the full SHA
    93aef2f View commit details
  5. Copy the full SHA
    3411cec View commit details
  6. Copy the full SHA
    7a5f633 View commit details
Showing with 43 additions and 0 deletions.
  1. +18 −0 lib/ruby/truffle/cext/ruby.h
  2. +25 −0 truffle/src/main/c/cext/ruby.c
18 changes: 18 additions & 0 deletions lib/ruby/truffle/cext/ruby.h
Original file line number Diff line number Diff line change
@@ -23,6 +23,7 @@ extern "C" {
#include <stdint.h>
#include <stdbool.h>
#include <stdio.h>
#include <unistd.h>
#include <string.h>
#include <math.h>

@@ -41,6 +42,8 @@ extern "C" {

#define HAVE_SYS_TIME_H

#define HAVE_RB_IO_T

// Macros

#define NORETURN(X) __attribute__((__noreturn__)) X
@@ -380,6 +383,9 @@ void rb_jump_tag(int status);

void rb_set_errinfo(VALUE error);

void rb_syserr_fail(int errno, const char *message);
void rb_sys_fail(const char *message);

// Defining classes, modules and methods

VALUE rb_define_class(const char *name, VALUE superclass);
@@ -466,6 +472,18 @@ int rb_nativethread_lock_destroy(rb_nativethread_lock_t *lock);
int rb_nativethread_lock_lock(rb_nativethread_lock_t *lock);
int rb_nativethread_lock_unlock(rb_nativethread_lock_t *lock);

// IO

typedef struct rb_io_t {
} rb_io_t;

#define rb_update_max_fd(fd) {}

void rb_io_check_writable(rb_io_t *io);
void rb_io_check_readable(rb_io_t *io);

int rb_cloexec_dup(int oldfd);

#if defined(__cplusplus)
}
#endif
25 changes: 25 additions & 0 deletions truffle/src/main/c/cext/ruby.c
Original file line number Diff line number Diff line change
@@ -591,6 +591,16 @@ void rb_set_errinfo(VALUE error) {
abort();
}

void rb_syserr_fail(int errno, const char *message) {
fprintf(stderr, "rb_syserr_fail: %d %s\n", errno, message);
abort();
}

void rb_sys_fail(const char *message) {
fprintf(stderr, "rb_sys_fail: %s\n", message);
abort();
}

// Defining classes, modules and methods

VALUE rb_define_class(const char *name, VALUE superclass) {
@@ -786,3 +796,18 @@ int rb_nativethread_lock_unlock(rb_nativethread_lock_t *lock) {
truffle_invoke(lock, "unlock");
return 0;
}

// IO

void rb_io_check_writable(rb_io_t *io) {
// TODO
}

void rb_io_check_readable(rb_io_t *io) {
// TODO
}

int rb_cloexec_dup(int oldfd) {
fprintf(stderr, "rb_cloexec_dup not implemented\n");
abort();
}