Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions ext/fcntl/fcntl.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
}