1#include "ruby/internal/config.h"
9flock(
int fd,
int operation)
14#elif defined HAVE_FCNTL && defined HAVE_FCNTL_H
37flock(
int fd,
int operation)
41 switch (operation & ~LOCK_NB) {
43 lock.l_type = F_RDLCK;
46 lock.l_type = F_WRLCK;
49 lock.l_type = F_UNLCK;
55 lock.l_whence = SEEK_SET;
56 lock.l_start = lock.l_len = 0L;
58 return fcntl(fd, (operation & LOCK_NB) ? F_SETLK : F_SETLKW, &lock);
61#elif defined(HAVE_LOCKF)
102flock(
int fd,
int operation)
112 return lockf (fd, F_LOCK, 0);
115 case LOCK_SH|LOCK_NB:
119 case LOCK_EX|LOCK_NB:
120 return lockf (fd, F_TLOCK, 0);
124 return lockf (fd, F_ULOCK, 0);
134flock(
int fd,
int operation)
void rb_notimplement(void)
#define errno
Ractor-aware version of errno.