Skip to content
This repository was archived by the owner on Oct 12, 2022. It is now read-only.
/ druntime Public archive
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions mak/COPY
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ COPY=\
$(IMPDIR)\core\sys\linux\unistd.d \
\
$(IMPDIR)\core\sys\linux\sys\auxv.d \
$(IMPDIR)\core\sys\linux\sys\file.d \
$(IMPDIR)\core\sys\linux\sys\inotify.d \
$(IMPDIR)\core\sys\linux\sys\mman.d \
$(IMPDIR)\core\sys\linux\sys\signalfd.d \
Expand Down
34 changes: 34 additions & 0 deletions src/core/sys/linux/sys/file.d
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/**
* D header file for Linux file ops.
*
* Copyright: Copyright Nemanja Boric 2016.
* License: $(WEB www.boost.org/LICENSE_1_0.txt, Boost License 1.0).
* Authors: Nemanja Boric
*/
module core.sys.linux.sys.file;

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

/* Operations for the `flock' call. */
/// Shared lock
enum LOCK_SH = 0x01;
/// Exclusive lock
enum LOCK_EX = 0x02;
/// Unlock
enum LOCK_UN = 0x08;

/// Don't block when locking.
/// Can be OR'd into one of the above.
enum LOCK_NB = 0x04;

/// Apply or remove an advisory lock on an open file
/// Params:
/// fd = file to apply or remove lock from
/// operation = lock operation to perform
/// Returns:
/// 0 on success, -1 on failure, with .errno
/// set appropriately.
int flock(int fd, int operation) @trusted;
3 changes: 3 additions & 0 deletions win32.mak
Original file line number Diff line number Diff line change
Expand Up @@ -467,6 +467,9 @@ $(IMPDIR)\core\sys\linux\unistd.d : src\core\sys\linux\unistd.d
$(IMPDIR)\core\sys\linux\sys\auxv.d : src\core\sys\linux\sys\auxv.d
copy $** $@

$(IMPDIR)\core\sys\linux\sys\file.d : src\core\sys\linux\sys\file.d
copy $** $@

$(IMPDIR)\core\sys\linux\sys\inotify.d : src\core\sys\linux\sys\inotify.d
copy $** $@

Expand Down
3 changes: 3 additions & 0 deletions win64.mak
Original file line number Diff line number Diff line change
Expand Up @@ -475,6 +475,9 @@ $(IMPDIR)\core\sys\linux\unistd.d : src\core\sys\linux\unistd.d
$(IMPDIR)\core\sys\linux\sys\auxv.d : src\core\sys\linux\sys\auxv.d
copy $** $@

$(IMPDIR)\core\sys\linux\sys\file.d : src\core\sys\linux\sys\file.d
copy $** $@

$(IMPDIR)\core\sys\linux\sys\inotify.d : src\core\sys\linux\sys\inotify.d
copy $** $@

Expand Down