Skip to content

Instantly share code, notes, and snippets.

View sortie's full-sized avatar

Jonas Termansen sortie

View GitHub Profile
@sortie
sortie / pex.c
Created April 20, 2016 18:12
pex
/* This file is part of ToaruOS and is released under the terms
* of the NCSA / University of Illinois License - see LICENSE.md
* Copyright (C) 2014 Kevin Lange
*/
#include <sys/socket.h>
#include <sys/un.h>
#include <alloca.h>
#include <assert.h>
#include <errno.h>
@sortie
sortie / bnf.bnf
Created April 7, 2016 16:11
bnf bnf
wspace ::= '\t' | '\n' | '\v' | '\f' | '\r' | ' '.
wspaces ::= <wspace>
| <wspace> <wspaces>.
ospaces ::=
| <wspaces>.
char-constant ::= '\'' [^'] '\''
| '\'' '\\' <char> '\''.
range-char ::= [^]].
ranges ::= | <range-char> <ranges>.
range-constant ::= '[' <ranges> ']
diff --git a/init/init.c b/init/init.c
index 8ade106..b27f846 100644
--- a/init/init.c
+++ b/init/init.c
@@ -370,13 +370,13 @@ static void set_hostname(void)
if ( !fp )
return warning("unable to set hostname: /etc/hostname: %m");
char* hostname = read_single_line(fp);
+ fclose(fp);
if ( !hostname )
/home/sortie/sortix/ports/xorriso/libburn/libdax_msgs.c:45
o->timestamp= tv.tv_sec+0.000001*tv.tv_usec;
4a7d79: f2 48 0f 2a 85 70 ff cvtsi2sdq -0x90(%rbp),%xmm0
4a7d80: ff ff
4a7d82: f2 0f 59 05 e6 40 03 mulsd 0x340e6(%rip),%xmm0 # 4dbe70 <_fini+0x219> (crash here)
4a7d89: 00
4a7d8a: f2 48 0f 2a 8d 68 ff cvtsi2sdq -0x98(%rbp),%xmm1
4a7d91: ff ff
4a7d93: f2 0f 58 c1 addsd %xmm1,%xmm0
4a7d97: f2 0f 11 02 movsd %xmm0,(%rdx)
@sortie
sortie / regexp.v
Created March 23, 2016 11:36
regexp.v
Require Export SfLib.
Inductive regexp :=
| empty : regexp
| atom : nat -> regexp
| any : regexp
| seq : regexp -> regexp -> regexp
| disj : regexp -> regexp -> regexp
| star : regexp -> regexp
| plus : regexp -> regexp.
@sortie
sortie / server.c
Created January 14, 2016 15:15
server main loop
int main(void)
{
signal(SIGPIPE, SIG_IGN );
struct addrinfo hints;
memset(&hints, 0, sizeof(hints));
hints.ai_family = AF_UNSPEC;
hints.ai_socktype = SOCK_STREAM;
hints.ai_flags = AI_PASSIVE;
@sortie
sortie / vcbprintf.cpp
Created December 13, 2015 14:14
Sortix libc ISC relicense to sinetek
/*
* Copyright (c) 2011, 2012, 2013, 2014, 2015 Jonas 'Sortie' Termansen
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
@sortie
sortie / serial.txt
Created December 3, 2015 01:29
pedigree login module load failure
(NN) [1450488486] memory-map:
(NN) [1450488486] 0x0 - 0x9fc00, type: 0x1
(NN) [1450488486] 0x9fc00 - 0xa0000, type: 0x2
(NN) [1450488486] 0xf0000 - 0x100000, type: 0x2
(NN) [1450488486] 0x100000 - 0x3fffe000, type: 0x1
(NN) [1450488486] 0x3fffe000 - 0x40000000, type: 0x2
(NN) [1450488486] 0xfeffc000 - 0xff000000, type: 0x2
(NN) [1450488486] 0xfffc0000 - 0x100000000, type: 0x2
(NN) [1450488486] Kernel heap range prepared from 0xffffffff00008000 to 0xffffffff40000000, size: 0x3fff8000
(DD) [1450488486] -> kernel heap bitmap is 32K
@sortie
sortie / minidiff.c
Created October 30, 2015 20:32
minidiff
void topicdiff(struct minicat* state,
const char* where,
const char* oldtopic,
const char* newtopic)
{
if ( !oldtopic )
oldtopic = "";
if ( !newtopic )
newtopic = "";
@sortie
sortie / mandoc warnings
Created October 6, 2015 23:13
ifconfig.8
mandoc: /tmp/ifconfig.8:37:14: WARNING: whitespace at end of input line
mandoc: /tmp/ifconfig.8:43:2: WARNING: missing -width in -tag list, using 8n: Bl -tag
mandoc: /tmp/ifconfig.8:66:64: WARNING: whitespace at end of input line
mandoc: /tmp/ifconfig.8:72:2: WARNING: sections out of conventional order: Sh AUTHORS
mandoc: /tmp/ifconfig.8:74:1: WARNING: blank line in fill mode, using .sp