diff options
Diffstat (limited to 'sys/linux/port/os/types.h')
-rw-r--r-- | sys/linux/port/os/types.h | 72 |
1 files changed, 72 insertions, 0 deletions
diff --git a/sys/linux/port/os/types.h b/sys/linux/port/os/types.h new file mode 100644 index 0000000..6e5c0c6 --- /dev/null +++ b/sys/linux/port/os/types.h @@ -0,0 +1,72 @@ +#pragma once + +/* + * time + */ + +/* timeval */ +typedef struct sys·TimeStamp sys·TimeStamp; + +struct sys·TimeStamp +{ + int64 sec; + uint32 nano; + int32 femto; +}; + +/* + * files + */ + +typedef struct sys·Info sys·Info; +typedef struct sys·Directory sys·Directory; +typedef struct sys·DirEntry sys·DirEntry; + +/* statx */ +struct sys·Info +{ + uint32 mask; + uint32 blksize; + uint64 attr; + uint32 nlink; + uint32 uid; + uint32 gid; + uint16 mode; + uint16 _pad; + uint64 inode; + uint64 size; + uint64 nblk; + uint64 attrmask; + + sys·TimeStamp access, create, status, modify; + + struct{ + uint32 major; + uint32 minor; + }spdev; + struct{ + uint32 major; + uint32 minor; + }device; + + uint64 spare[14]; +}; + +struct sys·Directory +{ + intptr off; + int fd; + int pad; + int pos, end; + /* buf needs fall on (off_t) 8 byte alignment */ + char buf[2048]; +}; + +struct sys·DirEntry +{ + ulong ino; /* inode number */ + ulong off; /* offset to next entry (from start of directory */ + ushort len; /* length of entry (in bytes) */ + uchar type; /* filetype */ + char name[]; /* filename */ +}; |