druntime: Fix compilation of rt.cover on Android (#21015)

This commit is contained in:
Martin Kinkelin 2025-03-17 15:06:24 +01:00 committed by GitHub
parent 57a60e575c
commit d2ee11364c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -27,7 +27,7 @@ else version (Posix)
{ {
import core.stdc.stdio : fopen; import core.stdc.stdio : fopen;
import core.sys.posix.fcntl : O_CREAT, O_RDWR, open, S_IRGRP, S_IROTH, S_IRUSR, S_IWGRP, S_IWOTH, S_IWUSR; import core.sys.posix.fcntl : O_CREAT, O_RDWR, open, S_IRGRP, S_IROTH, S_IRUSR, S_IWGRP, S_IWOTH, S_IWUSR;
import core.sys.posix.unistd : F_LOCK, ftruncate, lockf; import core.sys.posix.unistd : ftruncate;
} }
else else
static assert(0, "Unsupported platform"); static assert(0, "Unsupported platform");
@ -487,7 +487,10 @@ void lockFile(int fd)
flock(fd, LOCK_EX); // exclusive lock flock(fd, LOCK_EX); // exclusive lock
} }
else version (Posix) else version (Posix)
{
import core.sys.posix.unistd : F_LOCK, lockf;
lockf(fd, F_LOCK, 0); // exclusive lock lockf(fd, F_LOCK, 0); // exclusive lock
}
else version (Windows) else version (Windows)
{ {
OVERLAPPED off; OVERLAPPED off;