aboutsummaryrefslogtreecommitdiff
path: root/src/darwin_c.zig
diff options
context:
space:
mode:
authorGravatar Jarred Sumner <jarred@jarredsumner.com> 2021-12-30 21:12:32 -0800
committerGravatar GitHub <noreply@github.com> 2021-12-30 21:12:32 -0800
commite75c711c68896f5952793601f156c921c814caab (patch)
treef3b30e2281c7231d480bb84503d17b2370866ff9 /src/darwin_c.zig
parent8d031f13c0e04629d431176e211a31224b7618c0 (diff)
downloadbun-e75c711c68896f5952793601f156c921c814caab.tar.gz
bun-e75c711c68896f5952793601f156c921c814caab.tar.zst
bun-e75c711c68896f5952793601f156c921c814caab.zip
Upgrade to latest Zig, remove dependency on patched version of Zig (#96)
* Prepare to upgrade zig * zig fmt * AllocGate * Update data_url.zig * wip * few files * just headers now? * I think everything works? * Update mimalloc * Update hash_map.zig * Perf improvements to compensate for Allocgate * Bump * :camera: * Update bun.lockb * Less branching * [js parser] Slightly reduce memory usage * Update js_parser.zig * WIP remove unused * [JS parser] WIP support for `with` keyword * Remove more dead code * Fix all the build errors! * cleanup * Move `network_thread` up * Bump peechy * Update README.md
Diffstat (limited to 'src/darwin_c.zig')
-rw-r--r--src/darwin_c.zig22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/darwin_c.zig b/src/darwin_c.zig
index 559ebe8da..e227ee8bf 100644
--- a/src/darwin_c.zig
+++ b/src/darwin_c.zig
@@ -1,11 +1,11 @@
const std = @import("std");
-usingnamespace std.c;
const builtin = @import("builtin");
const os = std.os;
const mem = std.mem;
const Stat = std.fs.File.Stat;
const Kind = std.fs.File.Kind;
const StatError = std.fs.File.StatError;
+const off_t = std.c.off_t;
const errno = os.errno;
const zeroes = mem.zeroes;
@@ -66,14 +66,14 @@ pub extern "c" fn clonefile([*c]const u8, [*c]const u8, uint32_t: c_int) c_int;
// os.FILETYPE_SOCKET_STREAM, os.FILETYPE_SOCKET_DGRAM => Kind.UnixDomainSocket,
// else => Kind.Unknown,
// },
-// else => switch (st.mode & os.S_IFMT) {
-// os.S_IFBLK => Kind.BlockDevice,
-// os.S_IFCHR => Kind.CharacterDevice,
-// os.S_IFDIR => Kind.Directory,
-// os.S_IFIFO => Kind.NamedPipe,
-// os.S_IFLNK => Kind.SymLink,
-// os.S_IFREG => Kind.File,
-// os.S_IFSOCK => Kind.UnixDomainSocket,
+// else => switch (st.mode & os.S.IFMT) {
+// os.S.IFBLK => Kind.BlockDevice,
+// os.S.IFCHR => Kind.CharacterDevice,
+// os.S.IFDIR => Kind.Directory,
+// os.S.IFIFO => Kind.NamedPipe,
+// os.S.IFLNK => Kind.SymLink,
+// os.S.IFREG => Kind.File,
+// os.S.IFSOCK => Kind.UnixDomainSocket,
// else => Kind.Unknown,
// },
// },
@@ -105,13 +105,13 @@ pub fn preallocate_file(fd: os.fd_t, offset: off_t, len: off_t) !void {
fstore.fst_length = len + offset;
// Based on https://api.kde.org/frameworks/kcoreaddons/html/posix__fallocate__mac_8h_source.html
- var rc = os.system.fcntl(fd, os.F_PREALLOCATE, &fstore);
+ var rc = os.system.fcntl(fd, os.F.PREALLOCATE, &fstore);
switch (rc) {
0 => return,
else => {
fstore.fst_flags = F_ALLOCATEALL;
- rc = os.system.fcntl(fd, os.F_PREALLOCATE, &fstore);
+ rc = os.system.fcntl(fd, os.F.PREALLOCATE, &fstore);
},
}