Delete obsolete, unused files.

This commit is contained in:
Patrick Mahoney 2013-12-31 18:21:04 -06:00
parent af27697623
commit 3acc7afc34
2 changed files with 0 additions and 50 deletions

View File

@ -1,29 +0,0 @@
# require 'process_shared/libc' - circular dependency here...
module ProcessShared
module PosixCall
# Replace methods in +syms+ with error checking wrappers that
# invoke the original method and raise a {SystemCallError} with
# the current errno if the return value is an error.
#
# Errors are detected if the block returns true when called with
# the original method's return value.
def error_check(*syms, &is_err)
unless block_given?
is_err = lambda { |v| (v == -1) }
end
syms.each do |sym|
method = self.method(sym)
define_singleton_method(sym) do |*args|
ret = method.call(*args)
if is_err.call(ret)
raise SystemCallError.new("error in #{sym}", LibC.errno)
else
ret
end
end
end
end
end
end

View File

@ -1,21 +0,0 @@
require 'process_shared/posix_call'
require 'process_shared/psem'
module ProcessShared
module RT
extend FFI::Library
extend PosixCall
# FIXME: mac and linux OK, but what about everything else?
if FFI::Platform.mac?
ffi_lib 'c'
else
ffi_lib 'rt'
end
attach_function :shm_open, [:string, :int, :mode_t], :int
attach_function :shm_unlink, [:string], :int
error_check :shm_open, :shm_unlink
end
end