kern
diff include/kdef.h @ 98:921a264297a4
merged the filesystem stuff
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Thu, 17 Apr 2014 17:03:30 +0300 |
parents | 07fe6a614185 |
children |
line diff
1.1 --- a/include/kdef.h Thu Apr 17 12:30:02 2014 +0300 1.2 +++ b/include/kdef.h Thu Apr 17 17:03:30 2014 +0300 1.3 @@ -29,11 +29,21 @@ 1.4 1.5 /* --- defines for errno.h */ 1.6 #if defined(KERNEL) || defined(KDEF_ERRNO_H) 1.7 -#define EAGAIN 1 1.8 -#define EINVAL 2 1.9 -#define ECHILD 3 1.10 +#define EFOO 1 /* I just like to return -1 some times :) */ 1.11 1.12 -#define EBUG 255 /* not implemented yet */ 1.13 +#define EAGAIN 2 1.14 +#define EINVAL 3 1.15 +#define ECHILD 4 1.16 +#define EBUSY 5 1.17 +#define ENOMEM 6 1.18 +#define EIO 7 1.19 +#define ENOENT 8 1.20 +#define ENAMETOOLONG 9 1.21 +#define ENOSPC 10 1.22 +#define EPERM 11 1.23 +#define ENOTDIR 12 1.24 + 1.25 +#define EBUG 127 /* for missing features and known bugs */ 1.26 #endif /* errno.h */ 1.27 1.28 1.29 @@ -62,4 +72,36 @@ 1.30 1.31 #endif /* syscall.h */ 1.32 1.33 +/* --- defines for sys/stat.h */ 1.34 +#if defined(KERNEL) || defined(STAT_H) 1.35 + 1.36 +#define S_IFMT 0170000 /* bit mask for the file type bit fields */ 1.37 +#define S_IFSOCK 0140000 /* socket */ 1.38 +#define S_IFLNK 0120000 /* symbolic link */ 1.39 +#define S_IFREG 0100000 /* regular file */ 1.40 +#define S_IFBLK 0060000 /* block device */ 1.41 +#define S_IFDIR 0040000 /* directory */ 1.42 +#define S_IFCHR 0020000 /* character device */ 1.43 +#define S_IFIFO 0010000 /* FIFO */ 1.44 + 1.45 +#define S_ISUID 0004000 /* set UID bit */ 1.46 +#define S_ISGID 0002000 /* set-group-ID bit (see below) */ 1.47 +#define S_ISVTX 0001000 /* sticky bit (see below) */ 1.48 + 1.49 +#define S_IRWXU 00700 /* mask for file owner permissions */ 1.50 +#define S_IRUSR 00400 /* owner has read permission */ 1.51 +#define S_IWUSR 00200 /* owner has write permission */ 1.52 +#define S_IXUSR 00100 /* owner has execute permission */ 1.53 +#define S_IRWXG 00070 /* mask for group permissions */ 1.54 +#define S_IRGRP 00040 /* group has read permission */ 1.55 +#define S_IWGRP 00020 /* group has write permission */ 1.56 +#define S_IXGRP 00010 /* group has execute permission */ 1.57 +#define S_IRWXO 00007 /* mask for permissions for others (not in group) */ 1.58 +#define S_IROTH 00004 /* others have read permission */ 1.59 +#define S_IWOTH 00002 /* others have write permission */ 1.60 +#define S_IXOTH 00001 /* others have execute permission */ 1.61 + 1.62 +#endif /* sys/stat.h */ 1.63 + 1.64 + 1.65 #endif /* KERNEL_DEFS_H_ */