"Fossies" - the Fresh Open Source Software Archive

Member "dmd2/src/druntime/import/core/sys/linux/sys/xattr.d" (20 Nov 2020, 2828 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 GNU/Linux.
    3  *
    4  * Copyright: Copyright Robert Klotzner 2012.
    5  * License:   $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost License 1.0)
    6  * Authors:   Robert Klotzner
    7  */
    8 module core.sys.linux.sys.xattr;
    9 
   10 import core.sys.posix.sys.types;
   11 
   12 version (linux):
   13 extern (C):
   14 @system:
   15 nothrow:
   16 @nogc:
   17 
   18 enum {
   19     XATTR_CREATE = 1, /* set value, fail if attr already exists.  */
   20     XATTR_REPLACE = 2 /* set value, fail if attr does not exist.  */
   21 }
   22 
   23 enum XATTR_OS2_PREFIX = "os2.";
   24 enum XATTR_OS2_PREFIX_LEN = XATTR_OS2_PREFIX.length;
   25 enum XATTR_SECURITY_PREFIX = "security.";
   26 enum XATTR_SECURITY_PREFIX_LEN = XATTR_SECURITY_PREFIX.length;
   27 enum XATTR_SYSTEM_PREFIX = "system.";
   28 enum XATTR_SYSTEM_PREFIX_LEN = XATTR_SYSTEM_PREFIX.length;
   29 enum XATTR_TRUSTED_PREFIX = "trusted.";
   30 enum XATTR_TRUSTED_PREFIX_LEN = XATTR_TRUSTED_PREFIX.length;
   31 enum XATTR_USER_PREFIX = "user.";
   32 enum XATTR_USER_PREFIX_LEN = XATTR_USER_PREFIX.length;
   33 
   34 /* Security namespace */
   35 enum XATTR_SELINUX_SUFFIX = "selinux.";
   36 enum XATTR_NAME_SELINUX = XATTR_SECURITY_PREFIX ~ XATTR_SELINUX_SUFFIX;
   37 
   38 enum XATTR_SMACK_SUFFIX = "SMACK64";
   39 enum XATTR_SMACK_IPIN = "SMACK64IPIN";
   40 enum XATTR_SMACK_IPOUT = "SMACK64IPOUT";
   41 enum XATTR_SMACK_EXEC = "SMACK64EXEC";
   42 enum XATTR_SMACK_TRANSMUTE = "SMACK64TRANSMUTE";
   43 enum XATTR_SMACK_MMAP = "SMACK64MMAP";
   44 
   45 enum XATTR_NAME_SMACK = XATTR_SECURITY_PREFIX ~ XATTR_SMACK_SUFFIX;
   46 enum XATTR_NAME_SMACKIPIN = XATTR_SECURITY_PREFIX ~ XATTR_SMACK_IPIN;
   47 enum XATTR_NAME_SMACKIPOUT = XATTR_SECURITY_PREFIX ~ XATTR_SMACK_IPOUT;
   48 enum XATTR_NAME_SMACKEXEC = XATTR_SECURITY_PREFIX ~ XATTR_SMACK_EXEC;
   49 enum XATTR_NAME_SMACKTRANSMUTE = XATTR_SECURITY_PREFIX ~ XATTR_SMACK_TRANSMUTE;
   50 enum XATTR_NAME_SMACKMMAP = XATTR_SECURITY_PREFIX ~ XATTR_SMACK_MMAP;
   51 
   52 enum XATTR_CAPS_SUFFIX = "capability";
   53 enum XATTR_NAME_CAPS = XATTR_SECURITY_PREFIX ~ XATTR_CAPS_SUFFIX;
   54 
   55 
   56 int setxattr(const scope char* path, const scope char* name, const scope void* value, size_t size, int flags);
   57 
   58 int lsetxattr(const scope char* path, const scope char* name, const scope void* value, size_t size, int flags);
   59 int fsetxattr(int fd, const scope char* name, const scope void* value, size_t size, int flags);
   60 ssize_t getxattr(const scope char* path, const scope char* name, void* value, size_t size);
   61 ssize_t lgetxattr(const scope char* path, const scope char* name, void* value, size_t size);
   62 ssize_t fgetxattr(int fd, const scope char* name, void* value, size_t size);
   63 ssize_t listxattr(const scope char* path, char* list, size_t size);
   64 ssize_t llistxattr(const scope char* path, char* list, size_t size);
   65 ssize_t flistxattr (int __fd, char *list, size_t size);
   66 int removexattr (const scope char *path, const scope char *name);
   67 int lremovexattr (const scope char *path, const scope char *name);
   68 int fremovexattr (int fd, const scope char *name);
   69