Method deprecated or moved
This method is deprecated or moved on the latest stable version.
The last existing version (v1_9_2_180) is shown here.
unix_rights(*args)
public
static VALUE
ancillary_s_unix_rights(int argc, VALUE *argv, VALUE klass)
{
VALUE result, str, ary;
int i;
ary = rb_ary_new();
for (i = 0 ; i < argc; i++) {
VALUE obj = argv[i];
if (TYPE(obj) != T_FILE) {
rb_raise(rb_eTypeError, "IO expected");
}
rb_ary_push(ary, obj);
}
str = rb_str_buf_new(sizeof(int) * argc);
for (i = 0 ; i < argc; i++) {
VALUE obj = RARRAY_PTR(ary)[i];
rb_io_t *fptr;
int fd;
GetOpenFile(obj, fptr);
fd = fptr->fd;
rb_str_buf_cat(str, (char *)&fd, sizeof(int));
}
result = ancdata_new(AF_UNIX, SOL_SOCKET, SCM_RIGHTS, str);
rb_ivar_set(result, rb_intern("unix_rights"), ary);
return result;
}