1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
This commit is contained in:
Benoit Daloze 2021-02-27 13:00:26 +01:00
parent dbea0be13d
commit 36dde35e02
48 changed files with 811 additions and 64 deletions

View file

@ -227,6 +227,16 @@ static VALUE io_spec_errno_set(VALUE self, VALUE val) {
return val;
}
VALUE io_spec_mode_sync_flag(VALUE self, VALUE io) {
rb_io_t *fp;
GetOpenFile(io, fp);
if (fp->mode & FMODE_SYNC) {
return Qtrue;
} else {
return Qfalse;
}
}
void Init_io_spec(void) {
VALUE cls = rb_define_class("CApiIOSpecs", rb_cObject);
rb_define_method(cls, "GetOpenFile_fd", io_spec_GetOpenFile_fd, 1);
@ -251,6 +261,7 @@ void Init_io_spec(void) {
rb_define_method(cls, "rb_fd_fix_cloexec", io_spec_rb_fd_fix_cloexec, 1);
rb_define_method(cls, "rb_cloexec_open", io_spec_rb_cloexec_open, 3);
rb_define_method(cls, "errno=", io_spec_errno_set, 1);
rb_define_method(cls, "rb_io_mode_sync_flag", io_spec_mode_sync_flag, 1);
}
#ifdef __cplusplus