Skip to content

Commit ad793d5

Browse files
committed
Update to zig 0.14
1 parent 679ed59 commit ad793d5

File tree

6 files changed

+8
-7
lines changed

6 files changed

+8
-7
lines changed

.github/workflows/zig.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
- uses: mlugg/setup-zig@v1
1717
name: Set up zig
1818
with:
19-
version: 0.13.0
19+
version: 0.14.0
2020

2121
- name: Build
2222
run: |

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ linux system lib by zig namespace [std.os.linux](https://ziglang.org/documentati
2828
| [uname.zig](src/uname.zig) | [uname](https://ziglang.org/documentation/master/std/#std.os.linux.uname) |
2929

3030
## Usage
31-
* Install [zig >= 0.13](https://ziglang.org/download/)
31+
* Install [zig >= 0.14](https://ziglang.org/download/)
3232

3333
* Build Only.
3434
```sh

build.zig.zon

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
//
77
// It is redundant to include "zig" in this name because it is already
88
// within the Zig package namespace.
9-
.name = "zig-linux-cookbook",
9+
.name = .zig_linux_cookbook,
1010

1111
// This is a [Semantic Version](https://semver.org/).
1212
// In a future version of Zig it will be used for package deduplication.
@@ -69,4 +69,5 @@
6969
//"LICENSE",
7070
//"README.md",
7171
},
72+
.fingerprint = 0x475ac770e043713e,
7273
}

src/clock_gettime.zig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ pub fn main() !void {
1313
const end_rc = linux.clock_gettime(linux.CLOCK.MONOTONIC, &end_ts);
1414
try stdout.print("start rc: {}, end rc: {}\n", .{ start_rc, end_rc });
1515
// print time diff
16-
const sec_diff = end_ts.tv_sec - start_ts.tv_sec;
17-
const nano_diff = end_ts.tv_nsec - start_ts.tv_nsec;
16+
const sec_diff = end_ts.sec - start_ts.sec;
17+
const nano_diff = end_ts.nsec - start_ts.nsec;
1818
try stdout.print("elapsed time = {d} sec & {d} nanoseconds\n", .{ sec_diff, nano_diff });
1919
}

src/getcwd.zig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ pub fn main() !void {
99
const rc = linux.chdir(tmp);
1010
try stdout.print("chdir rc: {d}\n", .{rc});
1111

12-
var buf: [std.fs.MAX_PATH_BYTES]u8 = undefined;
12+
var buf: [std.fs.max_path_bytes]u8 = undefined;
1313
// call getcwd as linux system call
1414
_ = linux.getcwd(&buf, buf.len);
1515
const ptr = mem.sliceTo(&buf, 0);

src/symlink.zig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ pub fn main() !void {
77
const link_rc = linux.symlink("/tmp/foo", "/tmp/bar");
88
try stdout.print("link returns {}\n", .{link_rc});
99

10-
var buf: [std.fs.MAX_PATH_BYTES]u8 = undefined;
10+
var buf: [std.fs.max_path_bytes]u8 = undefined;
1111
const readlink_rc = linux.readlink("/tmp/bar", &buf, buf.len);
1212
try stdout.print("readlink -> {s}\n", .{buf[0..readlink_rc]});
1313

0 commit comments

Comments
 (0)