Changeset 611 for trunk/kernel/syscalls/shared_include/shared_dirent.h
- Timestamp:
- Jan 9, 2019, 3:02:51 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kernel/syscalls/shared_include/shared_dirent.h
r445 r611 26 26 27 27 /******************************************************************************************* 28 * Th ese two structure defines the informations returned to user by the opendir()29 * function, used by the readdir() function, and released by the closedir() function.30 * - "DIR" describes the complete directory.31 * - "dirent" describes one directory entry.28 * This enum defines the possible types for a dirent inode in a dirent structure. 29 * 30 * WARNING : these types must be kept consistent with inode types in <vfs.h> file. 31 * and with types in <shared_stat.h> file. 32 32 ******************************************************************************************/ 33 33 34 #define DIRENT_NAME_MAX_LENGTH 56 35 #define DIRENT_MAX_NUMBER 63 34 typedef enum 35 { 36 DT_REG = 0, /*! regular file */ 37 DT_DIR = 1, /*! directory */ 38 DT_FIFO = 2, /*! named pipe (FIFO) */ 39 DT_PIPE = 3, /*! anonymous pipe */ 40 DT_SOCK = 4, /*! socket */ 41 DT_CHR = 5, /*! character device */ 42 DT_BLK = 6, /*! block device */ 43 DT_LNK = 7, /*! symbolic link */ 44 DT_UNKNOWN = 8, /*! undetermined type */ 45 } 46 dirent_type_t; 47 48 /******************************************************************************************* 49 * This defines the actual ALMOS-MKH implementation of the DIR user type. 50 ******************************************************************************************/ 51 52 typedef unsigned int DIR; 53 54 /******************************************************************************************* 55 * This structure defines the informations returned to user by the readdir() syscall. 56 * 57 * WARNING: sizeof(dirent) must be 64 bytes. 58 ******************************************************************************************/ 36 59 37 60 struct dirent 38 61 { 39 unsigned int inum; /*! inode identifier */ 40 unsigned int type; /*! inode type */ 41 char name[DIRENT_NAME_MAX_LENGTH]; /*! directory entry name */ 62 int d_ino; /*! inode identifier */ 63 int d_type; /*! inode type */ 64 char d_name[48]; /*! dentry name */ 65 char padding[64 - 48 - (2*sizeof(int))]; 42 66 }; 43 67 44 typedef struct user_directory45 {46 struct dirent entry[DIRENT_MAX_NUMBER];47 unsigned int current;48 }49 DIR;50 51 68 #endif
Note: See TracChangeset
for help on using the changeset viewer.