$ clang -c test.c -fsanitize=fuzzer-no-link -S -emit-llvm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const std = @import("std"); | |
pub fn main() !void { | |
const addr = try std.net.Address.initUnix("/home/andy/dev/zig/.zig-cache/tmp/b8f2350f14c91bbf"); | |
std.log.debug("socket", .{}); | |
const sockfd = try std.posix.socket( | |
std.posix.AF.UNIX, | |
std.posix.SOCK.STREAM | std.posix.SOCK.CLOEXEC, | |
0, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const std = @import("std"); | |
pub fn main() !void { | |
const arena = std.heap.page_allocator; | |
var thread_pool: std.Thread.Pool = undefined; | |
try thread_pool.init(.{ | |
.allocator = arena, | |
.job_server = .{ .connect = try std.net.Address.initUnix("tmp_socket") }, | |
.n_jobs = 4, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ ./client | |
info: connecting first | |
info: poll first | |
info: connecting second | |
info: poll second | |
info: connecting third (note: returns immediately) | |
info: poll third (note: returns immediately) | |
info: sleep 5 seconds | |
info: exit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "zp.h" | |
#include <string.h> | |
#include <unistd.h> | |
int main(int argc, char **argv) { | |
zp_node root_node = zp_init(); | |
const char *task_name = "making orange juice"; | |
zp_node sub_node = zp_start(root_node, task_name, strlen(task_name), 5); | |
for (int i = 0; i < 5; i += 1) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
https://asciinema.org/a/gDna9RnicwYjDRIDn4e07NFSc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const std = @import("std"); | |
const assert = std.debug.assert; | |
const expect = std.testing.expect; | |
pub fn main() !void { | |
const big = try std.heap.page_allocator.alloc(u8, 2 * 1024 * 1024 * 1024); | |
_ = big; | |
var child = std.ChildProcess.init(&.{"/usr/bin/env"}, std.heap.page_allocator); | |
child.stdin_behavior = .Ignore; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Create a folder under the drive root | |
mkdir actions-runner; cd actions-runner | |
# Download the latest runner package | |
Invoke-WebRequest -Uri https://github.com/actions/runner/releases/download/v2.317.0/actions-runner-win-arm64-2.317.0.zip -OutFile actions-runner-win-arm64-2.317.0.zip | |
# Optional: Validate the hash |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pub fn add(a: i32, b: i32) i32 { | |
return a + b; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const std = @import("std"); | |
const example = | |
\\1abc2 | |
\\pqr3stu8vwx | |
\\a1b2c3d4e5f | |
\\treb7uchet | |
; | |
pub fn main() !void { |
NewerOlder