diff options
Diffstat (limited to 'ext/fcntl')
| -rw-r--r-- | ext/fcntl/depend | 2 | ||||
| -rw-r--r-- | ext/fcntl/fcntl.c | 48 | ||||
| -rw-r--r-- | ext/fcntl/fcntl.gemspec | 2 |
3 files changed, 50 insertions, 2 deletions
diff --git a/ext/fcntl/depend b/ext/fcntl/depend index 9ce9fa30ef..57ea0f2106 100644 --- a/ext/fcntl/depend +++ b/ext/fcntl/depend @@ -128,6 +128,7 @@ fcntl.o: $(hdrdir)/ruby/internal/intern/re.h fcntl.o: $(hdrdir)/ruby/internal/intern/ruby.h fcntl.o: $(hdrdir)/ruby/internal/intern/select.h fcntl.o: $(hdrdir)/ruby/internal/intern/select/largesize.h +fcntl.o: $(hdrdir)/ruby/internal/intern/set.h fcntl.o: $(hdrdir)/ruby/internal/intern/signal.h fcntl.o: $(hdrdir)/ruby/internal/intern/sprintf.h fcntl.o: $(hdrdir)/ruby/internal/intern/string.h @@ -147,6 +148,7 @@ fcntl.o: $(hdrdir)/ruby/internal/special_consts.h fcntl.o: $(hdrdir)/ruby/internal/static_assert.h fcntl.o: $(hdrdir)/ruby/internal/stdalign.h fcntl.o: $(hdrdir)/ruby/internal/stdbool.h +fcntl.o: $(hdrdir)/ruby/internal/stdckdint.h fcntl.o: $(hdrdir)/ruby/internal/symbol.h fcntl.o: $(hdrdir)/ruby/internal/value.h fcntl.o: $(hdrdir)/ruby/internal/value_type.h diff --git a/ext/fcntl/fcntl.c b/ext/fcntl/fcntl.c index e34a3aeae3..b987e237dd 100644 --- a/ext/fcntl/fcntl.c +++ b/ext/fcntl/fcntl.c @@ -65,7 +65,7 @@ pack up your own arguments to pass as args for locking functions, etc. * */ -#define FCNTL_VERSION "1.1.0" +#define FCNTL_VERSION "1.3.0" void Init_fcntl(void) @@ -251,4 +251,50 @@ Init_fcntl(void) */ rb_define_const(mFcntl, "F_DUP2FD_CLOEXEC", INT2NUM(F_DUP2FD_CLOEXEC)); #endif + +#ifdef F_PREALLOCATE + /* + * macOS specific flag used for preallocating file space. + */ + rb_define_const(mFcntl, "F_PREALLOCATE", INT2NUM(F_PREALLOCATE)); +#endif + +#ifdef F_ALLOCATECONTIG + /* + * macOS specific flag used with F_PREALLOCATE for allocating contiguous + * space. + */ + rb_define_const(mFcntl, "F_ALLOCATECONTIG", INT2NUM(F_ALLOCATECONTIG)); +#endif + +#ifdef F_ALLOCATEALL + /* + * macOS specific flag used with F_PREALLOCATE for allocating all contiguous + * space or no space. + */ + rb_define_const(mFcntl, "F_ALLOCATEALL", INT2NUM(F_ALLOCATEALL)); +#endif + +#ifdef F_ALLOCATEPERSIST + /* + * macOS specific flag used with F_PREALLOCATE. Allocate space that is not + * freed when close is called. + */ + rb_define_const(mFcntl, "F_ALLOCATEPERSIST", INT2NUM(F_ALLOCATEPERSIST)); +#endif + +#ifdef F_PEOFPOSMODE + /* + * macOS specific flag used with F_PREALLOCATE. Allocate from the physical + * end of file + */ + rb_define_const(mFcntl, "F_PEOFPOSMODE", INT2NUM(F_PEOFPOSMODE)); +#endif + +#ifdef F_VOLPOSMODE + /* + * macOS specific flag used with F_PREALLOCATE. Allocate from the volume offset. + */ + rb_define_const(mFcntl, "F_VOLPOSMODE", INT2NUM(F_VOLPOSMODE)); +#endif } diff --git a/ext/fcntl/fcntl.gemspec b/ext/fcntl/fcntl.gemspec index d621bc0491..613a90d1ae 100644 --- a/ext/fcntl/fcntl.gemspec +++ b/ext/fcntl/fcntl.gemspec @@ -23,7 +23,7 @@ Gem::Specification.new do |spec| spec.licenses = ["Ruby", "BSD-2-Clause"] spec.files = ["ext/fcntl/extconf.rb", "ext/fcntl/fcntl.c"] - spec.extra_rdoc_files = [".document", ".rdoc_options", "LICENSE.txt", "README.md"] + spec.extra_rdoc_files = [".document", ".rdoc_options", "BSDL", "COPYING", "README.md"] spec.bindir = "exe" spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) } spec.require_paths = ["lib"] |
