diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000000000000000000000000000000000000..403c8ef104b8bf3476b7a5155be3158eae28734e --- /dev/null +++ b/.gitattributes @@ -0,0 +1,3 @@ +* text=auto +*.zig text eol=lf +zigmod.* text eol=lf diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..755aa68f03a30361a954cb1bfbf823ba9fa604ae --- /dev/null +++ b/.gitignore @@ -0,0 +1,6 @@ +.zig-cache +zig-out +.zigmod +deps.zig +files.zig +zigmod.lock diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..68609fb927bd9fe47693b2d3fdfff7f7e708f383 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2025 Meghan Denny + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/build.zig b/build.zig new file mode 100644 index 0000000000000000000000000000000000000000..629f32099d91efb146e1f88465f3060f00f2f4cc --- /dev/null +++ b/build.zig @@ -0,0 +1,22 @@ +const std = @import("std"); +const deps = @import("./deps.zig"); + +pub fn build(b: *std.Build) void { + const target = b.standardTargetOptions(.{}); + const mode = b.option(std.builtin.Mode, "mode", "") orelse .Debug; + const disable_llvm = b.option(bool, "disable_llvm", "use the non-llvm zig codegen") orelse false; + + const tests = b.addTest(.{ + .root_source_file = b.path("test.zig"), + .target = target, + .optimize = mode, + }); + deps.addAllTo(tests); + tests.use_llvm = !disable_llvm; + tests.use_lld = !disable_llvm; + + const test_step = b.step("test", "Run all library tests"); + const tests_run = b.addRunArtifact(tests); + tests_run.has_side_effects = true; + test_step.dependOn(&tests_run.step); +} diff --git a/licenses.txt b/licenses.txt new file mode 100644 index 0000000000000000000000000000000000000000..c4c204e73b4ce1f423d62984fca622689e338415 --- /dev/null +++ b/licenses.txt @@ -0,0 +1,8 @@ +MIT: += https://spdx.org/licenses/MIT +- This +- git https://github.com/nektro/zig-errno + +GPL-2.0-only: += https://spdx.org/licenses/GPL-2.0-only +- git https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git diff --git a/mod.zig b/mod.zig new file mode 100644 index 0000000000000000000000000000000000000000..95a0b682a71942e4010a9c8ee96461fb9a3b53a3 --- /dev/null +++ b/mod.zig @@ -0,0 +1 @@ +const std = @import("std"); diff --git a/test.zig b/test.zig new file mode 100644 index 0000000000000000000000000000000000000000..95a0b682a71942e4010a9c8ee96461fb9a3b53a3 --- /dev/null +++ b/test.zig @@ -0,0 +1 @@ +const std = @import("std"); diff --git a/zigmod.yml b/zigmod.yml new file mode 100644 index 0000000000000000000000000000000000000000..ebcae56102575b23a2d7252914c35b92484fb107 --- /dev/null +++ b/zigmod.yml @@ -0,0 +1,12 @@ +id: h7tv7ayhffakkgy9wy5c88n4snmonw35f1bk5xuowvrxympr +name: sys-linux +main: mod.zig +license: MIT +description: OS bindings layer for directly making Linux syscalls +dependencies: + - src: git https://github.com/nektro/zig-errno + +root_dependencies: + - src: git https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git + license: GPL-2.0-only + keep: true