Updated Usermode FInfo structure to match the kernel's copy
[tpg/acess2.git] / Usermode / include / sys / types.h
1 /*
2  */
3 #ifndef _SYS_TYPES_H
4 #define _SYS_TYPES_H
5 //#include <stdint.h>
6
7 typedef struct {
8         int             st_dev;         //dev_t
9         int             st_ino;         //ino_t
10         int             st_mode;        //mode_t
11         unsigned int    st_nlink;
12         unsigned int    st_uid;
13         unsigned int    st_gid;
14         int             st_rdev;        //dev_t
15         unsigned int    st_size;
16         long    st_atime;       //time_t
17         long    st_mtime;
18         long    st_ctime;
19 } t_fstat;
20
21 #define FD_SETSIZE      128
22
23
24 #define CLONE_VM        0x10
25
26 typedef unsigned long   pid_t;
27 typedef unsigned long   tid_t;
28 typedef signed long long        time_t;
29
30 typedef unsigned int    uint;
31
32 typedef unsigned short  fd_set_ent_t;
33
34 /**
35  * \brief fd_set for select()
36  */
37 typedef struct
38 {
39         fd_set_ent_t    flags[FD_SETSIZE/16];
40 }       fd_set;
41
42 struct s_sysACL {
43         unsigned long   object; //!< Group or user (bit 31 determines)
44         unsigned long   perms;  //!< Inverted by bit 31
45 };
46 struct s_sysFInfo {
47         unsigned int    mount;
48         unsigned long long      inode;
49         unsigned int    uid;
50         unsigned int    gid;
51         unsigned int    flags;
52         unsigned long long      size;
53         time_t  atime;
54         time_t  mtime;
55         time_t  ctime;
56          int    numacls;
57         struct s_sysACL acls[];
58 };
59 typedef struct s_sysFInfo       t_sysFInfo;
60 typedef struct s_sysACL t_sysACL;
61
62 static inline void FD_ZERO(fd_set *fdsetp) {int i=FD_SETSIZE/16;while(i--)fdsetp->flags[i]=0; }
63 static inline void FD_CLR(int fd, fd_set *fdsetp) {
64         if(fd < 0 || fd > FD_SETSIZE)   return;
65         fdsetp->flags[fd/16] &= (fd_set_ent_t) ((~1 << (fd%16))) & 0xFFFF;
66 }
67 static inline void FD_SET(int fd, fd_set *fdsetp) {
68         if(fd < 0 || fd > FD_SETSIZE)   return;
69         fdsetp->flags[fd/16] |= (fd_set_ent_t) (1 << (fd%16));
70 }
71 static inline int FD_ISSET(int fd, fd_set *fdsetp) {
72         if(fd < 0 || fd > FD_SETSIZE)   return 0;
73         return !!( fdsetp->flags[fd/16] & (1<<(fd%16)) );
74 }
75
76 #endif

UCC git Repository :: git.ucc.asn.au