mruby-io: remove unused flock function

The local flock() function for Windows is now dead code since the
HAL refactoring. The Windows implementation is in hal-win-io which
provides mrb_hal_io_flock().

Fixes warning: 'flock' defined but not used [-Wunused-function]

Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
Yukihiro "Matz" Matsumoto
2026-01-05 08:55:53 +09:00
parent ee06bbb417
commit 5a1123ed22
-14
View File
@@ -100,20 +100,6 @@
# define mrb_fstat(fd, sb) _fstat64(fd, sb)
#endif
#ifdef _WIN32
static int
flock(int fd, int operation)
{
HANDLE h = (HANDLE)_get_osfhandle(fd);
DWORD flags;
flags = ((operation & LOCK_NB) ? LOCKFILE_FAIL_IMMEDIATELY : 0)
| ((operation & LOCK_SH) ? LOCKFILE_EXCLUSIVE_LOCK : 0);
static const OVERLAPPED zero_ov = {0};
OVERLAPPED ov = zero_ov;
return LockFileEx(h, flags, 0, 0xffffffff, 0xffffffff, &ov) ? 0 : -1;
}
#endif
/*
* call-seq:
* File.umask([mask]) -> integer