diff options
| author | Isaac Andrade <andradei@proton.me> | 2024-08-20 20:35:56 -0600 |
|---|---|---|
| committer | Isaac Andrade <andradei@proton.me> | 2024-08-20 20:35:56 -0600 |
| commit | ef06cd93ccfa5ea4cf6f49a46626dd10c959bcaa (patch) | |
| tree | 48b3e064b2473337632125c93da234abfa32a92e /core | |
| parent | c0521c6d992afed75a029c4eb1d2df04f83ea08c (diff) | |
Initial implementation of linux-specifig dirent struct.
Diffstat (limited to 'core')
| -rw-r--r-- | core/sys/posix/dirent.odin | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/core/sys/posix/dirent.odin b/core/sys/posix/dirent.odin index bbb5416c5..38ba2e8cf 100644 --- a/core/sys/posix/dirent.odin +++ b/core/sys/posix/dirent.odin @@ -193,11 +193,21 @@ when ODIN_OS == .Darwin { } else when ODIN_OS == .NetBSD { dirent :: struct { - d_ino: ino_t, /* [PSX] file number of entry */ - d_reclen: c.uint16_t, /* length of this record */ - d_namelen: c.uint16_t, /* length of string in d_name */ - d_type: D_Type, /* file type */ - d_name: [512]c.char `fmt:"s,0"`, /* [PSX] entry name */ + d_ino: ino_t, /* [PSX] file number of entry */ + d_reclen: c.uint16_t, /* length of this record */ + d_namelen: c.uint16_t, /* length of string in d_name */ + d_type: D_Type, /* file type */ + d_name: [512]c.char `fmt:"s,0"`, /* [PSX] entry name */ + } + +} else when ODIN_OS == .Linux { + + dirent :: struct { + d_ino: ino_t, /* [PSX] file number of entry */ + d_off: off_t, /* directory offset of the next entry */ + d_reclen: c.uint16_t, /* length of this record */ + d_type: D_Type, /* file type */ + d_name: [256]c.char `fmt:"s,0"` /* [PSX] entry name */ } } else { |