Skip to content

Instantly share code, notes, and snippets.

View The-King-of-Toasters's full-sized avatar

Stephen Gregoratto The-King-of-Toasters

View GitHub Profile
//! To get started, run this tool with no args and read the help message.
//!
//! This tool extracts syscall numbers from the Linux source tree and emits an enumerated list per arch.
const std = @import("std");
const mem = std.mem;
const fmt = std.fmt;
const zig = std.zig;
const fs = std.fs;
@The-King-of-Toasters
The-King-of-Toasters / ppc-zig-build.log
Created August 11, 2024 06:43
Whole lotta errors
ninja: Entering directory `build'
[1/3] Building C object CMakeFiles/zig2.dir/zig2.c.o
FAILED: CMakeFiles/zig2.dir/zig2.c.o
/usr/bin/cc -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/home/sg/gits/zig/stage1 -I/home/sg/local/llvm18-release/include -g -std=c99 -O0 -fno-stack-protector -MD -MT CMakeFiles/zig2.dir/zig2.c.o -MF CMakeFiles/zig2.dir/zig2.c.o.d -o CMakeFiles/zig2.dir/zig2.c.o -c /home/sg/gits/zig/build/zig2.c
/home/sg/gits/zig/build/zig2.c:300409:16: error: conflicting types for ‘sigaction’; have ‘int(int, const struct Sigaction__4012 *, struct Sigaction__4012 *)’
300409 | zig_extern int sigaction(int, struct Sigaction__4012 const *, struct Sigaction__4012 *);
| ^~~~~~~~~
In file included from /home/sg/gits/zig/stage1/zig.h:275,
from /home/sg/gits/zig/build/zig2.c:2:
/usr/include/signal.h:243:12: note: previous declaration of ‘sigaction’ with type ‘int(int, const struct sigaction * restrict, struct sigaction * restrict
Type Name
File \Device\HarddiskVolume9\gits\objectnames\zig-cache\tmp\M7HLirYDZKkk0lm1
File \Device\HarddiskVolume9\gits\objectnames\zig-cache\tmp\M7HLirYDZKkk0lm1\file
Directory \BaseNamedObjects\test-dir
File \Device\NamedPipe\test-pipe
File \Device\Mailslot\test-slot
Semaphore \Sessions\1\BaseNamedObjects\test-sema
WindowStation \Sessions\1\Windows\WindowStations\WinSta0
Desktop \Default
Desktop \test-desktop
@The-King-of-Toasters
The-King-of-Toasters / main.zig
Created September 28, 2023 09:26
cachestat example
const std = @import("std");
const os = std.os;
const process = std.process;
const linux = os.linux;
pub fn main() !void {
var args = std.process.ArgIteratorPosix.init();
_ = args.skip();
const out = std.io.getStdOut();
var buf = std.io.bufferedWriter(out.writer());
@The-King-of-Toasters
The-King-of-Toasters / d3xp_PlayerView.cpp
Last active May 13, 2021 10:50
cstdoom3 hud correction
/*
===================
idPlayerView::RenderPlayerView
===================
*/
void idPlayerView::RenderPlayerView( idUserInterface *hud ) {
const renderView_t *view = player->GetRenderView();
SingleView( hud, view );
ScreenFade();
@The-King-of-Toasters
The-King-of-Toasters / mbsync.vim
Last active August 10, 2019 04:45
Vim Syntax Highlighting for mbsyncrc
" Vim syntax file
" Language: mbsync setup files
" Maintainer: Stephen Gregoratto <[email protected]>
" Last Change: 2018-03-13
" Filenames: mbsyncrc
" Version: 0.2
" Licence: GPLv3+
"
" Note: This config borrows heavily from msmtprc.vim
" by Simon Ruderich and Eric Pruitt