"Fossies" - the Fresh Open Source Software Archive

Member "dmd2/src/druntime/src/core/sys/linux/sys/file.d" (20 Nov 2020, 857 Bytes) of package /linux/misc/dmd.2.094.2.linux.tar.xz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) D source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file.

    1 /**
    2  * D header file for Linux file ops.
    3  *
    4  * Copyright: Copyright Nemanja Boric 2016.
    5  * License:   $(HTTP www.boost.org/LICENSE_1_0.txt, Boost License 1.0).
    6  * Authors:   Nemanja Boric
    7  */
    8 module core.sys.linux.sys.file;
    9 
   10 version (linux):
   11 extern (C):
   12 nothrow:
   13 @nogc:
   14 
   15 /* Operations for the `flock' call. */
   16 /// Shared lock
   17 enum LOCK_SH              = 0x01;
   18 /// Exclusive lock
   19 enum LOCK_EX              = 0x02;
   20 /// Unlock
   21 enum LOCK_UN              = 0x08;
   22 
   23 /// Don't block when locking.
   24 /// Can be OR'd into one of the above.
   25 enum LOCK_NB              = 0x04;
   26 
   27 /// Apply or remove an advisory lock on an open file
   28 /// Params:
   29 ///     fd = file to apply or remove lock from
   30 ///     operation = lock operation to perform
   31 /// Returns:
   32 ///     0 on success, -1 on failure, with .errno
   33 ///     set appropriately.
   34 int     flock(int fd, int operation) @trusted;