authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2021-08-31 18:37:04-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2021-09-01 17:54:07-07:00
log5a4cc24c0eef08260e26c914828fc960aaa5631b
tree38119a28419c4587b8d5545b7931c5159d848198
parentf8dd4b13d6fe428265229fc1e31c2f8b0cd373b1

std: dirent is not part of posix


2 files changed, 4 insertions(+), 5 deletions(-)

lib/std/fs.zig+4-4
...@@ -304,7 +304,7 @@ pub const Dir = struct {...@@ -304,7 +304,7 @@ pub const Dir = struct {
304 .macos, .ios, .freebsd, .netbsd, .dragonfly, .openbsd => struct {304 .macos, .ios, .freebsd, .netbsd, .dragonfly, .openbsd => struct {
305 dir: Dir,305 dir: Dir,
306 seek: i64,306 seek: i64,
307 buf: [8192]u8, // TODO align(@alignOf(os.dirent)),307 buf: [8192]u8, // TODO align(@alignOf(os.system.dirent)),
308 index: usize,308 index: usize,
309 end_index: usize,309 end_index: usize,
310310
...@@ -344,7 +344,7 @@ pub const Dir = struct {...@@ -344,7 +344,7 @@ pub const Dir = struct {
344 self.index = 0;344 self.index = 0;
345 self.end_index = @intCast(usize, rc);345 self.end_index = @intCast(usize, rc);
346 }346 }
347 const darwin_entry = @ptrCast(*align(1) os.dirent, &self.buf[self.index]);347 const darwin_entry = @ptrCast(*align(1) os.system.dirent, &self.buf[self.index]);
348 const next_index = self.index + darwin_entry.reclen();348 const next_index = self.index + darwin_entry.reclen();
349 self.index = next_index;349 self.index = next_index;
350350
...@@ -391,7 +391,7 @@ pub const Dir = struct {...@@ -391,7 +391,7 @@ pub const Dir = struct {
391 self.index = 0;391 self.index = 0;
392 self.end_index = @intCast(usize, rc);392 self.end_index = @intCast(usize, rc);
393 }393 }
394 const bsd_entry = @ptrCast(*align(1) os.dirent, &self.buf[self.index]);394 const bsd_entry = @ptrCast(*align(1) os.system.dirent, &self.buf[self.index]);
395 const next_index = self.index + bsd_entry.reclen();395 const next_index = self.index + bsd_entry.reclen();
396 self.index = next_index;396 self.index = next_index;
397397
...@@ -462,7 +462,7 @@ pub const Dir = struct {...@@ -462,7 +462,7 @@ pub const Dir = struct {
462 self.index = 0;462 self.index = 0;
463 self.end_index = @intCast(usize, rc);463 self.end_index = @intCast(usize, rc);
464 }464 }
465 const haiku_entry = @ptrCast(*align(1) os.dirent, &self.buf[self.index]);465 const haiku_entry = @ptrCast(*align(1) os.system.dirent, &self.buf[self.index]);
466 const next_index = self.index + haiku_entry.reclen();466 const next_index = self.index + haiku_entry.reclen();
467 self.index = next_index;467 self.index = next_index;
468 const name = mem.spanZ(@ptrCast([*:0]u8, &haiku_entry.d_name));468 const name = mem.spanZ(@ptrCast([*:0]u8, &haiku_entry.d_name));
lib/std/os.zig-1
...@@ -123,7 +123,6 @@ pub const blksize_t = system.blksize_t;...@@ -123,7 +123,6 @@ pub const blksize_t = system.blksize_t;
123pub const clock_t = system.clock_t;123pub const clock_t = system.clock_t;
124pub const cpu_set_t = system.cpu_set_t;124pub const cpu_set_t = system.cpu_set_t;
125pub const dev_t = system.dev_t;125pub const dev_t = system.dev_t;
126pub const dirent = system.dirent;
127pub const dl_phdr_info = system.dl_phdr_info;126pub const dl_phdr_info = system.dl_phdr_info;
128pub const empty_sigset = system.empty_sigset;127pub const empty_sigset = system.empty_sigset;
129pub const fd_t = system.fd_t;128pub const fd_t = system.fd_t;