Showing with 15 additions and 6 deletions.
  1. +5 −0 src/core/sys/bionic/fcntl.d
  2. +5 −0 src/core/sys/bionic/unistd.d
  3. +0 −2 src/core/sys/posix/fcntl.d
  4. +0 −1 src/core/sys/posix/unistd.d
  5. +5 −1 src/rt/cover.d
  6. +0 −1 src/rt/sections_android.d
  7. +0 −1 src/rt/sections_solaris.d
5 changes: 5 additions & 0 deletions src/core/sys/bionic/fcntl.d
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module core.sys.bionic.fcntl;

version(CRuntime_Bionic) extern(C) nothrow @nogc:

enum LOCK_EX = 2;
5 changes: 5 additions & 0 deletions src/core/sys/bionic/unistd.d
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module core.sys.bionic.unistd;

version(CRuntime_Bionic) extern(C) nothrow @nogc:

int flock(int, int) @trusted;
2 changes: 0 additions & 2 deletions src/core/sys/posix/fcntl.d
Original file line number Diff line number Diff line change
Expand Up @@ -499,8 +499,6 @@ else version( CRuntime_Bionic )
enum F_WRLCK = 1;
enum F_UNLCK = 2;

enum LOCK_EX = 2;

version (X86)
{
enum O_CREAT = 0x40; // octal 0100
Expand Down
1 change: 0 additions & 1 deletion src/core/sys/posix/unistd.d
Original file line number Diff line number Diff line change
Expand Up @@ -1263,7 +1263,6 @@ else version( FreeBSD )
else version( CRuntime_Bionic )
{
int fchdir(int) @trusted;
int flock(int, int) @trusted;
pid_t getpgid(pid_t) @trusted;
int lchown(in char*, uid_t, gid_t);
int nice(int) @trusted;
Expand Down
6 changes: 5 additions & 1 deletion src/rt/cover.d
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,11 @@ version (Windows) HANDLE handle(int fd)
void lockFile(int fd)
{
version (CRuntime_Bionic)
core.sys.posix.unistd.flock(fd, LOCK_EX); // exclusive lock
{
import core.sys.bionic.fcntl : LOCK_EX;
import core.sys.bionic.unistd : flock;
flock(fd, LOCK_EX); // exclusive lock
}
else version (Posix)
lockf(fd, F_LOCK, 0); // exclusive lock
else version (Windows)
Expand Down
1 change: 0 additions & 1 deletion src/rt/sections_android.d
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ void initSections()

void finiSections()
{
.free(cast(void*)_sections.modules.ptr);
pthread_key_delete(_tlsKey);
}

Expand Down
1 change: 0 additions & 1 deletion src/rt/sections_solaris.d
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ void initSections()

void finiSections()
{
.free(cast(void*)_sections.modules.ptr);
}

void[] initTLSRanges()
Expand Down