Skip to content

Commit

Permalink
Removed Socketable/io_accept primitive
Browse files Browse the repository at this point in the history
This is no longer in use by rubysl-socket and serves no further purpose.
  • Loading branch information
Yorick Peterse committed Dec 18, 2015
1 parent 5a78231 commit 9d274e8
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 44 deletions.
7 changes: 0 additions & 7 deletions kernel/bootstrap/io.rb
Expand Up @@ -145,13 +145,6 @@ def socket_recv(bytes, flags, type)
raise PrimitiveFailure, "io_socket_read failed"
end

module Socketable
def accept
Rubinius.primitive :io_accept
raise PrimitiveFailure, "io_accept failed"
end
end

module TransferIO
def send_io
Rubinius.primitive :io_send_io
Expand Down
34 changes: 0 additions & 34 deletions vm/builtin/io.cpp
Expand Up @@ -1230,40 +1230,6 @@ namespace rubinius {


/** Socket methods */
Object* IO::accept(STATE, CallFrame* calling_environment) {
int fd = descriptor()->to_native();
int new_fd = -1;

struct sockaddr_storage socka;
socklen_t sock_len = sizeof(socka);

retry:
state->vm()->interrupt_with_signal();
state->vm()->thread->sleep(state, cTrue);

{
GCIndependent guard(state, calling_environment);
new_fd = ::accept(fd, (struct sockaddr*)&socka, &sock_len);
}

state->vm()->thread->sleep(state, cFalse);
state->vm()->clear_waiter();

if(new_fd == -1) {
if(errno == EAGAIN || errno == EINTR) {
if(!state->check_async(calling_environment)) return NULL;
ensure_open(state);
goto retry;
} else {
Exception::errno_error(state, "accept(2) failed");
}

return NULL;
}

return Fixnum::from(new_fd);
}

static const int cmsg_space = CMSG_SPACE(sizeof(int));

Object* IO::send_io(STATE, IO* io) {
Expand Down
3 changes: 0 additions & 3 deletions vm/builtin/io.hpp
Expand Up @@ -121,9 +121,6 @@ namespace rubinius {
// Rubinius.primitive :io_close
Object* close(STATE);

// Rubinius.primitive :io_accept
Object* accept(STATE, CallFrame* calling_environment);

// Rubinius.primitive :io_send_io
Object* send_io(STATE, IO* io);

Expand Down

0 comments on commit 9d274e8

Please sign in to comment.