File tree Expand file tree Collapse file tree 1 file changed +46
-0
lines changed
Expand file tree Collapse file tree 1 file changed +46
-0
lines changed Original file line number Diff line number Diff line change @@ -251,4 +251,50 @@ Init_fcntl(void)
251251 */
252252 rb_define_const (mFcntl , "F_DUP2FD_CLOEXEC" , INT2NUM (F_DUP2FD_CLOEXEC ));
253253#endif
254+
255+ #ifdef F_PREALLOCATE
256+ /*
257+ * macOS specific flag used for preallocating file space.
258+ */
259+ rb_define_const (mFcntl , "F_PREALLOCATE" , INT2NUM (F_PREALLOCATE ));
260+ #endif
261+
262+ #ifdef F_ALLOCATECONTIG
263+ /*
264+ * macOS specific flag used with F_PREALLOCATE for allocating contiguous
265+ * space.
266+ */
267+ rb_define_const (mFcntl , "F_ALLOCATECONTIG" , INT2NUM (F_ALLOCATECONTIG ));
268+ #endif
269+
270+ #ifdef F_ALLOCATEALL
271+ /*
272+ * macOS specific flag used with F_PREALLOCATE for allocating all contiguous
273+ * space or no space.
274+ */
275+ rb_define_const (mFcntl , "F_ALLOCATEALL" , INT2NUM (F_ALLOCATEALL ));
276+ #endif
277+
278+ #ifdef F_ALLOCATEPERSIST
279+ /*
280+ * macOS specific flag used with F_PREALLOCATE. Allocate space that is not
281+ * freed when close is called.
282+ */
283+ rb_define_const (mFcntl , "F_ALLOCATEPERSIST" , INT2NUM (F_ALLOCATEPERSIST ));
284+ #endif
285+
286+ #ifdef F_PEOFPOSMODE
287+ /*
288+ * macOS specific flag used with F_PREALLOCATE. Allocate from the physical
289+ * end of file
290+ */
291+ rb_define_const (mFcntl , "F_PEOFPOSMODE" , INT2NUM (F_PEOFPOSMODE ));
292+ #endif
293+
294+ #ifdef F_VOLPOSMODE
295+ /*
296+ * macOS specific flag used with F_PREALLOCATE. Allocate from the volume offset.
297+ */
298+ rb_define_const (mFcntl , "F_VOLPOSMODE" , INT2NUM (F_VOLPOSMODE ));
299+ #endif
254300}
You can’t perform that action at this time.
0 commit comments