X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=Usermode%2Finclude%2Fsys%2Ftypes.h;h=a1ed85b73d537cf968d4f16e4c19dd54925fa58c;hb=0cf0603b0b1f6a8617f8efc73375b9b1a9da2159;hp=2fad39fc38459216454542a7c66c6c50d9d0f8e4;hpb=b98fbd4e9c71447d81fc9bd643fb174c76346e0f;p=tpg%2Facess2.git diff --git a/Usermode/include/sys/types.h b/Usermode/include/sys/types.h index 2fad39fc..a1ed85b7 100644 --- a/Usermode/include/sys/types.h +++ b/Usermode/include/sys/types.h @@ -27,9 +27,57 @@ typedef struct { #define S_IFSOCK 0140000 /* socket */ #define S_IFIFO 0010000 /* fifo */ +#define FD_SETSIZE 128 + + +#define CLONE_VM 0x10 + +/** + * \brief fd_set for select() + */ +typedef struct +{ + uint16_t flags[FD_SETSIZE/16]; +} fd_set; + +struct s_sysACL { + union { + struct { + unsigned group: 1; + unsigned id: 31; + }; + uint32_t object; + }; + union { + struct { + unsigned invert: 1; + unsigned perms: 31; + }; + uint32_t rawperms; + }; +}; +struct s_sysFInfo { + unsigned int uid, gid; + unsigned int flags; + uint64_t size; + uint64_t atime; + uint64_t mtime; + uint64_t ctime; + int numacls; + struct s_sysACL acls[]; +}; +typedef struct s_sysFInfo t_sysFInfo; +typedef struct s_sysACL t_sysACL; + +static inline void FD_ZERO(fd_set *fdsetp) {int i=FD_SETSIZE/16;while(i--)fdsetp->flags[i]=0; } +static inline void FD_CLR(int fd, fd_set *fdsetp) { fdsetp->flags[fd/16]&=~(1<<(fd%16)); } +static inline void FD_SET(int fd, fd_set *fdsetp) { fdsetp->flags[fd/16]|=1<<(fd%16); } +static inline int FD_ISSET(int fd, fd_set *fdsetp) { return fdsetp->flags[fd/16]&(1<<(fd%16)); } typedef uint32_t pid_t; typedef uint32_t tid_t; typedef int64_t time_t; +typedef unsigned int uint; + #endif