From d2ee11364c25ca8865eb0acb9596a6147532ef41 Mon Sep 17 00:00:00 2001 From: Martin Kinkelin Date: Mon, 17 Mar 2025 15:06:24 +0100 Subject: [PATCH] druntime: Fix compilation of rt.cover on Android (#21015) --- druntime/src/rt/cover.d | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/druntime/src/rt/cover.d b/druntime/src/rt/cover.d index 7bc5ffbf11..0b1902104c 100644 --- a/druntime/src/rt/cover.d +++ b/druntime/src/rt/cover.d @@ -27,7 +27,7 @@ else version (Posix) { 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.unistd : F_LOCK, ftruncate, lockf; + import core.sys.posix.unistd : ftruncate; } else static assert(0, "Unsupported platform"); @@ -487,7 +487,10 @@ void lockFile(int fd) flock(fd, LOCK_EX); // exclusive lock } else version (Posix) + { + import core.sys.posix.unistd : F_LOCK, lockf; lockf(fd, F_LOCK, 0); // exclusive lock + } else version (Windows) { OVERLAPPED off;