summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2017-10-29 19:08:13 -0700
committerOri Bernstein <ori@eigenstate.org>2017-10-29 19:08:13 -0700
commit269e4f69372bc1250dcb70a9dfde30486809f1b0 (patch)
treeeb86ec1c691bf8f479be36ede67e029f55f3c09c
parent4eea6de57c9fce0a69f85270303baae069c3e237 (diff)
parentd359a98ab9cfc42de66ad35333bd6d6c0571b7ca (diff)
downloadmc-qbe.tar.gz
Merge branch 'master' into qbeqbe
-rw-r--r--6/blob.c8
-rw-r--r--6/genp9.c2
-rw-r--r--6/insns.def5
-rw-r--r--6/isel.c458
-rw-r--r--6/simp.c4
-rw-r--r--Makefile9
-rw-r--r--README.md2
-rw-r--r--bench/bigfactorial.myr12
-rw-r--r--bench/bld.sub45
-rw-r--r--bench/copious-allocs.myr76
-rw-r--r--bench/hashit.myr96
-rw-r--r--bench/intsort.myr8
-rw-r--r--bench/mandelbrot.myr51
-rw-r--r--bench/many-memcpy.myr46
-rw-r--r--bench/regex-match.myr36
-rw-r--r--bench/runbench.myr59
-rw-r--r--bench/sha1-compute.myr30
-rw-r--r--lib/bio/bio.myr191
-rw-r--r--lib/bio/geti.myr46
-rw-r--r--lib/bio/iter.myr10
-rw-r--r--lib/bio/puti.myr28
-rw-r--r--lib/bio/test/bio-delim.myr12
-rw-r--r--lib/bio/test/bio-endianrd.myr29
-rw-r--r--lib/bio/test/bio-peek.myr12
-rw-r--r--lib/bio/test/bio-read.myr6
-rw-r--r--lib/bio/test/bio-unitwr.myr2
-rw-r--r--lib/bio/test/mem.myr6
-rw-r--r--lib/bld.sub1
-rw-r--r--lib/crypto/entropy.myr2
-rw-r--r--lib/date/fmt.myr4
-rw-r--r--lib/date/parse.myr4
-rw-r--r--lib/date/test/fmt.myr26
-rw-r--r--lib/date/test/parse.myr11
-rw-r--r--lib/fileutil/bld.sub4
-rw-r--r--lib/fileutil/loopcheck+plan9.myr21
-rw-r--r--lib/fileutil/loopcheck+posixy.myr65
-rw-r--r--lib/fileutil/tmpdir.myr12
-rw-r--r--lib/fileutil/walk.myr55
-rw-r--r--lib/http/bld.sub34
-rw-r--r--lib/http/client.myr276
-rw-r--r--lib/http/h.myr90
-rw-r--r--lib/http/parse.myr278
-rw-r--r--lib/http/server.myr100
-rw-r--r--lib/http/session.myr80
-rw-r--r--lib/http/srvdot.myr66
-rw-r--r--lib/http/status.myr67
-rw-r--r--lib/http/types.myr83
-rw-r--r--lib/http/url.myr238
-rw-r--r--lib/inifile/parse.myr8
-rw-r--r--lib/inifile/write.myr2
-rw-r--r--lib/regex/interp.myr49
-rw-r--r--lib/regex/myr-regex.39
-rw-r--r--lib/regex/redump.myr6
-rw-r--r--lib/regex/types.myr3
-rw-r--r--lib/std/bigint.myr14
-rw-r--r--lib/std/bitset.myr2
-rw-r--r--lib/std/blat.myr2
-rw-r--r--lib/std/bld.sub1
-rw-r--r--lib/std/bytealloc.myr39
-rw-r--r--lib/std/dir+plan9.myr2
-rw-r--r--lib/std/fltbits.myr6
-rw-r--r--lib/std/fltfmt.myr17
-rw-r--r--lib/std/fltparse.myr7
-rw-r--r--lib/std/fmt.myr2
-rw-r--r--lib/std/hashfuncs.myr81
-rw-r--r--lib/std/htab.myr8
-rw-r--r--lib/std/listen+plan9.myr175
-rw-r--r--lib/std/listen+posixy.myr34
-rw-r--r--lib/std/mkpath.myr8
-rw-r--r--lib/std/mktemp.myr32
-rw-r--r--lib/std/resolve+posixy.myr2
-rw-r--r--lib/std/slurp.myr2
-rw-r--r--lib/std/syswrap+plan9.myr6
-rw-r--r--lib/std/syswrap+posixy.myr5
-rw-r--r--lib/std/syswrap-ss+plan9.myr2
-rw-r--r--lib/std/test/bitset.myr6
-rw-r--r--lib/std/test/fmt.myr1
-rw-r--r--lib/std/test/hashfuncs.myr123
-rw-r--r--lib/sys/bld.sub1
-rw-r--r--lib/sys/ifreq+netbsd.myr2
-rw-r--r--lib/sys/sys+freebsd-x64.myr594
-rw-r--r--lib/sys/sys+linux-x64.myr534
-rw-r--r--lib/sys/sys+netbsd-x64.myr3
-rw-r--r--lib/sys/sys+openbsd:6.1-x64.myr290
-rw-r--r--lib/sys/sys+openbsd:6.2-x64.myr1762
-rw-r--r--lib/sys/sys+osx-x64.myr4
-rw-r--r--lib/sys/sys+plan9-x64.myr4
-rw-r--r--lib/sys/syscall+netbsd-x64.s76
-rw-r--r--lib/sys/syscall+osx-x64.s7
-rw-r--r--lib/sys/syserrno+netbsd.myr123
-rw-r--r--lib/testr/testr.myr76
-rw-r--r--lib/thread/bld.sub15
-rw-r--r--lib/thread/mutex+openbsd:6.2.myr76
-rw-r--r--lib/thread/ncpu+linux.myr30
-rw-r--r--lib/thread/ncpu+openbsd.myr23
-rw-r--r--lib/thread/ncpu+plan9.myr2
-rw-r--r--lib/thread/spawn+osx.myr60
-rw-r--r--lib/thread/start+osx-x64.s41
-rw-r--r--lib/thread/test/mutex.myr1
-rw-r--r--mbld/deps.myr45
-rw-r--r--mbld/libs.myr48
-rw-r--r--mbld/main.myr2
-rw-r--r--mbld/mbld.14
-rw-r--r--mbld/opts.myr70
-rw-r--r--mbld/parse.myr58
-rw-r--r--mbld/subtest.myr114
-rw-r--r--mbld/test.myr27
-rw-r--r--mbld/types.myr8
-rwxr-xr-xmbldwrap.sh17
-rw-r--r--mi/flatten.c5
-rwxr-xr-xmk/bootstrap/bootstrap+Darwin-x86_64.sh273
-rwxr-xr-xmk/bootstrap/bootstrap+FreeBSD-amd64.sh148
-rwxr-xr-xmk/bootstrap/bootstrap+Linux-x86_64.sh273
-rwxr-xr-xmk/bootstrap/bootstrap+NetBSD-amd64.sh271
-rwxr-xr-xmk/bootstrap/bootstrap+OpenBSD-amd64.sh273
-rwxr-xr-xmk/bootstrap/bootstrap+Plan9-amd64.sh266
-rw-r--r--mkfile7
-rw-r--r--parse/export.c19
-rw-r--r--parse/gram.y23
-rw-r--r--parse/infer.c100
-rw-r--r--parse/node.c5
-rw-r--r--parse/parse.h7
-rw-r--r--parse/stab.c16
-rw-r--r--parse/tok.c1
-rw-r--r--parse/type.c68
-rw-r--r--parse/use.c44
-rw-r--r--rt/start-openbsd.s6
-rw-r--r--support/dumpleak.myr14
-rw-r--r--support/syscall-gen/gencalls.awk4
-rwxr-xr-xsupport/syscall-gen/gensys.sh1
-rw-r--r--support/syscall-gen/gentypes+openbsd:6.2-x64.frag120
-rw-r--r--support/syscall-gen/specials+openbsd:6.1-x64.frag2
-rw-r--r--support/syscall-gen/specials+openbsd:6.2-x64.frag286
-rw-r--r--support/syscall-gen/syscalls+openbsd:6.2.master571
-rw-r--r--support/syscall-gen/types+openbsd:6.1-x64.frag1
-rw-r--r--support/syscall-gen/types+openbsd:6.2-x64.frag477
-rw-r--r--test/loop.myr2
-rw-r--r--test/pkgtrait.myr14
-rwxr-xr-xtest/runtest.sh6
-rw-r--r--test/tests1
140 files changed, 8422 insertions, 2459 deletions
diff --git a/6/blob.c b/6/blob.c
index 46072a1..8e2671e 100644
--- a/6/blob.c
+++ b/6/blob.c
@@ -255,15 +255,17 @@ blobstruct(Blob *seq, Htab *globls, Htab *strtab, Node *n)
static size_t
blobucon(Blob *seq, Htab *globls, Htab *strtab, Node *n)
{
- size_t sz, pad;
+ size_t sz, align;
Ucon *uc;
sz = 4;
uc = finducon(exprtype(n), n->expr.args[0]);
b(seq, mkblobi(Bti32, uc->id));
+ align = 1;
if (n->expr.nargs > 1) {
- pad = tyalign(exprtype(n->expr.args[1])) - sz;
- sz += blobpad(seq, pad);
+ align = tyalign(exprtype(n->expr.args[1]));
+ if (align > sz)
+ sz += blobpad(seq, align - sz);
sz += blobrec(seq, globls, strtab, n->expr.args[1]);
}
sz += blobpad(seq, size(n) - sz);
diff --git a/6/genp9.c b/6/genp9.c
index 51db499..4a40099 100644
--- a/6/genp9.c
+++ b/6/genp9.c
@@ -340,8 +340,6 @@ writeblob(FILE *fd, Blob *b, size_t off, char *lbl)
n += writeblob(fd, b->seq.sub[i], off+n, lbl);
break;
case Btpad:
- for (i = 0; i < b->npad; i++)
- fprintf(fd, "\tDATA %s+%llu(SB)/1,$0\n", lbl, (uvlong)off+n+i);
n += b->npad;
break;
}
diff --git a/6/insns.def b/6/insns.def
index 105aa10..1e0a864 100644
--- a/6/insns.def
+++ b/6/insns.def
@@ -143,6 +143,11 @@ Insn(Ishr,
"\tSHR%2T %U,%R\n",
Use(.l={1,2}),
Def(.l={2}))
+Insn(Irol,
+ "\trol%2t %u,%r\n",
+ "\tROL%2T %U,%R\n",
+ Use(.l={1,2}),
+ Def(.l={2}))
Insn(Itest,
"\ttest%t %x,%r\n",
diff --git a/6/isel.c b/6/isel.c
index c7d637d..d7ec0c0 100644
--- a/6/isel.c
+++ b/6/isel.c
@@ -608,6 +608,54 @@ gencall(Isel *s, Node *n)
return ret;
}
+static Loc*
+rolop(Isel *s, Node *n, Node *l, Node *r)
+{
+ int64_t lv, rv;
+ Type *ty;
+
+ ty = tybase(exprtype(n));
+
+ if (!istyunsigned(ty))
+ return NULL;
+ if (exprop(l) != Obsl && exprop(l) != Obsr)
+ return NULL;
+ if (exprop(r) != Obsl && exprop(r) != Obsr)
+ return NULL;
+ if (exprop(r) == exprop(l))
+ return NULL;
+ if (exprop(l->expr.args[0]) != Ovar)
+ return NULL;
+ if (exprop(r->expr.args[0]) != Ovar)
+ return NULL;
+ if (l->expr.args[0]->expr.did != r->expr.args[0]->expr.did)
+ return NULL;
+
+ if (exprop(l->expr.args[1]) != Olit)
+ return NULL;
+ if (l->expr.args[1]->expr.args[0]->type != Nlit)
+ return NULL;
+ if (l->expr.args[1]->expr.args[0]->lit.littype != Lint)
+ return NULL;
+ lv = l->expr.args[1]->expr.args[0]->lit.intval;
+
+ if (exprop(r->expr.args[1]) != Olit)
+ return NULL;
+ if (r->expr.args[1]->expr.args[0]->type != Nlit)
+ return NULL;
+ if (r->expr.args[1]->expr.args[0]->lit.littype != Lint)
+ return NULL;
+ rv = r->expr.args[1]->expr.args[0]->lit.intval;
+
+ if (lv + rv != 8*size(n))
+ return NULL;
+
+ if (exprop(l) == Obsl)
+ return binop(s, Irol, l->expr.args[0], l->expr.args[1]);
+ else
+ return binop(s, Irol, r->expr.args[0], r->expr.args[1]);
+}
+
Loc *
selexpr(Isel *s, Node *n)
{
@@ -624,261 +672,265 @@ selexpr(Isel *s, Node *n)
switch (exprop(n)) {
case Oadd: r = binop(s, Iadd, args[0], args[1]); break;
case Osub: r = binop(s, Isub, args[0], args[1]); break;
- case Obor: r = binop(s, Ior, args[0], args[1]); break;
case Oband: r = binop(s, Iand, args[0], args[1]); break;
case Obxor: r = binop(s, Ixor, args[0], args[1]); break;
+ case Obor:
+ r = rolop(s, n, args[0], args[1]);
+ if (!r)
+ r = binop(s, Ior, args[0], args[1]);
+ break;
case Omul:
- if (size(args[0]) == 1) {
- a = selexpr(s, args[0]);
- b = inr(s, selexpr(s, args[1]));
-
- c = locphysreg(Ral);
- r = locreg(a->mode);
- g(s, Imov, a, c, NULL);
- g(s, Iimul_r, b, NULL);
- g(s, Imov, c, r, NULL);
- } else {
- r = binop(s, Iimul, args[0], args[1]);
- }
- break;
- case Odiv:
- case Omod:
- /* these get clobbered by the div insn */
+ if (size(args[0]) == 1) {
a = selexpr(s, args[0]);
- b = selexpr(s, args[1]);
- b = newr(s, b);
- c = coreg(Reax, mode(n));
+ b = inr(s, selexpr(s, args[1]));
+
+ c = locphysreg(Ral);
r = locreg(a->mode);
g(s, Imov, a, c, NULL);
- if (istysigned(exprtype(args[0]))) {
- switch (r->mode) {
- case ModeB: g(s, Imovsx, c, coreg(Rrax, ModeW), NULL); break;
- case ModeW: g(s, Icwd, NULL); break;
- case ModeL: g(s, Icdq, NULL); break;
- case ModeQ: g(s, Icqo, NULL); break;
- default: die("invalid mode in division"); break;
- }
- g(s, Iidiv, b, NULL);
- } else {
- if (r->mode == ModeB)
- g(s, Ixor, locphysreg(Rah), locphysreg(Rah), NULL);
- else
- g(s, Ixor, edx, edx, NULL);
- g(s, Idiv, b, NULL);
+ g(s, Iimul_r, b, NULL);
+ g(s, Imov, c, r, NULL);
+ } else {
+ r = binop(s, Iimul, args[0], args[1]);
+ }
+ break;
+ case Odiv:
+ case Omod:
+ /* these get clobbered by the div insn */
+ a = selexpr(s, args[0]);
+ b = selexpr(s, args[1]);
+ b = newr(s, b);
+ c = coreg(Reax, mode(n));
+ r = locreg(a->mode);
+ g(s, Imov, a, c, NULL);
+ if (istysigned(exprtype(args[0]))) {
+ switch (r->mode) {
+ case ModeB: g(s, Imovsx, c, coreg(Rrax, ModeW), NULL); break;
+ case ModeW: g(s, Icwd, NULL); break;
+ case ModeL: g(s, Icdq, NULL); break;
+ case ModeQ: g(s, Icqo, NULL); break;
+ default: die("invalid mode in division"); break;
}
- if (exprop(n) == Odiv)
- d = coreg(Reax, mode(n));
- else if (r->mode != ModeB)
- d = coreg(Redx, mode(n));
+ g(s, Iidiv, b, NULL);
+ } else {
+ if (r->mode == ModeB)
+ g(s, Ixor, locphysreg(Rah), locphysreg(Rah), NULL);
else
- d = locphysreg(Rah);
- g(s, Imov, d, r, NULL);
- break;
+ g(s, Ixor, edx, edx, NULL);
+ g(s, Idiv, b, NULL);
+ }
+ if (exprop(n) == Odiv)
+ d = coreg(Reax, mode(n));
+ else if (r->mode != ModeB)
+ d = coreg(Redx, mode(n));
+ else
+ d = locphysreg(Rah);
+ g(s, Imov, d, r, NULL);
+ break;
case Oneg:
- r = selexpr(s, args[0]);
- r = newr(s, r);
- g(s, Ineg, r, NULL);
- break;
+ r = selexpr(s, args[0]);
+ r = newr(s, r);
+ g(s, Ineg, r, NULL);
+ break;
- /* fp expressions */
+ /* fp expressions */
case Ofadd: r = binop(s, Iadds, args[0], args[1]); break;
case Ofsub: r = binop(s, Isubs, args[0], args[1]); break;
case Ofmul: r = binop(s, Imuls, args[0], args[1]); break;
case Ofdiv: r = binop(s, Idivs, args[0], args[1]); break;
case Ofneg:
- r = selexpr(s, args[0]);
- r = newr(s, r);
- a = NULL;
- b = NULL;
- if (mode(args[0]) == ModeF) {
- a = locreg(ModeF);
- b = loclit(1LL << (31), ModeF);
- g(s, Imovs, r, a);
- } else if (mode(args[0]) == ModeD) {
- a = locreg(ModeQ);
- b = loclit(1LL << 63, ModeQ);
- g(s, Imov, r, a, NULL);
- }
- g(s, Ixor, b, a, NULL);
- g(s, Imov, a, r, NULL);
- break;
+ r = selexpr(s, args[0]);
+ r = newr(s, r);
+ a = NULL;
+ b = NULL;
+ if (mode(args[0]) == ModeF) {
+ a = locreg(ModeF);
+ b = loclit(1LL << (31), ModeF);
+ g(s, Imovs, r, a);
+ } else if (mode(args[0]) == ModeD) {
+ a = locreg(ModeQ);
+ b = loclit(1LL << 63, ModeQ);
+ g(s, Imov, r, a, NULL);
+ }
+ g(s, Ixor, b, a, NULL);
+ g(s, Imov, a, r, NULL);
+ break;
case Obsl:
case Obsr:
- a = newr(s, selexpr(s, args[0]));
- b = selexpr(s, args[1]);
- if (b->type == Loclit) {
- d = b;
- } else {
- c = coreg(Rcl, b->mode);
- g(s, Imov, b, c, NULL);
- d = cl;
- }
- if (exprop(n) == Obsr) {
- if (istysigned(n->expr.type))
- g(s, Isar, d, a, NULL);
- else
- g(s, Ishr, d, a, NULL);
- } else {
- g(s, Ishl, d, a, NULL);
- }
- r = a;
- break;
+ a = newr(s, selexpr(s, args[0]));
+ b = selexpr(s, args[1]);
+ if (b->type == Loclit) {
+ d = b;
+ } else {
+ c = coreg(Rcl, b->mode);
+ g(s, Imov, b, c, NULL);
+ d = cl;
+ }
+ if (exprop(n) == Obsr) {
+ if (istysigned(n->expr.type))
+ g(s, Isar, d, a, NULL);
+ else
+ g(s, Ishr, d, a, NULL);
+ } else {
+ g(s, Ishl, d, a, NULL);
+ }
+ r = a;
+ break;
case Obnot:
- r = selexpr(s, args[0]);
- r = newr(s, r);
- g(s, Inot, r, NULL);
- break;
+ r = selexpr(s, args[0]);
+ r = newr(s, r);
+ g(s, Inot, r, NULL);
+ break;
case Oderef:
- r = memloc(s, args[0], mode(n));
- break;
+ r = memloc(s, args[0], mode(n));
+ break;
case Oaddr:
- a = selexpr(s, args[0]);
- if (a->type == Loclbl || (a->type == Locmeml && !a->mem.base)) {
- r = loclitl(a->lbl);
- } else {
- r = locreg(ModeQ);
- g(s, Ilea, a, r, NULL);
- }
- break;
+ a = selexpr(s, args[0]);
+ if (a->type == Loclbl || (a->type == Locmeml && !a->mem.base)) {
+ r = loclitl(a->lbl);
+ } else {
+ r = locreg(ModeQ);
+ g(s, Ilea, a, r, NULL);
+ }
+ break;
case Olnot:
- a = newr(s, selexpr(s, args[0]));
- b = locreg(ModeB);
- r = locreg(mode(n));
- /* lnot only valid for integer-like values */
- g(s, reloptab[exprop(n)].test, a, a, NULL);
- g(s, reloptab[exprop(n)].getflag, b, NULL);
- movz(s, b, r);
- break;
+ a = newr(s, selexpr(s, args[0]));
+ b = locreg(ModeB);
+ r = locreg(mode(n));
+ /* lnot only valid for integer-like values */
+ g(s, reloptab[exprop(n)].test, a, a, NULL);
+ g(s, reloptab[exprop(n)].getflag, b, NULL);
+ movz(s, b, r);
+ break;
case Oeq: case One: case Ogt: case Oge: case Olt: case Ole:
case Ofeq: case Ofne: case Ofgt: case Ofge: case Oflt: case Ofle:
case Oueq: case Oune: case Ougt: case Ouge: case Oult: case Oule:
- a = selexpr(s, args[0]);
- b = selexpr(s, args[1]);
- a = newr(s, a);
- c = locreg(ModeB);
- r = locreg(mode(n));
- g(s, reloptab[exprop(n)].test, b, a, NULL);
- g(s, reloptab[exprop(n)].getflag, c, NULL);
- movz(s, c, r);
- return r;
+ a = selexpr(s, args[0]);
+ b = selexpr(s, args[1]);
+ a = newr(s, a);
+ c = locreg(ModeB);
+ r = locreg(mode(n));
+ g(s, reloptab[exprop(n)].test, b, a, NULL);
+ g(s, reloptab[exprop(n)].getflag, c, NULL);
+ movz(s, c, r);
+ return r;
case Oasn: /* relabel */
- die("Unimplemented op %s", opstr[exprop(n)]);
- break;
+ die("Unimplemented op %s", opstr[exprop(n)]);
+ break;
case Oset:
- op = exprop(args[0]);
- assert(op == Ovar || op == Oderef || op == Ogap);
- assert(!stacknode(args[0]));
-
- if (op == Ogap)
- break;
-
- b = selexpr(s, args[1]);
- if (exprop(args[0]) == Oderef)
- a = memloc(s, args[0]->expr.args[0], mode(n));
- else
- a = selexpr(s, args[0]);
- b = inri(s, b);
- if (isfloatmode(b->mode))
- g(s, Imovs, b, a, NULL);
- else
- g(s, Imov, b, a, NULL);
- r = b;
- break;
+ op = exprop(args[0]);
+ assert(op == Ovar || op == Oderef || op == Ogap);
+ assert(!stacknode(args[0]));
+
+ if (op == Ogap)
+ break;
+
+ b = selexpr(s, args[1]);
+ if (exprop(args[0]) == Oderef)
+ a = memloc(s, args[0]->expr.args[0], mode(n));
+ else
+ a = selexpr(s, args[0]);
+ b = inri(s, b);
+ if (isfloatmode(b->mode))
+ g(s, Imovs, b, a, NULL);
+ else
+ g(s, Imov, b, a, NULL);
+ r = b;
+ break;
case Ocall:
case Ocallind:
- r = gencall(s, n);
- break;
+ r = gencall(s, n);
+ break;
case Oret:
- a = locstrlbl(s->cfg->end->lbls[0]);
- g(s, Ijmp, a, NULL);
- break;
+ a = locstrlbl(s->cfg->end->lbls[0]);
+ g(s, Ijmp, a, NULL);
+ break;
case Ojmp:
- g(s, Ijmp, loclbl(args[0]), NULL);
- break;
+ g(s, Ijmp, loclbl(args[0]), NULL);
+ break;
case Ocjmp:
- selcjmp(s, n, args);
- break;
+ selcjmp(s, n, args);
+ break;
case Ovjmp:
- selvjmp(s, n, args);
- break;
+ selvjmp(s, n, args);
+ break;
case Olit:
- r = loc(s, n);
- break;
+ r = loc(s, n);
+ break;
case Ovar:
- if (isconstfn(n)) {
- r = locreg(ModeQ);
- a = loc(s, n);
- g(s, Ilea, a, r, NULL);
- } else {
- r = loc(s, n);
- }
- break;
+ if (isconstfn(n)) {
+ r = locreg(ModeQ);
+ a = loc(s, n);
+ g(s, Ilea, a, r, NULL);
+ } else {
+ r = loc(s, n);
+ }
+ break;
case Ogap:
- break;
+ break;
case Oblit:
- a = selexpr(s, args[0]);
- r = selexpr(s, args[1]);
- al = alignto(1, args[0]->expr.type->sub[0]);
- blit(s, a, r, 0, 0, args[2]->expr.args[0]->lit.intval, al);
- break;
+ a = selexpr(s, args[0]);
+ r = selexpr(s, args[1]);
+ al = alignto(1, args[0]->expr.type->sub[0]);
+ blit(s, a, r, 0, 0, args[2]->expr.args[0]->lit.intval, al);
+ break;
case Oclear:
- a = selexpr(s, args[0]);
- clear(s, a, args[1]->expr.args[0]->lit.intval, 0);
- break;
+ a = selexpr(s, args[0]);
+ clear(s, a, args[1]->expr.args[0]->lit.intval, 0);
+ break;
- /* cast operators that actually modify the values */
+ /* cast operators that actually modify the values */
case Otrunc:
- a = selexpr(s, args[0]);
- a = inr(s, a);
- r = locreg(mode(n));
- g(s, Imov, a, r, NULL);
- break;
+ a = selexpr(s, args[0]);
+ a = inr(s, a);
+ r = locreg(mode(n));
+ g(s, Imov, a, r, NULL);
+ break;
case Ozwiden:
- a = selexpr(s, args[0]);
- a = inr(s, a);
- r = locreg(mode(n));
- movz(s, a, r);
- break;
+ a = selexpr(s, args[0]);
+ a = inr(s, a);
+ r = locreg(mode(n));
+ movz(s, a, r);
+ break;
case Oswiden:
- a = selexpr(s, args[0]);
- a = inr(s, a);
- r = locreg(mode(n));
- g(s, Imovsx, a, r, NULL);
- break;
+ a = selexpr(s, args[0]);
+ a = inr(s, a);
+ r = locreg(mode(n));
+ g(s, Imovsx, a, r, NULL);
+ break;
case Oint2flt:
- a = selexpr(s, args[0]);
- r = locreg(mode(n));
- g(s, Icvttsi2sd, a, r, NULL);
- break;
+ a = selexpr(s, args[0]);
+ r = locreg(mode(n));
+ g(s, Icvttsi2sd, a, r, NULL);
+ break;
case Oflt2int:
- a = selexpr(s, args[0]);
- r = locreg(mode(n));
- g(s, Icvttsd2si, a, r, NULL);
- break;
+ a = selexpr(s, args[0]);
+ r = locreg(mode(n));
+ g(s, Icvttsd2si, a, r, NULL);
+ break;
case Oflt2flt:
- a = selexpr(s, args[0]);
- r = locreg(mode(n));
- if (a->mode == ModeD)
- g(s, Icvttsd2ss, a, r, NULL);
- else
- g(s, Icvttss2sd, a, r, NULL);
- break;
+ a = selexpr(s, args[0]);
+ r = locreg(mode(n));
+ if (a->mode == ModeD)
+ g(s, Icvttsd2ss, a, r, NULL);
+ else
+ g(s, Icvttss2sd, a, r, NULL);
+ break;
case Odead:
case Oundef:
case Odef:
- /* nothing */
- break;
+ /* nothing */
+ break;
- /* These operators should never show up in the reduced trees,
- * since they should have been replaced with more primitive
- * expressions by now */
+ /* These operators should never show up in the reduced trees,
+ * since they should have been replaced with more primitive
+ * expressions by now */
case Obad: case Opreinc: case Opostinc: case Opredec:
case Opostdec: case Olor: case Oland: case Oaddeq:
case Osubeq: case Omuleq: case Odiveq: case Omodeq: case Oboreq:
@@ -888,9 +940,9 @@ selexpr(Isel *s, Node *n)
case Oslice: case Oidx: case Osize: case Otupget:
case Obreak: case Ocontinue:
case Numops:
- dump(n, stdout);
- die("Should not see %s in isel", opstr[exprop(n)]);
- break;
+ dump(n, stdout);
+ die("Should not see %s in isel", opstr[exprop(n)]);
+ break;
}
return r;
}
diff --git a/6/simp.c b/6/simp.c
index 97d82ca..2b03ec4 100644
--- a/6/simp.c
+++ b/6/simp.c
@@ -1111,8 +1111,8 @@ rval(Simp *s, Node *n, Node *dst)
u = idxaddr(s, t, n->expr.args[1]);
r = load(u);
break;
- /* array.len slice.len are magic 'virtual' members.
- * they need to be special cased. */
+ /* array.len slice.len are magic 'virtual' members.
+ * they need to be special cased. */
case Omemb:
t = membaddr(s, n);
r = load(t);
diff --git a/Makefile b/Makefile
index 8ca0d77..b7c85f5 100644
--- a/Makefile
+++ b/Makefile
@@ -18,11 +18,14 @@ check: all
.PHONY: bench
bench:
- mbld -tbench
- mbld -tbench bench:benchit
+ mbld bench
.PHONY: bootstrap
bootstrap: buildmyr
+ ./mk/bootstrap/bootstrap+`uname -s`-`uname -m`.sh
+
+.PHONY: genbootstrap
+genbootstrap: buildmyr
./genbootstrap.sh
buildmyr: subdirs
@@ -38,4 +41,4 @@ uninstallmyr:
./mbldwrap.sh uninstall
release:
- ./support/release.sh 0.1.1
+ ./support/release.sh 0.2.0
diff --git a/README.md b/README.md
index 578f96f..3b0ba9c 100644
--- a/README.md
+++ b/README.md
@@ -53,7 +53,7 @@ const main = {
str = "match against this!"
match regex.compile(".*")
| `std.Ok r: re = r
- | `std.Fail m: std.fatal("couldn't compile regex: {}\n", m)
+ | `std.Err m: std.fatal("couldn't compile regex: {}\n", m)
;;
match regex.exec(re, str)
| `std.Some _: std.put("regex matched\n")
diff --git a/bench/bigfactorial.myr b/bench/bigfactorial.myr
index 4363774..cbaab6c 100644
--- a/bench/bigfactorial.myr
+++ b/bench/bigfactorial.myr
@@ -1,11 +1,13 @@
use std
+use testr
-const N = 600
const main = {
- var i
- for i = 0; i < N; i++
- std.bigfree(bigfact(i))
- ;;
+ testr.bench([
+ [.name="bigfactorial-1", .fn={ctx; bigfact(1)}],
+ [.name="bigfactorial-100", .fn={ctx; bigfact(100)}],
+ [.name="bigfactorial-1000", .fn={ctx; bigfact(1000)}],
+ [.name="bigfactorial-10000", .fn={ctx; bigfact(10000)}],
+ ][:])
}
const bigfact = {n
diff --git a/bench/bld.sub b/bench/bld.sub
index 560ebdf..50ce1d4 100644
--- a/bench/bld.sub
+++ b/bench/bld.sub
@@ -1,57 +1,52 @@
-bin intsort {noinst,tag=bench} =
+bench hashit =
+ hashit.myr
+ lib ../lib/std:std
+ lib ../lib/sys:sys
+ lib ../lib/testr:testr
+;;
+bench intsort =
intsort.myr
lib ../lib/std:std
lib ../lib/sys:sys
+ lib ../lib/testr:testr
;;
-bin copious-allocs {noinst,tag=bench} =
+bench copious-allocs =
copious-allocs.myr
lib ../lib/std:std
lib ../lib/sys:sys
+ lib ../lib/testr:testr
;;
-bin sha1-compute {noinst,tag=bench} =
+bench sha1-compute =
sha1-compute.myr
lib ../lib/std:std
lib ../lib/sys:sys
lib ../lib/crypto:crypto
+ lib ../lib/testr:testr
;;
-bin bigfactorial {noinst,tag=bench} =
+bench bigfactorial =
bigfactorial.myr
lib ../lib/std:std
lib ../lib/sys:sys
+ lib ../lib/testr:testr
;;
-bin mandelbrot {noinst,tag=bench} =
+bench mandelbrot =
mandelbrot.myr
lib ../lib/std:std
lib ../lib/sys:sys
lib ../lib/bio:bio
+ lib ../lib/testr:testr
;;
-bin regex-match {noinst,tag=bench} =
+bench regex-match =
regex-match.myr
lib ../lib/std:std
lib ../lib/sys:sys
lib ../lib/regex:regex
+ lib ../lib/testr:testr
;;
-bin many-memcpy {noinst,tag=bench} =
+bench many-memcpy =
many-memcpy.myr
lib ../lib/std:std
lib ../lib/sys:sys
-;;
-
-# benchmark runner
-bin runbench {noinst,tag=bench} =
- runbench.myr
- lib ../lib/std:std
- lib ../lib/sys:sys
-;;
-
-cmd benchit {tag=bench} =
- ./runbench
- intsort
- copious-allocs
- sha1-compute
- bigfactorial
- mandelbrot
- regex-match
- many-memcpy
+ lib ../lib/testr:testr
;;
diff --git a/bench/copious-allocs.myr b/bench/copious-allocs.myr
index 7b02594..5b87b9f 100644
--- a/bench/copious-allocs.myr
+++ b/bench/copious-allocs.myr
@@ -1,37 +1,63 @@
use std
+use testr
type blob = struct
x : int[10]
;;
const main = {
+ testr.bench([
+ [.name="alloc-one", .fn=alloc_one],
+ [.name="allocmany-fwdfwd", .fn=alloc_fwdfwd],
+ [.name="allocmany-fwdrev", .fn=alloc_fwdrev],
+ [.name="allocmany-fwdrand", .fn=alloc_fwdrand],
+ ][:])
+}
+
+const alloc_one = {ctx
+ var a : int#
+
+ for var i = 0; i < 1000; i++
+ a = std.alloc()
+ std.free(a)
+ ;;
+}
+
+const alloc_fwdfwd = {ctx
+ var a : blob#[10000]
+
+ /* alloc forwards, dealloc forwards */
+ for var i = 0; i < a.len; i++
+ a[i] = std.alloc()
+ ;;
+ for var i = 0; i < a.len; i++
+ std.free(a[i])
+ ;;
+
+}
+
+const alloc_fwdrev = {ctx
+ var a : blob#[10000]
+
+ /* alloc forwards, dealloc backwards */
+ for var i = 0; i < a.len; i++
+ a[i] = std.alloc()
+ ;;
+ for var i = a.len; i > 0; i--
+ std.free(a[i - 1])
+ ;;
+}
+
+const alloc_fwdrand = {ctx
var a : blob#[10000]
- for var j = 0; j < 100; j++
- /* alloc forwards, dealloc forwards */
- for var i = 0; i < a.len; i++
- a[i] = std.alloc()
- ;;
- for var i = 0; i < a.len; i++
- std.free(a[i])
- ;;
-
- /* alloc forwards, dealloc backwards */
- for var i = 0; i < a.len; i++
- a[i] = std.alloc()
- ;;
- for var i = a.len; i > 0; i--
- std.free(a[i - 1])
- ;;
-
- /* alloc forwards, dealloc randomly */
- for var i = 0; i < a.len; i++
- a[i] = std.alloc()
- ;;
- shuffle(a[:])
- for var i = a.len; i > 0; i--
- std.free(a[i - 1])
- ;;
+ /* alloc forwards, dealloc randomly */
+ for var i = 0; i < a.len; i++
+ a[i] = std.alloc()
+ ;;
+ shuffle(a[:])
+ for var i = a.len; i > 0; i--
+ std.free(a[i - 1])
;;
}
diff --git a/bench/hashit.myr b/bench/hashit.myr
new file mode 100644
index 0000000..e06343e
--- /dev/null
+++ b/bench/hashit.myr
@@ -0,0 +1,96 @@
+use std
+use testr
+
+const main = {
+ testr.bench([
+ [.name="hashstr", .fn={ctx;
+ for var i = 0; i < 1000; i++
+ std.strhash("foobar")
+ ;;
+ }],
+ [.name="hashint", .fn={ctx
+ for var i = 0; i < 1000; i++
+ std.inthash(123)
+ ;;
+ }],
+ [.name="hashlongstr", .fn={ctx
+ for var i = 0; i < 1000; i++
+ std.strhash(a)
+ ;;
+ }],
+ [.name="htget", .fn={ctx
+ var h = std.mkht(std.strhash, std.streq)
+ std.htput(h, "foo", 123)
+ for var i = 0; i < 1000; i++
+ std.htget(h, "foo")
+ ;;
+ std.htfree(h)
+ }],
+ [.name="htput", .fn={ctx
+ var h = std.mkht(std.strhash, std.streq)
+ for var i = 0; i < 1000; i++
+ std.htput(h, "foo", 123)
+ ;;
+ std.htfree(h)
+ }],
+ [.name="htputmany", .fn={ctx
+ var h = std.mkht(std.inthash, std.inteq)
+ for var i = 0; i < 1000; i++
+ std.htput(h, i, 123)
+ ;;
+ std.htfree(h)
+ }],
+ ][:])
+}
+
+const a = \
+ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" \
+ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" \
+ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" \
+ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" \
+ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" \
+ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" \
+ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" \
+ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" \
+ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" \
+ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" \
+ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" \
+ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" \
+ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" \
+ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" \
+ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" \
+ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" \
+ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" \
+ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" \
+ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" \
+ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" \
+ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" \
+ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" \
+ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" \
+ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" \
+ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" \
+ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" \
+ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" \
+ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" \
+ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" \
+ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" \
+ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" \
+ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" \
+ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" \
+ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" \
+ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" \
+ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" \
+ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" \
+ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" \
+ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" \
+ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" \
+ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" \
+ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" \
+ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" \
+ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" \
+ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" \
+ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" \
+ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" \
+ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" \
+ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" \
+ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
diff --git a/bench/intsort.myr b/bench/intsort.myr
index cb7478c..ff69d3e 100644
--- a/bench/intsort.myr
+++ b/bench/intsort.myr
@@ -1,6 +1,13 @@
use std
+use testr
const main = {
+ testr.bench([
+ [.name="fill-sort", .fn={ctx; benchsort()}]
+ ][:])
+}
+
+const benchsort = {
var a, i
a = std.slalloc(500_000)
@@ -8,4 +15,5 @@ const main = {
a[i] = std.randnum()
;;
std.sort(a, std.numcmp)
+ std.slfree(a)
}
diff --git a/bench/mandelbrot.myr b/bench/mandelbrot.myr
index cf75fda..1d3ad01 100644
--- a/bench/mandelbrot.myr
+++ b/bench/mandelbrot.myr
@@ -1,9 +1,39 @@
use std
use bio
+use testr
const Bailout : flt64 = 16.0
const Maxiter = 1000
+const main = {
+ testr.bench([
+ [.name="mandelbrot", .fn=writemandel]
+ ][:])
+}
+
+
+const writemandel = {ctx
+ var x : flt64, y : flt64, i
+ var f
+
+ f = bio.mkfile(1, bio.Wr)
+ for i = 0; i < 10; i++
+ for y = -39.0; y < 39.0; y = y + 1.0
+ for x = -39.0; x < 39.0; x = x + 1.0
+ if mandelbrot(x/40.0, y/40.0) == 0
+ bio.write(f, "*")
+ else
+ bio.write(f, " ")
+ ;;
+ ;;
+ bio.write(f, "\n")
+ ;;
+ ;;
+ bio.write(f, "\n")
+ /* we still use this fd to log our test output... */
+ bio.flush(f)
+}
+
const mandelbrot = {x, y
var cr, ci, zr, zi
var tmp, zr2, zi2
@@ -32,24 +62,3 @@ const mandelbrot = {x, y
;;
-> 0
}
-
-const main = {args : byte[:][:]
- var x : flt64, y : flt64, i
- var f
-
- f = bio.mkfile(1, bio.Wr)
- for i = 0; i < 10; i++
- for y = -39.0; y < 39.0; y = y + 1.0
- for x = -39.0; x < 39.0; x = x + 1.0
- if mandelbrot(x/40.0, y/40.0) == 0
- bio.write(f, "*")
- else
- bio.write(f, " ")
- ;;
- ;;
- bio.write(f, "\n")
- ;;
- ;;
- bio.write(f, "\n")
- bio.close(f)
-}
diff --git a/bench/many-memcpy.myr b/bench/many-memcpy.myr
index 94a5486..7fce209 100644
--- a/bench/many-memcpy.myr
+++ b/bench/many-memcpy.myr
@@ -1,27 +1,31 @@
use std
+use testr
+
+var a : uint64[100000]
const main = {
- var a : uint64[100000]
-
- for var j = 0; j < 100; j++
- /* independent copies forward */
- for var i = 0; i < 10; i++
- std.slcp(a[:a.len/2-1], a[a.len/2+1:])
- ;;
- /* independent copies backward */
- for var i = 0; i < 10; i++
- std.slcp(a[:a.len/2-1], a[a.len/2+1:])
- ;;
-
- /* dependent copies forward */
- for var i = 0; i < 10; i++
- std.slcp(a[:a.len/2+1000], a[a.len/2-1000:])
- ;;
- /* dependent copies backward */
- for var i = 0; i < 10; i++
- std.slcp(a[a.len/2-1000:], a[:a.len/2+1000])
- ;;
- ;;
+ testr.bench([
+ [.name="fwd-independent", .fn=fwd_independent],
+ [.name="rev-independent", .fn=rev_independent],
+ [.name="fwd-dependent", .fn=fwd_dependent],
+ [.name="rev-dependent", .fn=rev_dependent],
+ ][:])
+}
+
+const fwd_independent = {ctx
+ std.slcp(a[:a.len/2-1], a[a.len/2+1:])
+}
+
+const rev_independent = {ctx
+ std.slcp(a[:a.len/2-1], a[a.len/2+1:])
+}
+
+const fwd_dependent = {ctx
+ std.slcp(a[:a.len/2+1000], a[a.len/2-1000:])
+}
+
+const rev_dependent = {ctx
+ std.slcp(a[a.len/2-1000:], a[:a.len/2+1000])
}
diff --git a/bench/regex-match.myr b/bench/regex-match.myr
index 47c9264..dd78860 100644
--- a/bench/regex-match.myr
+++ b/bench/regex-match.myr
@@ -1,26 +1,36 @@
use std
use regex
+use testr
-const main = {
- var str, re, i
+var str
+var dotstar, hello
- str = "€i²æ&±-ŝ€i²æ&±-ŝ€i²æ&±-ŝ€i²æ&±-ŝ€i²æ&±-ŝüüü€i²æ&±-ŝüüü€i²æ&±-ŝü"
+const main = {
+ str = std.sldup("hello world!")
str = std.strcat(str, str)
str = std.strcat(str, str)
str = std.strcat(str, str)
str = std.strcat(str, str)
- for i = 0; i < 100; i++
- match regex.compile(".*")
- | `std.Ok r: re = r
- | `std.Err m: std.fatal("couldn't compile regex: %s\n", m)
- ;;
+ dotstar = std.try(regex.compile(".*"))
+ hello = std.try(regex.compile("hel*o"))
+
+ testr.bench([
+ [.name="matchall", .fn=matchall],
+ [.name="searchhello", .fn=searchhello],
+ ][:])
+}
- match regex.exec(re, str)
- | `std.Some m:
- | `std.None: std.fatal("Didn't match regex\n")
- ;;
+const matchall = {ctx
+ match regex.exec(dotstar, str)
+ | `std.Some m: regex.matchfree(m)
+ | `std.None: std.fatal("Didn't match regex\n")
+ ;;
+}
- regex.free(re)
+const searchhello = {ctx
+ match regex.search(dotstar, str)
+ | `std.Some m: regex.matchfree(m)
+ | `std.None: std.fatal("Didn't match regex\n")
;;
}
diff --git a/bench/runbench.myr b/bench/runbench.myr
deleted file mode 100644
index ea69f83..0000000
--- a/bench/runbench.myr
+++ /dev/null
@@ -1,59 +0,0 @@
-use std
-
-const Nsamp = 10
-
-const main = {args : byte[:][:]
- var tot : flt64
-
- std.put("Running benchmarks: {} samples per binary\n", Nsamp);
- tot = 0.0;
- for arg : args[1:]
- tot = tot + timeit(arg)
- ;;
- std.put("total:\t{}s\n", tot);
-}
-
-const timeit = {prog -> flt64
- var avg, m, d, x, n : flt64
-
- avg = 0.0;
- m = 0.0;
- n = 0.0;
- for var i = 0; i < Nsamp; i++
- n = n + 1.0;
- x = run(prog);
- d = (x - avg);
- avg = avg + d/n;
- m = m + d*(x - avg);
- ;;
- std.put("{}:\t{}s (σ^2: {})\n", prog, avg, m/(n-1.0));
- -> avg;
-}
-
-const run = {prog -> flt64
- var infd, outfd
- var pid
- var tm
-
- tm = std.now()
- pid = std.fork();
- if pid < 0
- std.fatal("Could not fork\n");
- elif pid == 0
- infd = std.try(std.open("/dev/zero", std.Ordonly))
- outfd = std.try(std.open("/dev/null", std.Owronly))
- std.try(std.dup2(infd, 0))
- std.try(std.dup2(outfd, 1))
- std.execv(prog, [prog][:])
- std.fatal("Failed to exec\n")
- else
- match std.wait(pid)
- | `std.Wfailure: std.fatal("could not wait\n")
- | `std.Waiterror: std.fatal("running benchmark failed\n")
- | `std.Wsignalled: std.fatal("running benchmark failed\n")
- | `std.Wsuccess: /* nothing */
- ;;
- ;;
- -> (std.now() - tm : flt64) / 1_000_000.0
-}
-
diff --git a/bench/sha1-compute.myr b/bench/sha1-compute.myr
index e96aa65..def82a0 100644
--- a/bench/sha1-compute.myr
+++ b/bench/sha1-compute.myr
@@ -1,20 +1,26 @@
use crypto
use std
+use testr
+
+var buf : byte[128*1024*1024]
-const N = 20
const main = {
- var i, b
- var buf : byte[1024*1024]
+ for var i = 0; i < buf.len; i++
+ buf[i] = (i : byte)
+ ;;
+ testr.bench([
+ [.name="sha1-1kb", .fn={ctx; hash(std.KiB)}],
+ [.name="sha1-1mb", .fn={ctx; hash(std.MiB)}],
+ [.name="sha1-16mb", .fn={ctx; hash(16*std.MiB)}],
+ [.name="sha1-128mb", .fn={ctx; hash(128*std.MiB)}],
+ ][:])
+}
+
+const hash = {len
var st
- b = 0
- for i = 0; i < buf.len; i++
- buf[i] = b++
- ;;
- for i = 0; i < N; i++
- crypto.sha1init(&st)
- crypto.sha1add(&st, buf[:])
- crypto.sha1fin(&st)
- ;;
+ crypto.sha1init(&st)
+ crypto.sha1add(&st, buf[:len])
+ crypto.sha1fin(&st)
}
diff --git a/lib/bio/bio.myr b/lib/bio/bio.myr
index e56844a..437cde6 100644
--- a/lib/bio/bio.myr
+++ b/lib/bio/bio.myr
@@ -33,17 +33,10 @@ pkg bio =
close : (-> bool)
;;
- type status(@a) = union
+ type err = union
`Eof
- `Ok @a
- `Err ioerr
- ;;
-
- type ioerr = union
- `Ebadfile
- `Ebadbuf
- `Ebadfd
- `Eioerr
+ `Eio
+ `Ebadf
;;
/* creation */
@@ -56,36 +49,36 @@ pkg bio =
const free : (f : file# -> void)
/* basic i/o. Returns sub-buffer when applicable. */
- const write : (f : file#, src : byte[:] -> status(std.size))
- const read : (f : file#, dst : byte[:] -> status(byte[:]))
+ const write : (f : file#, src : byte[:] -> std.result(std.size, err))
+ const read : (f : file#, dst : byte[:] -> std.result(byte[:], err))
const flush : (f : file# -> bool)
/* seeking */
- const seek : (f : file#, off : std.off -> std.result(std.off, ioerr))
+ const seek : (f : file#, off : std.off -> std.result(std.off, err))
/* single unit operations */
- const putb : (f : file#, b : byte -> status(std.size))
- const putc : (f : file#, c : char -> status(std.size))
- const getb : (f : file# -> status(byte))
- const getc : (f : file# -> status(char))
+ const putb : (f : file#, b : byte -> std.result(std.size, err))
+ const putc : (f : file#, c : char -> std.result(std.size, err))
+ const getb : (f : file# -> std.result(byte, err))
+ const getc : (f : file# -> std.result(char, err))
/* peeking */
- const peekb : (f : file# -> status(byte))
- const peekc : (f : file# -> status(char))
+ const peekb : (f : file# -> std.result(byte, err))
+ const peekc : (f : file# -> std.result(char, err))
/* delimited read; returns freshly allocated buffer. */
- const readln : (f : file# -> status(byte[:]))
- const readto : (f : file#, delim : byte[:] -> status(byte[:]))
+ const readln : (f : file# -> std.result(byte[:], err))
+ const readto : (f : file#, delim : byte[:] -> std.result(byte[:], err))
const skipto : (f : file#, delim : byte[:] -> bool)
const skipspace : (f : file# -> bool)
/* formatted i/o */
- const put : (f : file#, fmt : byte[:], args : ... -> status(std.size))
- const putv : (f : file#, fmt : byte[:], ap : std.valist# -> status(std.size))
+ const put : (f : file#, fmt : byte[:], args : ... -> std.result(std.size, err))
+ const putv : (f : file#, fmt : byte[:], ap : std.valist# -> std.result(std.size, err))
/* pkg funcs */
- pkglocal const ensureread : (f : file#, n : std.size -> status(std.size))
- pkglocal const ensurewrite : (f : file#, n : std.size -> status(std.size))
+ pkglocal const ensureread : (f : file#, n : std.size -> std.result(std.size, err))
+ pkglocal const ensurewrite : (f : file#, n : std.size -> std.result(std.size, err))
;;
const Bufsz = 16*std.KiB
@@ -149,8 +142,8 @@ const dial = {srv, mode
/* map from the bio modes to the unix open modes */
const sysmode = {mode
match mode
- | Rd: -> std.Ordonly
- | Wr: -> std.Owronly
+ | Rd: -> std.Oread
+ | Wr: -> std.Owrite
| Rw: -> std.Ordwr
| _: std.fatal("bio: bad file mode")
;;
@@ -208,7 +201,7 @@ const write = {f, src
if src.len <= (f.wbuf.len - f.wend)
std.slcp(f.wbuf[f.wend:f.wend+src.len], src)
f.wend += src.len
- -> `Ok src.len
+ -> `std.Ok src.len
else
flush(f)
-> writebuf(f, src)
@@ -225,7 +218,7 @@ const read = {f, dst
/* Clear the error state so we can retry */
if f.lasterr != 0
- -> `Err geterr(f)
+ -> `std.Err geterr(f)
;;
/*
@@ -235,7 +228,7 @@ const read = {f, dst
an EOF condition.
*/
if dst.len == 0
- -> `Ok dst
+ -> `std.Ok dst
;;
std.assert(f.mode & Rd != 0, "File is not in read mode")
/*
@@ -268,7 +261,7 @@ const read = {f, dst
d = d[n:]
| `std.Err err:
if count == 0
- -> `Err errtype(err)
+ -> `std.Err errtype(err)
else
f.lasterr = err
;;
@@ -276,9 +269,9 @@ const read = {f, dst
;;
;;
if count == 0
- -> `Eof
+ -> `std.Err `Eof
else
- -> `Ok dst[:count]
+ -> `std.Ok dst[:count]
;;
}
@@ -289,7 +282,7 @@ const flush = {f
ret = true
if f.mode & Wr != 0
match writebuf(f, f.wbuf[:f.wend])
- | `Ok n: ret = (n == f.wend)
+ | `std.Ok n: ret = (n == f.wend)
| _: ret = false
;;
;;
@@ -309,11 +302,10 @@ const seek = {f, off
/* writes a single byte to the output stream */
const putb = {f, b
match ensurewrite(f, 1)
- | `Eof: -> `Eof
- | `Err e: -> `Err e
- | `Ok n:
+ | `std.Err e: -> `std.Err e
+ | `std.Ok n:
f.wbuf[f.wend++] = b
- -> `Ok 1
+ -> `std.Ok 1
;;
}
@@ -323,22 +315,20 @@ const putc = {f, c
sz = std.charlen(c)
match ensurewrite(f, sz)
- | `Eof: -> `Eof
- | `Err e: -> `Err e
- | `Ok n:
+ | `std.Err e: -> `std.Err e
+ | `std.Ok n:
std.encode(f.wbuf[f.wend:], c)
f.wend += sz
- -> `Ok sz
+ -> `std.Ok sz
;;
}
/* reads a single byte from the input stream */
const getb = {f
match ensureread(f, 1)
- | `Eof: -> `Eof
- | `Err e: -> `Err e
- | `Ok n:
- -> `Ok f.rbuf[f.rstart++]
+ | `std.Err e: -> `std.Err e
+ | `std.Ok n:
+ -> `std.Ok f.rbuf[f.rstart++]
;;
}
@@ -347,12 +337,11 @@ const getc = {f
var c
match ensurecodepoint(f)
- | `Eof: -> `Eof
- | `Err e: -> `Err e
- | `Ok n:
+ | `std.Err e: -> `std.Err e
+ | `std.Ok n:
c = std.decode(f.rbuf[f.rstart:f.rend])
f.rstart += std.charlen(c)
- -> `Ok c
+ -> `std.Ok c
;;
}
@@ -362,9 +351,8 @@ const ensurecodepoint = {f
var len
match ensureread(f, 1)
- | `Eof: -> `Eof
- | `Err e: -> `Err e
- | `Ok n:
+ | `std.Err e: -> `std.Err e
+ | `std.Ok n:
b = f.rbuf[f.rstart]
if b & 0x80 == 0 /* 0b0xxx_xxxx */
len = 1
@@ -408,20 +396,18 @@ generic putbe = {f, v : @a::(numeric,integral)
/* peeks a single byte from an input stream */
const peekb = {f
match ensureread(f, 1)
- | `Eof: -> `Eof
- | `Err e: -> `Err e
- | `Ok n:
- -> `Ok f.rbuf[f.rstart]
+ | `std.Err e: -> `std.Err e
+ | `std.Ok n:
+ -> `std.Ok f.rbuf[f.rstart]
;;
}
/* peeks a single character from a utf8 encoded input stream */
const peekc = {f
match ensurecodepoint(f)
- | `Eof: -> `Eof
- | `Err e: -> `Err e
- | `Ok n:
- -> `Ok std.decode(f.rbuf[f.rstart:f.rend])
+ | `std.Err e: -> `std.Err e
+ | `std.Ok n:
+ -> `std.Ok std.decode(f.rbuf[f.rstart:f.rend])
;;
}
@@ -441,23 +427,20 @@ const readto = {f, delim
/* same as readto, but drops the read data. */
const skipto = {f, delim
match readdelim(f, delim, true)
- | `Ok ign: -> true
- | `Eof: -> false
- | `Err _: -> false
+ | `std.Ok ign: -> true
+ | `std.Err _: -> false
;;
}
const skipspace = {f
while true
match bio.peekc(f)
- | `Ok c:
+ | `std.Ok c:
if !std.isspace(c)
break
;;
bio.getc(f)
- | `Err e: -> false
- | `Eof: break
-
+ | `std.Err e: -> false
;;
;;
-> true
@@ -471,15 +454,15 @@ const readln = {f
while true
/* get at least delimiter count of characters */
match ensureread(f, 1)
- | `Ok _:
- | `Err e: -> `Err e
- | `Eof:
+ | `std.Err `Eof:
ret = readinto(f, ret, f.rend - f.rstart)
if ret.len > 0
- -> `Ok ret
+ -> `std.Ok ret
else
- -> `Eof
+ -> `std.Err `Eof
;;
+ | `std.Err e: -> `std.Err e
+ | `std.Ok _:
;;
/* scan for delimiter */
for var i = f.rstart; i < f.rend; i++
@@ -491,7 +474,7 @@ const readln = {f
if c == '\r' && unwrapc(peekc(f), -1) == '\n'
f.rstart++
;;
- -> `Ok ret
+ -> `std.Ok ret
;;
:nextitergetln
;;
@@ -502,7 +485,7 @@ const readln = {f
const unwrapc = {cc, v
match cc
- | `Ok c: -> c
+ | `std.Ok c: -> c
| _: -> v
;;
}
@@ -514,17 +497,17 @@ const readdelim = {f, delim, drop
while true
/* get at least delimiter count of characters */
match ensureread(f, 1)
- | `Ok _:
- | `Err e: -> `Err e
- | `Eof:
+ | `std.Err `Eof:
if !drop
ret = readinto(f, ret, f.rend - f.rstart)
;;
if ret.len > 0
- -> `Ok ret
+ -> `std.Ok ret
else
- -> `Eof
+ -> `std.Err `Eof
;;
+ | `std.Err e: -> `std.Err e
+ | `std.Ok _:
;;
for var i = f.rstart; i < f.rend; i++
if f.rbuf[i] == delim[0]
@@ -537,7 +520,7 @@ const readdelim = {f, delim, drop
ret = readinto(f, ret, i - f.rstart)
;;
f.rstart += delim.len
- -> `Ok ret
+ -> `std.Ok ret
;;
:nextiterread
;;
@@ -591,14 +574,13 @@ const ensurewrite = {f, n
std.assert(n < f.wbuf.len, "ensured write capacity > buffer size")
if n > f.wbuf.len - f.wend
match writebuf(f, f.wbuf[:f.wend])
- | `Ok len:
+ | `std.Ok len:
f.wend = 0
- -> `Ok len
- | `Err e: -> `Err e
- | `Eof: -> `Eof
+ -> `std.Ok len
+ | `std.Err e: -> `std.Err e
;;
;;
- -> `Ok n
+ -> `std.Ok n
}
/*
@@ -612,17 +594,16 @@ const ensureread = {f, n
held = f.rend - f.rstart
if n > held
match fill(f, n)
- | `Eof: -> `Eof
- | `Err e: -> `Err e
- | `Ok len:
+ | `std.Err e: -> `std.Err e
+ | `std.Ok len:
if len >= n
- -> `Ok len
+ -> `std.Ok len
else
- -> `Eof
+ -> `std.Err `Eof
;;
;;
else
- -> `Ok n
+ -> `std.Ok n
;;
}
@@ -634,16 +615,16 @@ const writebuf = {f, src
while src.len != 0
match f.write(src)
| `std.Ok 0:
- -> `Eof
+ -> `std.Err `Eof
| `std.Ok n:
count += n
src = src[n:]
| `std.Err e:
- -> `Err errtype(e)
+ -> `std.Err errtype(e)
;;
;;
:writedone
- -> `Ok count
+ -> `std.Ok count
}
@@ -658,7 +639,7 @@ const fill = {f, min
count = 0
/* Clear the error state so we can retry */
if f.lasterr != 0
- -> `Err geterr(f)
+ -> `std.Err geterr(f)
;;
/* if we need to shift the slice down to the start, do it */
@@ -684,16 +665,16 @@ const fill = {f, min
if count > 0
f.lasterr = e
else
- -> `Err errtype(e)
+ -> `std.Err errtype(e)
;;
break
;;
;;
if count == 0
- -> `Eof
+ -> `std.Err `Eof
else
- -> `Ok count
+ -> `std.Ok count
;;
}
@@ -705,20 +686,18 @@ const geterr = {f
-> errtype(e)
}
-const errtype = {e : std.errno -> ioerr
+const errtype = {e : std.errno -> err
var errno
errno = (e : std.errno)
if errno == std.Ebadf
- -> `Ebadfile
+ -> `Ebadf
elif errno == std.Einval
- -> `Ebadfile
+ -> `Ebadf
elif errno == std.Efault
- -> `Ebadbuf
- elif errno == std.Eio
- -> `Eioerr
+ -> `Eio
else
- -> `Eioerr
+ -> `Eio
;;
}
diff --git a/lib/bio/geti.myr b/lib/bio/geti.myr
index 70186b2..c7ae74e 100644
--- a/lib/bio/geti.myr
+++ b/lib/bio/geti.myr
@@ -4,34 +4,31 @@ use "bio"
pkg bio =
/* unsigned big endian */
- generic getbe8 : (f : file# -> status(@a::(numeric,integral)))
- generic getbe16 : (f : file# -> status(@a::(numeric,integral)))
- generic getbe32 : (f : file# -> status(@a::(numeric,integral)))
- generic getbe64 : (f : file# -> status(@a::(numeric,integral)))
+ generic getbe8 : (f : file# -> std.result(@a::(numeric,integral), err))
+ generic getbe16 : (f : file# -> std.result(@a::(numeric,integral), err))
+ generic getbe32 : (f : file# -> std.result(@a::(numeric,integral), err))
+ generic getbe64 : (f : file# -> std.result(@a::(numeric,integral), err))
/* signed big endian */
- generic getle8 : (f : file# -> status(@a::(numeric,integral)))
- generic getle16 : (f : file# -> status(@a::(numeric,integral)))
- generic getle32 : (f : file# -> status(@a::(numeric,integral)))
- generic getle64 : (f : file# -> status(@a::(numeric,integral)))
+ generic getle8 : (f : file# -> std.result(@a::(numeric,integral), err))
+ generic getle16 : (f : file# -> std.result(@a::(numeric,integral), err))
+ generic getle32 : (f : file# -> std.result(@a::(numeric,integral), err))
+ generic getle64 : (f : file# -> std.result(@a::(numeric,integral), err))
;;
/*
reads a single integer-like value to the output stream, in
little endian format
*/
-generic getle = {f, n -> status(@a::(numeric,integral))
- var v, i
-
- v = 0
+generic getle = {f, n -> std.result(@a::(numeric,integral), err)
match ensureread(f, n)
- | `Eof: -> `Eof
- | `Err e : -> `Err e
- | `Ok _:
- for i = 0; i < n; i++
+ | `std.Err e : -> `std.Err e
+ | `std.Ok _:
+ var v = 0
+ for var i = 0; i < n; i++
v |= (f.rbuf[f.rstart++] : uint64) << (8*(i : uint64))
;;
- -> `Ok (v : @a::(numeric,integral))
+ -> `std.Ok (v : @a::(numeric,integral))
;;
}
@@ -39,19 +36,16 @@ generic getle = {f, n -> status(@a::(numeric,integral))
reads a single integer-like value to the output stream, in
big endian format
*/
-generic getbe = {f, n -> status(@a::(numeric,integral))
- var v, i
-
- v = 0
+generic getbe = {f, n -> std.result(@a::(numeric,integral), err)
match ensureread(f, n)
- | `Eof: -> `Eof
- | `Err e : -> `Err e
- | `Ok _:
- for i = 0; i < n; i++
+ | `std.Err e : -> `std.Err e
+ | `std.Ok _:
+ var v = 0
+ for var i = 0; i < n; i++
v <<= 8
v |= (f.rbuf[f.rstart++] : uint64)
;;
- -> `Ok (v : @a::(numeric,integral))
+ -> `std.Ok (v : @a::(numeric,integral))
;;
}
diff --git a/lib/bio/iter.myr b/lib/bio/iter.myr
index dbdd025..55379ed 100644
--- a/lib/bio/iter.myr
+++ b/lib/bio/iter.myr
@@ -18,9 +18,8 @@ const byline = {f
impl iterable lineiter -> byte[:] =
__iternext__ = {itp, outp
match bio.readln((itp# : file#))
- | `Ok ln: outp# = ln
- | `Err _: -> false
- | `Eof: -> false
+ | `std.Ok ln: outp# = ln
+ | `std.Err _: -> false
;;
-> true
}
@@ -37,9 +36,8 @@ const bychar = {f
impl iterable chariter -> char =
__iternext__ = {itp, outp : char#
match bio.getc((itp# : file#))
- | `Ok c: outp# = c
- | `Err _: -> false
- | `Eof: -> false
+ | `std.Ok c: outp# = c
+ | `std.Err _: -> false
;;
-> true
}
diff --git a/lib/bio/puti.myr b/lib/bio/puti.myr
index d4d7a3f..056f6a4 100644
--- a/lib/bio/puti.myr
+++ b/lib/bio/puti.myr
@@ -4,16 +4,16 @@ use "bio"
pkg bio =
/* unsigned big endian */
- generic putbe8 : (f : file#, v : @a::(numeric,integral) -> status(std.size))
- generic putbe16 : (f : file#, v : @a::(numeric,integral) -> status(std.size))
- generic putbe32 : (f : file#, v : @a::(numeric,integral) -> status(std.size))
- generic putbe64 : (f : file#, v : @a::(numeric,integral) -> status(std.size))
+ generic putbe8 : (f : file#, v : @a::(numeric,integral) -> std.result(std.size, err))
+ generic putbe16 : (f : file#, v : @a::(numeric,integral) -> std.result(std.size, err))
+ generic putbe32 : (f : file#, v : @a::(numeric,integral) -> std.result(std.size, err))
+ generic putbe64 : (f : file#, v : @a::(numeric,integral) -> std.result(std.size, err))
/* unsigned little endian */
- generic putle8 : (f : file#, v : @a::(numeric,integral) -> status(std.size))
- generic putle16 : (f : file#, v : @a::(numeric,integral) -> status(std.size))
- generic putle32 : (f : file#, v : @a::(numeric,integral) -> status(std.size))
- generic putle64 : (f : file#, v : @a::(numeric,integral) -> status(std.size))
+ generic putle8 : (f : file#, v : @a::(numeric,integral) -> std.result(std.size, err))
+ generic putle16 : (f : file#, v : @a::(numeric,integral) -> std.result(std.size, err))
+ generic putle32 : (f : file#, v : @a::(numeric,integral) -> std.result(std.size, err))
+ generic putle64 : (f : file#, v : @a::(numeric,integral) -> std.result(std.size, err))
;;
generic putbe8 = {f, v; -> putbe(f, (v : uint64), 1)}
@@ -30,9 +30,9 @@ const putle = {f, v, n
var buf : byte[8]
match ensurewrite(f, n)
- | `Eof: -> `Eof
- | `Err e: -> `Err e
- | `Ok _:
+ | `std.Err e:
+ -> `std.Err e
+ | `std.Ok _:
buf[0] = ((v >> 0) & 0xff : byte)
buf[1] = ((v >> 8) & 0xff : byte)
buf[2] = ((v >> 16) & 0xff : byte)
@@ -49,9 +49,9 @@ const putbe = {f, v, n
var buf : byte[8]
match ensurewrite(f, n)
- | `Eof: -> `Eof
- | `Err e: -> `Err e
- | `Ok _:
+ | `std.Err e:
+ -> `std.Err e
+ | `std.Ok _:
buf[0] = ((v >> 56) & 0xff : byte)
buf[1] = ((v >> 48) & 0xff : byte)
buf[2] = ((v >> 40) & 0xff : byte)
diff --git a/lib/bio/test/bio-delim.myr b/lib/bio/test/bio-delim.myr
index 354dc50..dbc2f65 100644
--- a/lib/bio/test/bio-delim.myr
+++ b/lib/bio/test/bio-delim.myr
@@ -67,11 +67,11 @@ const main = {
const readln = {f
match bio.readln(f)
- | `bio.Ok d: -> d
- | `bio.Eof:
+ | `std.Ok d: -> d
+ | `std.Err `bio.Eof:
std.put("eof\n")
-> [][:]
- | `bio.Err e:
+ | `std.Err e:
std.put("err\n")
-> [][:]
;;
@@ -79,11 +79,11 @@ const readln = {f
const readto = {f, delim
match bio.readto(f, delim)
- | `bio.Ok d: -> d
- | `bio.Eof:
+ | `std.Ok d: -> d
+ | `std.Err `bio.Eof:
std.put("eof\n")
-> [][:]
- | `bio.Err e:
+ | `std.Err e:
std.put("err\n")
-> [][:]
;;
diff --git a/lib/bio/test/bio-endianrd.myr b/lib/bio/test/bio-endianrd.myr
index e445459..8296c75 100644
--- a/lib/bio/test/bio-endianrd.myr
+++ b/lib/bio/test/bio-endianrd.myr
@@ -1,13 +1,6 @@
use std
use bio
-generic try = {opt : bio.status(@a::(integral,numeric))-> @a::(integral,numeric)
- match opt
- | `bio.Ok val: -> val
- | _: std.fatal("read failed")
- ;;
-}
-
const main = {
var b : byte
var w : uint16
@@ -23,31 +16,31 @@ const main = {
/* byte */
b = 0xaa
- var r = try(bio.getle8(f))
+ var r = std.try(bio.getle8(f))
std.assert(r == b, "le byte broken: {x}\n", r)
- std.assert(try(bio.getbe8(f)) == b, "be byte broken\n")
+ std.assert(std.try(bio.getbe8(f)) == b, "be byte broken\n")
/* word */
w = 0xaabb
- std.assert(try(bio.getle16(f)) == w, "le word broken\n")
- std.assert(try(bio.getbe16(f)) == w, "be word broken\n")
+ std.assert(std.try(bio.getle16(f)) == w, "le word broken\n")
+ std.assert(std.try(bio.getbe16(f)) == w, "be word broken\n")
/* long */
l = 0xaabbccdd
- std.assert(try(bio.getle32(f)) == l, "le long broken\n")
- std.assert(try(bio.getbe32(f)) == l, "be long broken\n")
+ std.assert(std.try(bio.getle32(f)) == l, "le long broken\n")
+ std.assert(std.try(bio.getbe32(f)) == l, "be long broken\n")
/* quad */
q = (0x11223344aabbccdd : uint64)
- std.assert(try(bio.getle64(f)) == q, "le quad broken\n")
- std.assert(try(bio.getbe64(f)) == q, "be quad broken\n")
+ std.assert(std.try(bio.getle64(f)) == q, "le quad broken\n")
+ std.assert(std.try(bio.getbe64(f)) == q, "be quad broken\n")
/* end of file */
match bio.getle64(f)
- | `bio.Eof:
- | `bio.Err _:
+ | `std.Err `bio.Eof:
+ | `std.Err _:
std.die("error on reading file\n")
- | `bio.Ok v:
+ | `std.Ok v:
std.die("read past end of file\n")
v = q /* shut up type inference */
;;
diff --git a/lib/bio/test/bio-peek.myr b/lib/bio/test/bio-peek.myr
index 506dea0..a0f4752 100644
--- a/lib/bio/test/bio-peek.myr
+++ b/lib/bio/test/bio-peek.myr
@@ -28,11 +28,11 @@ const main = {
const peekc = {f
match bio.peekc(f)
- | `bio.Ok c: -> c
- | `bio.Eof:
+ | `std.Ok c: -> c
+ | `std.Err `bio.Eof:
std.put("eof\n")
-> -1
- | `bio.Err e:
+ | `std.Err e:
std.fatal("error reading\n")
-> -1
;;
@@ -40,11 +40,11 @@ const peekc = {f
const peekb = {f
match bio.peekb(f)
- | `bio.Ok b: -> b
- | `bio.Eof:
+ | `std.Ok b: -> b
+ | `std.Err `bio.Eof:
std.put("eof\n")
-> -1
- | `bio.Err e:
+ | `std.Err e:
std.fatal("error reading\n")
-> -1
;;
diff --git a/lib/bio/test/bio-read.myr b/lib/bio/test/bio-read.myr
index 829b442..3e477c2 100644
--- a/lib/bio/test/bio-read.myr
+++ b/lib/bio/test/bio-read.myr
@@ -40,12 +40,12 @@ const main = {
const r = {f, buf
match bio.read(f, buf)
- | `bio.Ok b:
+ | `std.Ok b:
-> b
- | `bio.Eof:
+ | `std.Err `bio.Eof:
std.put("eof\n")
-> ""
- | `bio.Err e:
+ | `std.Err e:
std.put("err\n")
-> ""
;;
diff --git a/lib/bio/test/bio-unitwr.myr b/lib/bio/test/bio-unitwr.myr
index 5b66bbb..f101927 100644
--- a/lib/bio/test/bio-unitwr.myr
+++ b/lib/bio/test/bio-unitwr.myr
@@ -3,6 +3,8 @@ use bio
const main = {
var f
+
+ std.mkpath("tmpout")
match bio.create("tmpout/test-unitwr", bio.Wr, 0o644)
| `std.Ok bio: f = bio
| `std.Err m: std.fatal("Unable to open data file: {}\n", m)
diff --git a/lib/bio/test/mem.myr b/lib/bio/test/mem.myr
index f3135d2..a7cb613 100644
--- a/lib/bio/test/mem.myr
+++ b/lib/bio/test/mem.myr
@@ -7,21 +7,21 @@ const main = {
f = bio.mkmem("hello world")
match bio.read(f, buf[:3])
- | `bio.Ok "hel":
+ | `std.Ok "hel":
/* ok */
| _:
std.fatal("invalid read from memfile")
;;
match bio.read(f, buf[:])
- | `bio.Ok "lo world":
+ | `std.Ok "lo world":
/* ok */
| _:
std.fatal("invalid read from memfile")
;;
match bio.read(f, buf[:])
- | `bio.Eof:
+ | `std.Err `bio.Eof:
/* ok */
| _:
std.fatal("expected eof in memfile")
diff --git a/lib/bld.sub b/lib/bld.sub
index 3bb040b..da62ed6 100644
--- a/lib/bld.sub
+++ b/lib/bld.sub
@@ -4,6 +4,7 @@ sub =
date
escfmt
fileutil
+ http
inifile
json
regex
diff --git a/lib/crypto/entropy.myr b/lib/crypto/entropy.myr
index b5c5120..8120791 100644
--- a/lib/crypto/entropy.myr
+++ b/lib/crypto/entropy.myr
@@ -7,7 +7,7 @@ pkg crypto =
var randfd
const __init__ = {
- randfd = std.try(std.open("/dev/random", std.Ordonly))
+ randfd = std.try(std.open("/dev/random", std.Oread))
}
const getentropy = {buf
diff --git a/lib/date/fmt.myr b/lib/date/fmt.myr
index c66827b..323b25a 100644
--- a/lib/date/fmt.myr
+++ b/lib/date/fmt.myr
@@ -62,9 +62,9 @@ const datefmt = {sb, fmt, d
| 'H': std.sbfmt(sb, "{p=0,w=2}", d.h)
| 'I': std.sbfmt(sb, "{p=0,w=2}", d.h % 12)
| 'j': std.sbfmt(sb, "year day... unimplemented.")
- | 'k': std.sbfmt(sb, "{}", d.h)
+ | 'k': std.sbfmt(sb, "{p=0,w=2}", d.h)
| 'l': std.sbfmt(sb, "{}", d.h % 12)
- | 'm': std.sbfmt(sb, "{}", d.mon)
+ | 'm': std.sbfmt(sb, "{p=0,w=2}", d.mon)
| 'M': std.sbfmt(sb, "{p=0,w=2}", d.m)
| 'n': std.sbfmt(sb, "\n")
| 'O': std.sbfmt(sb, "unsupported %O")
diff --git a/lib/date/parse.myr b/lib/date/parse.myr
index 80f0b76..19798dd 100644
--- a/lib/date/parse.myr
+++ b/lib/date/parse.myr
@@ -164,9 +164,9 @@ const eatspace = {s
const indexof = {dst, s, set, err
for var i = 0; i < set.len; i++
- if s.len >= set[i].len && std.streq(s, set[i])
+ if s.len >= set[i].len && std.streq(s[:set[i].len], set[i])
dst# = i
- -> s
+ -> s[set[i].len:]
;;
;;
err# = `std.Some `Badname s
diff --git a/lib/date/test/fmt.myr b/lib/date/test/fmt.myr
index 024c7b6..d0abba9 100644
--- a/lib/date/test/fmt.myr
+++ b/lib/date/test/fmt.myr
@@ -7,13 +7,13 @@ const main = {
/* epoch */
d = date.mkinstant(0, "")
- eq("1970-1-01 00:00:00 +0000", std.bfmt(buf[:], "{D}", d))
+ eq("1970-01-01 00:00:00 +0000", std.bfmt(buf[:], "{D}", d))
d = date.mkinstant(24*3600*1_000_000, "")
- eq("1970-1-02 00:00:00 +0000", std.bfmt(buf[:], "{D}", d))
+ eq("1970-01-02 00:00:00 +0000", std.bfmt(buf[:], "{D}", d))
/* epoch + 12 hours */
d = date.mkinstant(12*3600*1_000_000, "")
- eq("1970-1-01 12:00:00 +0000", std.bfmt(buf[:], "{D}", d))
+ eq("1970-01-01 12:00:00 +0000", std.bfmt(buf[:], "{D}", d))
/* epoch - 6 hours */
d = date.mkinstant(-6*3600*1_000_000, "")
@@ -25,11 +25,11 @@ const main = {
/* more or less random: Fri 29 Aug 2014 07:47:43 PM UTC*/
d = date.mkinstant(1_409_341_663*1_000_000, "")
- eq("2014-8-29 19:47:43 +0000", std.bfmt(buf[:], "{D}", d))
+ eq("2014-08-29 19:47:43 +0000", std.bfmt(buf[:], "{D}", d))
/* large negative time stamp */
d = date.mkinstant(-50000000000*1_000_000, "")
- eq("385-7-25 07:06:40 +0000", std.bfmt(buf[:], "{D}", d))
+ eq("385-07-25 07:06:40 +0000", std.bfmt(buf[:], "{D}", d))
/* date : the bc */
d = date.mkinstant(-70000000000*1_000_000, "")
@@ -38,27 +38,27 @@ const main = {
/* test addition and subtraction of dates */
d = date.mkinstant(-1, "")
d = date.addperiod(d, `date.Hour 1)
- eq("1970-1-01 00:59:59 +0000", std.bfmt(buf[:], "{D}", d))
+ eq("1970-01-01 00:59:59 +0000", std.bfmt(buf[:], "{D}", d))
d = date.mkinstant(0, "")
d = date.addperiod(d, `date.Hour 24)
- eq("1970-1-02 00:00:00 +0000", std.bfmt(buf[:], "{D}", d))
+ eq("1970-01-02 00:00:00 +0000", std.bfmt(buf[:], "{D}", d))
d = date.mkinstant(0, "")
d = date.addperiod(d, `date.Day 1)
- eq("1970-1-02 00:00:00 +0000", std.bfmt(buf[:], "{D}", d))
+ eq("1970-01-02 00:00:00 +0000", std.bfmt(buf[:], "{D}", d))
d = date.subperiod(d, `date.Day 1)
- eq("1970-1-01 00:00:00 +0000", std.bfmt(buf[:], "{D}", d))
+ eq("1970-01-01 00:00:00 +0000", std.bfmt(buf[:], "{D}", d))
d = date.subperiod(d, `date.Year 1)
- eq("1969-1-01 00:00:00 +0000", std.bfmt(buf[:], "{D}", d))
+ eq("1969-01-01 00:00:00 +0000", std.bfmt(buf[:], "{D}", d))
d = date.addperiod(d, `date.Day 365)
- eq("1970-1-01 00:00:00 +0000", std.bfmt(buf[:], "{D}", d))
+ eq("1970-01-01 00:00:00 +0000", std.bfmt(buf[:], "{D}", d))
d = date.addperiod(d, `date.Year 2)
- eq("1972-1-01 00:00:00 +0000", std.bfmt(buf[:], "{D}", d))
+ eq("1972-01-01 00:00:00 +0000", std.bfmt(buf[:], "{D}", d))
d = date.addperiod(d, `date.Day 365)
eq("1972-12-31 00:00:00 +0000", std.bfmt(buf[:], "{D}", d))
@@ -66,7 +66,7 @@ const main = {
for var i = 0; i < 50; i++
d = date.addperiod(d, `date.Day 1)
d = date.addperiod(d, `date.Second 1)
- s = std.fmt("1970-{}-{p=0,w=2} 12:{p=0,w=2}:{p=0,w=2} +0000", \
+ s = std.fmt("1970-{p=0,w=2}-{p=0,w=2} 12:{p=0,w=2}:{p=0,w=2} +0000", \
(i+1)/31 + 1, (i+1)%31+1, (i+13)/60, (i+13)%60)
eq(s, std.bfmt(buf[:], "{D}", d))
std.slfree(s)
diff --git a/lib/date/test/parse.myr b/lib/date/test/parse.myr
index 6bc7347..dc34707 100644
--- a/lib/date/test/parse.myr
+++ b/lib/date/test/parse.myr
@@ -24,7 +24,7 @@ const main = {
match date.parsefmtz("%Y-%m-%d %H:%M:%S %z", "1969-12-31 16:00:00 -0800", "")
| `std.Ok d:
std.assert(d.actual == 0, "got wrong date")
- eq(std.bfmt(buf[:], "{D}", d), "1970-1-01 00:00:00 +0000")
+ eq(std.bfmt(buf[:], "{D}", d), "1970-01-01 00:00:00 +0000")
| `std.Err m:
std.fatal("failed to parse date: {}\n", m)
;;
@@ -37,6 +37,15 @@ const main = {
| `std.Err m:
std.fatal("Failed to parse date: {}", m)
;;
+
+ /*Names*/
+ match date.parsefmt("%a, %d %b %Y %H:%M:%S %z", "Thu, 21 Sep 2017 13:55:05 -0400")
+ | `std.Ok d:
+ std.assert(d.actual == 1506016505 * 1_000_000, "wrong timestamp")
+ eq(std.bfmt(buf[:], "{D}", d), "2017-09-21 13:55:05 -0400")
+ | `std.Err m:
+ std.fatal("Failed to parse date: {}", m)
+ ;;
}
const eq = {actual, expected
diff --git a/lib/fileutil/bld.sub b/lib/fileutil/bld.sub
index 8971630..e54f88d 100644
--- a/lib/fileutil/bld.sub
+++ b/lib/fileutil/bld.sub
@@ -1,6 +1,10 @@
lib fileutil =
walk.myr
homedir.myr
+ tmpdir.myr
+
+ loopcheck+posixy.myr
+ loopcheck+plan9.myr
lib ../sys:sys
lib ../std:std
diff --git a/lib/fileutil/loopcheck+plan9.myr b/lib/fileutil/loopcheck+plan9.myr
new file mode 100644
index 0000000..9b5584b
--- /dev/null
+++ b/lib/fileutil/loopcheck+plan9.myr
@@ -0,0 +1,21 @@
+use std
+
+/* plan 9 can't have directory loops, by construction, so this is nops */
+pkg fileutil =
+ type loopcheck = void
+
+ const mkloopcheck : (cwd : byte[:] -> loopcheck)
+ const freeloopcheck : (l : loopcheck -> void)
+ const looped : (l : loopcheck, p : byte[:] -> bool)
+;;
+
+const mkloopcheck = {cwd
+ -> (void : loopcheck)
+}
+
+const freeloopcheck = {l
+}
+
+const looped = {l, p
+ -> false
+}
diff --git a/lib/fileutil/loopcheck+posixy.myr b/lib/fileutil/loopcheck+posixy.myr
new file mode 100644
index 0000000..784fe3f
--- /dev/null
+++ b/lib/fileutil/loopcheck+posixy.myr
@@ -0,0 +1,65 @@
+use std
+use sys
+
+/* plan 9 can't have directory loops, by construction, so this is nops */
+pkg fileutil =
+ type loopcheck = std.htab((int64, int64), void)#
+
+ const mkloopcheck : (cwd : byte[:] -> loopcheck)
+ const freeloopcheck : (l : loopcheck -> void)
+ const looped : (l : loopcheck, p : byte[:] -> bool)
+;;
+
+const mkloopcheck = {cwd
+ var ht : std.htab((int64, int64), void)#
+ var l
+
+ ht = std.mkht(fidhash, fideq)
+ l = (ht : loopcheck)
+ looped(l, cwd)
+ -> l
+}
+
+const freeloopcheck = {l
+ std.htfree((l : std.htab((int64, int64), void)#))
+}
+
+const looped = {l, p
+ var ht, has
+
+ ht = (l : std.htab((int64, int64), void)#)
+ match fid(p)
+ | `std.Err e:
+ -> false
+ | `std.Ok id:
+ has = std.hthas(ht, id)
+ std.htput(ht, id, void)
+ -> has
+ ;;
+}
+
+const fid = {p
+ var sb
+
+ if sys.stat(p, &sb) != 0
+ -> `std.Err void
+ else
+ -> `std.Ok ((sb.dev : int64), (sb.ino : int64))
+ ;;
+}
+
+const fidhash = {fid
+ var dev, ino
+
+ (dev, ino) = fid
+ -> std.inthash(dev) ^ std.inthash(ino)
+}
+
+const fideq = {a, b
+ var adev, aino
+ var bdev, bino
+
+ (adev, aino) = a
+ (bdev, bino) = b
+ -> adev == bdev && aino == bino
+}
diff --git a/lib/fileutil/tmpdir.myr b/lib/fileutil/tmpdir.myr
new file mode 100644
index 0000000..786a151
--- /dev/null
+++ b/lib/fileutil/tmpdir.myr
@@ -0,0 +1,12 @@
+use std
+
+pkg fileutil =
+ const tmpdir : (-> byte[:])
+;;
+
+const tmpdir = {
+ match std.getenv("TMPDIR")
+ | `std.Some d: -> d
+ | `std.None: -> "/tmp"
+ ;;
+}
diff --git a/lib/fileutil/walk.myr b/lib/fileutil/walk.myr
index 75ed5e2..dbdfb5f 100644
--- a/lib/fileutil/walk.myr
+++ b/lib/fileutil/walk.myr
@@ -1,18 +1,33 @@
use std
+use "loopcheck"
+
pkg fileutil =
type walkiter = struct
dirstk : std.dir#[:]
curdir : byte[:][:]
- iterdir : bool
+ loopck : loopcheck
;;
impl iterable walkiter -> byte[:]
- const bywalk : (dir : std.dir# -> walkiter)
+ const bywalk : (dir : byte[:] -> walkiter)
;;
-const bywalk = {d
- -> [.dirstk = std.sldup([d][:]), .curdir = std.sldup([""][:])]
+const bywalk = {p
+ match std.diropen(p)
+ | `std.Ok d:
+ -> [
+ .dirstk = std.sldup([d][:]),
+ .curdir = std.sldup([std.sldup(p)][:]),
+ .loopck = mkloopcheck(p),
+ ]
+ | `std.Err e:
+ -> [
+ .dirstk = [][:],
+ .curdir = [][:],
+ .loopck = mkloopcheck(p),
+ ]
+ ;;
}
impl iterable walkiter -> byte[:] =
@@ -20,34 +35,38 @@ impl iterable walkiter -> byte[:] =
var cur, p
:nextfile
+ if itp.dirstk.len < 1
+ freeloopcheck(itp.loopck)
+ -> false
+ ;;
cur = itp.dirstk[itp.dirstk.len - 1]
match std.dirread(cur)
| `std.Some ".": goto nextfile
| `std.Some "..": goto nextfile
| `std.Some ent:
p = std.pathcat(itp.curdir[itp.curdir.len - 1], ent)
+ if looped(itp.loopck, p)
+ std.slfree(p)
+ goto nextfile
+ ;;
if std.fisdir(p)
match std.diropen(p)
- | `std.Ok d: std.slpush(&itp.dirstk, d)
+ | `std.Ok d:
+ std.slpush(&itp.dirstk, d)
+ std.slpush(&itp.curdir, p)
| `std.Err e: /* ? */
+ std.slfree(p)
;;
- std.slpush(&itp.curdir, p)
goto nextfile
- else
- valp# = p
;;
+ valp# = p
-> true
| `std.None:
- /* don't close the directory given to us by the user */
- if itp.dirstk.len > 1
- std.dirclose(itp.dirstk[itp.dirstk.len - 1])
- std.slfree(itp.curdir[itp.curdir.len - 1])
- std.slpop(&itp.curdir)
- std.slpop(&itp.dirstk)
- goto nextfile
- else
- -> false
- ;;
+ std.dirclose(cur)
+ std.slfree(itp.curdir[itp.curdir.len - 1])
+ std.slpop(&itp.curdir)
+ std.slpop(&itp.dirstk)
+ goto nextfile
;;
}
diff --git a/lib/http/bld.sub b/lib/http/bld.sub
new file mode 100644
index 0000000..0c4834b
--- /dev/null
+++ b/lib/http/bld.sub
@@ -0,0 +1,34 @@
+bin h {noinst}=
+ h.myr
+
+ lib http
+ lib ../sys:sys
+ lib ../std:std
+ lib ../bio:bio
+ lib ../thread:thread
+;;
+
+bin srvdot {noinst}=
+ srvdot.myr
+
+ lib http
+ lib ../sys:sys
+ lib ../std:std
+ lib ../bio:bio
+ lib ../thread:thread
+;;
+
+lib http =
+ parse.myr
+ types.myr
+ url.myr
+ client.myr
+ server.myr
+ session.myr
+ status.myr
+
+ lib ../sys:sys
+ lib ../std:std
+ lib ../bio:bio
+ lib ../thread:thread
+;;
diff --git a/lib/http/client.myr b/lib/http/client.myr
new file mode 100644
index 0000000..770c233
--- /dev/null
+++ b/lib/http/client.myr
@@ -0,0 +1,276 @@
+use std
+use bio
+
+use "types"
+use "session"
+use "parse"
+
+pkg http =
+ /* simple versions */
+ const get : (s : session#, r : url# -> std.result(resp#, err))
+ const head : (s : session#, r : url# -> std.result(resp#, err))
+ const put : (s : session#, r : url#, data : byte[:] -> std.result(resp#, err))
+ const post : (s : session#, r : url#, data : byte[:] -> std.result(resp#, err))
+ const delete : (s : session#, r : url# -> std.result(resp#, err))
+ const options : (s : session#, r : url# -> std.result(resp#, err))
+ const trace : (s : session#, r : url# -> std.result(resp#, err))
+
+ /* request based versions */
+ const getreq : (s : session#, r : req# -> std.result(resp#, err))
+ const headreq : (s : session#, r : req# -> std.result(resp#, err))
+ const putreq : (s : session#, r : req#, data : byte[:] -> std.result(resp#, err))
+ const postreq : (s : session#, r : req#, data : byte[:] -> std.result(resp#, err))
+ const deletereq : (s : session#, r : req# -> std.result(resp#, err))
+ const optionsreq : (s : session#, r : req# -> std.result(resp#, err))
+ const tracereq : (s : session#, r : req# -> std.result(resp#, err))
+
+ const freeresp : (r : resp# -> void)
+;;
+
+const get = {s, path; -> getreq(s, &[.url=path])}
+const head = {s, path; -> headreq(s, &[.url=path])}
+const put = {s, path, data; -> putreq(s, &[.url=path], data)}
+const post = {s, path, data; -> postreq(s, &[.url=path], data)}
+const delete = {s, path; -> deletereq(s, &[.url=path])}
+const options = {s, path; -> optionsreq(s, &[.url=path])}
+const trace = {s, path; -> tracereq(s, &[.url=path])}
+
+
+const getreq = {s, r
+ match request(s, `Get, r, `std.None)
+ | `std.Ok _: /* nothing */
+ | `std.Err e: -> `std.Err e
+ ;;
+
+ -> response(s, true)
+}
+
+const headreq = {s, r
+ match request(s, `Head, r, `std.None)
+ | `std.Ok _: /* nothing */
+ | `std.Err e: -> `std.Err e
+ ;;
+
+ -> response(s, false)
+}
+
+const putreq = {s, r, data
+ match request(s, `Put, r, `std.Some data)
+ | `std.Ok _: /* nothing */
+ | `std.Err e: -> `std.Err e
+ ;;
+
+ -> response(s, true)
+}
+
+const postreq = {s, r, data
+ match request(s, `Post, r, `std.Some data)
+ | `std.Ok _: /* nothing */
+ | `std.Err e: -> `std.Err e
+ ;;
+
+ -> response(s, true)
+}
+
+const deletereq = {s, r
+ match request(s, `Delete, r, `std.None)
+ | `std.Ok _: /* nothing */
+ | `std.Err e: -> `std.Err e
+ ;;
+
+ -> response(s, true)
+}
+
+const optionsreq = {s, r
+ match request(s, `Options, r, `std.None)
+ | `std.Ok _: /* nothing */
+ | `std.Err e: -> `std.Err e
+ ;;
+
+ -> response(s, true)
+}
+
+const tracereq = {s, r
+ match request(s, `Trace, r, `std.None)
+ | `std.Ok _: /* nothing */
+ | `std.Err e: -> `std.Err e
+ ;;
+
+ -> response(s, true)
+}
+
+const response = {s, body
+ var resp
+
+ resp = std.mk([
+ .hdrs = [][:],
+ .len = 0,
+ .err = `std.None,
+ .reason = "",
+ .status = 0,
+ .enc = `Length,
+ ])
+
+ if parseresp(s, resp)
+ if !body
+ -> `std.Ok resp
+ else
+ match readbody(s, resp)
+ | `std.Ok buf: resp.body = buf
+ | `std.Err e: -> `std.Err e
+ ;;
+ ;;
+ else
+ match resp.err
+ | `std.Some e: -> `std.Err e
+ | `std.None: -> `std.Err `Ewat
+ ;;
+ ;;
+ -> `std.Ok resp
+}
+
+const request = {s, method, r, data
+ /* status */
+ ioput(s, "{} {p} HTTP/1.1\r\n", method, r.url)
+
+ /* headers */
+ ioput(s, "Host: {}\r\n", s.host)
+ ioput(s, "User-Agent: {}\r\n", s.ua)
+ match data
+ | `std.Some d: ioput(s, "Content-Length: {}\r\n", d.len)
+ | `std.None: /* nothing to do */
+ ;;
+ for (k, v) : r.hdrs
+ ioput(s, "{}: {}\r\n", k, v)
+ ;;
+ ioput(s, "\r\n")
+
+ /* body */
+ match data
+ | `std.None: /* nothing to do */
+ | `std.Some d:
+ iowrite(s, d)
+ ioput(s, "\r\n")
+ ;;
+ ioflush(s)
+
+ if s.err
+ -> `std.Err `Econn
+ else
+ -> `std.Ok void
+ ;;
+
+}
+
+const readbody = {s, r -> std.result(byte[:], err)
+ match r.enc
+ | `Length: -> readlenbody(s, r)
+ | `Chunked: -> readchunkedbody(s, r)
+ | badenc: std.fatal("unsupported encoding {}\n", badenc)
+ ;;
+}
+
+const readlenbody = {s, r
+ var buf
+
+ buf = ""
+ if r.len == 0
+ -> `std.Ok buf
+ ;;
+
+ buf = std.slalloc(r.len)
+ match bio.read(s.f, buf)
+ | `std.Err e: goto shortread
+ | `std.Ok rd:
+ if rd.len != r.len
+ goto shortread
+ ;;
+ ;;
+ -> `std.Ok buf
+:shortread
+ std.slfree(buf)
+ -> `std.Err `Eshort
+}
+
+const __init__ = {
+ var m
+
+ m = `Get
+ std.fmtinstall(std.typeof(m), fmtmethod, [][:])
+}
+
+const readchunkedbody = {s, r
+ var buf, len
+
+ buf = ""
+ len = 0
+ while true
+ match parsechunksz(s)
+ | `std.Err e:
+ std.slfree(buf)
+ -> `std.Err e
+ | `std.Ok 0:
+ break
+ | `std.Ok sz:
+ std.slgrow(&buf, buf.len + sz)
+ match bio.read(s.f, buf[len:len + sz])
+ | `std.Err e:
+ std.slfree(buf)
+ -> `std.Err `Econn
+ | `std.Ok str:
+ if str.len != sz
+ std.slfree(buf)
+ -> `std.Err `Eshort
+ ;;
+ len += sz
+ match checkendln(s)
+ | `std.Ok _: /* nothing */
+ | `std.Err e:
+ std.slfree(buf)
+ -> `std.Err e
+ ;;
+ ;;
+ ;;
+ ;;
+ -> `std.Ok buf
+}
+
+const checkendln = {s
+ var r
+
+ match bio.readln(s.f)
+ | `std.Err e: r = `std.Err `Econn
+ | `std.Ok crlf:
+ if std.strstrip(crlf).len == 0
+ r = `std.Ok void
+ else
+ r = `std.Err `Eproto
+ ;;
+ std.slfree(crlf)
+ ;;
+ -> r
+}
+
+const fmtmethod = {sb, ap, opt
+ var r
+
+ r = std.vanext(ap)
+ match r
+ | `Get: std.sbputs(sb, "GET")
+ | `Head: std.sbputs(sb, "HEAD")
+ | `Put: std.sbputs(sb, "PUT")
+ | `Post: std.sbputs(sb, "POST")
+ | `Delete: std.sbputs(sb, "DELETE")
+ | `Trace: std.sbputs(sb, "TRACE")
+ | `Options: std.sbputs(sb, "OPTIONS")
+ ;;
+}
+
+const freeresp = {r
+ for (k, v) : r.hdrs
+ std.slfree(k)
+ std.slfree(v)
+ ;;
+ std.slfree(r.reason)
+ std.free(r)
+}
diff --git a/lib/http/h.myr b/lib/http/h.myr
new file mode 100644
index 0000000..9a00e2e
--- /dev/null
+++ b/lib/http/h.myr
@@ -0,0 +1,90 @@
+use std
+use http
+
+const main = {args
+ var data, method, showhdr, hdrs, out
+ var s, u, r
+ var cmd
+
+ cmd = std.optparse(args, &[
+ .argdesc = "url...",
+ .minargs = 1,
+ .opts = [
+ [.opt='m', .arg="method", .desc="http method to use"],
+ [.opt='d', .arg="data", .desc="data to put in request body"],
+ [.opt='o', .arg="out", .desc="output file name"],
+ [.opt='H', .desc="show headers"],
+ [.opt='D', .arg="hdr", .desc="define custom header"]
+ ][:]
+ ])
+
+ showhdr = false
+ method = "get"
+ data = ""
+ hdrs = [][:]
+ out = ""
+ for opt : cmd.opts
+ match opt
+ | ('m', m): method = m
+ | ('d', d): data = d
+ | ('o', o): out = o
+ | ('H', ""): showhdr = true
+ | ('D', def): parsedef(&hdrs, def)
+ | _: std.die("unreachable")
+ ;;
+ ;;
+
+ for url : cmd.args
+ if !std.hasprefix(url, "http")
+ url = std.fmt("http://{}", url)
+ ;;
+ u = std.try(http.parseurl(url))
+ s = std.try(http.mksession(u.schema, u.host, u.port))
+
+ match method
+ | "get": r = http.getreq(s, &[.url=u, .hdrs=hdrs])
+ | "head": r = http.headreq(s, &[.url=u, .hdrs=hdrs])
+ | "delete": r = http.deletereq(s, &[.url=u, .hdrs=hdrs])
+ | "trace": r = http.tracereq(s, &[.url=u, .hdrs=hdrs])
+ | "options": r = http.optionsreq(s, &[.url=u, .hdrs=hdrs])
+ | "put": r = http.putreq(s, &[.url=u, .hdrs=hdrs], data)
+ | "post": r = http.postreq(s, &[.url=u, .hdrs=hdrs], data)
+ | unknown: std.fatal("unknown method '{}'\n", unknown)
+ ;;
+
+ match r
+ | `std.Ok resp:
+ if showhdr
+ std.put("status: {}\n", resp.status)
+ for (k, v) : resp.hdrs
+ std.put("{}: {}\n", k, v)
+ ;;
+ ;;
+ if out.len != 0
+ if !std.blat(out, resp.body, 0o644)
+ std.fatal("could not write output: {}\n", out)
+ ;;
+ else
+ std.fblat(std.Out, resp.body)
+ ;;
+ http.freeresp(resp)
+ | `std.Err e:
+ std.put("{}\n", e)
+ ;;
+ http.urlfree(u)
+ ;;
+}
+
+const parsedef = {hdrs, hdr
+ var key, val
+
+ match std.strfind(hdr, ":")
+ | `std.None:
+ std.fatal("bad header string {}\n", hdr)
+ | `std.Some idx:
+ key = std.sldup(std.strstrip(hdr[:idx]))
+ val = std.sldup(std.strstrip(hdr[idx+1:]))
+ std.slpush(hdrs, (key, val))
+ ;;
+}
+
diff --git a/lib/http/parse.myr b/lib/http/parse.myr
new file mode 100644
index 0000000..fabf7a2
--- /dev/null
+++ b/lib/http/parse.myr
@@ -0,0 +1,278 @@
+use std
+use bio
+
+use "types"
+
+pkg http =
+ pkglocal const parsereq : (s : session# -> std.result(req#, err))
+ pkglocal const parseresp : (s : session#, r : resp# -> bool)
+ pkglocal const parsechunksz : (s : session# -> std.result(std.size, err))
+ pkglocal const parsenumber : (str : byte[:]#, base : int -> std.option(int))
+;;
+
+const parsereq = {s
+ var r, err
+
+ r.hdrs = [][:]
+ r.url = std.mk([
+ .schema=`Http,
+ .host=std.sldup(s.host),
+ .port=s.port,
+ .path="",
+ .params=[][:],
+ ])
+
+ match bio.readln(s.f)
+ | `std.Err e:
+ err = `Econn
+ goto error
+ | `std.Ok ln:
+ match parsereqstatus(s, r, ln)
+ | `std.Ok void:
+ | `std.Err e:
+ std.slfree(ln)
+ err = e
+ -> `std.Err e
+ ;;
+ std.slfree(ln)
+ ;;
+
+ while true
+ match bio.readln(s.f)
+ | `std.Err e:
+ err = `Econn
+ goto error
+ | `std.Ok ln:
+ if std.strstrip(ln).len == 0
+ std.slfree(ln)
+ break
+ ;;
+ match parsehdr(s, ln)
+ | `std.Ok kvp:
+ std.slpush(&r.hdrs, kvp)
+ | `std.Err e:
+ std.slfree(ln)
+ -> `std.Err e
+ ;;
+ std.slfree(ln)
+ ;;
+ ;;
+ -> `std.Ok std.mk(r)
+:error
+ -> `std.Err err
+}
+
+const parseresp = {s, r : resp#
+ match bio.readln(s.f)
+ | `std.Err _: r.err = `std.Some `Econn
+ | `std.Ok ln:
+ if !parserespstatus(s, r, ln)
+ std.slfree(ln)
+ -> false
+ ;;
+ std.slfree(ln)
+ ;;
+
+ while true
+ match bio.readln(s.f)
+ | `std.Err e: r.err = `std.Some `Econn
+ | `std.Ok ln:
+ if std.strstrip(ln).len == 0
+ std.slfree(ln)
+ break
+ ;;
+ match parsehdr(s, ln)
+ | `std.Ok kvp:
+ std.slpush(&r.hdrs, kvp)
+ | `std.Err e:
+ r.err = `std.Some e
+ std.slfree(ln)
+ -> false
+ ;;
+ std.slfree(ln)
+ ;;
+ ;;
+
+ match getenc(r)
+ | `std.Ok `Length:
+ r.enc = `Length
+ match getlen(r)
+ | `std.Some n:
+ r.len = n
+ | `std.None:
+ r.err = `std.Some `Eproto
+ -> false
+ ;;
+ | `std.Ok enc:
+ r.enc = enc
+ | `std.Err e:
+ r.err = `std.Some e
+ -> false
+ ;;
+ -> true
+
+}
+
+const parsereqstatus = {s, r, ln
+ match parseword(&ln)
+ | `std.Some "GET": r.method = `Get
+ | `std.Some "HEAD": r.method = `Head
+ | `std.Some "POST": r.method = `Post
+ | `std.Some "DELETE": r.method = `Delete
+ | `std.Some "TRACE": r.method = `Trace
+ | `std.Some "OPTIONS": r.method = `Options
+ | `std.Some _: -> `std.Err `Eproto
+ | `std.None: -> `std.Err `Eproto
+ ;;
+
+ match parseword(&ln)
+ | `std.Some w: r.url.path = std.sldup(w)
+ | `std.None: -> `std.Err `Eproto
+ ;;
+
+ match parseword(&ln)
+ | `std.Some "HTTP/1.1": /* ok */
+ | `std.Some w: std.put("warn: http version '{}'\n", w)
+ | `std.None: -> `std.Err `Eproto
+ ;;
+
+ ln = std.strfstrip(ln)
+ -> `std.Ok void
+}
+
+const parserespstatus = {s, r, ln
+ /* HTTP/1.1 */
+ ln = std.strfstrip(ln)
+ if !std.chomp(&ln, "HTTP")
+ r.err = `std.Some `Eproto
+ -> false
+ ;;
+ if !std.chomp(&ln, "/1.1")
+ r.err = `std.Some `Eproto
+ -> false
+ ;;
+
+ ln = std.strfstrip(ln)
+ match parsenumber(&ln, 10)
+ | `std.Some n:
+ r.status = n
+ | `std.None:
+ r.err = `std.Some `Eproto
+ -> false
+ ;;
+
+ ln = std.strfstrip(ln)
+ r.reason = std.sldup(ln)
+ -> true
+}
+
+const parsehdr = {s, ln
+ var key, val
+
+ match std.strfind(ln, ":")
+ | `std.Some idx:
+ key = std.sldup(std.strstrip(ln[:idx]))
+ val = std.sldup(std.strstrip(ln[idx+1:]))
+ -> `std.Ok (key, val)
+ | `std.None:
+ -> `std.Err `Ehdr
+ ;;
+}
+
+const getlen = {r
+ match findhdr(r, "Content-Length")
+ | `std.Some v:
+ match std.intparsebase(v, 10)
+ | `std.Some n: -> `std.Some n
+ | `std.None: -> `std.None
+ ;;
+ | `std.None:
+ -> `std.None
+ ;;
+}
+
+const parsechunksz = {s
+ var ret, str
+
+ match bio.readln(s.f)
+ | `std.Err e: ret = `std.Err `Econn
+ | `std.Ok ln:
+ str = ln
+ match parsenumber(&str, 16)
+ | `std.Some n: ret = `std.Ok (n : std.size)
+ | `std.None:
+ ret = `std.Err `Eproto
+ ;;
+ std.slfree(ln)
+ ;;
+ -> ret
+}
+
+const getenc = {r
+ match findhdr(r, "Transfer-Encoding")
+ | `std.None: -> `std.Ok `Length
+ | `std.Some "chunked": -> `std.Ok `Chunked
+ | `std.Some "compress": -> `std.Ok `Compress
+ | `std.Some "deflate": -> `std.Ok `Deflate
+ | `std.Some "gzip": -> `std.Ok `Gzip
+ | `std.Some unknown: -> `std.Err `Eenc
+ ;;
+}
+
+const findhdr = {r, name
+ for (k, v) : r.hdrs
+ if std.strcaseeq(k, name)
+ -> `std.Some v
+ ;;
+ ;;
+ -> `std.None
+}
+
+const parseword = {ln
+ var w, end
+
+ ln# = std.strfstrip(ln#)
+ end = 0
+ for var i = 0; i < ln#.len; i++
+ if i == ln#.len - 1
+ end = i + 1
+ elif std.isspace(std.decode(ln#[i:]))
+ end = i
+ break
+ ;;
+ ;;
+ if end == 0
+ -> `std.None
+ else
+ w = ln#[:end]
+ ln# = ln#[end:]
+ -> `std.Some w
+ ;;
+}
+
+const parsenumber = {ln, base
+ var n, ok
+ var c, s, dig
+
+ n = 0
+ s = ln#
+ ok = false
+ while true
+ (c, s) = std.strstep(s)
+ dig = std.charval(c, base)
+ if dig >= 0 && dig < base
+ ok = true
+ n *= base
+ n += dig
+ else
+ break
+ ;;
+ ;;
+ ln# = s
+ if ok
+ -> `std.Some n
+ else
+ -> `std.None
+ ;;
+}
+
diff --git a/lib/http/server.myr b/lib/http/server.myr
new file mode 100644
index 0000000..0cfdcb0
--- /dev/null
+++ b/lib/http/server.myr
@@ -0,0 +1,100 @@
+use bio
+use std
+use thread
+
+use "types"
+use "session"
+use "parse"
+
+pkg http =
+ const announce : (ds : byte[:] -> std.result(server#, err))
+ const shutdown : (srv : server# -> void)
+ const serve : (srv : server#, fn : (srv : server#, s : session#, req : req# -> void) -> void)
+ const respond : (srv : server#, sess : session#, resp : resp# -> void)
+;;
+
+const announce = {ds
+ match std.announce(ds)
+ | `std.Err e: -> `std.Err `Econn
+ | `std.Ok a:
+ -> `std.Ok std.mk([
+ .refs=1,
+ .ann=a,
+ .quit=false
+ ])
+ ;;
+}
+
+const serve = {srv, fn
+ while !srv.quit
+ match waitconn(srv)
+ | `std.Ok fd:
+ ref(srv)
+ thread.spawn({;communicate(srv, fd, fn)})
+ | `std.Err e: /* eh? */
+ ;;
+ ;;
+ unref(srv)
+}
+
+const communicate = {srv, fd, fn
+ var s
+
+ s = mksrvsession(fd)
+ while !srv.quit
+ match parsereq(s)
+ | `std.Ok req: fn(srv, s, req)
+ | `std.Err e: break
+ ;;
+ ;;
+ std.close(fd)
+ unref(srv)
+}
+
+const respond = {srv, s, resp
+ var sb
+
+ sb = std.mksb()
+ ioput(s, "HTTP/1.1 {} {}\r\n", resp.status, statusstr(resp.status))
+ ioput(s, "Content-Length: {}\r\n", resp.body.len)
+ ioput(s, "Encoding: {}\r\n", resp.enc)
+ for (k, v) : resp.hdrs
+ ioput(s, "{}: {}\r\n", k, v)
+ ;;
+ ioput(s, "\r\n")
+ iowrite(s, resp.body)
+ ioflush(s)
+}
+
+const statusstr = {st
+ match st
+ | 200: -> "OK"
+ | 404: -> "Not Found"
+ | 503: -> "Internal Error"
+ | _: -> "Bad State"
+ ;;
+}
+
+const shutdown = {srv
+ std.aclose(srv.ann)
+ srv.quit = true
+}
+
+const waitconn = {srv
+ match std.accept(srv.ann)
+ | `std.Ok fd: -> `std.Ok fd
+ | `std.Err e: -> `std.Err `Econn
+ ;;
+}
+
+
+const ref = {srv
+ thread.xadd(&srv.refs, 1)
+}
+
+const unref = {srv
+ thread.xadd(&srv.refs, -1)
+ if thread.xget(&srv.refs) == 0
+ std.free(srv)
+ ;;
+}
diff --git a/lib/http/session.myr b/lib/http/session.myr
new file mode 100644
index 0000000..4091165
--- /dev/null
+++ b/lib/http/session.myr
@@ -0,0 +1,80 @@
+use std
+use bio
+
+use "types"
+
+pkg http =
+ const mksession : (schema : schema, host : byte[:], port : uint16 -> std.result(session#, err))
+ const mksrvsession : (fd : std.fd -> session#)
+ const freesession : (s : session# -> void)
+
+ pkglocal const ioput : (s : session#, fmt : byte[:], args : ... -> bool)
+ pkglocal const iowrite : (s : session#, buf : byte[:] -> bool)
+ pkglocal const ioflush : (s : session# -> void)
+;;
+
+const mksession = {schema, host, port
+ var s, sess
+
+ match schema
+ | `Http: /* nothing */
+ | `Https: std.fatal("unsupported protocol\n")
+ ;;
+
+ s = std.fmt("tcp!{}!{}", host, port)
+ match std.dial(s)
+ | `std.Err e: sess = `std.Err `Econn
+ | `std.Ok fd: sess = `std.Ok std.mk([
+ .err = false,
+ .ua = std.sldup("Myrfoo HTTP"),
+ .host = std.sldup(host),
+ .f = bio.mkfile(fd, bio.Rw)
+ ])
+ ;;
+ std.slfree(s)
+ -> sess
+}
+
+const mksrvsession = {fd
+ -> std.mk([
+ .err = false,
+ .srvname = std.sldup("Myrfoo HTTP Server"),
+ .f = bio.mkfile(fd, bio.Rw),
+ ])
+}
+
+const freesession = {s
+ bio.close(s.f)
+ std.slfree(s.host)
+ std.slfree(s.ua)
+ std.free(s)
+}
+
+const ioput = {s, fmt, args
+ var ap
+
+ if s.err
+ -> false
+ ;;
+ ap = std.vastart(&args)
+ match bio.putv(s.f, fmt, &ap)
+ | `std.Ok _: /* nothing */
+ | `std.Err _: s.err = true
+ ;;
+ -> s.err
+}
+
+const iowrite = {s, buf
+ if s.err
+ -> false
+ ;;
+ match bio.write(s.f, buf)
+ | `std.Ok _: /* nothing */
+ | `std.Err _: s.err = true
+ ;;
+ -> s.err
+}
+
+const ioflush = {s
+ bio.flush(s.f)
+}
diff --git a/lib/http/srvdot.myr b/lib/http/srvdot.myr
new file mode 100644
index 0000000..e6c0a21
--- /dev/null
+++ b/lib/http/srvdot.myr
@@ -0,0 +1,66 @@
+use std
+use http
+
+const main = {args
+ var srv, ann, cmd
+
+ cmd = std.optparse(args, &[
+ .maxargs=0,
+ .opts = [[.opt='a', .arg="ann", .desc="announce on `ann`"]][:]
+ ])
+ ann = "tcp!localhost!8080"
+ for opt : cmd.opts
+ match opt
+ | ('a', a): ann = a
+ | _: std.die("unreachable")
+ ;;
+ ;;
+
+ match http.announce(ann)
+ | `std.Ok s: srv = s
+ | `std.Err e: std.fatal("unable to announce: {}\n", e)
+ ;;
+
+ http.serve(srv, route)
+}
+
+const route = {srv, sess, req
+ std.put("Reading path {}\n", req.url.path)
+ match req.url.path
+ | "/ping": respond(srv, sess, 200, "pong")
+ | "/quit": http.shutdown(srv)
+ | fspath: showfile(srv, sess, req.url.path)
+ ;;
+}
+
+const showfile = {srv, sess, path
+ var eb : byte[128]
+ var p
+
+ p = std.pathcat(".", path)
+ match std.slurp(p)
+ | `std.Ok buf:
+ respond(srv, sess, 200, buf)
+ std.slfree(buf)
+ | `std.Err e:
+ respond(srv, sess, 404, std.bfmt(eb[:], "error reading {}: {}\n", p, e))
+ ;;
+ std.slfree(p)
+}
+
+
+const respond = {srv, sess, status, body
+ var resp
+
+ resp = std.mk([
+ .status=status,
+ .hdrs = [][:],
+ .len = 0,
+ .err = `std.None,
+ .reason = "",
+ .body = body,
+ .enc = `http.Length
+ ])
+ http.respond(srv, sess, resp)
+ std.free(resp)
+}
diff --git a/lib/http/status.myr b/lib/http/status.myr
new file mode 100644
index 0000000..df247be
--- /dev/null
+++ b/lib/http/status.myr
@@ -0,0 +1,67 @@
+use "types"
+
+pkg http =
+ const Continue : status = 100 /* RFC 7231, 6.2.1*/
+ const SwitchingProtocols : status = 101 /* RFC 7231, 6.2.2*/
+ const Processing : status = 102 /* RFC 2518, 10.1*/
+
+ const Ok : status = 200 /* RFC 7231, 6.3.1*/
+ const Created : status = 201 /* RFC 7231, 6.3.2*/
+ const Accepted : status = 202 /* RFC 7231, 6.3.3*/
+ const NonAuthoritativeInfo : status = 203 /* RFC 7231, 6.3.4*/
+ const NoContent : status = 204 /* RFC 7231, 6.3.5*/
+ const ResetContent : status = 205 /* RFC 7231, 6.3.6*/
+ const PartialContent : status = 206 /* RFC 7233, 4.1*/
+ const Multi : status = 207 /* RFC 4918, 11.1*/
+ const AlreadyReported : status = 208 /* RFC 5842, 7.1*/
+ const IMUsed : status = 226 /* RFC 3229, 10.4.1*/
+
+ const MultipleChoices : status = 300 /* RFC 7231, 6.4.1*/
+ const MovedPermanently : status = 301 /* RFC 7231, 6.4.2*/
+ const Found : status = 302 /* RFC 7231, 6.4.3*/
+ const SeeOther : status = 303 /* RFC 7231, 6.4.4*/
+ const NotModified : status = 304 /* RFC 7232, 4.1*/
+ const UseProxy : status = 305 /* RFC 7231, 6.4.5*/
+ const TemporaryRedirect : status = 307 /* RFC 7231, 6.4.7*/
+ const PermanentRedirect : status = 308 /* RFC 7538, 3*/
+
+ const BadRequest : status = 400 /* RFC 7231, 6.5.1*/
+ const Unauthorized : status = 401 /* RFC 7235, 3.1*/
+ const PaymentRequired : status = 402 /* RFC 7231, 6.5.2*/
+ const Forbidden : status = 403 /* RFC 7231, 6.5.3*/
+ const NotFound : status = 404 /* RFC 7231, 6.5.4*/
+ const MethodNotAllowed : status = 405 /* RFC 7231, 6.5.5*/
+ const NotAcceptable : status = 406 /* RFC 7231, 6.5.6*/
+ const ProxyAuthRequired : status = 407 /* RFC 7235, 3.2*/
+ const RequestTimeout : status = 408 /* RFC 7231, 6.5.7*/
+ const Conflict : status = 409 /* RFC 7231, 6.5.8*/
+ const Gone : status = 410 /* RFC 7231, 6.5.9*/
+ const LengthRequired : status = 411 /* RFC 7231, 6.5.10*/
+ const PreconditionFailed : status = 412 /* RFC 7232, 4.2*/
+ const RequestEntityTooLarge : status = 413 /* RFC 7231, 6.5.11*/
+ const RequestURITooLong : status = 414 /* RFC 7231, 6.5.12*/
+ const UnsupportedMediaType : status = 415 /* RFC 7231, 6.5.13*/
+ const RangeNotSatisfiable : status = 416 /* RFC 7233, 4.4*/
+ const ExpectationFailed : status = 417 /* RFC 7231, 6.5.14*/
+ const Teapot : status = 418 /* RFC 7168, 2.3.3*/
+ const UnprocessableEntity : status = 422 /* RFC 4918, 11.2*/
+ const Locked : status = 423 /* RFC 4918, 11.3*/
+ const FailedDependency : status = 424 /* RFC 4918, 11.4*/
+ const UpgradeRequired : status = 426 /* RFC 7231, 6.5.15*/
+ const PreconditionRequired : status = 428 /* RFC 6585, 3*/
+ const TooManyRequests : status = 429 /* RFC 6585, 4*/
+ const HeaderFieldsTooLarge : status = 431 /* RFC 6585, 5*/
+ const UnavailableForLegal : status = 451 /* RFC 7725, 3*/
+
+ const InternalServerError : status = 500 /* RFC 7231, 6.6.1*/
+ const NotImplemented : status = 501 /* RFC 7231, 6.6.2*/
+ const BadGateway : status = 502 /* RFC 7231, 6.6.3*/
+ const ServiceUnavailable : status = 503 /* RFC 7231, 6.6.4*/
+ const GatewayTimeout : status = 504 /* RFC 7231, 6.6.5*/
+ const VersionNotSupported : status = 505 /* RFC 7231, 6.6.6*/
+ const VariantAlsoNegotiates : status = 506 /* RFC 2295, 8.1*/
+ const InsufficientStorage : status = 507 /* RFC 4918, 11.5*/
+ const LoopDetected : status = 508 /* RFC 5842, 7.2*/
+ const NotExtended : status = 510 /* RFC 2774, 7*/
+ const NetworkAuthRequired : status = 511 /* RFC 6585, 6*/
+;;
diff --git a/lib/http/types.myr b/lib/http/types.myr
new file mode 100644
index 0000000..68e2c28
--- /dev/null
+++ b/lib/http/types.myr
@@ -0,0 +1,83 @@
+use std
+use bio
+
+pkg http =
+ type status = int
+
+ type session = struct
+ f : bio.file#
+ host : byte[:]
+ port : uint16
+ srvname : byte[:]
+ ua : byte[:]
+ err : bool
+ ;;
+
+
+ type server = struct
+ ann : std.announce#
+ refs : uint32
+ quit : bool
+ ;;
+
+ type url = struct
+ schema : schema
+ port : uint16
+ host : byte[:]
+ path : byte[:]
+ params : (byte[:], byte[:])[:]
+ ;;
+
+ type err = union
+ `Ehttp int /* http error */
+ `Eunsupp /* unsupported feature */
+ `Econn /* connection lost */
+ `Ehdr /* invalid header */
+ `Eproto /* protocol error */
+ `Eshort /* truncated response */
+ `Egarbled /* syntax error */
+ `Eenc /* encoding error */
+ `Ewat /* unknown error */
+ ;;
+
+ type schema = union
+ `Http
+ `Https
+ ;;
+
+ type method = union
+ `Get
+ `Head
+ `Put
+ `Post
+ `Delete
+ `Trace
+ `Options
+ ;;
+
+ type encoding = union
+ `Length
+ `Chunked
+ `Compress
+ `Deflate
+ `Gzip
+ ;;
+
+ type req = struct
+ url : url#
+ hdrs : (byte[:], byte[:])[:]
+ err : std.option(err)
+ method : method
+ ;;
+
+ type resp = struct
+ status : int
+ hdrs : (byte[:], byte[:])[:]
+ len : std.size
+ err : std.option(err)
+ reason : byte[:]
+ body : byte[:]
+ enc : encoding
+ ;;
+
+;;
diff --git a/lib/http/url.myr b/lib/http/url.myr
new file mode 100644
index 0000000..be17d20
--- /dev/null
+++ b/lib/http/url.myr
@@ -0,0 +1,238 @@
+use std
+
+use "types"
+use "parse"
+
+pkg http =
+ const parseurl : (url : byte[:] -> std.result(url#, err))
+ const urlfree : (url : url# -> void)
+;;
+
+const __init__ = {
+ var u : url#
+
+ u = u
+ std.fmtinstall(std.typeof(u), urlfmt, [
+ ("p", false)
+ ][:])
+}
+
+const urlfmt = {sb, ap, opts
+ var url : url#
+ var defaultport
+ var sep
+ var showhost
+
+ showhost = true
+ url = std.vanext(ap)
+ for o : opts
+ match o
+ | ("p", ""): showhost = false
+ | _: std.fatal("unknown param\n")
+ ;;
+ ;;
+
+ if showhost
+ match url.schema
+ | `Http:
+ std.sbputs(sb, "http://")
+ defaultport = 80
+ | `Https:
+ std.sbputs(sb, "https://")
+ defaultport = 443
+ ;;
+
+ std.sbputs(sb, url.host)
+ if url.port != defaultport
+ std.sbfmt(sb, ":{}", url.port)
+ ;;
+ ;;
+
+ std.sbfmt(sb, url.path)
+
+ if url.params.len > 0
+ sep = '?'
+ for (k, v) : url.params
+ std.sbfmt(sb, "{}{}={}", sep, k, v)
+ sep = '&'
+ ;;
+ ;;
+}
+
+const parseurl = {url
+ var schema, host, port, path, params
+
+ match parseschema(&url)
+ | `std.Ok s: schema = s
+ | `std.Err e: -> `std.Err e
+ ;;
+
+ match parsehostname(&url)
+ | `std.Ok h: host = h
+ | `std.Err e: -> `std.Err e
+ ;;
+
+ match parseport(&url)
+ | `std.Ok p: port = p
+ | `std.Err e: -> `std.Err e
+ ;;
+
+ match parsepath(&url)
+ | `std.Ok p: path = p
+ | `std.Err e: -> `std.Err e
+ ;;
+
+ match parseparams(&url)
+ | `std.Ok p: params = p
+ | `std.Err e: -> `std.Err e
+ ;;
+
+ /* todo: params */
+ -> `std.Ok std.mk([
+ .schema=schema,
+ .host=std.sldup(host),
+ .port=port,
+ .path=std.sldup(path),
+ .params=params,
+ ])
+}
+
+const urlfree = {url
+ std.slfree(url.host)
+ std.slfree(url.path)
+ std.free(url)
+}
+
+const parseschema = {url
+ if std.chomp(url, "http://")
+ -> `std.Ok `Http
+ elif std.chomp(url, "https://")
+ -> `std.Err `Eunsupp
+ else
+ -> `std.Err `Eproto
+ ;;
+}
+
+const parsehostname = {url
+ if std.chomp(url, "[")
+ -> ipv6hostname(url)
+ else
+ -> hostname(url)
+ ;;
+}
+
+const parsepath = {url
+ var len, p
+
+ if url#.len == 0
+ -> `std.Ok "/"
+ elif std.decode(url#) == '?'
+ -> `std.Ok "/"
+ elif std.decode(url#) == '/'
+ match std.strfind(url#, "?")
+ | `std.Some i: len = i
+ | `std.None: len = url#.len
+ ;;
+ p = url#[:len]
+ url# = url#[len:]
+ -> `std.Ok p
+ else
+ -> `std.Err `Egarbled
+ ;;
+}
+
+const parseparams = {url
+ var kvp : byte[:][2]
+ var params
+
+ if url#.len == 0
+ -> `std.Ok [][:]
+ ;;
+
+ match std.decode(url#)
+ | '?': (_, url#) = std.strstep(url#)
+ | _: -> `std.Err `Egarbled
+ ;;
+
+ params = [][:]
+ for sp : std.bysplit(url#, "&")
+ if std.bstrsplit(kvp[:], sp, "=").len != 2
+ -> `std.Err `Egarbled
+ ;;
+ std.slpush(&params, (std.sldup(kvp[0]), std.sldup(kvp[1])))
+ ;;
+
+ -> `std.Ok params
+}
+
+const hostname = {url
+ var len, host
+
+ len = 0
+ for c : std.bychar(url#)
+ match c
+ | ':': break
+ | '/': break
+ | '?': break
+ | chr:
+ if ishostchar(chr)
+ len += std.charlen(chr)
+ else
+ -> `std.Err `Egarbled
+ ;;
+ ;;
+ ;;
+
+ host = url#[:len]
+ url# = url#[len:]
+ -> `std.Ok host
+}
+
+const ipv6hostname = {url -> std.result(byte[:], err)
+ var ip
+
+ match std.strfind(url#, "]")
+ | `std.None: -> `std.Err `Egarbled
+ | `std.Some idx:
+ ip = url#[:idx]
+ url# = url#[idx+1:]
+ match std.ip6parse(url#[:idx])
+ | `std.Some _: -> `std.Ok ip
+ | `std.None: -> `std.Err `Egarbled
+ ;;
+ ;;
+}
+
+const parseport = {url
+ if std.chomp(url, ":")
+ match parsenumber(url, 10)
+ | `std.None: -> `std.Err `Egarbled
+ | `std.Some n:
+ if n > 65535
+ -> `std.Err `Egarbled
+ else
+ -> `std.Ok (n : uint16)
+ ;;
+ ;;
+ else
+ -> `std.Ok 80
+ ;;
+}
+
+const ishostchar = {c
+ if !std.isascii(c)
+ -> false
+ else
+ -> std.isalnum(c) || unreserved(c) || subdelim(c)
+ ;;
+}
+
+const unreserved = {c
+ -> c == '.' || c == '-' || c == '_' || c == '~'
+}
+
+const subdelim = {c
+ -> c == '.' || c == '-' || c == '_' || c == '~' || c == '!' || \
+ c == '$' || c == '&' || c == '\'' || c == '(' || c == ')' || \
+ c == '*' || c == '+' || c == ',' || c == ';' || c == '='
+}
diff --git a/lib/inifile/parse.myr b/lib/inifile/parse.myr
index e2490c2..6b9be91 100644
--- a/lib/inifile/parse.myr
+++ b/lib/inifile/parse.myr
@@ -18,7 +18,7 @@ type parser = struct
;;
const load = {path
- match std.open(path, std.Ordonly)
+ match std.open(path, std.Oread)
| `std.Ok fd: -> loadf(fd)
| `std.Err e: -> `std.Err `Fileerr
;;
@@ -54,13 +54,13 @@ const loadf = {fd
f = bio.mkfile(fd, bio.Rd)
while true
match bio.readln(f)
- | `bio.Eof:
+ | `std.Err `bio.Eof:
break
- | `bio.Ok ln:
+ | `std.Ok ln:
if !parseline(p, ini, ln)
break
;;
- | `bio.Err e:
+ | `std.Err e:
p.err = `std.Some `Fileerr
break
;;
diff --git a/lib/inifile/write.myr b/lib/inifile/write.myr
index 1c7071d..ab4042c 100644
--- a/lib/inifile/write.myr
+++ b/lib/inifile/write.myr
@@ -53,7 +53,7 @@ const writeini = {f, ini
val = std.htgetv(ini.elts, (sect, key), "")
match bio.put(f, "\t{} = {}\n", key, val)
- | `bio.Err e: -> false
+ | `std.Err e: -> false
| _:
;;
;;
diff --git a/lib/regex/interp.myr b/lib/regex/interp.myr
index c7e8514..3856c57 100644
--- a/lib/regex/interp.myr
+++ b/lib/regex/interp.myr
@@ -127,7 +127,7 @@ const sbsuball = {sb, re, str, subst
std.sbputb(sb, str[i])
i++
else
- len = thr.mend[0]
+ len = thr.mgroup[0][1]
s = str[i:len + i]
dosubst(sb, re, thr, s, subst)
i += len
@@ -142,10 +142,10 @@ const dosubst = {sb, re, thr, str, subst
off = 0
for var i = 1; i < re.nmatch; i++
- if thr.mstart[i] != -1 && thr.mend[i] != -1
- std.sbputs(sb, str[off:thr.mstart[i]])
+ if thr.mgroup[i][0] != -1 && thr.mgroup[i][1] != -1
+ std.sbputs(sb, str[off:thr.mgroup[i][0]])
std.sbputs(sb, subst[i - 1])
- off = thr.mend[i]
+ off = thr.mgroup[i][1]
;;
;;
std.sbputs(sb, str[off:])
@@ -164,7 +164,10 @@ const cleanup = {re
next = thr.next
thrfree(re, thr)
;;
+ re.runq = Zthr
+ re.expired = Zthr
re.nexttid = 0
+ re.nthr = 0
}
const matchfree = {m
@@ -179,8 +182,8 @@ const getmatches = {re, thr
;;
ret = std.slalloc(re.nmatch)
for var i = 0; i < re.nmatch; i++
- if thr.mstart[i] != -1 && thr.mend[i] != -1
- ret[i] = re.str[thr.mstart[i]:thr.mend[i]]
+ if thr.mgroup[i][0] != -1 && thr.mgroup[i][1] != -1
+ ret[i] = re.str[thr.mgroup[i][0]:thr.mgroup[i][1]]
else
ret[i] = [][:]
;;
@@ -197,8 +200,8 @@ const getidxmatches = {re, thr
;;
ret = std.slalloc(re.nmatch)
for var i = 0; i < re.nmatch; i++
- if thr.mstart[i] != -1 && thr.mend[i] != -1
- ret[i] = (thr.mstart[i], thr.mend[i])
+ if thr.mgroup[i][0] != -1 && thr.mgroup[i][1] != -1
+ ret[i] = (thr.mgroup[i][0], thr.mgroup[i][1])
else
ret[i] = (-1, -1)
;;
@@ -230,11 +233,10 @@ const run = {re, str, idx, wholestr
re.traces = [][:]
std.slpush(&re.traces, std.mkbs())
;;
- re.runq.mstart = std.slalloc(re.nmatch)
- re.runq.mend = std.slalloc(re.nmatch)
+ re.runq.mgroup = std.slalloc(re.nmatch)
for var i = 0; i < re.nmatch; i++
- re.runq.mstart[i] = -1
- re.runq.mend[i] = -1
+ re.runq.mgroup[i][0] = -1
+ re.runq.mgroup[i][1] = -1
;;
while re.nthr > 0
while re.runq != Zthr
@@ -299,8 +301,7 @@ const run = {re, str, idx, wholestr
*/
const step = {re, thr, curip
var str
- var mstart
- var mend
+ var mgroup
str = re.str
match re.prog[thr.ip]
@@ -372,22 +373,21 @@ const step = {re, thr, curip
| `Ilbra m:
trace(re, thr, "\t{}:\tLbra {}\n", thr.ip, m)
trace(re, thr, "\t\tmatch start = {}\n", re.strp)
- thr.mstart[m] = re.strp
+ thr.mgroup[m][0] = re.strp
hit(re, thr)
thr.ip++
-> false
| `Irbra m:
trace(re, thr, "\t{}:\tRbra {}\n", thr.ip, m)
- thr.mend[m] = re.strp
+ thr.mgroup[m][1] = re.strp
hit(re, thr)
thr.ip++
-> false
| `Ifork (lip, rip):
trace(re, thr, "\t{}:\tFork ({}, {})\n", thr.ip, lip, rip)
- mstart = std.sldup(thr.mstart)
- mend = std.sldup(thr.mend)
+ mgroup = std.sldup(thr.mgroup)
hit(re, thr)
- fork(re, rip, curip, mstart, mend)
+ fork(re, rip, curip, mgroup)
if re.debug
std.slpush(&re.traces, std.bsdup(re.traces[thr.tid]))
;;
@@ -407,7 +407,7 @@ const step = {re, thr, curip
-> true
}
-const fork = {re, ip, curip, mstart, mend
+const fork = {re, ip, curip, mgroup
var thr
if ip == curip /* loop detection */
@@ -415,8 +415,7 @@ const fork = {re, ip, curip, mstart, mend
;;
thr = mkthread(re, ip)
thr.next = re.runq
- thr.mstart = mstart
- thr.mend = mend
+ thr.mgroup = mgroup
re.runq = thr
}
@@ -455,8 +454,7 @@ const mkthread = {re, ip
thr.dead = false
thr.matched = false
- thr.mstart = [][:]
- thr.mend = [][:]
+ thr.mgroup = [][:]
re.nthr++
@@ -465,8 +463,7 @@ const mkthread = {re, ip
const thrfree = {re, thr
trace(re, thr, "\t\tcleanup {}\n", thr.tid)
- std.slfree(thr.mstart)
- std.slfree(thr.mend)
+ std.slfree(thr.mgroup)
std.free(thr)
}
diff --git a/lib/regex/myr-regex.3 b/lib/regex/myr-regex.3
index 6e8f018..46bb998 100644
--- a/lib/regex/myr-regex.3
+++ b/lib/regex/myr-regex.3
@@ -167,17 +167,18 @@ Space separator unicode property
use regex
const main = {
- match regex.compile(pat)
var i
- | `std.Success re:
+
+ match regex.compile(pat)
+ | `std.Ok re:
match regex.exec(re, text)
| `std.Some matches:
for i = 0; i < matches.len; i++
- std.put("Match %i: %s\n", i, match[i])
+ std.put("Match {}: {}\n", i, matches[i])
;;
| `std.None: std.put("Text did not match\n")
;;
- | `std.Failure err:
+ | `std.Err err:
std.put("failed to compile regex")
;;
}
diff --git a/lib/regex/redump.myr b/lib/regex/redump.myr
index e47b824..2cbb4ad 100644
--- a/lib/regex/redump.myr
+++ b/lib/regex/redump.myr
@@ -57,12 +57,12 @@ const runall = {re, files
const dump = {re, fd
while true
match bio.readln(fd)
- | `bio.Ok ln:
+ | `std.Ok ln:
show(re, ln, regex.exec(re, ln))
std.slfree(ln)
- | `bio.Eof:
+ | `std.Err `bio.Eof:
break
- | `bio.Err e:
+ | `std.Err e:
std.put("error reading from input: {}", e)
break
;;
diff --git a/lib/regex/types.myr b/lib/regex/types.myr
index 766105b..c21d474 100644
--- a/lib/regex/types.myr
+++ b/lib/regex/types.myr
@@ -68,8 +68,7 @@ pkg regex =
dead : bool /* thread died */
matched : bool /* thread matched */
- mstart : std.size[:] /* match starts */
- mend : std.size[:] /* match ends */
+ mgroup : std.size[2][:] /* match starts */
;;
pkglocal type reinst = union
diff --git a/lib/std/bigint.myr b/lib/std/bigint.myr
index 45170dd..129890c 100644
--- a/lib/std/bigint.myr
+++ b/lib/std/bigint.myr
@@ -28,6 +28,7 @@ pkg std =
const bigdup : (a : bigint# -> bigint#)
const bigassign : (d : bigint#, s : bigint# -> bigint#)
const bigmove : (d : bigint#, s : bigint# -> bigint#)
+ const bigsteal : (d : bigint#, s : bigint# -> bigint#)
const bigparse : (s : byte[:] -> option(bigint#))
const bigclear : (a : bigint# -> bigint#)
const bigbfmt : (b : byte[:], a : bigint#, base : int -> size)
@@ -162,6 +163,12 @@ const bigmove = {d, s
-> d
}
+const bigsteal = {d, s
+ bigmove(d, s);
+ bigfree(s)
+ -> d
+}
+
const bigclear = {v
std.slfree(v.dig)
v.sign = 0
@@ -547,7 +554,7 @@ const bigdiv = {a : bigint#, b : bigint# -> bigint#
(q, r) = bigdivmod(a, b)
bigfree(r)
- -> bigmove(a, q)
+ -> bigsteal(a, q)
}
const bigmod = {a : bigint#, b : bigint# -> bigint#
@@ -555,7 +562,7 @@ const bigmod = {a : bigint#, b : bigint# -> bigint#
(q, r) = bigdivmod(a, b)
bigfree(q)
- -> bigmove(a, r)
+ -> bigsteal(a, r)
}
/* a /= b */
@@ -665,6 +672,7 @@ const bigdivmod = {a : bigint#, b : bigint# -> (bigint#, bigint#)
/* undo the biasing for remainder */
bigshri(u, shift)
trim(q)
+ bigfree(v)
-> (trim(q), trim(u))
}
@@ -698,7 +706,7 @@ const bigmodpow = {base, exp, mod
bigmul(base, base)
bigmod(base, mod)
;;
- -> bigmove(base, r)
+ -> bigsteal(base, r)
}
/* returns the number of leading zeros */
diff --git a/lib/std/bitset.myr b/lib/std/bitset.myr
index b173d87..afc66b4 100644
--- a/lib/std/bitset.myr
+++ b/lib/std/bitset.myr
@@ -30,7 +30,7 @@ pkg std =
const bsunion : (a : bitset#, b : bitset# -> void)
const bseq : (a : bitset#, b : bitset# -> bool)
const bsissubset : (a : bitset#, b : bitset# -> bool)
- const bshash : (a : bitset# -> uint32)
+ const bshash : (a : bitset# -> uint64)
type bsiter = struct
idx : size
diff --git a/lib/std/blat.myr b/lib/std/blat.myr
index c0e2b4b..f68f089 100644
--- a/lib/std/blat.myr
+++ b/lib/std/blat.myr
@@ -7,7 +7,7 @@ pkg std =
;;
const blat = {path, buf, perm
- match openmode(path, Ocreat|Owronly, perm)
+ match openmode(path, Ocreat|Owrite, perm)
| `Ok fd: -> fblat(fd, buf)
| `Err e: -> false
;;
diff --git a/lib/std/bld.sub b/lib/std/bld.sub
index b8ce9bc..a834dbb 100644
--- a/lib/std/bld.sub
+++ b/lib/std/bld.sub
@@ -108,6 +108,7 @@ lib std {inc=.} =
env+posixy.myr
errno+plan9.myr
listen+posixy.myr
+ listen+plan9.myr
resolve+plan9.myr
resolve+posixy.myr
wait+plan9.myr
diff --git a/lib/std/bytealloc.myr b/lib/std/bytealloc.myr
index 51c0a34..9b48acc 100644
--- a/lib/std/bytealloc.myr
+++ b/lib/std/bytealloc.myr
@@ -28,7 +28,7 @@ pkg std =
const Zslab = (0 : slab#)
const Zchunk = (0 : chunk#)
-const Slabsz = 4*MiB
+const Slabsz = 512*KiB
const Cachemax = 4
const Bktmax = 128*KiB /* a balance between wasted space and falling back to mmap */
const Pagesz = 4*KiB
@@ -71,7 +71,7 @@ const __init__ = {
}
const startalloctrace = {path
- match openmode(path, Owronly | Ocreat, 0o644)
+ match openmode(path, Owrite | Ocreat, 0o644)
| `Ok fd: tracefd = fd
| `Err e: -> void
;;
@@ -92,7 +92,7 @@ const zbytealloc = {sz
}
const tracealloc = {p, sz
- var stk : void#[13] /* [type, addr, sz, 10 stack slots] */
+ var stk : void#[23] /* [type, addr, sz, 10 stack slots] */
slfill(stk[:], (0 : void#))
stk[0] = (0 : void#)
@@ -123,6 +123,7 @@ const writealloctrace = {sl
const bytealloc = {sz
var bkt, p
+ sz += 8
if sz <= Bktmax
bkt = &buckets[bktnum(sz)]
lock(memlck)
@@ -142,7 +143,12 @@ const bytealloc = {sz
/* frees a blob that is 'sz' bytes long. */
const bytefree = {p, sz
var bkt
+ var v
+ if p == (0 : byte#)
+ -> void
+ ;;
+ v = ((p : size) + sz : uint32#)#
if trace
lock(memlck)
tracefree(p, sz)
@@ -253,7 +259,9 @@ const mkslab = {bkt
s = bkt.cache
bkt.cache = s.next
bkt.ncache--
+ -> s
;;
+
/*
tricky: we need power of two alignment, so we allocate double the
needed size, chop off the unaligned ends, and waste the address
@@ -308,13 +316,12 @@ const bktalloc = {bkt
b = s.freehd
s.freehd = b.next
s.nfree--
- if s.nfree == 0
+ if s.freehd == Zchunk
bkt.slabs = s.next
if s.next != Zslab
s.next.prev = Zslab
;;
;;
-
-> (b : byte#)
}
@@ -337,6 +344,16 @@ const bktfree = {bkt, m
s.prev = Zslab
bkt.slabs = s
elif s.nfree == bkt.nper - 1
+ /* unlink the slab from the list */
+ if s.next != Zslab
+ s.next.prev = s.prev
+ ;;
+ if s.prev != Zslab
+ s.prev.next = s.next
+ ;;
+ if bkt.slabs == s
+ bkt.slabs = s.next
+ ;;
/*
HACK HACK HACK: if we can't unmap, keep an infinite cache per slab size.
We should solve this better somehow.
@@ -345,17 +362,8 @@ const bktfree = {bkt, m
s.next = bkt.cache
s.prev = Zslab
bkt.cache = s
+ bkt.ncache++
else
- /* unlink the slab from the list */
- if s.next != Zslab
- s.next.prev = s.prev
- ;;
- if s.prev != Zslab
- s.prev.next = s.next
- ;;
- if bkt.slabs == s
- bkt.slabs = s.next
- ;;
/* we mapped 2*Slabsz so we could align it,
so we need to unmap the same */
freemem(s.head, Slabsz*2)
@@ -433,3 +441,4 @@ be a power of two.
const mtrunc = {m, align
-> ((m : intptr) & ~((align : intptr) - 1) : byte#)
}
+
diff --git a/lib/std/dir+plan9.myr b/lib/std/dir+plan9.myr
index e363662..82e301f 100644
--- a/lib/std/dir+plan9.myr
+++ b/lib/std/dir+plan9.myr
@@ -26,7 +26,7 @@ const diropen = {p
var fd
var dir
- match open(p, Ordonly)
+ match open(p, Oread)
| `Ok f: fd = f
| `Err e: -> `Err "couldn't open directory"
;;
diff --git a/lib/std/fltbits.myr b/lib/std/fltbits.myr
index f9afd7a..0d7169b 100644
--- a/lib/std/fltbits.myr
+++ b/lib/std/fltbits.myr
@@ -48,12 +48,12 @@ const flt32explode = {flt
bits = flt32bits(flt)
isneg = (bits >> 31) != 0 /* msb is sign bit */
- exp = (bits >> 22) & 0xff /* exp is in bits [23..30] */
- mant = bits & ((1 << 22) - 1) /* msb is in bits [0..22] */
+ exp = (bits >> 23) & 0xff /* exp is in bits [23..30] */
+ mant = bits & ((1 << 23) - 1) /* msb is in bits [0..22] */
/* add back the implicit bit if this is not a denormal */
if exp != 0
- mant |= 1 << 22
+ mant |= 1 << 23
else
exp = 1
;;
diff --git a/lib/std/fltfmt.myr b/lib/std/fltfmt.myr
index 71bb183..9b2e100 100644
--- a/lib/std/fltfmt.myr
+++ b/lib/std/fltfmt.myr
@@ -32,7 +32,7 @@ const flt32bfmt = {sb, val, mode, precision
var isneg, exp, mant
(isneg, mant, exp) = flt32explode(val)
- dragon4(sb, isneg, (mant : int64), (exp - 52 : int64), Fltbias, mode, precision)
+ dragon4(sb, isneg, (mant : int64), (exp - 23 : int64), Fltbias, mode, precision)
}
/*
@@ -52,10 +52,10 @@ const dragon4 = {sb, isneg, f, e, p, mode, cutoff
var k
var a, i
- /* if we have zero for the mantissa, we can return early */
if isneg
sbputs(sb, "-")
;;
+ /* if we have zero for the mantissa, we can return early */
if f == 0
sbputs(sb, "0.0")
-> void
@@ -63,12 +63,11 @@ const dragon4 = {sb, isneg, f, e, p, mode, cutoff
/* initialize */
roundup = false
- r = mkbigint(f)
- r = bigshli(r, max(e - p, 0))
+ u = mkbigint(0)
+ r = bigshli(mkbigint(f), max(e - p, 0))
s = bigshli(mkbigint(1), max(0, -(e - p)))
mm = bigshli(mkbigint(1), max((e - p), 0))
mp = bigdup(mm)
- u = mkbigint(0)
/* fixup: unequal gaps */
t = mkbigint(1)
@@ -224,10 +223,16 @@ const dragon4 = {sb, isneg, f, e, p, mode, cutoff
;;
;;
k--
-
while k >= -1
format(sb, 0, k--)
;;
+
+ bigfree(u)
+ bigfree(r)
+ bigfree(s)
+ bigfree(mm)
+ bigfree(mp)
+
}
const lowdig = {u
diff --git a/lib/std/fltparse.myr b/lib/std/fltparse.myr
index fcc97af..9836d1f 100644
--- a/lib/std/fltparse.myr
+++ b/lib/std/fltparse.myr
@@ -183,8 +183,8 @@ const fallback = {mant, exp, lim
while true
(xprime, rprime) = std.bigdivmod(u, v)
- std.bigmove(x, xprime)
- std.bigmove(r, rprime)
+ std.bigsteal(x, xprime)
+ std.bigsteal(r, rprime)
if k == lim.minexp
if std.biggei(x, lim.minsig) && std.biglei(x, lim.maxsig)
break
@@ -193,7 +193,8 @@ const fallback = {mant, exp, lim
goto done
;;
elif k > lim.maxexp
- -> std.flt64inf()
+ f = std.flt64inf()
+ goto done
;;
if std.biglti(x, lim.minsig)
std.bigmuli(u, 2)
diff --git a/lib/std/fmt.myr b/lib/std/fmt.myr
index 11268e4..08b814d 100644
--- a/lib/std/fmt.myr
+++ b/lib/std/fmt.myr
@@ -481,11 +481,13 @@ const intparams = {params
]
opts = parseparams(params, [
+ ("b", true),
("x", false),
("w", true),
("p", true)][:])
for o : opts
match o
+ | ("b", bas): ip.base = getint(bas, "fmt: base must be integer")
| ("x", ""): ip.base = 16
| ("w", wid): ip.padto = getint(wid, "fmt: width must be integer")
| ("p", pad): ip.padfill = decode(pad)
diff --git a/lib/std/hashfuncs.myr b/lib/std/hashfuncs.myr
index 3046377..da47215 100644
--- a/lib/std/hashfuncs.myr
+++ b/lib/std/hashfuncs.myr
@@ -1,30 +1,32 @@
use "alloc"
use "chartype"
use "die"
+use "getint"
use "sleq"
use "slpush"
use "types"
use "utf"
pkg std =
- const strhash : (s : byte[:] -> uint32)
+ const strhash : (s : byte[:] -> uint64)
const streq : (a : byte[:], b : byte[:] -> bool)
- const strcasehash : (s : byte[:] -> uint32)
+ const strcasehash : (s : byte[:] -> uint64)
const strcaseeq : (a : byte[:], b : byte[:] -> bool)
- generic ptrhash : (p : @a# -> uint32)
+ generic ptrhash : (p : @a# -> uint64)
generic ptreq : (a : @a#, b : @a# -> bool)
- generic inthash : (v : @a::(integral,numeric) -> uint32)
+ generic inthash : (v : @a::(integral,numeric) -> uint64)
generic inteq : (a : @a::(integral,numeric), b : @a::(integral,numeric) -> bool)
const murmurhash2 : (data : byte[:], seed : uint32 -> uint32)
+ const siphash24 : (data : byte[:], seed : byte[16] -> uint64)
- generic slhash : (sl : @a[:] -> uint32)
+ generic slhash : (sl : @a[:] -> uint64)
;;
-const Seed = 1234
+const Seed : byte[16] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]
generic slhash = {data : @a[:]
-> strhash(slbytes(data))
@@ -38,7 +40,7 @@ generic slbytes = {data : @a[:]
}
const strhash = {s
- -> murmurhash2(s, Seed)
+ -> siphash24(s, Seed)
}
const strcaseeq = {a, b
@@ -66,7 +68,7 @@ const strcasehash = {s
(c, s) = std.strstep(s)
std.slpush(&chars, std.tolower(c))
;;
- h = murmurhash2(slbytes(chars), Seed)
+ h = siphash24(slbytes(chars), Seed)
slfree(chars)
-> h
}
@@ -76,10 +78,7 @@ const streq = {a, b
}
generic ptrhash = {p : @a#
- var x
-
- x = (&p : byte#)
- -> murmurhash2(x[0:sizeof(@a#)], Seed)
+ -> inthash((p : intptr))
}
generic ptreq = {a, b
@@ -90,7 +89,7 @@ generic inthash = {v : @a::(integral,numeric)
var p
p = (&v : byte#)
- -> murmurhash2(p[0:sizeof(@a)], Seed)
+ -> siphash24(p[0:sizeof(@a)], Seed)
}
generic inteq = {a, b
@@ -141,3 +140,59 @@ const murmurhash2 = {data, seed
-> h
}
+
+const sipround = {v0, v1, v2, v3 -> (uint64, uint64, uint64, uint64)
+ v0 += v1
+ v1 = (v1 << 13) | (v1 >> 51)
+ v1 ^= v0
+ v0 = (v0 << 32) | (v0 >> 32)
+ v2 += v3
+ v3 = (v3 << 16) | (v3 >> 48)
+ v3 ^= v2
+
+ v2 += v1
+ v1 = (v1 << 17) | (v1 >> 47)
+ v1 ^= v2
+ v2 = (v2 << 32) | (v2 >> 32)
+ v0 += v3
+ v3 = (v3 << 21) | (v3 >> 43)
+ v3 ^= v0
+
+ -> (v0, v1, v2, v3)
+}
+
+const siphash24 = {data, seed
+ var k0, k1, m, v0, v1, v2, v3, w
+ var tail : byte[8] = [0, 0, 0, 0, 0, 0, 0, 0]
+
+ k0 = std.getle64(seed[0:8])
+ k1 = std.getle64(seed[8:16])
+ v0 = k0 ^ 0x736f6d6570736575
+ v1 = k1 ^ 0x646f72616e646f6d
+ v2 = k0 ^ 0x6c7967656e657261
+ v3 = k1 ^ 0x7465646279746573
+ w = (data.len + 8) / 8 - 1
+ for var i = 0; i < w; i++
+ m = std.getle64(data[8 * i:8 * (i + 1)])
+ v3 ^= m
+ (v0, v1, v2, v3) = sipround(v0, v1, v2, v3)
+ (v0, v1, v2, v3) = sipround(v0, v1, v2, v3)
+ v0 ^= m
+ ;;
+ for var i = 0; i < data.len % 8; i++
+ tail[i] = data[8 * w + i]
+ ;;
+ tail[7] = (data.len % 256 : byte)
+ m = std.getle64(tail[:])
+ v3 ^= m
+ (v0, v1, v2, v3) = sipround(v0, v1, v2, v3)
+ (v0, v1, v2, v3) = sipround(v0, v1, v2, v3)
+ v0 ^= m
+
+ v2 ^= 0xff
+ (v0, v1, v2, v3) = sipround(v0, v1, v2, v3)
+ (v0, v1, v2, v3) = sipround(v0, v1, v2, v3)
+ (v0, v1, v2, v3) = sipround(v0, v1, v2, v3)
+ (v0, v1, v2, v3) = sipround(v0, v1, v2, v3)
+ -> v0 ^ v1 ^ v2 ^ v3
+}
diff --git a/lib/std/htab.myr b/lib/std/htab.myr
index ec4ce72..b728124 100644
--- a/lib/std/htab.myr
+++ b/lib/std/htab.myr
@@ -6,19 +6,19 @@ use "types"
pkg std =
type htab(@k, @v) = struct
- hash : (k : @k -> uint32)
+ hash : (k : @k -> uint64)
eq : (a : @k, b : @k -> bool)
nelt : size
ndead : size
keys : @k[:]
vals : @v[:]
- hashes : uint32[:]
+ hashes : uint64[:]
dead : bool[:]
;;
- generic mkht : (h : (k : @k -> uint32), eq : (a : @k, b : @k -> bool) -> htab(@k, @v)#)
- generic htinit : (ht : htab(@k, @v)#, h : (k : @k -> uint32), eq : (a : @k, b : @k -> bool) -> void)
+ generic mkht : (h : (k : @k -> uint64), eq : (a : @k, b : @k -> bool) -> htab(@k, @v)#)
+ generic htinit : (ht : htab(@k, @v)#, h : (k : @k -> uint64), eq : (a : @k, b : @k -> bool) -> void)
generic htfree : (ht : htab(@k, @v)# -> void)
generic htput : (ht : htab(@k, @v)#, k : @k, v : @v -> void)
generic htdel : (ht : htab(@k, @v)#, k : @k -> void)
diff --git a/lib/std/listen+plan9.myr b/lib/std/listen+plan9.myr
new file mode 100644
index 0000000..be82bcf
--- /dev/null
+++ b/lib/std/listen+plan9.myr
@@ -0,0 +1,175 @@
+use sys
+
+use "alloc"
+use "cstrconv"
+use "die"
+use "dirname"
+use "fmt"
+use "mk"
+use "option"
+use "result"
+use "sldup"
+use "strfind"
+use "syswrap"
+use "utf"
+
+
+pkg std =
+ type announce = struct
+ afd : fd
+ lpath : byte[:]
+ netdir : byte[:]
+ ;;
+
+ const announce : (ds : byte[:] -> result(announce#, byte[:]))
+ const aclose : (a : announce# -> void)
+ const accept : (a : announce# -> result(fd, byte[:]))
+;;
+
+const Maxpath = 256
+
+const announce = {ds
+ var a, abuf : byte[Maxpath]
+ var f, fbuf : byte[Maxpath]
+ var nbuf : byte[32]
+ var dir, ctl, n
+
+ /* announce */
+ match translate(ds, abuf[:], fbuf[:])
+ | `Err _: -> `Err "invalid dial string"
+ | `Ok (addr, file):
+ put("addr: {}, file: {}\n", addr, file)
+ a = addr
+ f = file
+ match strrfind(f, "/")
+ | `Some i: dir = i
+ | `None: -> `Err "invalid net dir"
+ ;;
+ ;;
+
+ match open(f, Ordwr)
+ | `Ok fd: ctl = fd
+ | `Err e: -> `Err "could not open ctl fd"
+ ;;
+
+ match read(ctl, nbuf[:])
+ | `Err e: ->`Err "unable to read ctl fd"
+ | `Ok nn:
+ n = fput(ctl, "announce {}", a)
+ if n <= 0
+ close(ctl)
+ -> `Err "writing announce"
+ ;;
+
+ -> `std.Ok mk([
+ .afd=ctl,
+ .lpath = fmt("{}/{}/listen", f[:dir], nbuf[:nn]),
+ .netdir = sldup(f[:dir]),
+ ])
+ ;;
+
+}
+
+const aclose = {a
+ slfree(a.netdir)
+ slfree(a.lpath)
+ close(a.afd)
+ free(a)
+}
+
+const accept = {a -> result(fd, byte[:])
+ var num, numbuf : byte[16]
+ var dat, datbuf : byte[Maxpath]
+ var lfd
+
+ match open(a.lpath, Ordwr)
+ | `Err e: -> `Err "could not open ctl"
+ | `Ok fd: lfd = fd
+ ;;
+
+ match read(lfd, numbuf[:])
+ | `Ok n: num = numbuf[:n]
+ | `Err e: -> `Err "could not accept"
+ ;;
+
+ dat = bfmt(datbuf[:], "{}/{}/data", a.netdir, num)
+ match open(dat, Ordwr)
+ | `Ok fd: -> `Ok fd
+ | `Err e: -> `Err "could not open data fd"
+ ;;
+}
+
+const translate = {ds, addrbuf, filebuf
+ var cs, csbuf : byte[Maxpath]
+ var r, rbuf : byte[Maxpath]
+ var netdir, rest
+ var addr, file
+
+ match strfind(ds, "!")
+ | `None: -> `Err void
+ | `Some sep:
+ if decode(ds[:sep]) == '#' || decode(ds[:sep]) == '/'
+ match strrfind(ds[:sep], "/")
+ | `None: -> `Err void
+ | `Some idx:
+ netdir = ds[:idx]
+ rest = ds[idx+1:]
+ ;;
+ else
+ netdir = "/net"
+ addr = ds
+ ;;
+ ;;
+
+ cs = bfmt(csbuf[:], "{}/cs", netdir)
+ match open(cs, Ordwr)
+ | `Err e: -> identtrans(rest, netdir, addrbuf, filebuf)
+ | `Ok fd:
+ match write(fd, addr)
+ | `Err e:
+ close(fd)
+ -> `Err void
+ | `Ok _:
+ ;;
+
+ seek(fd, 0, Seekset)
+ match read(fd, rbuf[:])
+ | `Err e:
+ close(fd)
+ -> `Err void
+ | `Ok n:
+ r = rbuf[:n]
+ ;;
+ close(fd)
+ ;;
+
+ put("cs returned: {}\n", r)
+ match strfind(r, " ")
+ | `None: -> `Err void
+ | `Some i:
+ addr = bfmt(addrbuf, "{}", r[i+1:])
+ if decode(r) == '/'
+ match strfind(r[:i], "/")
+ | `None: -> `Err void
+ | `Some 0: file = bfmt(filebuf, "{}{}", netdir, r[:i])
+ | `Some n: file = bfmt(filebuf, "{}{}", netdir, r[n+1:])
+ ;;
+ else
+ file = bfmt(filebuf, "{}/{}", netdir, r[:i])
+ ;;
+ ;;
+ -> `Ok (addr, file)
+}
+
+const identtrans = {ds, netdir, addrbuf, filebuf
+ var a, f
+
+ match strfind(ds, "!")
+ | `None:
+ -> `Err void
+ | `Some sep:
+ a = bfmt(addrbuf, "{}", ds[sep + 1:])
+ f = bfmt(filebuf, "{}/{}/clone", netdir, ds[:sep])
+ -> `Ok (a, f)
+ ;;
+}
diff --git a/lib/std/listen+posixy.myr b/lib/std/listen+posixy.myr
index be4456d..49d1054 100644
--- a/lib/std/listen+posixy.myr
+++ b/lib/std/listen+posixy.myr
@@ -5,6 +5,7 @@ use "chartype"
use "dialparse"
use "die"
use "endian"
+use "mk"
use "option"
use "resolve"
use "result"
@@ -16,9 +17,14 @@ use "syswrap"
use "utf"
pkg std =
- const announce : (ds : byte[:] -> result(fd, byte[:]))
- const listen : (sock : fd -> result(fd, byte[:]))
- const accept : (lfd : fd -> result(fd, byte[:]))
+ type announce = struct
+ lfd : fd
+ ;;
+
+ const announce : (ds : byte[:] -> result(announce#, byte[:]))
+ const aclose : (a : announce# -> void)
+
+ const accept : (a : announce# -> result(fd, byte[:]))
;;
const announce = {ds
@@ -31,6 +37,11 @@ const announce = {ds
;;
}
+const aclose = {a
+ close(a.lfd)
+ free(a)
+}
+
const announcesock = {proto, str
var sa4 : sys.sockaddr_in
var sa6 : sys.sockaddr_in6
@@ -80,7 +91,10 @@ const announcesock = {proto, str
if sys.bind(sock, sa, sz) < 0
-> `Err "failed to bind socket"
;;
- -> `Ok (sock : fd)
+ if sys.listen((sock : sys.fd), 10) < 0
+ -> `Err "unable to listen on socket"
+ ;;
+ -> `Ok mk([.lfd=(sock : fd)])
}
const announceunix = {path
@@ -106,23 +120,19 @@ const announceunix = {path
if sys.bind(sock, (&sa : sys.sockaddr#), sizeof(sys.sockaddr_un)) < 0
-> `Err "failed to bind address"
;;
- -> `Ok (sock : fd)
-
-}
-
-const listen = {sock : std.fd -> result(fd, byte[:])
if sys.listen((sock : sys.fd), 10) < 0
-> `Err "unable to listen on socket"
;;
- -> `Ok (sys.dup((sock : sys.fd)) : fd)
+ -> `Ok mk([.lfd=(sock : fd)])
+
}
-const accept = {lfd
+const accept = {a
var sa : sys.sockaddr_storage
var len : sys.size
var fd
- fd = sys.accept((lfd : sys.fd), (0 : sys.sockaddr#), (0 : sys.size#))
+ fd = sys.accept((a.lfd : sys.fd), (0 : sys.sockaddr#), (0 : sys.size#))
if fd < 0
-> `Err "unable to accept socket"
;;
diff --git a/lib/std/mkpath.myr b/lib/std/mkpath.myr
index 61e2a72..22d1d3d 100644
--- a/lib/std/mkpath.myr
+++ b/lib/std/mkpath.myr
@@ -10,9 +10,11 @@ const mkpath = {p
for var i = 0; i < p.len; i++
if p[i] == ('/' : byte) && i != 0
- st = mkdir(p[:i], 0o755)
- if st != 0 && st != Eexist
- -> st
+ if !fexists(p[:i])
+ st = mkdir(p[:i], 0o755)
+ if st != 0
+ -> st
+ ;;
;;
;;
;;
diff --git a/lib/std/mktemp.myr b/lib/std/mktemp.myr
index c5f06c8..bc1bf87 100644
--- a/lib/std/mktemp.myr
+++ b/lib/std/mktemp.myr
@@ -15,6 +15,8 @@ use "types"
pkg std =
const mktemp : (base : byte[:], opt : fdopt, mode : int64 -> std.result((fd, byte[:]), errno))
const mktempat : (dir : byte[:], base : byte[:], opt : fdopt, mode : int64 -> std.result((fd, byte[:]), errno))
+ const mkdtemp : (base : byte[:], mode : int64 -> std.result(byte[:], errno))
+ const mkdtempat : (dir : byte[:], base : byte[:], mode : int64 -> std.result(byte[:], errno))
const mktemppath : (base : byte[:] -> byte[:])
;;
@@ -51,6 +53,36 @@ const mktempat = {tmpdir, base, opt, mode
-> `Err Eexist
}
+const mkdtemp = {base, mode
+ var tmpdir
+
+ match std.getenv("TMPDIR")
+ | `std.Some d: tmpdir = d
+ | `std.None: tmpdir = "/tmp"
+ ;;
+
+ -> mkdtempat(tmpdir, base, mode)
+}
+
+const mkdtempat = {tmpdir, base, mode
+ var path
+
+ for var i = 0; i < Retries; i++
+ path = randpath(tmpdir, base)
+ match std.mkdir(path, mode)
+ | Enone:
+ -> `Ok path
+ | e:
+ if e != Eexist
+ std.slfree(path)
+ -> `Err e
+ ;;
+ ;;
+ std.slfree(path)
+ ;;
+ -> `Err Eexist
+}
+
const mktemppath = {base
var tmpdir, path
diff --git a/lib/std/resolve+posixy.myr b/lib/std/resolve+posixy.myr
index 06250d5..8fa8352 100644
--- a/lib/std/resolve+posixy.myr
+++ b/lib/std/resolve+posixy.myr
@@ -333,7 +333,7 @@ const rquery = {srv, host, id
pfd = [
[.fd=srv, .events=sys.Pollin, .revents=0]
][:]
- r = sys.poll(pfd[:], (std.now() - giveup : int)/1000)
+ r = sys.poll(pfd[:], (giveup - std.now() : int)/1000)
if r < 0
-> `Err `Badconn
elif r == 0
diff --git a/lib/std/slurp.myr b/lib/std/slurp.myr
index a966e4a..8e653f9 100644
--- a/lib/std/slurp.myr
+++ b/lib/std/slurp.myr
@@ -15,7 +15,7 @@ const Bufstart = 4096
const slurp = {path
var sl
- match open(path, Ordonly)
+ match open(path, Oread)
| `Err e: -> `Err e
| `Ok fd:
sl = fslurp(fd)
diff --git a/lib/std/syswrap+plan9.myr b/lib/std/syswrap+plan9.myr
index ddf37ab..9f0ccc9 100644
--- a/lib/std/syswrap+plan9.myr
+++ b/lib/std/syswrap+plan9.myr
@@ -27,8 +27,8 @@ pkg std =
const Failmem : byte# = (-1 : byte#)
- const Ordonly : fdopt = (sys.Ordonly : fdopt)
- const Owronly : fdopt = (sys.Owronly : fdopt)
+ const Oread : fdopt = (sys.Oread : fdopt)
+ const Owrite : fdopt = (sys.Owrite : fdopt)
const Ordwr : fdopt = (sys.Ordwr : fdopt)
const Otrunc : fdopt = (sys.Otrunc : fdopt)
const Ocexec : fdopt = (sys.Ocexec : fdopt)
@@ -198,7 +198,7 @@ const chdir = {path; -> sys.chdir(path) == 0}
const mkdir = {path, mode;
var fd
- fd = sys.create(path, sys.Ordonly, sys.Dmdir | (mode : int))
+ fd = sys.create(path, sys.Oread, sys.Dmdir | (mode : int))
if fd < 0
-> lasterr()
;;
diff --git a/lib/std/syswrap+posixy.myr b/lib/std/syswrap+posixy.myr
index 5766a00..f49f9b8 100644
--- a/lib/std/syswrap+posixy.myr
+++ b/lib/std/syswrap+posixy.myr
@@ -25,12 +25,13 @@ pkg std =
const Seekcur : whence = (sys.Seekcur : whence)
const Seekend : whence = (sys.Seekend : whence)
- const Ordonly : fdopt = (sys.Ordonly : fdopt)
- const Owronly : fdopt = (sys.Owronly : fdopt)
+ const Oread : fdopt = (sys.Ordonly : fdopt)
+ const Owrite : fdopt = (sys.Owronly : fdopt)
const Ordwr : fdopt = (sys.Ordwr : fdopt)
const Ocreat : fdopt = (sys.Ocreat : fdopt)
const Otrunc : fdopt = (sys.Otrunc : fdopt)
const Ocexec : fdopt = (sys.Ocloexec : fdopt)
+ const Oappend : fdopt = (sys.Oappend : fdopt)
const Odir : fdopt = (sys.Odir : fdopt)
/* fd stuff */
diff --git a/lib/std/syswrap-ss+plan9.myr b/lib/std/syswrap-ss+plan9.myr
index 96a2973..58a751a 100644
--- a/lib/std/syswrap-ss+plan9.myr
+++ b/lib/std/syswrap-ss+plan9.myr
@@ -22,7 +22,7 @@ const nanosleep = {nsecs
const bgetcwd = {buf
var fd
- fd = sys.open(".", sys.Ordonly)
+ fd = sys.open(".", sys.Oread)
if fd < 0
-> (fd : errno)
;;
diff --git a/lib/std/test/bitset.myr b/lib/std/test/bitset.myr
index 9112537..6936cba 100644
--- a/lib/std/test/bitset.myr
+++ b/lib/std/test/bitset.myr
@@ -49,11 +49,11 @@ const main = {
}],
[.name="hash", .fn={ctx
var bs = mkset([][:])
- testr.check(ctx, std.bshash(bs) == 2580988821, "wrong hash, got {}", std.bshash(bs))
+ testr.check(ctx, std.bshash(bs) == 0x726fdb47dd0e0e31, "wrong hash, got {}", std.bshash(bs))
std.bsput(bs, 123456)
- testr.check(ctx, std.bshash(bs) == 2020624217, "wrong hash, got {}", std.bshash(bs))
+ testr.check(ctx, std.bshash(bs) == 0x778abc1d7706143b, "wrong hash, got {}", std.bshash(bs))
std.bsdel(bs, 123456)
- testr.check(ctx, std.bshash(bs) == 2580988821, "wrong hash, got {}", std.bshash(bs))
+ testr.check(ctx, std.bshash(bs) == 0x726fdb47dd0e0e31, "wrong hash, got {}", std.bshash(bs))
std.bsfree(bs)
}]
][:])
diff --git a/lib/std/test/fmt.myr b/lib/std/test/fmt.myr
index 67ba2e4..5d0cfa8 100644
--- a/lib/std/test/fmt.myr
+++ b/lib/std/test/fmt.myr
@@ -62,6 +62,7 @@ const builtins = {
check("0x7b", "0x{x}", 123)
check("0.0", "{}", 0.0)
check("0.3", "{}", 0.3)
+ check("0.3", "{}", (0.3 : flt32))
check("1.0", "{}", 1.0)
check("100.0", "{}", 100.0)
check("666.91972", "{}", 666.91972)
diff --git a/lib/std/test/hashfuncs.myr b/lib/std/test/hashfuncs.myr
index d2b1161..f1684f9 100644
--- a/lib/std/test/hashfuncs.myr
+++ b/lib/std/test/hashfuncs.myr
@@ -1,24 +1,113 @@
use std
+use testr
const main = {
- var x, y: int
+ testr.run([
+ [.name="string hash and equality", .fn={ctx
+ testr.check(ctx, std.strhash("abc") == 0x5dbcfa53aa2007a5, "wrong hash\n")
+ testr.check(ctx, std.streq("abc\0def", "abc\0def"), "equal strings not equal\n")
+ testr.check(ctx, !std.streq("abc\0def", "abcdef"), "unequal strings are equal\n")
+ }],
+ [.name="case insensitive hash and equality", .fn={ctx
+ testr.check(ctx, std.strcasehash("abc") == std.strcasehash("AbC"), "wrong case insensitive hash\n")
+ testr.check(ctx, std.strcaseeq("abc", "AbC"), "equal case insensitive strings not equal")
+ testr.check(ctx, !std.strcaseeq("abc", "AbCd"), "unequal case insensitive strings equal")
+ }],
+ [.name="pointer equality", .fn={ctx
+ var x, y: int
+ /* can't sanely test ptrhash; it will change every time */
+ testr.check(ctx, std.ptreq(&x, &x), "equal pointers not equal")
+ testr.check(ctx, !std.ptreq(&x, &y), "unequal pointers are equal")
+ }],
+ [.name="int hash and equality", .fn={ctx
+ testr.check(ctx, std.inthash(123) == 0x5671db246859d5b6, "wrong int hash")
+ testr.check(ctx, std.inteq(123, 123), "equal integers not equal")
+ testr.check(ctx, !std.inteq(123, 456), "unequal integers are equal")
+ }],
+ [.name="murmurhash test", .fn={ctx
+ testr.check(ctx, std.murmurhash2("foobar", 1234) == 2203212445, "wrong murmurhash value")
+ }],
+ [.name="siphash test", .fn={ctx
+ siphashreferencetestvector(ctx)
+ }],
+ ][:])
- std.assert(std.strhash("abc") == 1241861192, "wrong hash\n")
- std.assert(std.streq("abc\0def", "abc\0def"), "equal strings not equal\n")
- std.assert(!std.streq("abc\0def", "abcdef"), "unstrings are equal\n")
-
- std.assert(std.strcasehash("abc") == std.strcasehash("AbC"), "wrong case insensitive hash\n")
- std.assert(std.strcaseeq("abc", "AbC"), "equal case insensitive strings not equal")
- std.assert(!std.strcaseeq("abc", "AbCd"), "unequal case insensitive strings equal")
-
- /* can't sanely test ptrhash; it will change every time */
- std.assert(std.ptreq(&x, &x), "equal pointers not equal")
- std.assert(!std.ptreq(&x, &y), "unequal pointers are equal")
-
- std.assert(std.inthash(123) == 3497506805, "wrong int hash")
- std.assert(std.inteq(123, 123), "equal integers not equal")
- std.assert(!std.inteq(123, 456), "unequal integers are equal")
+}
- std.assert(std.murmurhash2("foobar", 1234) == 2203212445, "wrong murmurhash value")
+const siphashtestvector : byte[8][64] = [
+ [ 0x31, 0x0e, 0x0e, 0xdd, 0x47, 0xdb, 0x6f, 0x72, ],
+ [ 0xfd, 0x67, 0xdc, 0x93, 0xc5, 0x39, 0xf8, 0x74, ],
+ [ 0x5a, 0x4f, 0xa9, 0xd9, 0x09, 0x80, 0x6c, 0x0d, ],
+ [ 0x2d, 0x7e, 0xfb, 0xd7, 0x96, 0x66, 0x67, 0x85, ],
+ [ 0xb7, 0x87, 0x71, 0x27, 0xe0, 0x94, 0x27, 0xcf, ],
+ [ 0x8d, 0xa6, 0x99, 0xcd, 0x64, 0x55, 0x76, 0x18, ],
+ [ 0xce, 0xe3, 0xfe, 0x58, 0x6e, 0x46, 0xc9, 0xcb, ],
+ [ 0x37, 0xd1, 0x01, 0x8b, 0xf5, 0x00, 0x02, 0xab, ],
+ [ 0x62, 0x24, 0x93, 0x9a, 0x79, 0xf5, 0xf5, 0x93, ],
+ [ 0xb0, 0xe4, 0xa9, 0x0b, 0xdf, 0x82, 0x00, 0x9e, ],
+ [ 0xf3, 0xb9, 0xdd, 0x94, 0xc5, 0xbb, 0x5d, 0x7a, ],
+ [ 0xa7, 0xad, 0x6b, 0x22, 0x46, 0x2f, 0xb3, 0xf4, ],
+ [ 0xfb, 0xe5, 0x0e, 0x86, 0xbc, 0x8f, 0x1e, 0x75, ],
+ [ 0x90, 0x3d, 0x84, 0xc0, 0x27, 0x56, 0xea, 0x14, ],
+ [ 0xee, 0xf2, 0x7a, 0x8e, 0x90, 0xca, 0x23, 0xf7, ],
+ [ 0xe5, 0x45, 0xbe, 0x49, 0x61, 0xca, 0x29, 0xa1, ],
+ [ 0xdb, 0x9b, 0xc2, 0x57, 0x7f, 0xcc, 0x2a, 0x3f, ],
+ [ 0x94, 0x47, 0xbe, 0x2c, 0xf5, 0xe9, 0x9a, 0x69, ],
+ [ 0x9c, 0xd3, 0x8d, 0x96, 0xf0, 0xb3, 0xc1, 0x4b, ],
+ [ 0xbd, 0x61, 0x79, 0xa7, 0x1d, 0xc9, 0x6d, 0xbb, ],
+ [ 0x98, 0xee, 0xa2, 0x1a, 0xf2, 0x5c, 0xd6, 0xbe, ],
+ [ 0xc7, 0x67, 0x3b, 0x2e, 0xb0, 0xcb, 0xf2, 0xd0, ],
+ [ 0x88, 0x3e, 0xa3, 0xe3, 0x95, 0x67, 0x53, 0x93, ],
+ [ 0xc8, 0xce, 0x5c, 0xcd, 0x8c, 0x03, 0x0c, 0xa8, ],
+ [ 0x94, 0xaf, 0x49, 0xf6, 0xc6, 0x50, 0xad, 0xb8, ],
+ [ 0xea, 0xb8, 0x85, 0x8a, 0xde, 0x92, 0xe1, 0xbc, ],
+ [ 0xf3, 0x15, 0xbb, 0x5b, 0xb8, 0x35, 0xd8, 0x17, ],
+ [ 0xad, 0xcf, 0x6b, 0x07, 0x63, 0x61, 0x2e, 0x2f, ],
+ [ 0xa5, 0xc9, 0x1d, 0xa7, 0xac, 0xaa, 0x4d, 0xde, ],
+ [ 0x71, 0x65, 0x95, 0x87, 0x66, 0x50, 0xa2, 0xa6, ],
+ [ 0x28, 0xef, 0x49, 0x5c, 0x53, 0xa3, 0x87, 0xad, ],
+ [ 0x42, 0xc3, 0x41, 0xd8, 0xfa, 0x92, 0xd8, 0x32, ],
+ [ 0xce, 0x7c, 0xf2, 0x72, 0x2f, 0x51, 0x27, 0x71, ],
+ [ 0xe3, 0x78, 0x59, 0xf9, 0x46, 0x23, 0xf3, 0xa7, ],
+ [ 0x38, 0x12, 0x05, 0xbb, 0x1a, 0xb0, 0xe0, 0x12, ],
+ [ 0xae, 0x97, 0xa1, 0x0f, 0xd4, 0x34, 0xe0, 0x15, ],
+ [ 0xb4, 0xa3, 0x15, 0x08, 0xbe, 0xff, 0x4d, 0x31, ],
+ [ 0x81, 0x39, 0x62, 0x29, 0xf0, 0x90, 0x79, 0x02, ],
+ [ 0x4d, 0x0c, 0xf4, 0x9e, 0xe5, 0xd4, 0xdc, 0xca, ],
+ [ 0x5c, 0x73, 0x33, 0x6a, 0x76, 0xd8, 0xbf, 0x9a, ],
+ [ 0xd0, 0xa7, 0x04, 0x53, 0x6b, 0xa9, 0x3e, 0x0e, ],
+ [ 0x92, 0x59, 0x58, 0xfc, 0xd6, 0x42, 0x0c, 0xad, ],
+ [ 0xa9, 0x15, 0xc2, 0x9b, 0xc8, 0x06, 0x73, 0x18, ],
+ [ 0x95, 0x2b, 0x79, 0xf3, 0xbc, 0x0a, 0xa6, 0xd4, ],
+ [ 0xf2, 0x1d, 0xf2, 0xe4, 0x1d, 0x45, 0x35, 0xf9, ],
+ [ 0x87, 0x57, 0x75, 0x19, 0x04, 0x8f, 0x53, 0xa9, ],
+ [ 0x10, 0xa5, 0x6c, 0xf5, 0xdf, 0xcd, 0x9a, 0xdb, ],
+ [ 0xeb, 0x75, 0x09, 0x5c, 0xcd, 0x98, 0x6c, 0xd0, ],
+ [ 0x51, 0xa9, 0xcb, 0x9e, 0xcb, 0xa3, 0x12, 0xe6, ],
+ [ 0x96, 0xaf, 0xad, 0xfc, 0x2c, 0xe6, 0x66, 0xc7, ],
+ [ 0x72, 0xfe, 0x52, 0x97, 0x5a, 0x43, 0x64, 0xee, ],
+ [ 0x5a, 0x16, 0x45, 0xb2, 0x76, 0xd5, 0x92, 0xa1, ],
+ [ 0xb2, 0x74, 0xcb, 0x8e, 0xbf, 0x87, 0x87, 0x0a, ],
+ [ 0x6f, 0x9b, 0xb4, 0x20, 0x3d, 0xe7, 0xb3, 0x81, ],
+ [ 0xea, 0xec, 0xb2, 0xa3, 0x0b, 0x22, 0xa8, 0x7f, ],
+ [ 0x99, 0x24, 0xa4, 0x3c, 0xc1, 0x31, 0x57, 0x24, ],
+ [ 0xbd, 0x83, 0x8d, 0x3a, 0xaf, 0xbf, 0x8d, 0xb7, ],
+ [ 0x0b, 0x1a, 0x2a, 0x32, 0x65, 0xd5, 0x1a, 0xea, ],
+ [ 0x13, 0x50, 0x79, 0xa3, 0x23, 0x1c, 0xe6, 0x60, ],
+ [ 0x93, 0x2b, 0x28, 0x46, 0xe4, 0xd7, 0x06, 0x66, ],
+ [ 0xe1, 0x91, 0x5f, 0x5c, 0xb1, 0xec, 0xa4, 0x6c, ],
+ [ 0xf3, 0x25, 0x96, 0x5c, 0xa1, 0x6d, 0x62, 0x9f, ],
+ [ 0x57, 0x5f, 0xf2, 0x8e, 0x60, 0x38, 0x1b, 0xe5, ],
+ [ 0x72, 0x45, 0x06, 0xeb, 0x4c, 0x32, 0x8a, 0x95, ],
+]
+const siphashreferencetestvector = {ctx
+ var key = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]
+ var e, h, msg : byte[64]
+ for var i = 0; i < 64; i++
+ msg[i] = i
+ h = std.siphash24(msg[:i], key)
+ e = std.getle64(siphashtestvector[i][:])
+ testr.check(ctx, e == h, "wrong siphash value for entry {}: got {x}\n", i, h)
+ ;;
}
diff --git a/lib/sys/bld.sub b/lib/sys/bld.sub
index 7ffb6c8..abf90f5 100644
--- a/lib/sys/bld.sub
+++ b/lib/sys/bld.sub
@@ -7,6 +7,7 @@ lib sys =
sys+osx-x64.myr
sys+openbsd-x64.myr
sys+openbsd:6.1-x64.myr
+ sys+openbsd:6.2-x64.myr
sys+plan9-x64.myr
syscall+freebsd-x64.s
diff --git a/lib/sys/ifreq+netbsd.myr b/lib/sys/ifreq+netbsd.myr
new file mode 100644
index 0000000..e7d6400
--- /dev/null
+++ b/lib/sys/ifreq+netbsd.myr
@@ -0,0 +1,2 @@
+pkg sys =
+;;
diff --git a/lib/sys/sys+freebsd-x64.myr b/lib/sys/sys+freebsd-x64.myr
index 2a77fbe..440f396 100644
--- a/lib/sys/sys+freebsd-x64.myr
+++ b/lib/sys/sys+freebsd-x64.myr
@@ -1,3 +1,8 @@
+/*
+ generated-ish source
+ stitched for freebsd arch:x64
+ edit with caution.
+ */
pkg sys =
type size = int64 /* spans entire address space */
type usize = uint64 /* unsigned size */
@@ -792,6 +797,7 @@ pkg sys =
extern const syscall : (sc:scno, args:... -> int64)
extern var __cenvp : byte##
+
const Sysnosys : scno = 0
const Sysexit : scno = 1
@@ -1129,7 +1135,8 @@ pkg sys =
const Sysfutimens : scno = 546
const Sysutimensat : scno = 547
- /* manual overrides */ const exit : (status:int -> void)
+ /* start manual overrides { */
+ const exit : (status:int -> void)
const getpid : ( -> pid)
const kill : (pid:pid, sig:int64 -> int64)
const fork : (-> pid)
@@ -1188,6 +1195,10 @@ pkg sys =
old : void#, oldsz : size#, \
new : void#, newsz : size# \
-> int)
+ extern const cstring : (str : byte[:] -> byte#)
+ extern const alloca : (sz : size -> byte#)
+ extern const __freebsd_pipe : (fds : fd[2]# -> int64)
+ /* } end manual overrides */
const nosys : ( -> int)
const link : (path : byte#, link : byte# -> int)
@@ -1196,24 +1207,24 @@ pkg sys =
const chmod : (path : byte#, mode : int -> int)
const chown : (path : byte#, uid : int, gid : int -> int)
const obreak : (nsize : byte# -> int)
- const mount : (kind : byte#, path : byte#, flags : int, data : caddr -> int)
+ const mount : (kind : byte#, path : byte#, flags : int, data : void# -> int)
const unmount : (path : byte#, flags : int -> int)
const setuid : (uid : uid -> int)
const getuid : ( -> uid)
const geteuid : ( -> uid)
- const ptrace : (req : int, pid : pid, addr : caddr, data : int -> int)
+ const ptrace : (req : int, pid : pid, addr : void#, data : int -> int)
const recvmsg : (s : int, msg : msghdr#, flags : int -> int)
const sendmsg : (s : int, msg : msghdr#, flags : int -> int)
- const recvfrom : (s : int, buf : caddr, len : size, flags : int, from : sockaddr# , fromlenaddr : socklen# -> int)
- const getpeername : (fdes : int, asa : sockaddr# , alen : socklen# -> int)
- const getsockname : (fdes : int, asa : sockaddr# , alen : socklen# -> int)
+ const recvfrom : (s : int, buf : void#, len : size, flags : int, from : sockaddr#, fromlenaddr : int32# -> int)
+ const getpeername : (fdes : int, asa : sockaddr#, alen : int32# -> int)
+ const getsockname : (fdes : int, asa : sockaddr#, alen : int32# -> int)
const access : (path : byte#, amode : int -> int)
const chflags : (path : byte#, flags : uint64 -> int)
const fchflags : (fd : int, flags : uint64 -> int)
const sync : ( -> int)
const getppid : ( -> pid)
const getegid : ( -> gid)
- const profil : (samples : caddr, size : size, offset : size, scale : uint -> int)
+ const profil : (samples : void#, size : size, offset : size, scale : uint -> int)
const ktrace : (fname : byte#, ops : int, facs : int, pid : int -> int)
const getgid : ( -> gid)
const getlogin : (namebuf : byte#, namelen : uint -> int)
@@ -1256,14 +1267,14 @@ pkg sys =
const rename : (from : byte#, to : byte# -> int)
const flock : (fd : int, how : int -> int)
const mkfifo : (path : byte#, mode : int -> int)
- const sendto : (s : int, buf : caddr, len : size, flags : int, to : caddr, tolen : int -> int)
+ const sendto : (s : int, buf : void#, len : size, flags : int, to : void#, tolen : int -> int)
const shutdown : (s : int, how : int -> int)
const socketpair : (domain : int, kind : int, protocol : int, rsv : int# -> int)
const rmdir : (path : byte# -> int)
const utimes : (path : byte#, tptr : timeval# -> int)
const adjtime : (delta : timeval#, olddelta : timeval# -> int)
const setsid : ( -> int)
- const quotactl : (path : byte#, cmd : int, uid : int, arg : caddr -> int)
+ const quotactl : (path : byte#, cmd : int, uid : int, arg : void# -> int)
const lgetfh : (fname : byte#, fhp : fhandle# -> int)
const getfh : (fname : byte#, fhp : fhandle# -> int)
const sysarch : (op : int, parms : byte# -> int)
@@ -1299,7 +1310,7 @@ pkg sys =
const lchown : (path : byte#, uid : int, gid : int -> int)
const aio_read : (aiocbp : aiocb# -> int)
const aio_write : (aiocbp : aiocb# -> int)
- const lio_listio : (mode : int, acb_list : aiocb# #, nent : int, sig : sigevent# -> int)
+ const lio_listio : (mode : int, acb_list : aiocb##, nent : int, sig : sigevent# -> int)
const getdents : (fd : int, buf : byte#, count : size -> int)
const lchmod : (path : byte#, mode : filemode -> int)
const lutimes : (path : byte#, tptr : timeval# -> int)
@@ -1322,7 +1333,7 @@ pkg sys =
const setresuid : (ruid : uid, euid : uid, suid : uid -> int)
const setresgid : (rgid : gid, egid : gid, sgid : gid -> int)
const aio_return : (aiocbp : aiocb# -> size)
- const aio_suspend : (aiocbp : aiocb# #, nent : int, timeout : timespec# -> int)
+ const aio_suspend : (aiocbp : aiocb##, nent : int, timeout : timespec# -> int)
const aio_cancel : (fd : int, aiocbp : aiocb# -> int)
const aio_error : (aiocbp : aiocb# -> int)
const mlockall : (how : int -> int)
@@ -1467,10 +1478,10 @@ pkg sys =
const cap_ioctls_get : (fd : int, cmds : uint64#, maxcmds : size -> size)
const cap_fcntls_limit : (fd : int, fcntlrights : uint32 -> int)
const cap_fcntls_get : (fd : int, fcntlrightsp : uint32# -> int)
- const bindat : (fd : int, s : int, name : caddr, namelen : int -> int)
- const connectat : (fd : int, s : int, name : caddr, namelen : int -> int)
+ const bindat : (fd : int, s : int, name : void#, namelen : int -> int)
+ const connectat : (fd : int, s : int, name : void#, namelen : int -> int)
const chflagsat : (fd : int, path : byte#, flags : uint64, atflag : int -> int)
- const accept4 : (s : int, name : sockaddr# , anamelen : socklen# , flags : int -> int)
+ const accept4 : (s : int, name : sockaddr#, anamelen : int32#, flags : int -> int)
const pipe2 : (fildes : int#, flags : int -> int)
const aio_mlock : (aiocbp : aiocb# -> int)
const procctl : (idtype : idtype, id : id, com : int, data : void# -> int)
@@ -1479,7 +1490,8 @@ pkg sys =
const utimensat : (fd : int, path : byte#, times : timespec#, flag : int -> int)
;;
- /* manual overrides */ /* pkg sys */
+ /* start manual overrides { */
+ /* pkg sys */
/* process control */
/* wrappers to extract wait status */
@@ -1509,10 +1521,7 @@ pkg sys =
*/
generic a = {x : @t; -> (x : uint64)}
- extern const cstring : (str : byte[:] -> byte#)
- extern const alloca : (sz : size -> byte#)
- extern const __freebsd_pipe : (fds : fd[2]# -> int64)
/* process management */
const exit = {status; syscall(Sysexit, a(status))}
@@ -1700,7 +1709,7 @@ pkg sys =
;;
mib[0] = 1 /* CTL_KERN */
- mib[1] = 4 /* KERN_OSVERSION */
+ mib[1] = 4 /* KERN_VERSION */
ver = (buf.version[:] : void#)
versz = buf.version.len
ret = sysctl(mib[:], ver, &versz, (0 : void#), (0 : size#))
@@ -1719,35 +1728,36 @@ pkg sys =
-> 0
}
+ /* } end manual overrides */
const nosys = {
-> (syscall(Sysnosys) : int)
}
const link = {path, link
- -> (syscall(Syslink, a(link)) : int)
+ -> (syscall(Syslink, a(path), a(link)) : int)
}
const fchdir = {fd
- -> (syscall(Sysfchdir) : int)
+ -> (syscall(Sysfchdir, a(fd)) : int)
}
const mknod = {path, mode, dev
- -> (syscall(Sysmknod, a(mode), a(dev)) : int)
+ -> (syscall(Sysmknod, a(path), a(mode), a(dev)) : int)
}
const chmod = {path, mode
- -> (syscall(Syschmod, a(mode)) : int)
+ -> (syscall(Syschmod, a(path), a(mode)) : int)
}
const chown = {path, uid, gid
- -> (syscall(Syschown, a(uid), a(gid)) : int)
+ -> (syscall(Syschown, a(path), a(uid), a(gid)) : int)
}
const obreak = {nsize
- -> (syscall(Sysobreak) : int)
+ -> (syscall(Sysobreak, a(nsize)) : int)
}
const mount = {kind, path, flags, data
- -> (syscall(Sysmount, a(path), a(flags), a(data)) : int)
+ -> (syscall(Sysmount, a(kind), a(path), a(flags), a(data)) : int)
}
const unmount = {path, flags
- -> (syscall(Sysunmount, a(flags)) : int)
+ -> (syscall(Sysunmount, a(path), a(flags)) : int)
}
const setuid = {uid
- -> (syscall(Syssetuid) : int)
+ -> (syscall(Syssetuid, a(uid)) : int)
}
const getuid = {
-> (syscall(Sysgetuid) : uid)
@@ -1756,31 +1766,31 @@ const geteuid = {
-> (syscall(Sysgeteuid) : uid)
}
const ptrace = {req, pid, addr, data
- -> (syscall(Sysptrace, a(pid), a(addr), a(data)) : int)
+ -> (syscall(Sysptrace, a(req), a(pid), a(addr), a(data)) : int)
}
const recvmsg = {s, msg, flags
- -> (syscall(Sysrecvmsg, a(msg), a(flags)) : int)
+ -> (syscall(Sysrecvmsg, a(s), a(msg), a(flags)) : int)
}
const sendmsg = {s, msg, flags
- -> (syscall(Syssendmsg, a(msg), a(flags)) : int)
+ -> (syscall(Syssendmsg, a(s), a(msg), a(flags)) : int)
}
const recvfrom = {s, buf, len, flags, from, fromlenaddr
- -> (syscall(Sysrecvfrom, a(buf), a(len), a(flags), a(from), a(fromlenaddr)) : int)
+ -> (syscall(Sysrecvfrom, a(s), a(buf), a(len), a(flags), a(from), a(fromlenaddr)) : int)
}
const getpeername = {fdes, asa, alen
- -> (syscall(Sysgetpeername, a(asa), a(alen)) : int)
+ -> (syscall(Sysgetpeername, a(fdes), a(asa), a(alen)) : int)
}
const getsockname = {fdes, asa, alen
- -> (syscall(Sysgetsockname, a(asa), a(alen)) : int)
+ -> (syscall(Sysgetsockname, a(fdes), a(asa), a(alen)) : int)
}
const access = {path, amode
- -> (syscall(Sysaccess, a(amode)) : int)
+ -> (syscall(Sysaccess, a(path), a(amode)) : int)
}
const chflags = {path, flags
- -> (syscall(Syschflags, a(flags)) : int)
+ -> (syscall(Syschflags, a(path), a(flags)) : int)
}
const fchflags = {fd, flags
- -> (syscall(Sysfchflags, a(flags)) : int)
+ -> (syscall(Sysfchflags, a(fd), a(flags)) : int)
}
const sync = {
-> (syscall(Syssync) : int)
@@ -1792,794 +1802,794 @@ const getegid = {
-> (syscall(Sysgetegid) : gid)
}
const profil = {samples, size, offset, scale
- -> (syscall(Sysprofil, a(size), a(offset), a(scale)) : int)
+ -> (syscall(Sysprofil, a(samples), a(size), a(offset), a(scale)) : int)
}
const ktrace = {fname, ops, facs, pid
- -> (syscall(Sysktrace, a(ops), a(facs), a(pid)) : int)
+ -> (syscall(Sysktrace, a(fname), a(ops), a(facs), a(pid)) : int)
}
const getgid = {
-> (syscall(Sysgetgid) : gid)
}
const getlogin = {namebuf, namelen
- -> (syscall(Sysgetlogin, a(namelen)) : int)
+ -> (syscall(Sysgetlogin, a(namebuf), a(namelen)) : int)
}
const setlogin = {namebuf
- -> (syscall(Syssetlogin) : int)
+ -> (syscall(Syssetlogin, a(namebuf)) : int)
}
const acct = {path
- -> (syscall(Sysacct) : int)
+ -> (syscall(Sysacct, a(path)) : int)
}
const sigaltstack = {ss, oss
- -> (syscall(Syssigaltstack, a(oss)) : int)
+ -> (syscall(Syssigaltstack, a(ss), a(oss)) : int)
}
const reboot = {opt
- -> (syscall(Sysreboot) : int)
+ -> (syscall(Sysreboot, a(opt)) : int)
}
const revoke = {path
- -> (syscall(Sysrevoke) : int)
+ -> (syscall(Sysrevoke, a(path)) : int)
}
const symlink = {path, link
- -> (syscall(Syssymlink, a(link)) : int)
+ -> (syscall(Syssymlink, a(path), a(link)) : int)
}
const readlink = {path, buf, count
- -> (syscall(Sysreadlink, a(buf), a(count)) : size)
+ -> (syscall(Sysreadlink, a(path), a(buf), a(count)) : size)
}
const umask = {newmask
- -> (syscall(Sysumask) : int)
+ -> (syscall(Sysumask, a(newmask)) : int)
}
const chroot = {path
- -> (syscall(Syschroot) : int)
+ -> (syscall(Syschroot, a(path)) : int)
}
const msync = {addr, len, flags
- -> (syscall(Sysmsync, a(len), a(flags)) : int)
+ -> (syscall(Sysmsync, a(addr), a(len), a(flags)) : int)
}
const vfork = {
-> (syscall(Sysvfork) : int)
}
const sbrk = {incr
- -> (syscall(Syssbrk) : int)
+ -> (syscall(Syssbrk, a(incr)) : int)
}
const sstk = {incr
- -> (syscall(Syssstk) : int)
+ -> (syscall(Syssstk, a(incr)) : int)
}
const ovadvise = {anom
- -> (syscall(Sysovadvise) : int)
+ -> (syscall(Sysovadvise, a(anom)) : int)
}
const mprotect = {addr, len, prot
- -> (syscall(Sysmprotect, a(len), a(prot)) : int)
+ -> (syscall(Sysmprotect, a(addr), a(len), a(prot)) : int)
}
const madvise = {addr, len, behav
- -> (syscall(Sysmadvise, a(len), a(behav)) : int)
+ -> (syscall(Sysmadvise, a(addr), a(len), a(behav)) : int)
}
const mincore = {addr, len, vec
- -> (syscall(Sysmincore, a(len), a(vec)) : int)
+ -> (syscall(Sysmincore, a(addr), a(len), a(vec)) : int)
}
const getgroups = {gidsetsize, gidset
- -> (syscall(Sysgetgroups, a(gidset)) : int)
+ -> (syscall(Sysgetgroups, a(gidsetsize), a(gidset)) : int)
}
const setgroups = {gidsetsize, gidset
- -> (syscall(Syssetgroups, a(gidset)) : int)
+ -> (syscall(Syssetgroups, a(gidsetsize), a(gidset)) : int)
}
const getpgrp = {
-> (syscall(Sysgetpgrp) : int)
}
const setpgid = {pid, pgid
- -> (syscall(Syssetpgid, a(pgid)) : int)
+ -> (syscall(Syssetpgid, a(pid), a(pgid)) : int)
}
const setitimer = {which, itv, oitv
- -> (syscall(Syssetitimer, a(itv), a(oitv)) : int)
+ -> (syscall(Syssetitimer, a(which), a(itv), a(oitv)) : int)
}
const swapon = {name
- -> (syscall(Sysswapon) : int)
+ -> (syscall(Sysswapon, a(name)) : int)
}
const getitimer = {which, itv
- -> (syscall(Sysgetitimer, a(itv)) : int)
+ -> (syscall(Sysgetitimer, a(which), a(itv)) : int)
}
const getdtablesize = {
-> (syscall(Sysgetdtablesize) : int)
}
const select = {nd, _in, ou, ex, tv
- -> (syscall(Sysselect, a(_in), a(ou), a(ex), a(tv)) : int)
+ -> (syscall(Sysselect, a(nd), a(_in), a(ou), a(ex), a(tv)) : int)
}
const fsync = {fd
- -> (syscall(Sysfsync) : int)
+ -> (syscall(Sysfsync, a(fd)) : int)
}
const setpriority = {which, who, prio
- -> (syscall(Syssetpriority, a(who), a(prio)) : int)
+ -> (syscall(Syssetpriority, a(which), a(who), a(prio)) : int)
}
const getpriority = {which, who
- -> (syscall(Sysgetpriority, a(who)) : int)
+ -> (syscall(Sysgetpriority, a(which), a(who)) : int)
}
const gettimeofday = {tp, tzp
- -> (syscall(Sysgettimeofday, a(tzp)) : int)
+ -> (syscall(Sysgettimeofday, a(tp), a(tzp)) : int)
}
const getrusage = {who, rusage
- -> (syscall(Sysgetrusage, a(rusage)) : int)
+ -> (syscall(Sysgetrusage, a(who), a(rusage)) : int)
}
const settimeofday = {tv, tzp
- -> (syscall(Syssettimeofday, a(tzp)) : int)
+ -> (syscall(Syssettimeofday, a(tv), a(tzp)) : int)
}
const fchown = {fd, uid, gid
- -> (syscall(Sysfchown, a(uid), a(gid)) : int)
+ -> (syscall(Sysfchown, a(fd), a(uid), a(gid)) : int)
}
const fchmod = {fd, mode
- -> (syscall(Sysfchmod, a(mode)) : int)
+ -> (syscall(Sysfchmod, a(fd), a(mode)) : int)
}
const setreuid = {ruid, euid
- -> (syscall(Syssetreuid, a(euid)) : int)
+ -> (syscall(Syssetreuid, a(ruid), a(euid)) : int)
}
const setregid = {rgid, egid
- -> (syscall(Syssetregid, a(egid)) : int)
+ -> (syscall(Syssetregid, a(rgid), a(egid)) : int)
}
const rename = {from, to
- -> (syscall(Sysrename, a(to)) : int)
+ -> (syscall(Sysrename, a(from), a(to)) : int)
}
const flock = {fd, how
- -> (syscall(Sysflock, a(how)) : int)
+ -> (syscall(Sysflock, a(fd), a(how)) : int)
}
const mkfifo = {path, mode
- -> (syscall(Sysmkfifo, a(mode)) : int)
+ -> (syscall(Sysmkfifo, a(path), a(mode)) : int)
}
const sendto = {s, buf, len, flags, to, tolen
- -> (syscall(Syssendto, a(buf), a(len), a(flags), a(to), a(tolen)) : int)
+ -> (syscall(Syssendto, a(s), a(buf), a(len), a(flags), a(to), a(tolen)) : int)
}
const shutdown = {s, how
- -> (syscall(Sysshutdown, a(how)) : int)
+ -> (syscall(Sysshutdown, a(s), a(how)) : int)
}
const socketpair = {domain, kind, protocol, rsv
- -> (syscall(Syssocketpair, a(kind), a(protocol), a(rsv)) : int)
+ -> (syscall(Syssocketpair, a(domain), a(kind), a(protocol), a(rsv)) : int)
}
const rmdir = {path
- -> (syscall(Sysrmdir) : int)
+ -> (syscall(Sysrmdir, a(path)) : int)
}
const utimes = {path, tptr
- -> (syscall(Sysutimes, a(tptr)) : int)
+ -> (syscall(Sysutimes, a(path), a(tptr)) : int)
}
const adjtime = {delta, olddelta
- -> (syscall(Sysadjtime, a(olddelta)) : int)
+ -> (syscall(Sysadjtime, a(delta), a(olddelta)) : int)
}
const setsid = {
-> (syscall(Syssetsid) : int)
}
const quotactl = {path, cmd, uid, arg
- -> (syscall(Sysquotactl, a(cmd), a(uid), a(arg)) : int)
+ -> (syscall(Sysquotactl, a(path), a(cmd), a(uid), a(arg)) : int)
}
const lgetfh = {fname, fhp
- -> (syscall(Syslgetfh, a(fhp)) : int)
+ -> (syscall(Syslgetfh, a(fname), a(fhp)) : int)
}
const getfh = {fname, fhp
- -> (syscall(Sysgetfh, a(fhp)) : int)
+ -> (syscall(Sysgetfh, a(fname), a(fhp)) : int)
}
const sysarch = {op, parms
- -> (syscall(Syssysarch, a(parms)) : int)
+ -> (syscall(Syssysarch, a(op), a(parms)) : int)
}
const rtprio = {function, pid, rtp
- -> (syscall(Sysrtprio, a(pid), a(rtp)) : int)
+ -> (syscall(Sysrtprio, a(function), a(pid), a(rtp)) : int)
}
const setfib = {fibnum
- -> (syscall(Syssetfib) : int)
+ -> (syscall(Syssetfib, a(fibnum)) : int)
}
const ntp_adjtime = {tp
- -> (syscall(Sysntp_adjtime) : int)
+ -> (syscall(Sysntp_adjtime, a(tp)) : int)
}
const setgid = {gid
- -> (syscall(Syssetgid) : int)
+ -> (syscall(Syssetgid, a(gid)) : int)
}
const setegid = {egid
- -> (syscall(Syssetegid) : int)
+ -> (syscall(Syssetegid, a(egid)) : int)
}
const seteuid = {euid
- -> (syscall(Sysseteuid) : int)
+ -> (syscall(Sysseteuid, a(euid)) : int)
}
const pathconf = {path, name
- -> (syscall(Syspathconf, a(name)) : int)
+ -> (syscall(Syspathconf, a(path), a(name)) : int)
}
const fpathconf = {fd, name
- -> (syscall(Sysfpathconf, a(name)) : int)
+ -> (syscall(Sysfpathconf, a(fd), a(name)) : int)
}
const getrlimit = {which, rlp
- -> (syscall(Sysgetrlimit, a(rlp)) : int)
+ -> (syscall(Sysgetrlimit, a(which), a(rlp)) : int)
}
const setrlimit = {which, rlp
- -> (syscall(Syssetrlimit, a(rlp)) : int)
+ -> (syscall(Syssetrlimit, a(which), a(rlp)) : int)
}
const __sysctl = {name, namelen, old, oldlenp, new, newlen
- -> (syscall(Sys__sysctl, a(namelen), a(old), a(oldlenp), a(new), a(newlen)) : int)
+ -> (syscall(Sys__sysctl, a(name), a(namelen), a(old), a(oldlenp), a(new), a(newlen)) : int)
}
const mlock = {addr, len
- -> (syscall(Sysmlock, a(len)) : int)
+ -> (syscall(Sysmlock, a(addr), a(len)) : int)
}
const munlock = {addr, len
- -> (syscall(Sysmunlock, a(len)) : int)
+ -> (syscall(Sysmunlock, a(addr), a(len)) : int)
}
const undelete = {path
- -> (syscall(Sysundelete) : int)
+ -> (syscall(Sysundelete, a(path)) : int)
}
const futimes = {fd, tptr
- -> (syscall(Sysfutimes, a(tptr)) : int)
+ -> (syscall(Sysfutimes, a(fd), a(tptr)) : int)
}
const getpgid = {pid
- -> (syscall(Sysgetpgid) : int)
+ -> (syscall(Sysgetpgid, a(pid)) : int)
}
const ktimer_create = {clock_id, evp, timerid
- -> (syscall(Sysktimer_create, a(evp), a(timerid)) : int)
+ -> (syscall(Sysktimer_create, a(clock_id), a(evp), a(timerid)) : int)
}
const ktimer_delete = {timerid
- -> (syscall(Sysktimer_delete) : int)
+ -> (syscall(Sysktimer_delete, a(timerid)) : int)
}
const ktimer_settime = {timerid, flags, value, ovalue
- -> (syscall(Sysktimer_settime, a(flags), a(value), a(ovalue)) : int)
+ -> (syscall(Sysktimer_settime, a(timerid), a(flags), a(value), a(ovalue)) : int)
}
const ktimer_gettime = {timerid, value
- -> (syscall(Sysktimer_gettime, a(value)) : int)
+ -> (syscall(Sysktimer_gettime, a(timerid), a(value)) : int)
}
const ktimer_getoverrun = {timerid
- -> (syscall(Sysktimer_getoverrun) : int)
+ -> (syscall(Sysktimer_getoverrun, a(timerid)) : int)
}
const ffclock_getcounter = {ffcount
- -> (syscall(Sysffclock_getcounter) : int)
+ -> (syscall(Sysffclock_getcounter, a(ffcount)) : int)
}
const ffclock_setestimate = {cest
- -> (syscall(Sysffclock_setestimate) : int)
+ -> (syscall(Sysffclock_setestimate, a(cest)) : int)
}
const ffclock_getestimate = {cest
- -> (syscall(Sysffclock_getestimate) : int)
+ -> (syscall(Sysffclock_getestimate, a(cest)) : int)
}
const clock_getcpuclockid2 = {id, which, clock_id
- -> (syscall(Sysclock_getcpuclockid2, a(which), a(clock_id)) : int)
+ -> (syscall(Sysclock_getcpuclockid2, a(id), a(which), a(clock_id)) : int)
}
const minherit = {addr, len, inherit
- -> (syscall(Sysminherit, a(len), a(inherit)) : int)
+ -> (syscall(Sysminherit, a(addr), a(len), a(inherit)) : int)
}
const rfork = {flags
- -> (syscall(Sysrfork) : int)
+ -> (syscall(Sysrfork, a(flags)) : int)
}
const openbsd_poll = {fds, nfds, timeout
- -> (syscall(Sysopenbsd_poll, a(nfds), a(timeout)) : int)
+ -> (syscall(Sysopenbsd_poll, a(fds), a(nfds), a(timeout)) : int)
}
const issetugid = {
-> (syscall(Sysissetugid) : int)
}
const lchown = {path, uid, gid
- -> (syscall(Syslchown, a(uid), a(gid)) : int)
+ -> (syscall(Syslchown, a(path), a(uid), a(gid)) : int)
}
const aio_read = {aiocbp
- -> (syscall(Sysaio_read) : int)
+ -> (syscall(Sysaio_read, a(aiocbp)) : int)
}
const aio_write = {aiocbp
- -> (syscall(Sysaio_write) : int)
+ -> (syscall(Sysaio_write, a(aiocbp)) : int)
}
const lio_listio = {mode, acb_list, nent, sig
- -> (syscall(Syslio_listio, a(acb_list), a(nent), a(sig)) : int)
+ -> (syscall(Syslio_listio, a(mode), a(acb_list), a(nent), a(sig)) : int)
}
const getdents = {fd, buf, count
- -> (syscall(Sysgetdents, a(buf), a(count)) : int)
+ -> (syscall(Sysgetdents, a(fd), a(buf), a(count)) : int)
}
const lchmod = {path, mode
- -> (syscall(Syslchmod, a(mode)) : int)
+ -> (syscall(Syslchmod, a(path), a(mode)) : int)
}
const lutimes = {path, tptr
- -> (syscall(Syslutimes, a(tptr)) : int)
+ -> (syscall(Syslutimes, a(path), a(tptr)) : int)
}
const nstat = {path, ub
- -> (syscall(Sysnstat, a(ub)) : int)
+ -> (syscall(Sysnstat, a(path), a(ub)) : int)
}
const nfstat = {fd, sb
- -> (syscall(Sysnfstat, a(sb)) : int)
+ -> (syscall(Sysnfstat, a(fd), a(sb)) : int)
}
const nlstat = {path, ub
- -> (syscall(Sysnlstat, a(ub)) : int)
+ -> (syscall(Sysnlstat, a(path), a(ub)) : int)
}
const preadv = {fd, iovp, iovcnt, offset
- -> (syscall(Syspreadv, a(iovp), a(iovcnt), a(offset)) : size)
+ -> (syscall(Syspreadv, a(fd), a(iovp), a(iovcnt), a(offset)) : size)
}
const pwritev = {fd, iovp, iovcnt, offset
- -> (syscall(Syspwritev, a(iovp), a(iovcnt), a(offset)) : size)
+ -> (syscall(Syspwritev, a(fd), a(iovp), a(iovcnt), a(offset)) : size)
}
const fhopen = {u_fhp, flags
- -> (syscall(Sysfhopen, a(flags)) : int)
+ -> (syscall(Sysfhopen, a(u_fhp), a(flags)) : int)
}
const fhstat = {u_fhp, sb
- -> (syscall(Sysfhstat, a(sb)) : int)
+ -> (syscall(Sysfhstat, a(u_fhp), a(sb)) : int)
}
const modnext = {modid
- -> (syscall(Sysmodnext) : int)
+ -> (syscall(Sysmodnext, a(modid)) : int)
}
const modfnext = {modid
- -> (syscall(Sysmodfnext) : int)
+ -> (syscall(Sysmodfnext, a(modid)) : int)
}
const modfind = {name
- -> (syscall(Sysmodfind) : int)
+ -> (syscall(Sysmodfind, a(name)) : int)
}
const kldload = {file
- -> (syscall(Syskldload) : int)
+ -> (syscall(Syskldload, a(file)) : int)
}
const kldunload = {fileid
- -> (syscall(Syskldunload) : int)
+ -> (syscall(Syskldunload, a(fileid)) : int)
}
const kldfind = {file
- -> (syscall(Syskldfind) : int)
+ -> (syscall(Syskldfind, a(file)) : int)
}
const kldnext = {fileid
- -> (syscall(Syskldnext) : int)
+ -> (syscall(Syskldnext, a(fileid)) : int)
}
const kldfirstmod = {fileid
- -> (syscall(Syskldfirstmod) : int)
+ -> (syscall(Syskldfirstmod, a(fileid)) : int)
}
const getsid = {pid
- -> (syscall(Sysgetsid) : int)
+ -> (syscall(Sysgetsid, a(pid)) : int)
}
const setresuid = {ruid, euid, suid
- -> (syscall(Syssetresuid, a(euid), a(suid)) : int)
+ -> (syscall(Syssetresuid, a(ruid), a(euid), a(suid)) : int)
}
const setresgid = {rgid, egid, sgid
- -> (syscall(Syssetresgid, a(egid), a(sgid)) : int)
+ -> (syscall(Syssetresgid, a(rgid), a(egid), a(sgid)) : int)
}
const aio_return = {aiocbp
- -> (syscall(Sysaio_return) : size)
+ -> (syscall(Sysaio_return, a(aiocbp)) : size)
}
const aio_suspend = {aiocbp, nent, timeout
- -> (syscall(Sysaio_suspend, a(nent), a(timeout)) : int)
+ -> (syscall(Sysaio_suspend, a(aiocbp), a(nent), a(timeout)) : int)
}
const aio_cancel = {fd, aiocbp
- -> (syscall(Sysaio_cancel, a(aiocbp)) : int)
+ -> (syscall(Sysaio_cancel, a(fd), a(aiocbp)) : int)
}
const aio_error = {aiocbp
- -> (syscall(Sysaio_error) : int)
+ -> (syscall(Sysaio_error, a(aiocbp)) : int)
}
const mlockall = {how
- -> (syscall(Sysmlockall) : int)
+ -> (syscall(Sysmlockall, a(how)) : int)
}
const munlockall = {
-> (syscall(Sysmunlockall) : int)
}
const sched_setparam = {pid, param
- -> (syscall(Syssched_setparam, a(param)) : int)
+ -> (syscall(Syssched_setparam, a(pid), a(param)) : int)
}
const sched_getparam = {pid, param
- -> (syscall(Syssched_getparam, a(param)) : int)
+ -> (syscall(Syssched_getparam, a(pid), a(param)) : int)
}
const sched_setscheduler = {pid, policy, param
- -> (syscall(Syssched_setscheduler, a(policy), a(param)) : int)
+ -> (syscall(Syssched_setscheduler, a(pid), a(policy), a(param)) : int)
}
const sched_getscheduler = {pid
- -> (syscall(Syssched_getscheduler) : int)
+ -> (syscall(Syssched_getscheduler, a(pid)) : int)
}
const sched_get_priority_max = {policy
- -> (syscall(Syssched_get_priority_max) : int)
+ -> (syscall(Syssched_get_priority_max, a(policy)) : int)
}
const sched_get_priority_min = {policy
- -> (syscall(Syssched_get_priority_min) : int)
+ -> (syscall(Syssched_get_priority_min, a(policy)) : int)
}
const sched_rr_get_interval = {pid, interval
- -> (syscall(Syssched_rr_get_interval, a(interval)) : int)
+ -> (syscall(Syssched_rr_get_interval, a(pid), a(interval)) : int)
}
const utrace = {addr, len
- -> (syscall(Sysutrace, a(len)) : int)
+ -> (syscall(Sysutrace, a(addr), a(len)) : int)
}
const kldsym = {fileid, cmd, data
- -> (syscall(Syskldsym, a(cmd), a(data)) : int)
+ -> (syscall(Syskldsym, a(fileid), a(cmd), a(data)) : int)
}
const jail = {jail
- -> (syscall(Sysjail) : int)
+ -> (syscall(Sysjail, a(jail)) : int)
}
const sigsuspend = {sigmask
- -> (syscall(Syssigsuspend) : int)
+ -> (syscall(Syssigsuspend, a(sigmask)) : int)
}
const sigpending = {set
- -> (syscall(Syssigpending) : int)
+ -> (syscall(Syssigpending, a(set)) : int)
}
const sigtimedwait = {set, info, timeout
- -> (syscall(Syssigtimedwait, a(info), a(timeout)) : int)
+ -> (syscall(Syssigtimedwait, a(set), a(info), a(timeout)) : int)
}
const sigwaitinfo = {set, info
- -> (syscall(Syssigwaitinfo, a(info)) : int)
+ -> (syscall(Syssigwaitinfo, a(set), a(info)) : int)
}
const __acl_get_file = {path, kind, aclp
- -> (syscall(Sys__acl_get_file, a(kind), a(aclp)) : int)
+ -> (syscall(Sys__acl_get_file, a(path), a(kind), a(aclp)) : int)
}
const __acl_set_file = {path, kind, aclp
- -> (syscall(Sys__acl_set_file, a(kind), a(aclp)) : int)
+ -> (syscall(Sys__acl_set_file, a(path), a(kind), a(aclp)) : int)
}
const __acl_get_fd = {filedes, kind, aclp
- -> (syscall(Sys__acl_get_fd, a(kind), a(aclp)) : int)
+ -> (syscall(Sys__acl_get_fd, a(filedes), a(kind), a(aclp)) : int)
}
const __acl_set_fd = {filedes, kind, aclp
- -> (syscall(Sys__acl_set_fd, a(kind), a(aclp)) : int)
+ -> (syscall(Sys__acl_set_fd, a(filedes), a(kind), a(aclp)) : int)
}
const __acl_delete_file = {path, kind
- -> (syscall(Sys__acl_delete_file, a(kind)) : int)
+ -> (syscall(Sys__acl_delete_file, a(path), a(kind)) : int)
}
const __acl_delete_fd = {filedes, kind
- -> (syscall(Sys__acl_delete_fd, a(kind)) : int)
+ -> (syscall(Sys__acl_delete_fd, a(filedes), a(kind)) : int)
}
const __acl_aclcheck_file = {path, kind, aclp
- -> (syscall(Sys__acl_aclcheck_file, a(kind), a(aclp)) : int)
+ -> (syscall(Sys__acl_aclcheck_file, a(path), a(kind), a(aclp)) : int)
}
const __acl_aclcheck_fd = {filedes, kind, aclp
- -> (syscall(Sys__acl_aclcheck_fd, a(kind), a(aclp)) : int)
+ -> (syscall(Sys__acl_aclcheck_fd, a(filedes), a(kind), a(aclp)) : int)
}
const extattrctl = {path, cmd, filename, attrnamespace, attrname
- -> (syscall(Sysextattrctl, a(cmd), a(filename), a(attrnamespace), a(attrname)) : int)
+ -> (syscall(Sysextattrctl, a(path), a(cmd), a(filename), a(attrnamespace), a(attrname)) : int)
}
const extattr_set_file = {path, attrnamespace, attrname, data, nbytes
- -> (syscall(Sysextattr_set_file, a(attrnamespace), a(attrname), a(data), a(nbytes)) : size)
+ -> (syscall(Sysextattr_set_file, a(path), a(attrnamespace), a(attrname), a(data), a(nbytes)) : size)
}
const extattr_get_file = {path, attrnamespace, attrname, data, nbytes
- -> (syscall(Sysextattr_get_file, a(attrnamespace), a(attrname), a(data), a(nbytes)) : size)
+ -> (syscall(Sysextattr_get_file, a(path), a(attrnamespace), a(attrname), a(data), a(nbytes)) : size)
}
const extattr_delete_file = {path, attrnamespace, attrname
- -> (syscall(Sysextattr_delete_file, a(attrnamespace), a(attrname)) : int)
+ -> (syscall(Sysextattr_delete_file, a(path), a(attrnamespace), a(attrname)) : int)
}
const aio_waitcomplete = {aiocbp, timeout
- -> (syscall(Sysaio_waitcomplete, a(timeout)) : size)
+ -> (syscall(Sysaio_waitcomplete, a(aiocbp), a(timeout)) : size)
}
const getresuid = {ruid, euid, suid
- -> (syscall(Sysgetresuid, a(euid), a(suid)) : int)
+ -> (syscall(Sysgetresuid, a(ruid), a(euid), a(suid)) : int)
}
const getresgid = {rgid, egid, sgid
- -> (syscall(Sysgetresgid, a(egid), a(sgid)) : int)
+ -> (syscall(Sysgetresgid, a(rgid), a(egid), a(sgid)) : int)
}
const kqueue = {
-> (syscall(Syskqueue) : int)
}
const kevent = {fd, changelist, nchanges, eventlist, nevents, timeout
- -> (syscall(Syskevent, a(changelist), a(nchanges), a(eventlist), a(nevents), a(timeout)) : int)
+ -> (syscall(Syskevent, a(fd), a(changelist), a(nchanges), a(eventlist), a(nevents), a(timeout)) : int)
}
const extattr_set_fd = {fd, attrnamespace, attrname, data, nbytes
- -> (syscall(Sysextattr_set_fd, a(attrnamespace), a(attrname), a(data), a(nbytes)) : size)
+ -> (syscall(Sysextattr_set_fd, a(fd), a(attrnamespace), a(attrname), a(data), a(nbytes)) : size)
}
const extattr_get_fd = {fd, attrnamespace, attrname, data, nbytes
- -> (syscall(Sysextattr_get_fd, a(attrnamespace), a(attrname), a(data), a(nbytes)) : size)
+ -> (syscall(Sysextattr_get_fd, a(fd), a(attrnamespace), a(attrname), a(data), a(nbytes)) : size)
}
const extattr_delete_fd = {fd, attrnamespace, attrname
- -> (syscall(Sysextattr_delete_fd, a(attrnamespace), a(attrname)) : int)
+ -> (syscall(Sysextattr_delete_fd, a(fd), a(attrnamespace), a(attrname)) : int)
}
const __setugid = {flag
- -> (syscall(Sys__setugid) : int)
+ -> (syscall(Sys__setugid, a(flag)) : int)
}
const eaccess = {path, amode
- -> (syscall(Syseaccess, a(amode)) : int)
+ -> (syscall(Syseaccess, a(path), a(amode)) : int)
}
const nmount = {iovp, iovcnt, flags
- -> (syscall(Sysnmount, a(iovcnt), a(flags)) : int)
+ -> (syscall(Sysnmount, a(iovp), a(iovcnt), a(flags)) : int)
}
const __mac_get_proc = {mac_p
- -> (syscall(Sys__mac_get_proc) : int)
+ -> (syscall(Sys__mac_get_proc, a(mac_p)) : int)
}
const __mac_set_proc = {mac_p
- -> (syscall(Sys__mac_set_proc) : int)
+ -> (syscall(Sys__mac_set_proc, a(mac_p)) : int)
}
const __mac_get_fd = {fd, mac_p
- -> (syscall(Sys__mac_get_fd, a(mac_p)) : int)
+ -> (syscall(Sys__mac_get_fd, a(fd), a(mac_p)) : int)
}
const __mac_get_file = {path_p, mac_p
- -> (syscall(Sys__mac_get_file, a(mac_p)) : int)
+ -> (syscall(Sys__mac_get_file, a(path_p), a(mac_p)) : int)
}
const __mac_set_fd = {fd, mac_p
- -> (syscall(Sys__mac_set_fd, a(mac_p)) : int)
+ -> (syscall(Sys__mac_set_fd, a(fd), a(mac_p)) : int)
}
const __mac_set_file = {path_p, mac_p
- -> (syscall(Sys__mac_set_file, a(mac_p)) : int)
+ -> (syscall(Sys__mac_set_file, a(path_p), a(mac_p)) : int)
}
const kenv = {what, name, value, len
- -> (syscall(Syskenv, a(name), a(value), a(len)) : int)
+ -> (syscall(Syskenv, a(what), a(name), a(value), a(len)) : int)
}
const lchflags = {path, flags
- -> (syscall(Syslchflags, a(flags)) : int)
+ -> (syscall(Syslchflags, a(path), a(flags)) : int)
}
const uuidgen = {store, count
- -> (syscall(Sysuuidgen, a(count)) : int)
+ -> (syscall(Sysuuidgen, a(store), a(count)) : int)
}
const sendfile = {fd, s, offset, nbytes, hdtr, sbytes, flags
- -> (syscall(Syssendfile, a(s), a(offset), a(nbytes), a(hdtr), a(sbytes), a(flags)) : int)
+ -> (syscall(Syssendfile, a(fd), a(s), a(offset), a(nbytes), a(hdtr), a(sbytes), a(flags)) : int)
}
const mac_syscall = {policy, call, arg
- -> (syscall(Sysmac_syscall, a(call), a(arg)) : int)
+ -> (syscall(Sysmac_syscall, a(policy), a(call), a(arg)) : int)
}
const getfsstat = {buf, bufsize, flags
- -> (syscall(Sysgetfsstat, a(bufsize), a(flags)) : int)
+ -> (syscall(Sysgetfsstat, a(buf), a(bufsize), a(flags)) : int)
}
const statfs = {path, buf
- -> (syscall(Sysstatfs, a(buf)) : int)
+ -> (syscall(Sysstatfs, a(path), a(buf)) : int)
}
const fstatfs = {fd, buf
- -> (syscall(Sysfstatfs, a(buf)) : int)
+ -> (syscall(Sysfstatfs, a(fd), a(buf)) : int)
}
const fhstatfs = {u_fhp, buf
- -> (syscall(Sysfhstatfs, a(buf)) : int)
+ -> (syscall(Sysfhstatfs, a(u_fhp), a(buf)) : int)
}
const __mac_get_pid = {pid, mac_p
- -> (syscall(Sys__mac_get_pid, a(mac_p)) : int)
+ -> (syscall(Sys__mac_get_pid, a(pid), a(mac_p)) : int)
}
const __mac_get_link = {path_p, mac_p
- -> (syscall(Sys__mac_get_link, a(mac_p)) : int)
+ -> (syscall(Sys__mac_get_link, a(path_p), a(mac_p)) : int)
}
const __mac_set_link = {path_p, mac_p
- -> (syscall(Sys__mac_set_link, a(mac_p)) : int)
+ -> (syscall(Sys__mac_set_link, a(path_p), a(mac_p)) : int)
}
const extattr_set_link = {path, attrnamespace, attrname, data, nbytes
- -> (syscall(Sysextattr_set_link, a(attrnamespace), a(attrname), a(data), a(nbytes)) : size)
+ -> (syscall(Sysextattr_set_link, a(path), a(attrnamespace), a(attrname), a(data), a(nbytes)) : size)
}
const extattr_get_link = {path, attrnamespace, attrname, data, nbytes
- -> (syscall(Sysextattr_get_link, a(attrnamespace), a(attrname), a(data), a(nbytes)) : size)
+ -> (syscall(Sysextattr_get_link, a(path), a(attrnamespace), a(attrname), a(data), a(nbytes)) : size)
}
const extattr_delete_link = {path, attrnamespace, attrname
- -> (syscall(Sysextattr_delete_link, a(attrnamespace), a(attrname)) : int)
+ -> (syscall(Sysextattr_delete_link, a(path), a(attrnamespace), a(attrname)) : int)
}
const __mac_execve = {fname, argv, envv, mac_p
- -> (syscall(Sys__mac_execve, a(argv), a(envv), a(mac_p)) : int)
+ -> (syscall(Sys__mac_execve, a(fname), a(argv), a(envv), a(mac_p)) : int)
}
const sigreturn = {sigcntxp
- -> (syscall(Syssigreturn) : int)
+ -> (syscall(Syssigreturn, a(sigcntxp)) : int)
}
const getcontext = {ucp
- -> (syscall(Sysgetcontext) : int)
+ -> (syscall(Sysgetcontext, a(ucp)) : int)
}
const setcontext = {ucp
- -> (syscall(Syssetcontext) : int)
+ -> (syscall(Syssetcontext, a(ucp)) : int)
}
const swapcontext = {oucp, ucp
- -> (syscall(Sysswapcontext, a(ucp)) : int)
+ -> (syscall(Sysswapcontext, a(oucp), a(ucp)) : int)
}
const swapoff = {name
- -> (syscall(Sysswapoff) : int)
+ -> (syscall(Sysswapoff, a(name)) : int)
}
const __acl_get_link = {path, kind, aclp
- -> (syscall(Sys__acl_get_link, a(kind), a(aclp)) : int)
+ -> (syscall(Sys__acl_get_link, a(path), a(kind), a(aclp)) : int)
}
const __acl_set_link = {path, kind, aclp
- -> (syscall(Sys__acl_set_link, a(kind), a(aclp)) : int)
+ -> (syscall(Sys__acl_set_link, a(path), a(kind), a(aclp)) : int)
}
const __acl_delete_link = {path, kind
- -> (syscall(Sys__acl_delete_link, a(kind)) : int)
+ -> (syscall(Sys__acl_delete_link, a(path), a(kind)) : int)
}
const __acl_aclcheck_link = {path, kind, aclp
- -> (syscall(Sys__acl_aclcheck_link, a(kind), a(aclp)) : int)
+ -> (syscall(Sys__acl_aclcheck_link, a(path), a(kind), a(aclp)) : int)
}
const sigwait = {set, sig
- -> (syscall(Syssigwait, a(sig)) : int)
+ -> (syscall(Syssigwait, a(set), a(sig)) : int)
}
const thr_create = {ctx, id, flags
- -> (syscall(Systhr_create, a(id), a(flags)) : int)
+ -> (syscall(Systhr_create, a(ctx), a(id), a(flags)) : int)
}
const thr_self = {id
- -> (syscall(Systhr_self) : int)
+ -> (syscall(Systhr_self, a(id)) : int)
}
const thr_kill = {id, sig
- -> (syscall(Systhr_kill, a(sig)) : int)
+ -> (syscall(Systhr_kill, a(id), a(sig)) : int)
}
const jail_attach = {jid
- -> (syscall(Sysjail_attach) : int)
+ -> (syscall(Sysjail_attach, a(jid)) : int)
}
const extattr_list_fd = {fd, attrnamespace, data, nbytes
- -> (syscall(Sysextattr_list_fd, a(attrnamespace), a(data), a(nbytes)) : size)
+ -> (syscall(Sysextattr_list_fd, a(fd), a(attrnamespace), a(data), a(nbytes)) : size)
}
const extattr_list_file = {path, attrnamespace, data, nbytes
- -> (syscall(Sysextattr_list_file, a(attrnamespace), a(data), a(nbytes)) : size)
+ -> (syscall(Sysextattr_list_file, a(path), a(attrnamespace), a(data), a(nbytes)) : size)
}
const extattr_list_link = {path, attrnamespace, data, nbytes
- -> (syscall(Sysextattr_list_link, a(attrnamespace), a(data), a(nbytes)) : size)
+ -> (syscall(Sysextattr_list_link, a(path), a(attrnamespace), a(data), a(nbytes)) : size)
}
const thr_suspend = {timeout
- -> (syscall(Systhr_suspend) : int)
+ -> (syscall(Systhr_suspend, a(timeout)) : int)
}
const thr_wake = {id
- -> (syscall(Systhr_wake) : int)
+ -> (syscall(Systhr_wake, a(id)) : int)
}
const kldunloadf = {fileid, flags
- -> (syscall(Syskldunloadf, a(flags)) : int)
+ -> (syscall(Syskldunloadf, a(fileid), a(flags)) : int)
}
const audit = {record, length
- -> (syscall(Sysaudit, a(length)) : int)
+ -> (syscall(Sysaudit, a(record), a(length)) : int)
}
const auditon = {cmd, data, length
- -> (syscall(Sysauditon, a(data), a(length)) : int)
+ -> (syscall(Sysauditon, a(cmd), a(data), a(length)) : int)
}
const _umtx_op = {obj, op, val, uaddr1, uaddr2
- -> (syscall(Sys_umtx_op, a(op), a(val), a(uaddr1), a(uaddr2)) : int)
+ -> (syscall(Sys_umtx_op, a(obj), a(op), a(val), a(uaddr1), a(uaddr2)) : int)
}
const sigqueue = {pid, signum, value
- -> (syscall(Syssigqueue, a(signum), a(value)) : int)
+ -> (syscall(Syssigqueue, a(pid), a(signum), a(value)) : int)
}
const abort2 = {why, nargs, args
- -> (syscall(Sysabort2, a(nargs), a(args)) : int)
+ -> (syscall(Sysabort2, a(why), a(nargs), a(args)) : int)
}
const thr_set_name = {id, name
- -> (syscall(Systhr_set_name, a(name)) : int)
+ -> (syscall(Systhr_set_name, a(id), a(name)) : int)
}
const aio_fsync = {op, aiocbp
- -> (syscall(Sysaio_fsync, a(aiocbp)) : int)
+ -> (syscall(Sysaio_fsync, a(op), a(aiocbp)) : int)
}
const rtprio_thread = {function, lwpid, rtp
- -> (syscall(Sysrtprio_thread, a(lwpid), a(rtp)) : int)
+ -> (syscall(Sysrtprio_thread, a(function), a(lwpid), a(rtp)) : int)
}
const truncate = {path, length
- -> (syscall(Systruncate, a(length)) : int)
+ -> (syscall(Systruncate, a(path), a(length)) : int)
}
const ftruncate = {fd, length
- -> (syscall(Sysftruncate, a(length)) : int)
+ -> (syscall(Sysftruncate, a(fd), a(length)) : int)
}
const thr_kill2 = {pid, id, sig
- -> (syscall(Systhr_kill2, a(id), a(sig)) : int)
+ -> (syscall(Systhr_kill2, a(pid), a(id), a(sig)) : int)
}
const shm_open = {path, flags, mode
- -> (syscall(Sysshm_open, a(flags), a(mode)) : int)
+ -> (syscall(Sysshm_open, a(path), a(flags), a(mode)) : int)
}
const shm_unlink = {path
- -> (syscall(Sysshm_unlink) : int)
+ -> (syscall(Sysshm_unlink, a(path)) : int)
}
const cpuset = {setid
- -> (syscall(Syscpuset) : int)
+ -> (syscall(Syscpuset, a(setid)) : int)
}
const cpuset_setid = {which, id, setid
- -> (syscall(Syscpuset_setid, a(id), a(setid)) : int)
+ -> (syscall(Syscpuset_setid, a(which), a(id), a(setid)) : int)
}
const cpuset_getid = {level, which, id, setid
- -> (syscall(Syscpuset_getid, a(which), a(id), a(setid)) : int)
+ -> (syscall(Syscpuset_getid, a(level), a(which), a(id), a(setid)) : int)
}
const cpuset_getaffinity = {level, which, id, cpusetsize, mask
- -> (syscall(Syscpuset_getaffinity, a(which), a(id), a(cpusetsize), a(mask)) : int)
+ -> (syscall(Syscpuset_getaffinity, a(level), a(which), a(id), a(cpusetsize), a(mask)) : int)
}
const cpuset_setaffinity = {level, which, id, cpusetsize, mask
- -> (syscall(Syscpuset_setaffinity, a(which), a(id), a(cpusetsize), a(mask)) : int)
+ -> (syscall(Syscpuset_setaffinity, a(level), a(which), a(id), a(cpusetsize), a(mask)) : int)
}
const faccessat = {fd, path, amode, flag
- -> (syscall(Sysfaccessat, a(path), a(amode), a(flag)) : int)
+ -> (syscall(Sysfaccessat, a(fd), a(path), a(amode), a(flag)) : int)
}
const fchmodat = {fd, path, mode, flag
- -> (syscall(Sysfchmodat, a(path), a(mode), a(flag)) : int)
+ -> (syscall(Sysfchmodat, a(fd), a(path), a(mode), a(flag)) : int)
}
const fchownat = {fd, path, uid, gid, flag
- -> (syscall(Sysfchownat, a(path), a(uid), a(gid), a(flag)) : int)
+ -> (syscall(Sysfchownat, a(fd), a(path), a(uid), a(gid), a(flag)) : int)
}
const fexecve = {fd, argv, envv
- -> (syscall(Sysfexecve, a(argv), a(envv)) : int)
+ -> (syscall(Sysfexecve, a(fd), a(argv), a(envv)) : int)
}
const fstatat = {fd, path, buf, flag
- -> (syscall(Sysfstatat, a(path), a(buf), a(flag)) : int)
+ -> (syscall(Sysfstatat, a(fd), a(path), a(buf), a(flag)) : int)
}
const futimesat = {fd, path, times
- -> (syscall(Sysfutimesat, a(path), a(times)) : int)
+ -> (syscall(Sysfutimesat, a(fd), a(path), a(times)) : int)
}
const linkat = {fd1, path1, fd2, path2, flag
- -> (syscall(Syslinkat, a(path1), a(fd2), a(path2), a(flag)) : int)
+ -> (syscall(Syslinkat, a(fd1), a(path1), a(fd2), a(path2), a(flag)) : int)
}
const mkdirat = {fd, path, mode
- -> (syscall(Sysmkdirat, a(path), a(mode)) : int)
+ -> (syscall(Sysmkdirat, a(fd), a(path), a(mode)) : int)
}
const mkfifoat = {fd, path, mode
- -> (syscall(Sysmkfifoat, a(path), a(mode)) : int)
+ -> (syscall(Sysmkfifoat, a(fd), a(path), a(mode)) : int)
}
const mknodat = {fd, path, mode, dev
- -> (syscall(Sysmknodat, a(path), a(mode), a(dev)) : int)
+ -> (syscall(Sysmknodat, a(fd), a(path), a(mode), a(dev)) : int)
}
const openat = {fd, path, flag, mode
- -> (syscall(Sysopenat, a(path), a(flag), a(mode)) : int)
+ -> (syscall(Sysopenat, a(fd), a(path), a(flag), a(mode)) : int)
}
const readlinkat = {fd, path, buf, bufsize
- -> (syscall(Sysreadlinkat, a(path), a(buf), a(bufsize)) : int)
+ -> (syscall(Sysreadlinkat, a(fd), a(path), a(buf), a(bufsize)) : int)
}
const renameat = {oldfd, old, newfd, new
- -> (syscall(Sysrenameat, a(old), a(newfd), a(new)) : int)
+ -> (syscall(Sysrenameat, a(oldfd), a(old), a(newfd), a(new)) : int)
}
const symlinkat = {path1, fd, path2
- -> (syscall(Syssymlinkat, a(fd), a(path2)) : int)
+ -> (syscall(Syssymlinkat, a(path1), a(fd), a(path2)) : int)
}
const unlinkat = {fd, path, flag
- -> (syscall(Sysunlinkat, a(path), a(flag)) : int)
+ -> (syscall(Sysunlinkat, a(fd), a(path), a(flag)) : int)
}
const posix_openpt = {flags
- -> (syscall(Sysposix_openpt) : int)
+ -> (syscall(Sysposix_openpt, a(flags)) : int)
}
const jail_get = {iovp, iovcnt, flags
- -> (syscall(Sysjail_get, a(iovcnt), a(flags)) : int)
+ -> (syscall(Sysjail_get, a(iovp), a(iovcnt), a(flags)) : int)
}
const jail_set = {iovp, iovcnt, flags
- -> (syscall(Sysjail_set, a(iovcnt), a(flags)) : int)
+ -> (syscall(Sysjail_set, a(iovp), a(iovcnt), a(flags)) : int)
}
const jail_remove = {jid
- -> (syscall(Sysjail_remove) : int)
+ -> (syscall(Sysjail_remove, a(jid)) : int)
}
const closefrom = {lowfd
- -> (syscall(Sysclosefrom) : int)
+ -> (syscall(Sysclosefrom, a(lowfd)) : int)
}
const lpathconf = {path, name
- -> (syscall(Syslpathconf, a(name)) : int)
+ -> (syscall(Syslpathconf, a(path), a(name)) : int)
}
const __cap_rights_get = {version, fd, rightsp
- -> (syscall(Sys__cap_rights_get, a(fd), a(rightsp)) : int)
+ -> (syscall(Sys__cap_rights_get, a(version), a(fd), a(rightsp)) : int)
}
const cap_enter = {
-> (syscall(Syscap_enter) : int)
}
const cap_getmode = {modep
- -> (syscall(Syscap_getmode) : int)
+ -> (syscall(Syscap_getmode, a(modep)) : int)
}
const pdfork = {fdp, flags
- -> (syscall(Syspdfork, a(flags)) : int)
+ -> (syscall(Syspdfork, a(fdp), a(flags)) : int)
}
const pdkill = {fd, signum
- -> (syscall(Syspdkill, a(signum)) : int)
+ -> (syscall(Syspdkill, a(fd), a(signum)) : int)
}
const pdgetpid = {fd, pidp
- -> (syscall(Syspdgetpid, a(pidp)) : int)
+ -> (syscall(Syspdgetpid, a(fd), a(pidp)) : int)
}
const pselect = {nd, _in, ou, ex, ts, sm
- -> (syscall(Syspselect, a(_in), a(ou), a(ex), a(ts), a(sm)) : int)
+ -> (syscall(Syspselect, a(nd), a(_in), a(ou), a(ex), a(ts), a(sm)) : int)
}
const getloginclass = {namebuf, namelen
- -> (syscall(Sysgetloginclass, a(namelen)) : int)
+ -> (syscall(Sysgetloginclass, a(namebuf), a(namelen)) : int)
}
const setloginclass = {namebuf
- -> (syscall(Syssetloginclass) : int)
+ -> (syscall(Syssetloginclass, a(namebuf)) : int)
}
const rctl_get_racct = {inbufp, inbuflen, outbufp, outbuflen
- -> (syscall(Sysrctl_get_racct, a(inbuflen), a(outbufp), a(outbuflen)) : int)
+ -> (syscall(Sysrctl_get_racct, a(inbufp), a(inbuflen), a(outbufp), a(outbuflen)) : int)
}
const rctl_get_rules = {inbufp, inbuflen, outbufp, outbuflen
- -> (syscall(Sysrctl_get_rules, a(inbuflen), a(outbufp), a(outbuflen)) : int)
+ -> (syscall(Sysrctl_get_rules, a(inbufp), a(inbuflen), a(outbufp), a(outbuflen)) : int)
}
const rctl_get_limits = {inbufp, inbuflen, outbufp, outbuflen
- -> (syscall(Sysrctl_get_limits, a(inbuflen), a(outbufp), a(outbuflen)) : int)
+ -> (syscall(Sysrctl_get_limits, a(inbufp), a(inbuflen), a(outbufp), a(outbuflen)) : int)
}
const rctl_add_rule = {inbufp, inbuflen, outbufp, outbuflen
- -> (syscall(Sysrctl_add_rule, a(inbuflen), a(outbufp), a(outbuflen)) : int)
+ -> (syscall(Sysrctl_add_rule, a(inbufp), a(inbuflen), a(outbufp), a(outbuflen)) : int)
}
const rctl_remove_rule = {inbufp, inbuflen, outbufp, outbuflen
- -> (syscall(Sysrctl_remove_rule, a(inbuflen), a(outbufp), a(outbuflen)) : int)
+ -> (syscall(Sysrctl_remove_rule, a(inbufp), a(inbuflen), a(outbufp), a(outbuflen)) : int)
}
const posix_fallocate = {fd, offset, len
- -> (syscall(Sysposix_fallocate, a(offset), a(len)) : int)
+ -> (syscall(Sysposix_fallocate, a(fd), a(offset), a(len)) : int)
}
const posix_fadvise = {fd, offset, len, advice
- -> (syscall(Sysposix_fadvise, a(offset), a(len), a(advice)) : int)
+ -> (syscall(Sysposix_fadvise, a(fd), a(offset), a(len), a(advice)) : int)
}
const wait6 = {idtype, id, status, options, wrusage, info
- -> (syscall(Syswait6, a(id), a(status), a(options), a(wrusage), a(info)) : int)
+ -> (syscall(Syswait6, a(idtype), a(id), a(status), a(options), a(wrusage), a(info)) : int)
}
const cap_rights_limit = {fd, rightsp
- -> (syscall(Syscap_rights_limit, a(rightsp)) : int)
+ -> (syscall(Syscap_rights_limit, a(fd), a(rightsp)) : int)
}
const cap_ioctls_limit = {fd, cmds, ncmds
- -> (syscall(Syscap_ioctls_limit, a(cmds), a(ncmds)) : int)
+ -> (syscall(Syscap_ioctls_limit, a(fd), a(cmds), a(ncmds)) : int)
}
const cap_ioctls_get = {fd, cmds, maxcmds
- -> (syscall(Syscap_ioctls_get, a(cmds), a(maxcmds)) : size)
+ -> (syscall(Syscap_ioctls_get, a(fd), a(cmds), a(maxcmds)) : size)
}
const cap_fcntls_limit = {fd, fcntlrights
- -> (syscall(Syscap_fcntls_limit, a(fcntlrights)) : int)
+ -> (syscall(Syscap_fcntls_limit, a(fd), a(fcntlrights)) : int)
}
const cap_fcntls_get = {fd, fcntlrightsp
- -> (syscall(Syscap_fcntls_get, a(fcntlrightsp)) : int)
+ -> (syscall(Syscap_fcntls_get, a(fd), a(fcntlrightsp)) : int)
}
const bindat = {fd, s, name, namelen
- -> (syscall(Sysbindat, a(s), a(name), a(namelen)) : int)
+ -> (syscall(Sysbindat, a(fd), a(s), a(name), a(namelen)) : int)
}
const connectat = {fd, s, name, namelen
- -> (syscall(Sysconnectat, a(s), a(name), a(namelen)) : int)
+ -> (syscall(Sysconnectat, a(fd), a(s), a(name), a(namelen)) : int)
}
const chflagsat = {fd, path, flags, atflag
- -> (syscall(Syschflagsat, a(path), a(flags), a(atflag)) : int)
+ -> (syscall(Syschflagsat, a(fd), a(path), a(flags), a(atflag)) : int)
}
const accept4 = {s, name, anamelen, flags
- -> (syscall(Sysaccept4, a(name), a(anamelen), a(flags)) : int)
+ -> (syscall(Sysaccept4, a(s), a(name), a(anamelen), a(flags)) : int)
}
const pipe2 = {fildes, flags
- -> (syscall(Syspipe2, a(flags)) : int)
+ -> (syscall(Syspipe2, a(fildes), a(flags)) : int)
}
const aio_mlock = {aiocbp
- -> (syscall(Sysaio_mlock) : int)
+ -> (syscall(Sysaio_mlock, a(aiocbp)) : int)
}
const procctl = {idtype, id, com, data
- -> (syscall(Sysprocctl, a(id), a(com), a(data)) : int)
+ -> (syscall(Sysprocctl, a(idtype), a(id), a(com), a(data)) : int)
}
const ppoll = {fds, nfds, ts, set
- -> (syscall(Sysppoll, a(nfds), a(ts), a(set)) : int)
+ -> (syscall(Sysppoll, a(fds), a(nfds), a(ts), a(set)) : int)
}
const futimens = {fd, times
- -> (syscall(Sysfutimens, a(times)) : int)
+ -> (syscall(Sysfutimens, a(fd), a(times)) : int)
}
const utimensat = {fd, path, times, flag
- -> (syscall(Sysutimensat, a(path), a(times), a(flag)) : int)
+ -> (syscall(Sysutimensat, a(fd), a(path), a(times), a(flag)) : int)
}
diff --git a/lib/sys/sys+linux-x64.myr b/lib/sys/sys+linux-x64.myr
index d8a1d96..e5c8d35 100644
--- a/lib/sys/sys+linux-x64.myr
+++ b/lib/sys/sys+linux-x64.myr
@@ -10,6 +10,7 @@ pkg sys =
type intptr = uint64 /* can hold any pointer losslessly */
type time = int64 /* milliseconds since epoch */
type scno = int64 /* syscall */
+ type ioctlno = int64 /* ioctl */
/* processes/threads */
type pid = int /* process id */
@@ -1177,6 +1178,49 @@ pkg sys =
const Syspkey_alloc : scno = 330
const Syspkey_free : scno = 331
+ const Tcsetaf : ioctlno = 0x00005408
+ const Tcsbrk : ioctlno = 0x00005409
+ const Tcxonc : ioctlno = 0x0000540A
+ const Tcflsh : ioctlno = 0x0000540B
+ const Tiocexcl : ioctlno = 0x0000540C
+ const Tiocnxcl : ioctlno = 0x0000540D
+ const Tiocsctty : ioctlno = 0x0000540E
+ const Tiocgpgrp : ioctlno = 0x0000540F
+ const Tiocspgrp : ioctlno = 0x00005410
+ const Tiocoutq : ioctlno = 0x00005411
+ const Tiocsti : ioctlno = 0x00005412
+ const Tiocgwinsz : ioctlno = 0x00005413
+ const Tiocswinsz : ioctlno = 0x00005414
+ const Tiocmget : ioctlno = 0x00005415
+ const Tiocmbis : ioctlno = 0x00005416
+ const Tiocmbic : ioctlno = 0x00005417
+ const Tiocmset : ioctlno = 0x00005418
+ const Tiocgsoftcar : ioctlno = 0x00005419
+ const Tiocssoftcar : ioctlno = 0x0000541A
+ const Fionread : ioctlno = 0x0000541B
+ const Tiocinq : ioctlno = 0x0000541B
+ const Tioclinux : ioctlno = 0x0000541C
+ const Tioccons : ioctlno = 0x0000541D
+ const Tiocgserial : ioctlno = 0x0000541E
+ const Tiocsserial : ioctlno = 0x0000541F
+ const Tiocpkt : ioctlno = 0x00005420
+ const Fionbio : ioctlno = 0x00005421
+ const Tiocnotty : ioctlno = 0x00005422
+ const Tiocsetd : ioctlno = 0x00005423
+ const Tiocgetd : ioctlno = 0x00005424
+ const Tcsbrkp : ioctlno = 0x00005425
+ const Tiocttygstruct : ioctlno = 0x00005426
+ const Fionclex : ioctlno = 0x00005450
+ const Fioclex : ioctlno = 0x00005451
+ const Fioasync : ioctlno = 0x00005452
+ const Tiocserconfig : ioctlno = 0x00005453
+ const Tiocsergwild : ioctlno = 0x00005454
+ const Tiocserswild : ioctlno = 0x00005455
+ const Tiocglcktrmios : ioctlno = 0x00005456
+ const Tiocslcktrmios : ioctlno = 0x00005457
+ const Tiocsergstruct : ioctlno = 0x00005458
+ const Tiocsergetlsr : ioctlno = 0x00005459
+
/* start manual overrides { */
extern const syscall : (sc:scno, args:... -> int64)
extern const sigreturn : (-> void)
@@ -1215,7 +1259,7 @@ pkg sys =
const lstat : (path:byte[:], sb:statbuf# -> int64)
const fstat : (fd:fd, sb:statbuf# -> int64)
const mkdir : (path : byte[:], mode : int64 -> int64)
- generic ioctl : (fd:fd, req : int64, arg:@a# -> int64)
+ generic ioctl : (fd:fd, req : ioctlno, arg:@a# -> int64)
const getdents64 : (fd:fd, buf : byte[:] -> int64)
const chdir : (p : byte[:] -> int64)
const getcwd : (buf : byte[:] -> int64)
@@ -1721,25 +1765,25 @@ pkg sys =
}
/* } end manual overrides */
const time = {tloc
- -> (syscall(Systime) : int64)
+ -> (syscall(Systime, a(tloc)) : int64)
}
const gettimeofday = {tv, tz
- -> (syscall(Sysgettimeofday, a(tz)) : int64)
+ -> (syscall(Sysgettimeofday, a(tv), a(tz)) : int64)
}
const settimeofday = {tv, tz
- -> (syscall(Syssettimeofday, a(tz)) : int64)
+ -> (syscall(Syssettimeofday, a(tv), a(tz)) : int64)
}
const adjtimex = {txc_p
- -> (syscall(Sysadjtimex) : int64)
+ -> (syscall(Sysadjtimex, a(txc_p)) : int64)
}
const times = {tbuf
- -> (syscall(Systimes) : int64)
+ -> (syscall(Systimes, a(tbuf)) : int64)
}
const gettid = {
-> (syscall(Sysgettid) : int64)
}
const alarm = {seconds
- -> (syscall(Sysalarm) : int64)
+ -> (syscall(Sysalarm, a(seconds)) : int64)
}
const getppid = {
-> (syscall(Sysgetppid) : int64)
@@ -1751,187 +1795,187 @@ const getegid = {
-> (syscall(Sysgetegid) : int64)
}
const getresuid = {ruid, euid, suid
- -> (syscall(Sysgetresuid, a(euid), a(suid)) : int64)
+ -> (syscall(Sysgetresuid, a(ruid), a(euid), a(suid)) : int64)
}
const getresgid = {rgid, egid, sgid
- -> (syscall(Sysgetresgid, a(egid), a(sgid)) : int64)
+ -> (syscall(Sysgetresgid, a(rgid), a(egid), a(sgid)) : int64)
}
const getpgid = {pid
- -> (syscall(Sysgetpgid) : int64)
+ -> (syscall(Sysgetpgid, a(pid)) : int64)
}
const getpgrp = {
-> (syscall(Sysgetpgrp) : int64)
}
const getsid = {pid
- -> (syscall(Sysgetsid) : int64)
+ -> (syscall(Sysgetsid, a(pid)) : int64)
}
const getgroups = {gidsetsize, grouplist
- -> (syscall(Sysgetgroups, a(grouplist)) : int64)
+ -> (syscall(Sysgetgroups, a(gidsetsize), a(grouplist)) : int64)
}
const setregid = {rgid, egid
- -> (syscall(Syssetregid, a(egid)) : int64)
+ -> (syscall(Syssetregid, a(rgid), a(egid)) : int64)
}
const setreuid = {ruid, euid
- -> (syscall(Syssetreuid, a(euid)) : int64)
+ -> (syscall(Syssetreuid, a(ruid), a(euid)) : int64)
}
const setresuid = {ruid, euid, suid
- -> (syscall(Syssetresuid, a(euid), a(suid)) : int64)
+ -> (syscall(Syssetresuid, a(ruid), a(euid), a(suid)) : int64)
}
const setresgid = {rgid, egid, sgid
- -> (syscall(Syssetresgid, a(egid), a(sgid)) : int64)
+ -> (syscall(Syssetresgid, a(rgid), a(egid), a(sgid)) : int64)
}
const setfsuid = {uid
- -> (syscall(Syssetfsuid) : int64)
+ -> (syscall(Syssetfsuid, a(uid)) : int64)
}
const setfsgid = {gid
- -> (syscall(Syssetfsgid) : int64)
+ -> (syscall(Syssetfsgid, a(gid)) : int64)
}
const setpgid = {pid, pgid
- -> (syscall(Syssetpgid, a(pgid)) : int64)
+ -> (syscall(Syssetpgid, a(pid), a(pgid)) : int64)
}
const setsid = {
-> (syscall(Syssetsid) : int64)
}
const setgroups = {gidsetsize, grouplist
- -> (syscall(Syssetgroups, a(grouplist)) : int64)
+ -> (syscall(Syssetgroups, a(gidsetsize), a(grouplist)) : int64)
}
const acct = {name
- -> (syscall(Sysacct) : int64)
+ -> (syscall(Sysacct, a(name)) : int64)
}
const capget = {header, dataptr
- -> (syscall(Syscapget, a(dataptr)) : int64)
+ -> (syscall(Syscapget, a(header), a(dataptr)) : int64)
}
const capset = {header, data
- -> (syscall(Syscapset, a(data)) : int64)
+ -> (syscall(Syscapset, a(header), a(data)) : int64)
}
const personality = {personality
- -> (syscall(Syspersonality) : int64)
+ -> (syscall(Syspersonality, a(personality)) : int64)
}
const sigaltstack = {uss, uoss
- -> (syscall(Syssigaltstack, a(uoss)) : int64)
+ -> (syscall(Syssigaltstack, a(uss), a(uoss)) : int64)
}
const getitimer = {which, value
- -> (syscall(Sysgetitimer, a(value)) : int64)
+ -> (syscall(Sysgetitimer, a(which), a(value)) : int64)
}
const setitimer = {which, value, ovalue
- -> (syscall(Syssetitimer, a(value), a(ovalue)) : int64)
+ -> (syscall(Syssetitimer, a(which), a(value), a(ovalue)) : int64)
}
const timer_create = {which_clock, timer_event_spec, created_timer_id
- -> (syscall(Systimer_create, a(timer_event_spec), a(created_timer_id)) : int64)
+ -> (syscall(Systimer_create, a(which_clock), a(timer_event_spec), a(created_timer_id)) : int64)
}
const timer_gettime = {timer_id, setting
- -> (syscall(Systimer_gettime, a(setting)) : int64)
+ -> (syscall(Systimer_gettime, a(timer_id), a(setting)) : int64)
}
const timer_getoverrun = {timer_id
- -> (syscall(Systimer_getoverrun) : int64)
+ -> (syscall(Systimer_getoverrun, a(timer_id)) : int64)
}
const timer_settime = {timer_id, flags, new_setting, old_setting
- -> (syscall(Systimer_settime, a(flags), a(new_setting), a(old_setting)) : int64)
+ -> (syscall(Systimer_settime, a(timer_id), a(flags), a(new_setting), a(old_setting)) : int64)
}
const timer_delete = {timer_id
- -> (syscall(Systimer_delete) : int64)
+ -> (syscall(Systimer_delete, a(timer_id)) : int64)
}
const clock_adjtime = {which_clock, tx
- -> (syscall(Sysclock_adjtime, a(tx)) : int64)
+ -> (syscall(Sysclock_adjtime, a(which_clock), a(tx)) : int64)
}
const clock_nanosleep = {which_clock, flags, rqtp, rmtp
- -> (syscall(Sysclock_nanosleep, a(flags), a(rqtp), a(rmtp)) : int64)
+ -> (syscall(Sysclock_nanosleep, a(which_clock), a(flags), a(rqtp), a(rmtp)) : int64)
}
const sched_setscheduler = {pid, policy, param
- -> (syscall(Syssched_setscheduler, a(policy), a(param)) : int64)
+ -> (syscall(Syssched_setscheduler, a(pid), a(policy), a(param)) : int64)
}
const sched_setparam = {pid, param
- -> (syscall(Syssched_setparam, a(param)) : int64)
+ -> (syscall(Syssched_setparam, a(pid), a(param)) : int64)
}
const sched_setattr = {pid, attr, flags
- -> (syscall(Syssched_setattr, a(attr), a(flags)) : int64)
+ -> (syscall(Syssched_setattr, a(pid), a(attr), a(flags)) : int64)
}
const sched_getscheduler = {pid
- -> (syscall(Syssched_getscheduler) : int64)
+ -> (syscall(Syssched_getscheduler, a(pid)) : int64)
}
const sched_getparam = {pid, param
- -> (syscall(Syssched_getparam, a(param)) : int64)
+ -> (syscall(Syssched_getparam, a(pid), a(param)) : int64)
}
const sched_getattr = {pid, attr, size, flags
- -> (syscall(Syssched_getattr, a(attr), a(size), a(flags)) : int64)
+ -> (syscall(Syssched_getattr, a(pid), a(attr), a(size), a(flags)) : int64)
}
const sched_setaffinity = {pid, len, user_mask_ptr
- -> (syscall(Syssched_setaffinity, a(len), a(user_mask_ptr)) : int64)
+ -> (syscall(Syssched_setaffinity, a(pid), a(len), a(user_mask_ptr)) : int64)
}
const sched_getaffinity = {pid, len, user_mask_ptr
- -> (syscall(Syssched_getaffinity, a(len), a(user_mask_ptr)) : int64)
+ -> (syscall(Syssched_getaffinity, a(pid), a(len), a(user_mask_ptr)) : int64)
}
const sched_yield = {
-> (syscall(Syssched_yield) : int64)
}
const sched_get_priority_max = {policy
- -> (syscall(Syssched_get_priority_max) : int64)
+ -> (syscall(Syssched_get_priority_max, a(policy)) : int64)
}
const sched_get_priority_min = {policy
- -> (syscall(Syssched_get_priority_min) : int64)
+ -> (syscall(Syssched_get_priority_min, a(policy)) : int64)
}
const sched_rr_get_interval = {pid, interval
- -> (syscall(Syssched_rr_get_interval, a(interval)) : int64)
+ -> (syscall(Syssched_rr_get_interval, a(pid), a(interval)) : int64)
}
const setpriority = {which, who, niceval
- -> (syscall(Syssetpriority, a(who), a(niceval)) : int64)
+ -> (syscall(Syssetpriority, a(which), a(who), a(niceval)) : int64)
}
const getpriority = {which, who
- -> (syscall(Sysgetpriority, a(who)) : int64)
+ -> (syscall(Sysgetpriority, a(which), a(who)) : int64)
}
const shutdown = {_a0, _a1
- -> (syscall(Sysshutdown, a(_a1)) : int64)
+ -> (syscall(Sysshutdown, a(_a0), a(_a1)) : int64)
}
const reboot = {magic1, magic2, cmd, arg
- -> (syscall(Sysreboot, a(magic2), a(cmd), a(arg)) : int64)
+ -> (syscall(Sysreboot, a(magic1), a(magic2), a(cmd), a(arg)) : int64)
}
const restart_syscall = {
-> (syscall(Sysrestart_syscall) : int64)
}
const kexec_load = {entry, nr_segments, segments, flags
- -> (syscall(Syskexec_load, a(nr_segments), a(segments), a(flags)) : int64)
+ -> (syscall(Syskexec_load, a(entry), a(nr_segments), a(segments), a(flags)) : int64)
}
const kexec_file_load = {kernel_fd, initrd_fd, cmdline_len, cmdline_ptr, flags
- -> (syscall(Syskexec_file_load, a(initrd_fd), a(cmdline_len), a(cmdline_ptr), a(flags)) : int64)
+ -> (syscall(Syskexec_file_load, a(kernel_fd), a(initrd_fd), a(cmdline_len), a(cmdline_ptr), a(flags)) : int64)
}
const waitid = {which, pid, infop, options, ru
- -> (syscall(Syswaitid, a(pid), a(infop), a(options), a(ru)) : int64)
+ -> (syscall(Syswaitid, a(which), a(pid), a(infop), a(options), a(ru)) : int64)
}
const set_tid_address = {tidptr
- -> (syscall(Sysset_tid_address) : int64)
+ -> (syscall(Sysset_tid_address, a(tidptr)) : int64)
}
const init_module = {umod, len, uargs
- -> (syscall(Sysinit_module, a(len), a(uargs)) : int64)
+ -> (syscall(Sysinit_module, a(umod), a(len), a(uargs)) : int64)
}
const delete_module = {name_user, flags
- -> (syscall(Sysdelete_module, a(flags)) : int64)
+ -> (syscall(Sysdelete_module, a(name_user), a(flags)) : int64)
}
const rt_sigsuspend = {unewset, sigsetsize
- -> (syscall(Sysrt_sigsuspend, a(sigsetsize)) : int64)
+ -> (syscall(Sysrt_sigsuspend, a(unewset), a(sigsetsize)) : int64)
}
const rt_sigaction = {_a0, _a1, _a2, _a3
- -> (syscall(Sysrt_sigaction, a(_a1), a(_a2), a(_a3)) : int64)
+ -> (syscall(Sysrt_sigaction, a(_a0), a(_a1), a(_a2), a(_a3)) : int64)
}
const rt_sigprocmask = {how, set, oset, sigsetsize
- -> (syscall(Sysrt_sigprocmask, a(set), a(oset), a(sigsetsize)) : int64)
+ -> (syscall(Sysrt_sigprocmask, a(how), a(set), a(oset), a(sigsetsize)) : int64)
}
const rt_sigpending = {set, sigsetsize
- -> (syscall(Sysrt_sigpending, a(sigsetsize)) : int64)
+ -> (syscall(Sysrt_sigpending, a(set), a(sigsetsize)) : int64)
}
const rt_sigtimedwait = {uthese, uinfo, uts, sigsetsize
- -> (syscall(Sysrt_sigtimedwait, a(uinfo), a(uts), a(sigsetsize)) : int64)
+ -> (syscall(Sysrt_sigtimedwait, a(uthese), a(uinfo), a(uts), a(sigsetsize)) : int64)
}
const rt_tgsigqueueinfo = {tgid, pid, sig, uinfo
- -> (syscall(Sysrt_tgsigqueueinfo, a(pid), a(sig), a(uinfo)) : int64)
+ -> (syscall(Sysrt_tgsigqueueinfo, a(tgid), a(pid), a(sig), a(uinfo)) : int64)
}
const tgkill = {tgid, pid, sig
- -> (syscall(Systgkill, a(pid), a(sig)) : int64)
+ -> (syscall(Systgkill, a(tgid), a(pid), a(sig)) : int64)
}
const tkill = {pid, sig
- -> (syscall(Systkill, a(sig)) : int64)
+ -> (syscall(Systkill, a(pid), a(sig)) : int64)
}
const rt_sigqueueinfo = {pid, sig, uinfo
- -> (syscall(Sysrt_sigqueueinfo, a(sig), a(uinfo)) : int64)
+ -> (syscall(Sysrt_sigqueueinfo, a(pid), a(sig), a(uinfo)) : int64)
}
const pause = {
-> (syscall(Syspause) : int64)
@@ -1940,557 +1984,557 @@ const sync = {
-> (syscall(Syssync) : int64)
}
const fsync = {fd
- -> (syscall(Sysfsync) : int64)
+ -> (syscall(Sysfsync, a(fd)) : int64)
}
const fdatasync = {fd
- -> (syscall(Sysfdatasync) : int64)
+ -> (syscall(Sysfdatasync, a(fd)) : int64)
}
const mount = {dev_name, dir_name, kind, flags, data
- -> (syscall(Sysmount, a(dir_name), a(kind), a(flags), a(data)) : int64)
+ -> (syscall(Sysmount, a(dev_name), a(dir_name), a(kind), a(flags), a(data)) : int64)
}
const umount2 = {name, flags
- -> (syscall(Sysumount2, a(flags)) : int64)
+ -> (syscall(Sysumount2, a(name), a(flags)) : int64)
}
const truncate = {path, length
- -> (syscall(Systruncate, a(length)) : int64)
+ -> (syscall(Systruncate, a(path), a(length)) : int64)
}
const ftruncate = {fd, length
- -> (syscall(Sysftruncate, a(length)) : int64)
+ -> (syscall(Sysftruncate, a(fd), a(length)) : int64)
}
const statfs = {path, buf
- -> (syscall(Sysstatfs, a(buf)) : int64)
+ -> (syscall(Sysstatfs, a(path), a(buf)) : int64)
}
const fstatfs = {fd, buf
- -> (syscall(Sysfstatfs, a(buf)) : int64)
+ -> (syscall(Sysfstatfs, a(fd), a(buf)) : int64)
}
const ustat = {dev, ubuf
- -> (syscall(Sysustat, a(ubuf)) : int64)
+ -> (syscall(Sysustat, a(dev), a(ubuf)) : int64)
}
const setxattr = {path, name, value, size, flags
- -> (syscall(Syssetxattr, a(name), a(value), a(size), a(flags)) : int64)
+ -> (syscall(Syssetxattr, a(path), a(name), a(value), a(size), a(flags)) : int64)
}
const lsetxattr = {path, name, value, size, flags
- -> (syscall(Syslsetxattr, a(name), a(value), a(size), a(flags)) : int64)
+ -> (syscall(Syslsetxattr, a(path), a(name), a(value), a(size), a(flags)) : int64)
}
const fsetxattr = {fd, name, value, size, flags
- -> (syscall(Sysfsetxattr, a(name), a(value), a(size), a(flags)) : int64)
+ -> (syscall(Sysfsetxattr, a(fd), a(name), a(value), a(size), a(flags)) : int64)
}
const getxattr = {path, name, value, size
- -> (syscall(Sysgetxattr, a(name), a(value), a(size)) : int64)
+ -> (syscall(Sysgetxattr, a(path), a(name), a(value), a(size)) : int64)
}
const lgetxattr = {path, name, value, size
- -> (syscall(Syslgetxattr, a(name), a(value), a(size)) : int64)
+ -> (syscall(Syslgetxattr, a(path), a(name), a(value), a(size)) : int64)
}
const fgetxattr = {fd, name, value, size
- -> (syscall(Sysfgetxattr, a(name), a(value), a(size)) : int64)
+ -> (syscall(Sysfgetxattr, a(fd), a(name), a(value), a(size)) : int64)
}
const listxattr = {path, list, size
- -> (syscall(Syslistxattr, a(list), a(size)) : int64)
+ -> (syscall(Syslistxattr, a(path), a(list), a(size)) : int64)
}
const llistxattr = {path, list, size
- -> (syscall(Sysllistxattr, a(list), a(size)) : int64)
+ -> (syscall(Sysllistxattr, a(path), a(list), a(size)) : int64)
}
const flistxattr = {fd, list, size
- -> (syscall(Sysflistxattr, a(list), a(size)) : int64)
+ -> (syscall(Sysflistxattr, a(fd), a(list), a(size)) : int64)
}
const removexattr = {path, name
- -> (syscall(Sysremovexattr, a(name)) : int64)
+ -> (syscall(Sysremovexattr, a(path), a(name)) : int64)
}
const lremovexattr = {path, name
- -> (syscall(Syslremovexattr, a(name)) : int64)
+ -> (syscall(Syslremovexattr, a(path), a(name)) : int64)
}
const fremovexattr = {fd, name
- -> (syscall(Sysfremovexattr, a(name)) : int64)
+ -> (syscall(Sysfremovexattr, a(fd), a(name)) : int64)
}
const brk = {brk
- -> (syscall(Sysbrk) : int64)
+ -> (syscall(Sysbrk, a(brk)) : int64)
}
const mprotect = {start, len, prot
- -> (syscall(Sysmprotect, a(len), a(prot)) : int64)
+ -> (syscall(Sysmprotect, a(start), a(len), a(prot)) : int64)
}
const mremap = {addr, old_len, new_len, flags, new_addr
- -> (syscall(Sysmremap, a(old_len), a(new_len), a(flags), a(new_addr)) : int64)
+ -> (syscall(Sysmremap, a(addr), a(old_len), a(new_len), a(flags), a(new_addr)) : int64)
}
const remap_file_pages = {start, size, prot, pgoff, flags
- -> (syscall(Sysremap_file_pages, a(size), a(prot), a(pgoff), a(flags)) : int64)
+ -> (syscall(Sysremap_file_pages, a(start), a(size), a(prot), a(pgoff), a(flags)) : int64)
}
const msync = {start, len, flags
- -> (syscall(Sysmsync, a(len), a(flags)) : int64)
+ -> (syscall(Sysmsync, a(start), a(len), a(flags)) : int64)
}
const fadvise = {fd, offset, len, advice
- -> (syscall(Sysfadvise, a(offset), a(len), a(advice)) : int64)
+ -> (syscall(Sysfadvise, a(fd), a(offset), a(len), a(advice)) : int64)
}
const mlock = {start, len
- -> (syscall(Sysmlock, a(len)) : int64)
+ -> (syscall(Sysmlock, a(start), a(len)) : int64)
}
const munlock = {start, len
- -> (syscall(Sysmunlock, a(len)) : int64)
+ -> (syscall(Sysmunlock, a(start), a(len)) : int64)
}
const mlockall = {flags
- -> (syscall(Sysmlockall) : int64)
+ -> (syscall(Sysmlockall, a(flags)) : int64)
}
const munlockall = {
-> (syscall(Sysmunlockall) : int64)
}
const madvise = {start, len, behavior
- -> (syscall(Sysmadvise, a(len), a(behavior)) : int64)
+ -> (syscall(Sysmadvise, a(start), a(len), a(behavior)) : int64)
}
const mincore = {start, len, vec
- -> (syscall(Sysmincore, a(len), a(vec)) : int64)
+ -> (syscall(Sysmincore, a(start), a(len), a(vec)) : int64)
}
const pivot_root = {new_root, put_old
- -> (syscall(Syspivot_root, a(put_old)) : int64)
+ -> (syscall(Syspivot_root, a(new_root), a(put_old)) : int64)
}
const chroot = {filename
- -> (syscall(Syschroot) : int64)
+ -> (syscall(Syschroot, a(filename)) : int64)
}
const mknod = {filename, mode, dev
- -> (syscall(Sysmknod, a(mode), a(dev)) : int64)
+ -> (syscall(Sysmknod, a(filename), a(mode), a(dev)) : int64)
}
const link = {oldname, newname
- -> (syscall(Syslink, a(newname)) : int64)
+ -> (syscall(Syslink, a(oldname), a(newname)) : int64)
}
const symlink = {old, new
- -> (syscall(Syssymlink, a(new)) : int64)
+ -> (syscall(Syssymlink, a(old), a(new)) : int64)
}
const chmod = {filename, mode
- -> (syscall(Syschmod, a(mode)) : int64)
+ -> (syscall(Syschmod, a(filename), a(mode)) : int64)
}
const fchmod = {fd, mode
- -> (syscall(Sysfchmod, a(mode)) : int64)
+ -> (syscall(Sysfchmod, a(fd), a(mode)) : int64)
}
const fcntl = {fd, cmd, arg
- -> (syscall(Sysfcntl, a(cmd), a(arg)) : int64)
+ -> (syscall(Sysfcntl, a(fd), a(cmd), a(arg)) : int64)
}
const pipe2 = {fildes, flags
- -> (syscall(Syspipe2, a(flags)) : int64)
+ -> (syscall(Syspipe2, a(fildes), a(flags)) : int64)
}
const dup3 = {oldfd, newfd, flags
- -> (syscall(Sysdup3, a(newfd), a(flags)) : int64)
+ -> (syscall(Sysdup3, a(oldfd), a(newfd), a(flags)) : int64)
}
const ioperm = {from, num, on
- -> (syscall(Sysioperm, a(num), a(on)) : int64)
+ -> (syscall(Sysioperm, a(from), a(num), a(on)) : int64)
}
const flock = {fd, cmd
- -> (syscall(Sysflock, a(cmd)) : int64)
+ -> (syscall(Sysflock, a(fd), a(cmd)) : int64)
}
const io_setup = {nr_reqs, ctx
- -> (syscall(Sysio_setup, a(ctx)) : int64)
+ -> (syscall(Sysio_setup, a(nr_reqs), a(ctx)) : int64)
}
const io_destroy = {ctx
- -> (syscall(Sysio_destroy) : int64)
+ -> (syscall(Sysio_destroy, a(ctx)) : int64)
}
const io_getevents = {ctx_id, min_nr, nr, events, timeout
- -> (syscall(Sysio_getevents, a(min_nr), a(nr), a(events), a(timeout)) : int64)
+ -> (syscall(Sysio_getevents, a(ctx_id), a(min_nr), a(nr), a(events), a(timeout)) : int64)
}
const io_submit = {_a0, _a1, _a2
- -> (syscall(Sysio_submit, a(_a1), a(_a2)) : int64)
+ -> (syscall(Sysio_submit, a(_a0), a(_a1), a(_a2)) : int64)
}
const io_cancel = {ctx_id, iocb, result
- -> (syscall(Sysio_cancel, a(iocb), a(result)) : int64)
+ -> (syscall(Sysio_cancel, a(ctx_id), a(iocb), a(result)) : int64)
}
const sendfile = {out_fd, in_fd, offset, count
- -> (syscall(Syssendfile, a(in_fd), a(offset), a(count)) : int64)
+ -> (syscall(Syssendfile, a(out_fd), a(in_fd), a(offset), a(count)) : int64)
}
const access = {filename, mode
- -> (syscall(Sysaccess, a(mode)) : int64)
+ -> (syscall(Sysaccess, a(filename), a(mode)) : int64)
}
const vhangup = {
-> (syscall(Sysvhangup) : int64)
}
const chown = {filename, user, group
- -> (syscall(Syschown, a(user), a(group)) : int64)
+ -> (syscall(Syschown, a(filename), a(user), a(group)) : int64)
}
const lchown = {filename, user, group
- -> (syscall(Syslchown, a(user), a(group)) : int64)
+ -> (syscall(Syslchown, a(filename), a(user), a(group)) : int64)
}
const fchown = {fd, user, group
- -> (syscall(Sysfchown, a(user), a(group)) : int64)
+ -> (syscall(Sysfchown, a(fd), a(user), a(group)) : int64)
}
const utime = {filename, times
- -> (syscall(Sysutime, a(times)) : int64)
+ -> (syscall(Sysutime, a(filename), a(times)) : int64)
}
const utimes = {filename, utimes
- -> (syscall(Sysutimes, a(utimes)) : int64)
+ -> (syscall(Sysutimes, a(filename), a(utimes)) : int64)
}
const readahead = {fd, offset, count
- -> (syscall(Sysreadahead, a(offset), a(count)) : int64)
+ -> (syscall(Sysreadahead, a(fd), a(offset), a(count)) : int64)
}
const readv = {fd, vec, vlen
- -> (syscall(Sysreadv, a(vec), a(vlen)) : int64)
+ -> (syscall(Sysreadv, a(fd), a(vec), a(vlen)) : int64)
}
const writev = {fd, vec, vlen
- -> (syscall(Syswritev, a(vec), a(vlen)) : int64)
+ -> (syscall(Syswritev, a(fd), a(vec), a(vlen)) : int64)
}
const preadv = {fd, vec, vlen, pos_l, pos_h
- -> (syscall(Syspreadv, a(vec), a(vlen), a(pos_l), a(pos_h)) : int64)
+ -> (syscall(Syspreadv, a(fd), a(vec), a(vlen), a(pos_l), a(pos_h)) : int64)
}
const preadv2 = {fd, vec, vlen, pos_l, pos_h, flags
- -> (syscall(Syspreadv2, a(vec), a(vlen), a(pos_l), a(pos_h), a(flags)) : int64)
+ -> (syscall(Syspreadv2, a(fd), a(vec), a(vlen), a(pos_l), a(pos_h), a(flags)) : int64)
}
const pwritev = {fd, vec, vlen, pos_l, pos_h
- -> (syscall(Syspwritev, a(vec), a(vlen), a(pos_l), a(pos_h)) : int64)
+ -> (syscall(Syspwritev, a(fd), a(vec), a(vlen), a(pos_l), a(pos_h)) : int64)
}
const pwritev2 = {fd, vec, vlen, pos_l, pos_h, flags
- -> (syscall(Syspwritev2, a(vec), a(vlen), a(pos_l), a(pos_h), a(flags)) : int64)
+ -> (syscall(Syspwritev2, a(fd), a(vec), a(vlen), a(pos_l), a(pos_h), a(flags)) : int64)
}
const fchdir = {fd
- -> (syscall(Sysfchdir) : int64)
+ -> (syscall(Sysfchdir, a(fd)) : int64)
}
const rmdir = {pathname
- -> (syscall(Sysrmdir) : int64)
+ -> (syscall(Sysrmdir, a(pathname)) : int64)
}
const lookup_dcookie = {cookie64, buf, len
- -> (syscall(Syslookup_dcookie, a(buf), a(len)) : int64)
+ -> (syscall(Syslookup_dcookie, a(cookie64), a(buf), a(len)) : int64)
}
const quotactl = {cmd, special, id, addr
- -> (syscall(Sysquotactl, a(special), a(id), a(addr)) : int64)
+ -> (syscall(Sysquotactl, a(cmd), a(special), a(id), a(addr)) : int64)
}
const accept4 = {_a0, _a1, _a2, _a3
- -> (syscall(Sysaccept4, a(_a1), a(_a2), a(_a3)) : int64)
+ -> (syscall(Sysaccept4, a(_a0), a(_a1), a(_a2), a(_a3)) : int64)
}
const getsockname = {_a0, _a1, _a2
- -> (syscall(Sysgetsockname, a(_a1), a(_a2)) : int64)
+ -> (syscall(Sysgetsockname, a(_a0), a(_a1), a(_a2)) : int64)
}
const getpeername = {_a0, _a1, _a2
- -> (syscall(Sysgetpeername, a(_a1), a(_a2)) : int64)
+ -> (syscall(Sysgetpeername, a(_a0), a(_a1), a(_a2)) : int64)
}
const sendto = {_a0, _a1, _a2, _a3, _a4, _a5
- -> (syscall(Syssendto, a(_a1), a(_a2), a(_a3), a(_a4), a(_a5)) : int64)
+ -> (syscall(Syssendto, a(_a0), a(_a1), a(_a2), a(_a3), a(_a4), a(_a5)) : int64)
}
const sendmmsg = {fd, msg, vlen, flags
- -> (syscall(Syssendmmsg, a(msg), a(vlen), a(flags)) : int64)
+ -> (syscall(Syssendmmsg, a(fd), a(msg), a(vlen), a(flags)) : int64)
}
const recvfrom = {_a0, _a1, _a2, _a3, _a4, _a5
- -> (syscall(Sysrecvfrom, a(_a1), a(_a2), a(_a3), a(_a4), a(_a5)) : int64)
+ -> (syscall(Sysrecvfrom, a(_a0), a(_a1), a(_a2), a(_a3), a(_a4), a(_a5)) : int64)
}
const recvmmsg = {fd, msg, vlen, flags, timeout
- -> (syscall(Sysrecvmmsg, a(msg), a(vlen), a(flags), a(timeout)) : int64)
+ -> (syscall(Sysrecvmmsg, a(fd), a(msg), a(vlen), a(flags), a(timeout)) : int64)
}
const socketpair = {_a0, _a1, _a2, _a3
- -> (syscall(Syssocketpair, a(_a1), a(_a2), a(_a3)) : int64)
+ -> (syscall(Syssocketpair, a(_a0), a(_a1), a(_a2), a(_a3)) : int64)
}
const select = {n, inp, outp, exp, tvp
- -> (syscall(Sysselect, a(inp), a(outp), a(exp), a(tvp)) : int64)
+ -> (syscall(Sysselect, a(n), a(inp), a(outp), a(exp), a(tvp)) : int64)
}
const epoll_create = {size
- -> (syscall(Sysepoll_create) : int64)
+ -> (syscall(Sysepoll_create, a(size)) : int64)
}
const epoll_create1 = {flags
- -> (syscall(Sysepoll_create1) : int64)
+ -> (syscall(Sysepoll_create1, a(flags)) : int64)
}
const epoll_ctl = {epfd, op, fd, event
- -> (syscall(Sysepoll_ctl, a(op), a(fd), a(event)) : int64)
+ -> (syscall(Sysepoll_ctl, a(epfd), a(op), a(fd), a(event)) : int64)
}
const epoll_wait = {epfd, events, maxevents, timeout
- -> (syscall(Sysepoll_wait, a(events), a(maxevents), a(timeout)) : int64)
+ -> (syscall(Sysepoll_wait, a(epfd), a(events), a(maxevents), a(timeout)) : int64)
}
const epoll_pwait = {epfd, events, maxevents, timeout, sigmask, sigsetsize
- -> (syscall(Sysepoll_pwait, a(events), a(maxevents), a(timeout), a(sigmask), a(sigsetsize)) : int64)
+ -> (syscall(Sysepoll_pwait, a(epfd), a(events), a(maxevents), a(timeout), a(sigmask), a(sigsetsize)) : int64)
}
const sethostname = {name, len
- -> (syscall(Syssethostname, a(len)) : int64)
+ -> (syscall(Syssethostname, a(name), a(len)) : int64)
}
const setdomainname = {name, len
- -> (syscall(Syssetdomainname, a(len)) : int64)
+ -> (syscall(Syssetdomainname, a(name), a(len)) : int64)
}
const getrlimit = {resource, rlim
- -> (syscall(Sysgetrlimit, a(rlim)) : int64)
+ -> (syscall(Sysgetrlimit, a(resource), a(rlim)) : int64)
}
const setrlimit = {resource, rlim
- -> (syscall(Syssetrlimit, a(rlim)) : int64)
+ -> (syscall(Syssetrlimit, a(resource), a(rlim)) : int64)
}
const prlimit = {pid, resource, new_rlim, old_rlim
- -> (syscall(Sysprlimit, a(resource), a(new_rlim), a(old_rlim)) : int64)
+ -> (syscall(Sysprlimit, a(pid), a(resource), a(new_rlim), a(old_rlim)) : int64)
}
const getrusage = {who, ru
- -> (syscall(Sysgetrusage, a(ru)) : int64)
+ -> (syscall(Sysgetrusage, a(who), a(ru)) : int64)
}
const umask = {mask
- -> (syscall(Sysumask) : int64)
+ -> (syscall(Sysumask, a(mask)) : int64)
}
const msgget = {key, msgflg
- -> (syscall(Sysmsgget, a(msgflg)) : int64)
+ -> (syscall(Sysmsgget, a(key), a(msgflg)) : int64)
}
const msgsnd = {msqid, msgp, msgsz, msgflg
- -> (syscall(Sysmsgsnd, a(msgp), a(msgsz), a(msgflg)) : int64)
+ -> (syscall(Sysmsgsnd, a(msqid), a(msgp), a(msgsz), a(msgflg)) : int64)
}
const msgrcv = {msqid, msgp, msgsz, msgtyp, msgflg
- -> (syscall(Sysmsgrcv, a(msgp), a(msgsz), a(msgtyp), a(msgflg)) : int64)
+ -> (syscall(Sysmsgrcv, a(msqid), a(msgp), a(msgsz), a(msgtyp), a(msgflg)) : int64)
}
const msgctl = {msqid, cmd, buf
- -> (syscall(Sysmsgctl, a(cmd), a(buf)) : int64)
+ -> (syscall(Sysmsgctl, a(msqid), a(cmd), a(buf)) : int64)
}
const semget = {key, nsems, semflg
- -> (syscall(Syssemget, a(nsems), a(semflg)) : int64)
+ -> (syscall(Syssemget, a(key), a(nsems), a(semflg)) : int64)
}
const semop = {semid, sops, nsops
- -> (syscall(Syssemop, a(sops), a(nsops)) : int64)
+ -> (syscall(Syssemop, a(semid), a(sops), a(nsops)) : int64)
}
const semtimedop = {semid, sops, nsops, timeout
- -> (syscall(Syssemtimedop, a(sops), a(nsops), a(timeout)) : int64)
+ -> (syscall(Syssemtimedop, a(semid), a(sops), a(nsops), a(timeout)) : int64)
}
const shmat = {shmid, shmaddr, shmflg
- -> (syscall(Sysshmat, a(shmaddr), a(shmflg)) : int64)
+ -> (syscall(Sysshmat, a(shmid), a(shmaddr), a(shmflg)) : int64)
}
const shmget = {key, size, flag
- -> (syscall(Sysshmget, a(size), a(flag)) : int64)
+ -> (syscall(Sysshmget, a(key), a(size), a(flag)) : int64)
}
const shmdt = {shmaddr
- -> (syscall(Sysshmdt) : int64)
+ -> (syscall(Sysshmdt, a(shmaddr)) : int64)
}
const shmctl = {shmid, cmd, buf
- -> (syscall(Sysshmctl, a(cmd), a(buf)) : int64)
+ -> (syscall(Sysshmctl, a(shmid), a(cmd), a(buf)) : int64)
}
const mq_open = {name, oflag, mode, attr
- -> (syscall(Sysmq_open, a(oflag), a(mode), a(attr)) : int64)
+ -> (syscall(Sysmq_open, a(name), a(oflag), a(mode), a(attr)) : int64)
}
const mq_unlink = {name
- -> (syscall(Sysmq_unlink) : int64)
+ -> (syscall(Sysmq_unlink, a(name)) : int64)
}
const mq_timedsend = {mqdes, msg_ptr, msg_len, msg_prio, abs_timeout
- -> (syscall(Sysmq_timedsend, a(msg_ptr), a(msg_len), a(msg_prio), a(abs_timeout)) : int64)
+ -> (syscall(Sysmq_timedsend, a(mqdes), a(msg_ptr), a(msg_len), a(msg_prio), a(abs_timeout)) : int64)
}
const mq_timedreceive = {mqdes, msg_ptr, msg_len, msg_prio, abs_timeout
- -> (syscall(Sysmq_timedreceive, a(msg_ptr), a(msg_len), a(msg_prio), a(abs_timeout)) : int64)
+ -> (syscall(Sysmq_timedreceive, a(mqdes), a(msg_ptr), a(msg_len), a(msg_prio), a(abs_timeout)) : int64)
}
const mq_notify = {mqdes, notification
- -> (syscall(Sysmq_notify, a(notification)) : int64)
+ -> (syscall(Sysmq_notify, a(mqdes), a(notification)) : int64)
}
const mq_getsetattr = {mqdes, mqstat, omqstat
- -> (syscall(Sysmq_getsetattr, a(mqstat), a(omqstat)) : int64)
+ -> (syscall(Sysmq_getsetattr, a(mqdes), a(mqstat), a(omqstat)) : int64)
}
const prctl = {option, arg2, arg3, arg4, arg5
- -> (syscall(Sysprctl, a(arg2), a(arg3), a(arg4), a(arg5)) : int64)
+ -> (syscall(Sysprctl, a(option), a(arg2), a(arg3), a(arg4), a(arg5)) : int64)
}
const swapon = {specialfile, swap_flags
- -> (syscall(Sysswapon, a(swap_flags)) : int64)
+ -> (syscall(Sysswapon, a(specialfile), a(swap_flags)) : int64)
}
const swapoff = {specialfile
- -> (syscall(Sysswapoff) : int64)
+ -> (syscall(Sysswapoff, a(specialfile)) : int64)
}
const _sysctl = {args
- -> (syscall(Sys_sysctl) : int64)
+ -> (syscall(Sys_sysctl, a(args)) : int64)
}
const sysinfo = {info
- -> (syscall(Syssysinfo) : int64)
+ -> (syscall(Syssysinfo, a(info)) : int64)
}
const sysfs = {option, arg1, arg2
- -> (syscall(Syssysfs, a(arg1), a(arg2)) : int64)
+ -> (syscall(Syssysfs, a(option), a(arg1), a(arg2)) : int64)
}
const syslog = {kind, buf, len
- -> (syscall(Syssyslog, a(buf), a(len)) : int64)
+ -> (syscall(Syssyslog, a(kind), a(buf), a(len)) : int64)
}
const ptrace = {request, pid, addr, data
- -> (syscall(Sysptrace, a(pid), a(addr), a(data)) : int64)
+ -> (syscall(Sysptrace, a(request), a(pid), a(addr), a(data)) : int64)
}
const add_key = {_type, _description, _payload, plen, destringid
- -> (syscall(Sysadd_key, a(_description), a(_payload), a(plen), a(destringid)) : int64)
+ -> (syscall(Sysadd_key, a(_type), a(_description), a(_payload), a(plen), a(destringid)) : int64)
}
const request_key = {_type, _description, _callout_info, destringid
- -> (syscall(Sysrequest_key, a(_description), a(_callout_info), a(destringid)) : int64)
+ -> (syscall(Sysrequest_key, a(_type), a(_description), a(_callout_info), a(destringid)) : int64)
}
const keyctl = {cmd, arg2, arg3, arg4, arg5
- -> (syscall(Syskeyctl, a(arg2), a(arg3), a(arg4), a(arg5)) : int64)
+ -> (syscall(Syskeyctl, a(cmd), a(arg2), a(arg3), a(arg4), a(arg5)) : int64)
}
const ioprio_set = {which, who, ioprio
- -> (syscall(Sysioprio_set, a(who), a(ioprio)) : int64)
+ -> (syscall(Sysioprio_set, a(which), a(who), a(ioprio)) : int64)
}
const ioprio_get = {which, who
- -> (syscall(Sysioprio_get, a(who)) : int64)
+ -> (syscall(Sysioprio_get, a(which), a(who)) : int64)
}
const set_mempolicy = {mode, nmask, maxnode
- -> (syscall(Sysset_mempolicy, a(nmask), a(maxnode)) : int64)
+ -> (syscall(Sysset_mempolicy, a(mode), a(nmask), a(maxnode)) : int64)
}
const migrate_pages = {pid, maxnode, from, to
- -> (syscall(Sysmigrate_pages, a(maxnode), a(from), a(to)) : int64)
+ -> (syscall(Sysmigrate_pages, a(pid), a(maxnode), a(from), a(to)) : int64)
}
const move_pages = {pid, nr_pages, pages, nodes, status, flags
- -> (syscall(Sysmove_pages, a(nr_pages), a(pages), a(nodes), a(status), a(flags)) : int64)
+ -> (syscall(Sysmove_pages, a(pid), a(nr_pages), a(pages), a(nodes), a(status), a(flags)) : int64)
}
const mbind = {start, len, mode, nmask, maxnode, flags
- -> (syscall(Sysmbind, a(len), a(mode), a(nmask), a(maxnode), a(flags)) : int64)
+ -> (syscall(Sysmbind, a(start), a(len), a(mode), a(nmask), a(maxnode), a(flags)) : int64)
}
const get_mempolicy = {policy, nmask, maxnode, addr, flags
- -> (syscall(Sysget_mempolicy, a(nmask), a(maxnode), a(addr), a(flags)) : int64)
+ -> (syscall(Sysget_mempolicy, a(policy), a(nmask), a(maxnode), a(addr), a(flags)) : int64)
}
const inotify_init = {
-> (syscall(Sysinotify_init) : int64)
}
const inotify_init1 = {flags
- -> (syscall(Sysinotify_init1) : int64)
+ -> (syscall(Sysinotify_init1, a(flags)) : int64)
}
const inotify_add_watch = {fd, path, mask
- -> (syscall(Sysinotify_add_watch, a(path), a(mask)) : int64)
+ -> (syscall(Sysinotify_add_watch, a(fd), a(path), a(mask)) : int64)
}
const inotify_rm_watch = {fd, wd
- -> (syscall(Sysinotify_rm_watch, a(wd)) : int64)
+ -> (syscall(Sysinotify_rm_watch, a(fd), a(wd)) : int64)
}
const mknodat = {dfd, filename, mode, dev
- -> (syscall(Sysmknodat, a(filename), a(mode), a(dev)) : int64)
+ -> (syscall(Sysmknodat, a(dfd), a(filename), a(mode), a(dev)) : int64)
}
const mkdirat = {dfd, pathname, mode
- -> (syscall(Sysmkdirat, a(pathname), a(mode)) : int64)
+ -> (syscall(Sysmkdirat, a(dfd), a(pathname), a(mode)) : int64)
}
const unlinkat = {dfd, pathname, flag
- -> (syscall(Sysunlinkat, a(pathname), a(flag)) : int64)
+ -> (syscall(Sysunlinkat, a(dfd), a(pathname), a(flag)) : int64)
}
const symlinkat = {oldname, newdfd, newname
- -> (syscall(Syssymlinkat, a(newdfd), a(newname)) : int64)
+ -> (syscall(Syssymlinkat, a(oldname), a(newdfd), a(newname)) : int64)
}
const linkat = {olddfd, oldname, newdfd, newname, flags
- -> (syscall(Syslinkat, a(oldname), a(newdfd), a(newname), a(flags)) : int64)
+ -> (syscall(Syslinkat, a(olddfd), a(oldname), a(newdfd), a(newname), a(flags)) : int64)
}
const renameat = {olddfd, oldname, newdfd, newname
- -> (syscall(Sysrenameat, a(oldname), a(newdfd), a(newname)) : int64)
+ -> (syscall(Sysrenameat, a(olddfd), a(oldname), a(newdfd), a(newname)) : int64)
}
const renameat2 = {olddfd, oldname, newdfd, newname, flags
- -> (syscall(Sysrenameat2, a(oldname), a(newdfd), a(newname), a(flags)) : int64)
+ -> (syscall(Sysrenameat2, a(olddfd), a(oldname), a(newdfd), a(newname), a(flags)) : int64)
}
const futimesat = {dfd, filename, utimes
- -> (syscall(Sysfutimesat, a(filename), a(utimes)) : int64)
+ -> (syscall(Sysfutimesat, a(dfd), a(filename), a(utimes)) : int64)
}
const faccessat = {dfd, filename, mode
- -> (syscall(Sysfaccessat, a(filename), a(mode)) : int64)
+ -> (syscall(Sysfaccessat, a(dfd), a(filename), a(mode)) : int64)
}
const fchmodat = {dfd, filename, mode
- -> (syscall(Sysfchmodat, a(filename), a(mode)) : int64)
+ -> (syscall(Sysfchmodat, a(dfd), a(filename), a(mode)) : int64)
}
const fchownat = {dfd, filename, user, group, flag
- -> (syscall(Sysfchownat, a(filename), a(user), a(group), a(flag)) : int64)
+ -> (syscall(Sysfchownat, a(dfd), a(filename), a(user), a(group), a(flag)) : int64)
}
const openat = {dfd, filename, flags, mode
- -> (syscall(Sysopenat, a(filename), a(flags), a(mode)) : int64)
+ -> (syscall(Sysopenat, a(dfd), a(filename), a(flags), a(mode)) : int64)
}
const newfstatat = {dfd, filename, statbuf, flag
- -> (syscall(Sysnewfstatat, a(filename), a(statbuf), a(flag)) : int64)
+ -> (syscall(Sysnewfstatat, a(dfd), a(filename), a(statbuf), a(flag)) : int64)
}
const readlinkat = {dfd, path, buf, bufsiz
- -> (syscall(Sysreadlinkat, a(path), a(buf), a(bufsiz)) : int64)
+ -> (syscall(Sysreadlinkat, a(dfd), a(path), a(buf), a(bufsiz)) : int64)
}
const utimensat = {dfd, filename, utimes, flags
- -> (syscall(Sysutimensat, a(filename), a(utimes), a(flags)) : int64)
+ -> (syscall(Sysutimensat, a(dfd), a(filename), a(utimes), a(flags)) : int64)
}
const unshare = {unshare_flags
- -> (syscall(Sysunshare) : int64)
+ -> (syscall(Sysunshare, a(unshare_flags)) : int64)
}
const splice = {fd_in, off_in, fd_out, off_out, len, flags
- -> (syscall(Syssplice, a(off_in), a(fd_out), a(off_out), a(len), a(flags)) : int64)
+ -> (syscall(Syssplice, a(fd_in), a(off_in), a(fd_out), a(off_out), a(len), a(flags)) : int64)
}
const vmsplice = {fd, iov, nr_segs, flags
- -> (syscall(Sysvmsplice, a(iov), a(nr_segs), a(flags)) : int64)
+ -> (syscall(Sysvmsplice, a(fd), a(iov), a(nr_segs), a(flags)) : int64)
}
const tee = {fdin, fdout, len, flags
- -> (syscall(Systee, a(fdout), a(len), a(flags)) : int64)
+ -> (syscall(Systee, a(fdin), a(fdout), a(len), a(flags)) : int64)
}
const sync_file_range = {fd, offset, nbytes, flags
- -> (syscall(Syssync_file_range, a(offset), a(nbytes), a(flags)) : int64)
+ -> (syscall(Syssync_file_range, a(fd), a(offset), a(nbytes), a(flags)) : int64)
}
const get_robust_list = {pid, head_ptr, len_ptr
- -> (syscall(Sysget_robust_list, a(head_ptr), a(len_ptr)) : int64)
+ -> (syscall(Sysget_robust_list, a(pid), a(head_ptr), a(len_ptr)) : int64)
}
const set_robust_list = {head, len
- -> (syscall(Sysset_robust_list, a(len)) : int64)
+ -> (syscall(Sysset_robust_list, a(head), a(len)) : int64)
}
const getcpu = {cpu, node, cache
- -> (syscall(Sysgetcpu, a(node), a(cache)) : int64)
+ -> (syscall(Sysgetcpu, a(cpu), a(node), a(cache)) : int64)
}
const signalfd = {ufd, user_mask, sizemask
- -> (syscall(Syssignalfd, a(user_mask), a(sizemask)) : int64)
+ -> (syscall(Syssignalfd, a(ufd), a(user_mask), a(sizemask)) : int64)
}
const signalfd4 = {ufd, user_mask, sizemask, flags
- -> (syscall(Syssignalfd4, a(user_mask), a(sizemask), a(flags)) : int64)
+ -> (syscall(Syssignalfd4, a(ufd), a(user_mask), a(sizemask), a(flags)) : int64)
}
const timerfd_create = {clockid, flags
- -> (syscall(Systimerfd_create, a(flags)) : int64)
+ -> (syscall(Systimerfd_create, a(clockid), a(flags)) : int64)
}
const timerfd_settime = {ufd, flags, utmr, otmr
- -> (syscall(Systimerfd_settime, a(flags), a(utmr), a(otmr)) : int64)
+ -> (syscall(Systimerfd_settime, a(ufd), a(flags), a(utmr), a(otmr)) : int64)
}
const timerfd_gettime = {ufd, otmr
- -> (syscall(Systimerfd_gettime, a(otmr)) : int64)
+ -> (syscall(Systimerfd_gettime, a(ufd), a(otmr)) : int64)
}
const eventfd = {count
- -> (syscall(Syseventfd) : int64)
+ -> (syscall(Syseventfd, a(count)) : int64)
}
const eventfd2 = {count, flags
- -> (syscall(Syseventfd2, a(flags)) : int64)
+ -> (syscall(Syseventfd2, a(count), a(flags)) : int64)
}
const memfd_create = {uname_ptr, flags
- -> (syscall(Sysmemfd_create, a(flags)) : int64)
+ -> (syscall(Sysmemfd_create, a(uname_ptr), a(flags)) : int64)
}
const userfaultfd = {flags
- -> (syscall(Sysuserfaultfd) : int64)
+ -> (syscall(Sysuserfaultfd, a(flags)) : int64)
}
const pselect6 = {_a0, _a1, _a2, _a3, _a4, _a5
- -> (syscall(Syspselect6, a(_a1), a(_a2), a(_a3), a(_a4), a(_a5)) : int64)
+ -> (syscall(Syspselect6, a(_a0), a(_a1), a(_a2), a(_a3), a(_a4), a(_a5)) : int64)
}
const ppoll = {_a0, int, _a2, _a3, _a4
- -> (syscall(Sysppoll, a(int), a(_a2), a(_a3), a(_a4)) : int64)
+ -> (syscall(Sysppoll, a(_a0), a(int), a(_a2), a(_a3), a(_a4)) : int64)
}
const fanotify_init = {flags, event_f_flags
- -> (syscall(Sysfanotify_init, a(event_f_flags)) : int64)
+ -> (syscall(Sysfanotify_init, a(flags), a(event_f_flags)) : int64)
}
const fanotify_mark = {fanotify_fd, flags, mask, fd, pathname
- -> (syscall(Sysfanotify_mark, a(flags), a(mask), a(fd), a(pathname)) : int64)
+ -> (syscall(Sysfanotify_mark, a(fanotify_fd), a(flags), a(mask), a(fd), a(pathname)) : int64)
}
const syncfs = {fd
- -> (syscall(Syssyncfs) : int64)
+ -> (syscall(Syssyncfs, a(fd)) : int64)
}
const vfork = {
-> (syscall(Sysvfork) : int64)
}
const perf_event_open = {attr_uptr, pid, cpu, group_fd, flags
- -> (syscall(Sysperf_event_open, a(pid), a(cpu), a(group_fd), a(flags)) : int64)
+ -> (syscall(Sysperf_event_open, a(attr_uptr), a(pid), a(cpu), a(group_fd), a(flags)) : int64)
}
const name_to_handle_at = {dfd, name, handle, mnt_id, flag
- -> (syscall(Sysname_to_handle_at, a(name), a(handle), a(mnt_id), a(flag)) : int64)
+ -> (syscall(Sysname_to_handle_at, a(dfd), a(name), a(handle), a(mnt_id), a(flag)) : int64)
}
const open_by_handle_at = {mountdirfd, handle, flags
- -> (syscall(Sysopen_by_handle_at, a(handle), a(flags)) : int64)
+ -> (syscall(Sysopen_by_handle_at, a(mountdirfd), a(handle), a(flags)) : int64)
}
const setns = {fd, nstype
- -> (syscall(Syssetns, a(nstype)) : int64)
+ -> (syscall(Syssetns, a(fd), a(nstype)) : int64)
}
const process_vm_readv = {pid, lvec, liovcnt, rvec, riovcnt, flags
- -> (syscall(Sysprocess_vm_readv, a(lvec), a(liovcnt), a(rvec), a(riovcnt), a(flags)) : int64)
+ -> (syscall(Sysprocess_vm_readv, a(pid), a(lvec), a(liovcnt), a(rvec), a(riovcnt), a(flags)) : int64)
}
const process_vm_writev = {pid, lvec, liovcnt, rvec, riovcnt, flags
- -> (syscall(Sysprocess_vm_writev, a(lvec), a(liovcnt), a(rvec), a(riovcnt), a(flags)) : int64)
+ -> (syscall(Sysprocess_vm_writev, a(pid), a(lvec), a(liovcnt), a(rvec), a(riovcnt), a(flags)) : int64)
}
const kcmp = {pid1, pid2, kind, idx1, idx2
- -> (syscall(Syskcmp, a(pid2), a(kind), a(idx1), a(idx2)) : int64)
+ -> (syscall(Syskcmp, a(pid1), a(pid2), a(kind), a(idx1), a(idx2)) : int64)
}
const finit_module = {fd, uargs, flags
- -> (syscall(Sysfinit_module, a(uargs), a(flags)) : int64)
+ -> (syscall(Sysfinit_module, a(fd), a(uargs), a(flags)) : int64)
}
const seccomp = {op, flags, uargs
- -> (syscall(Sysseccomp, a(flags), a(uargs)) : int64)
+ -> (syscall(Sysseccomp, a(op), a(flags), a(uargs)) : int64)
}
const getrandom = {buf, count, flags
- -> (syscall(Sysgetrandom, a(count), a(flags)) : int64)
+ -> (syscall(Sysgetrandom, a(buf), a(count), a(flags)) : int64)
}
const bpf = {cmd, attr, size
- -> (syscall(Sysbpf, a(attr), a(size)) : int64)
+ -> (syscall(Sysbpf, a(cmd), a(attr), a(size)) : int64)
}
const execveat = {dfd, filename, argv, envp, flags
- -> (syscall(Sysexecveat, a(filename), a(argv), a(envp), a(flags)) : int64)
+ -> (syscall(Sysexecveat, a(dfd), a(filename), a(argv), a(envp), a(flags)) : int64)
}
const membarrier = {cmd, flags
- -> (syscall(Sysmembarrier, a(flags)) : int64)
+ -> (syscall(Sysmembarrier, a(cmd), a(flags)) : int64)
}
const copy_file_range = {fd_in, off_in, fd_out, off_out, len, flags
- -> (syscall(Syscopy_file_range, a(off_in), a(fd_out), a(off_out), a(len), a(flags)) : int64)
+ -> (syscall(Syscopy_file_range, a(fd_in), a(off_in), a(fd_out), a(off_out), a(len), a(flags)) : int64)
}
const mlock2 = {start, len, flags
- -> (syscall(Sysmlock2, a(len), a(flags)) : int64)
+ -> (syscall(Sysmlock2, a(start), a(len), a(flags)) : int64)
}
const pkey_mprotect = {start, len, prot, pkey
- -> (syscall(Syspkey_mprotect, a(len), a(prot), a(pkey)) : int64)
+ -> (syscall(Syspkey_mprotect, a(start), a(len), a(prot), a(pkey)) : int64)
}
const pkey_alloc = {flags, init_val
- -> (syscall(Syspkey_alloc, a(init_val)) : int64)
+ -> (syscall(Syspkey_alloc, a(flags), a(init_val)) : int64)
}
const pkey_free = {pkey
- -> (syscall(Syspkey_free) : int64)
+ -> (syscall(Syspkey_free, a(pkey)) : int64)
}
diff --git a/lib/sys/sys+netbsd-x64.myr b/lib/sys/sys+netbsd-x64.myr
index c13d88a..02f9a76 100644
--- a/lib/sys/sys+netbsd-x64.myr
+++ b/lib/sys/sys+netbsd-x64.myr
@@ -1003,7 +1003,8 @@ const chdir = {dir; -> syscall(Syschdir, cstring(dir))}
const __getcwd = {buf; -> syscall(Sys__getcwd, a(buf), a(buf.len))}
/* file stuff */
-const pipe = {fds; -> syscall(Syspipe, fds)}
+extern const __netbsd_pipe : (fds : fd[2]# -> int64)
+const pipe = {fds; -> __netbsd_pipe(fds)}
const dup = {fd; -> (syscall(Sysdup, a(fd)) : fd)}
const dup2 = {src, dst; -> (syscall(Sysdup2, a(src), a(dst)) : fd)}
const fcntl = {fd, cmd, args; -> syscall(Sysfcntl, a(fd), a(cmd), a(args))}
diff --git a/lib/sys/sys+openbsd:6.1-x64.myr b/lib/sys/sys+openbsd:6.1-x64.myr
index a2a609d..64cc453 100644
--- a/lib/sys/sys+openbsd:6.1-x64.myr
+++ b/lib/sys/sys+openbsd:6.1-x64.myr
@@ -1263,43 +1263,43 @@ pkg sys =
/* } end manual overrides */
const getentropy = {buf, nbyte
- -> (syscall(Sysgetentropy, a(nbyte)) : int)
+ -> (syscall(Sysgetentropy, a(buf), a(nbyte)) : int)
}
const __tfork = {param, psize
- -> (syscall(Sys__tfork, a(psize)) : int)
+ -> (syscall(Sys__tfork, a(param), a(psize)) : int)
}
const link = {path, link
- -> (syscall(Syslink, a(link)) : int)
+ -> (syscall(Syslink, a(path), a(link)) : int)
}
const fchdir = {fd
- -> (syscall(Sysfchdir) : int)
+ -> (syscall(Sysfchdir, a(fd)) : int)
}
const mknod = {path, mode, dev
- -> (syscall(Sysmknod, a(mode), a(dev)) : int)
+ -> (syscall(Sysmknod, a(path), a(mode), a(dev)) : int)
}
const chmod = {path, mode
- -> (syscall(Syschmod, a(mode)) : int)
+ -> (syscall(Syschmod, a(path), a(mode)) : int)
}
const chown = {path, uid, gid
- -> (syscall(Syschown, a(uid), a(gid)) : int)
+ -> (syscall(Syschown, a(path), a(uid), a(gid)) : int)
}
const obreak = {nsize
- -> (syscall(Sysobreak) : int)
+ -> (syscall(Sysobreak, a(nsize)) : int)
}
const getdtablecount = {
-> (syscall(Sysgetdtablecount) : int)
}
const getrusage = {who, rusage
- -> (syscall(Sysgetrusage, a(rusage)) : int)
+ -> (syscall(Sysgetrusage, a(who), a(rusage)) : int)
}
const mount = {kind, path, flags, data
- -> (syscall(Sysmount, a(path), a(flags), a(data)) : int)
+ -> (syscall(Sysmount, a(kind), a(path), a(flags), a(data)) : int)
}
const unmount = {path, flags
- -> (syscall(Sysunmount, a(flags)) : int)
+ -> (syscall(Sysunmount, a(path), a(flags)) : int)
}
const setuid = {uid
- -> (syscall(Syssetuid) : int)
+ -> (syscall(Syssetuid, a(uid)) : int)
}
const getuid = {
-> (syscall(Sysgetuid) : uid)
@@ -1308,31 +1308,31 @@ const geteuid = {
-> (syscall(Sysgeteuid) : uid)
}
const ptrace = {req, pid, addr, data
- -> (syscall(Sysptrace, a(pid), a(addr), a(data)) : int)
+ -> (syscall(Sysptrace, a(req), a(pid), a(addr), a(data)) : int)
}
const recvmsg = {s, msg, flags
- -> (syscall(Sysrecvmsg, a(msg), a(flags)) : size)
+ -> (syscall(Sysrecvmsg, a(s), a(msg), a(flags)) : size)
}
const sendmsg = {s, msg, flags
- -> (syscall(Syssendmsg, a(msg), a(flags)) : size)
+ -> (syscall(Syssendmsg, a(s), a(msg), a(flags)) : size)
}
const recvfrom = {s, buf, len, flags, from, fromlenaddr
- -> (syscall(Sysrecvfrom, a(buf), a(len), a(flags), a(from), a(fromlenaddr)) : size)
+ -> (syscall(Sysrecvfrom, a(s), a(buf), a(len), a(flags), a(from), a(fromlenaddr)) : size)
}
const getpeername = {fdes, asa, alen
- -> (syscall(Sysgetpeername, a(asa), a(alen)) : int)
+ -> (syscall(Sysgetpeername, a(fdes), a(asa), a(alen)) : int)
}
const getsockname = {fdes, asa, alen
- -> (syscall(Sysgetsockname, a(asa), a(alen)) : int)
+ -> (syscall(Sysgetsockname, a(fdes), a(asa), a(alen)) : int)
}
const access = {path, amode
- -> (syscall(Sysaccess, a(amode)) : int)
+ -> (syscall(Sysaccess, a(path), a(amode)) : int)
}
const chflags = {path, flags
- -> (syscall(Syschflags, a(flags)) : int)
+ -> (syscall(Syschflags, a(path), a(flags)) : int)
}
const fchflags = {fd, flags
- -> (syscall(Sysfchflags, a(flags)) : int)
+ -> (syscall(Sysfchflags, a(fd), a(flags)) : int)
}
const sync = {
-> (syscall(Syssync) : void)
@@ -1341,349 +1341,349 @@ const getppid = {
-> (syscall(Sysgetppid) : pid)
}
const fstatat = {fd, path, buf, flag
- -> (syscall(Sysfstatat, a(path), a(buf), a(flag)) : int)
+ -> (syscall(Sysfstatat, a(fd), a(path), a(buf), a(flag)) : int)
}
const getegid = {
-> (syscall(Sysgetegid) : gid)
}
const profil = {samples, size, offset, scale
- -> (syscall(Sysprofil, a(size), a(offset), a(scale)) : int)
+ -> (syscall(Sysprofil, a(samples), a(size), a(offset), a(scale)) : int)
}
const ktrace = {fname, ops, facs, pid
- -> (syscall(Sysktrace, a(ops), a(facs), a(pid)) : int)
+ -> (syscall(Sysktrace, a(fname), a(ops), a(facs), a(pid)) : int)
}
const getgid = {
-> (syscall(Sysgetgid) : gid)
}
const getlogin59 = {namebuf, namelen
- -> (syscall(Sysgetlogin59, a(namelen)) : int)
+ -> (syscall(Sysgetlogin59, a(namebuf), a(namelen)) : int)
}
const setlogin = {namebuf
- -> (syscall(Syssetlogin) : int)
+ -> (syscall(Syssetlogin, a(namebuf)) : int)
}
const acct = {path
- -> (syscall(Sysacct) : int)
+ -> (syscall(Sysacct, a(path)) : int)
}
const sigpending = {
-> (syscall(Syssigpending) : int)
}
const reboot = {opt
- -> (syscall(Sysreboot) : int)
+ -> (syscall(Sysreboot, a(opt)) : int)
}
const revoke = {path
- -> (syscall(Sysrevoke) : int)
+ -> (syscall(Sysrevoke, a(path)) : int)
}
const symlink = {path, link
- -> (syscall(Syssymlink, a(link)) : int)
+ -> (syscall(Syssymlink, a(path), a(link)) : int)
}
const readlink = {path, buf, count
- -> (syscall(Sysreadlink, a(buf), a(count)) : size)
+ -> (syscall(Sysreadlink, a(path), a(buf), a(count)) : size)
}
const umask = {newmask
- -> (syscall(Sysumask) : filemode)
+ -> (syscall(Sysumask, a(newmask)) : filemode)
}
const chroot = {path
- -> (syscall(Syschroot) : int)
+ -> (syscall(Syschroot, a(path)) : int)
}
const getfsstat = {buf, bufsize, flags
- -> (syscall(Sysgetfsstat, a(bufsize), a(flags)) : int)
+ -> (syscall(Sysgetfsstat, a(buf), a(bufsize), a(flags)) : int)
}
const statfs = {path, buf
- -> (syscall(Sysstatfs, a(buf)) : int)
+ -> (syscall(Sysstatfs, a(path), a(buf)) : int)
}
const fstatfs = {fd, buf
- -> (syscall(Sysfstatfs, a(buf)) : int)
+ -> (syscall(Sysfstatfs, a(fd), a(buf)) : int)
}
const fhstatfs = {fhp, buf
- -> (syscall(Sysfhstatfs, a(buf)) : int)
+ -> (syscall(Sysfhstatfs, a(fhp), a(buf)) : int)
}
const vfork = {
-> (syscall(Sysvfork) : int)
}
const gettimeofday = {tp, tzp
- -> (syscall(Sysgettimeofday, a(tzp)) : int)
+ -> (syscall(Sysgettimeofday, a(tp), a(tzp)) : int)
}
const settimeofday = {tv, tzp
- -> (syscall(Syssettimeofday, a(tzp)) : int)
+ -> (syscall(Syssettimeofday, a(tv), a(tzp)) : int)
}
const setitimer = {which, itv, oitv
- -> (syscall(Syssetitimer, a(itv), a(oitv)) : int)
+ -> (syscall(Syssetitimer, a(which), a(itv), a(oitv)) : int)
}
const getitimer = {which, itv
- -> (syscall(Sysgetitimer, a(itv)) : int)
+ -> (syscall(Sysgetitimer, a(which), a(itv)) : int)
}
const select = {nd, _in, ou, ex, tv
- -> (syscall(Sysselect, a(_in), a(ou), a(ex), a(tv)) : int)
+ -> (syscall(Sysselect, a(nd), a(_in), a(ou), a(ex), a(tv)) : int)
}
const kevent = {fd, changelist, nchanges, eventlist, nevents, timeout
- -> (syscall(Syskevent, a(changelist), a(nchanges), a(eventlist), a(nevents), a(timeout)) : int)
+ -> (syscall(Syskevent, a(fd), a(changelist), a(nchanges), a(eventlist), a(nevents), a(timeout)) : int)
}
const mprotect = {addr, len, prot
- -> (syscall(Sysmprotect, a(len), a(prot)) : int)
+ -> (syscall(Sysmprotect, a(addr), a(len), a(prot)) : int)
}
const madvise = {addr, len, behav
- -> (syscall(Sysmadvise, a(len), a(behav)) : int)
+ -> (syscall(Sysmadvise, a(addr), a(len), a(behav)) : int)
}
const utimes = {path, tptr
- -> (syscall(Sysutimes, a(tptr)) : int)
+ -> (syscall(Sysutimes, a(path), a(tptr)) : int)
}
const futimes = {fd, tptr
- -> (syscall(Sysfutimes, a(tptr)) : int)
+ -> (syscall(Sysfutimes, a(fd), a(tptr)) : int)
}
const mincore = {addr, len, vec
- -> (syscall(Sysmincore, a(len), a(vec)) : int)
+ -> (syscall(Sysmincore, a(addr), a(len), a(vec)) : int)
}
const getgroups = {gidsetsize, gidset
- -> (syscall(Sysgetgroups, a(gidset)) : int)
+ -> (syscall(Sysgetgroups, a(gidsetsize), a(gidset)) : int)
}
const setgroups = {gidsetsize, gidset
- -> (syscall(Syssetgroups, a(gidset)) : int)
+ -> (syscall(Syssetgroups, a(gidsetsize), a(gidset)) : int)
}
const getpgrp = {
-> (syscall(Sysgetpgrp) : int)
}
const setpgid = {pid, pgid
- -> (syscall(Syssetpgid, a(pgid)) : int)
+ -> (syscall(Syssetpgid, a(pid), a(pgid)) : int)
}
const utimensat = {fd, path, times, flag
- -> (syscall(Sysutimensat, a(path), a(times), a(flag)) : int)
+ -> (syscall(Sysutimensat, a(fd), a(path), a(times), a(flag)) : int)
}
const futimens = {fd, times
- -> (syscall(Sysfutimens, a(times)) : int)
+ -> (syscall(Sysfutimens, a(fd), a(times)) : int)
}
const kbind = {param, psize, proc_cookie
- -> (syscall(Syskbind, a(psize), a(proc_cookie)) : int)
+ -> (syscall(Syskbind, a(param), a(psize), a(proc_cookie)) : int)
}
const accept4 = {s, name, anamelen, flags
- -> (syscall(Sysaccept4, a(name), a(anamelen), a(flags)) : int)
+ -> (syscall(Sysaccept4, a(s), a(name), a(anamelen), a(flags)) : int)
}
const __thrsleep = {ident, clock_id, tp, lock, abort
- -> (syscall(Sys__thrsleep, a(clock_id), a(tp), a(lock), a(abort)) : int)
+ -> (syscall(Sys__thrsleep, a(ident), a(clock_id), a(tp), a(lock), a(abort)) : int)
}
const fsync = {fd
- -> (syscall(Sysfsync) : int)
+ -> (syscall(Sysfsync, a(fd)) : int)
}
const setpriority = {which, who, prio
- -> (syscall(Syssetpriority, a(who), a(prio)) : int)
+ -> (syscall(Syssetpriority, a(which), a(who), a(prio)) : int)
}
const getpriority = {which, who
- -> (syscall(Sysgetpriority, a(who)) : int)
+ -> (syscall(Sysgetpriority, a(which), a(who)) : int)
}
const pipe2 = {fdp, flags
- -> (syscall(Syspipe2, a(flags)) : int)
+ -> (syscall(Syspipe2, a(fdp), a(flags)) : int)
}
const dup3 = {from, to, flags
- -> (syscall(Sysdup3, a(to), a(flags)) : int)
+ -> (syscall(Sysdup3, a(from), a(to), a(flags)) : int)
}
const sigreturn = {sigcntxp
- -> (syscall(Syssigreturn) : int)
+ -> (syscall(Syssigreturn, a(sigcntxp)) : int)
}
const chflagsat = {fd, path, flags, atflags
- -> (syscall(Syschflagsat, a(path), a(flags), a(atflags)) : int)
+ -> (syscall(Syschflagsat, a(fd), a(path), a(flags), a(atflags)) : int)
}
const pledge = {request, paths
- -> (syscall(Syspledge, a(paths)) : int)
+ -> (syscall(Syspledge, a(request), a(paths)) : int)
}
const ppoll = {fds, nfds, ts, mask
- -> (syscall(Sysppoll, a(nfds), a(ts), a(mask)) : int)
+ -> (syscall(Sysppoll, a(fds), a(nfds), a(ts), a(mask)) : int)
}
const pselect = {nd, _in, ou, ex, ts, mask
- -> (syscall(Syspselect, a(_in), a(ou), a(ex), a(ts), a(mask)) : int)
+ -> (syscall(Syspselect, a(nd), a(_in), a(ou), a(ex), a(ts), a(mask)) : int)
}
const sigsuspend = {mask
- -> (syscall(Syssigsuspend) : int)
+ -> (syscall(Syssigsuspend, a(mask)) : int)
}
const sendsyslog = {buf, nbyte, flags
- -> (syscall(Syssendsyslog, a(nbyte), a(flags)) : int)
+ -> (syscall(Syssendsyslog, a(buf), a(nbyte), a(flags)) : int)
}
const thrkill = {tid, signum, tcb
- -> (syscall(Systhrkill, a(signum), a(tcb)) : int)
+ -> (syscall(Systhrkill, a(tid), a(signum), a(tcb)) : int)
}
const fchown = {fd, uid, gid
- -> (syscall(Sysfchown, a(uid), a(gid)) : int)
+ -> (syscall(Sysfchown, a(fd), a(uid), a(gid)) : int)
}
const fchmod = {fd, mode
- -> (syscall(Sysfchmod, a(mode)) : int)
+ -> (syscall(Sysfchmod, a(fd), a(mode)) : int)
}
const setreuid = {ruid, euid
- -> (syscall(Syssetreuid, a(euid)) : int)
+ -> (syscall(Syssetreuid, a(ruid), a(euid)) : int)
}
const setregid = {rgid, egid
- -> (syscall(Syssetregid, a(egid)) : int)
+ -> (syscall(Syssetregid, a(rgid), a(egid)) : int)
}
const rename = {from, to
- -> (syscall(Sysrename, a(to)) : int)
+ -> (syscall(Sysrename, a(from), a(to)) : int)
}
const flock = {fd, how
- -> (syscall(Sysflock, a(how)) : int)
+ -> (syscall(Sysflock, a(fd), a(how)) : int)
}
const mkfifo = {path, mode
- -> (syscall(Sysmkfifo, a(mode)) : int)
+ -> (syscall(Sysmkfifo, a(path), a(mode)) : int)
}
const sendto = {s, buf, len, flags, to, tolen
- -> (syscall(Syssendto, a(buf), a(len), a(flags), a(to), a(tolen)) : size)
+ -> (syscall(Syssendto, a(s), a(buf), a(len), a(flags), a(to), a(tolen)) : size)
}
const shutdown = {s, how
- -> (syscall(Sysshutdown, a(how)) : int)
+ -> (syscall(Sysshutdown, a(s), a(how)) : int)
}
const socketpair = {domain, kind, protocol, rsv
- -> (syscall(Syssocketpair, a(kind), a(protocol), a(rsv)) : int)
+ -> (syscall(Syssocketpair, a(domain), a(kind), a(protocol), a(rsv)) : int)
}
const rmdir = {path
- -> (syscall(Sysrmdir) : int)
+ -> (syscall(Sysrmdir, a(path)) : int)
}
const adjtime = {delta, olddelta
- -> (syscall(Sysadjtime, a(olddelta)) : int)
+ -> (syscall(Sysadjtime, a(delta), a(olddelta)) : int)
}
const getlogin_r = {namebuf, namelen
- -> (syscall(Sysgetlogin_r, a(namelen)) : int)
+ -> (syscall(Sysgetlogin_r, a(namebuf), a(namelen)) : int)
}
const setsid = {
-> (syscall(Syssetsid) : int)
}
const quotactl = {path, cmd, uid, arg
- -> (syscall(Sysquotactl, a(cmd), a(uid), a(arg)) : int)
+ -> (syscall(Sysquotactl, a(path), a(cmd), a(uid), a(arg)) : int)
}
const nfssvc = {flag, argp
- -> (syscall(Sysnfssvc, a(argp)) : int)
+ -> (syscall(Sysnfssvc, a(flag), a(argp)) : int)
}
const getfh = {fname, fhp
- -> (syscall(Sysgetfh, a(fhp)) : int)
+ -> (syscall(Sysgetfh, a(fname), a(fhp)) : int)
}
const sysarch = {op, parms
- -> (syscall(Syssysarch, a(parms)) : int)
+ -> (syscall(Syssysarch, a(op), a(parms)) : int)
}
const setgid = {gid
- -> (syscall(Syssetgid) : int)
+ -> (syscall(Syssetgid, a(gid)) : int)
}
const setegid = {egid
- -> (syscall(Syssetegid) : int)
+ -> (syscall(Syssetegid, a(egid)) : int)
}
const seteuid = {euid
- -> (syscall(Sysseteuid) : int)
+ -> (syscall(Sysseteuid, a(euid)) : int)
}
const pathconf = {path, name
- -> (syscall(Syspathconf, a(name)) : int64)
+ -> (syscall(Syspathconf, a(path), a(name)) : int64)
}
const fpathconf = {fd, name
- -> (syscall(Sysfpathconf, a(name)) : int64)
+ -> (syscall(Sysfpathconf, a(fd), a(name)) : int64)
}
const swapctl = {cmd, arg, misc
- -> (syscall(Sysswapctl, a(arg), a(misc)) : int)
+ -> (syscall(Sysswapctl, a(cmd), a(arg), a(misc)) : int)
}
const getrlimit = {which, rlp
- -> (syscall(Sysgetrlimit, a(rlp)) : int)
+ -> (syscall(Sysgetrlimit, a(which), a(rlp)) : int)
}
const setrlimit = {which, rlp
- -> (syscall(Syssetrlimit, a(rlp)) : int)
+ -> (syscall(Syssetrlimit, a(which), a(rlp)) : int)
}
const truncate = {path, pad, length
- -> (syscall(Systruncate, a(pad), a(length)) : int)
+ -> (syscall(Systruncate, a(path), a(pad), a(length)) : int)
}
const ftruncate = {fd, pad, length
- -> (syscall(Sysftruncate, a(pad), a(length)) : int)
+ -> (syscall(Sysftruncate, a(fd), a(pad), a(length)) : int)
}
const mlock = {addr, len
- -> (syscall(Sysmlock, a(len)) : int)
+ -> (syscall(Sysmlock, a(addr), a(len)) : int)
}
const munlock = {addr, len
- -> (syscall(Sysmunlock, a(len)) : int)
+ -> (syscall(Sysmunlock, a(addr), a(len)) : int)
}
const getpgid = {pid
- -> (syscall(Sysgetpgid) : pid)
+ -> (syscall(Sysgetpgid, a(pid)) : pid)
}
const utrace = {label, addr, len
- -> (syscall(Sysutrace, a(addr), a(len)) : int)
+ -> (syscall(Sysutrace, a(label), a(addr), a(len)) : int)
}
const semget = {key, nsems, semflg
- -> (syscall(Syssemget, a(nsems), a(semflg)) : int)
+ -> (syscall(Syssemget, a(key), a(nsems), a(semflg)) : int)
}
const msgget = {key, msgflg
- -> (syscall(Sysmsgget, a(msgflg)) : int)
+ -> (syscall(Sysmsgget, a(key), a(msgflg)) : int)
}
const msgsnd = {msqid, msgp, msgsz, msgflg
- -> (syscall(Sysmsgsnd, a(msgp), a(msgsz), a(msgflg)) : int)
+ -> (syscall(Sysmsgsnd, a(msqid), a(msgp), a(msgsz), a(msgflg)) : int)
}
const msgrcv = {msqid, msgp, msgsz, msgtyp, msgflg
- -> (syscall(Sysmsgrcv, a(msgp), a(msgsz), a(msgtyp), a(msgflg)) : int)
+ -> (syscall(Sysmsgrcv, a(msqid), a(msgp), a(msgsz), a(msgtyp), a(msgflg)) : int)
}
const shmat = {shmid, shmaddr, shmflg
- -> (syscall(Sysshmat, a(shmaddr), a(shmflg)) : void)
+ -> (syscall(Sysshmat, a(shmid), a(shmaddr), a(shmflg)) : void)
}
const shmdt = {shmaddr
- -> (syscall(Sysshmdt) : int)
+ -> (syscall(Sysshmdt, a(shmaddr)) : int)
}
const minherit = {addr, len, inherit
- -> (syscall(Sysminherit, a(len), a(inherit)) : int)
+ -> (syscall(Sysminherit, a(addr), a(len), a(inherit)) : int)
}
const issetugid = {
-> (syscall(Sysissetugid) : int)
}
const lchown = {path, uid, gid
- -> (syscall(Syslchown, a(uid), a(gid)) : int)
+ -> (syscall(Syslchown, a(path), a(uid), a(gid)) : int)
}
const getsid = {pid
- -> (syscall(Sysgetsid) : pid)
+ -> (syscall(Sysgetsid, a(pid)) : pid)
}
const msync = {addr, len, flags
- -> (syscall(Sysmsync, a(len), a(flags)) : int)
+ -> (syscall(Sysmsync, a(addr), a(len), a(flags)) : int)
}
const fhopen = {fhp, flags
- -> (syscall(Sysfhopen, a(flags)) : int)
+ -> (syscall(Sysfhopen, a(fhp), a(flags)) : int)
}
const preadv = {fd, iovp, iovcnt, pad, offset
- -> (syscall(Syspreadv, a(iovp), a(iovcnt), a(pad), a(offset)) : size)
+ -> (syscall(Syspreadv, a(fd), a(iovp), a(iovcnt), a(pad), a(offset)) : size)
}
const pwritev = {fd, iovp, iovcnt, pad, offset
- -> (syscall(Syspwritev, a(iovp), a(iovcnt), a(pad), a(offset)) : size)
+ -> (syscall(Syspwritev, a(fd), a(iovp), a(iovcnt), a(pad), a(offset)) : size)
}
const kqueue = {
-> (syscall(Syskqueue) : int)
}
const mlockall = {flags
- -> (syscall(Sysmlockall) : int)
+ -> (syscall(Sysmlockall, a(flags)) : int)
}
const munlockall = {
-> (syscall(Sysmunlockall) : int)
}
const getresuid = {ruid, euid, suid
- -> (syscall(Sysgetresuid, a(euid), a(suid)) : int)
+ -> (syscall(Sysgetresuid, a(ruid), a(euid), a(suid)) : int)
}
const setresuid = {ruid, euid, suid
- -> (syscall(Syssetresuid, a(euid), a(suid)) : int)
+ -> (syscall(Syssetresuid, a(ruid), a(euid), a(suid)) : int)
}
const getresgid = {rgid, egid, sgid
- -> (syscall(Sysgetresgid, a(egid), a(sgid)) : int)
+ -> (syscall(Sysgetresgid, a(rgid), a(egid), a(sgid)) : int)
}
const setresgid = {rgid, egid, sgid
- -> (syscall(Syssetresgid, a(egid), a(sgid)) : int)
+ -> (syscall(Syssetresgid, a(rgid), a(egid), a(sgid)) : int)
}
const mquery = {addr, len, prot, flags, fd, pad, pos
- -> (syscall(Sysmquery, a(len), a(prot), a(flags), a(fd), a(pad), a(pos)) : void)
+ -> (syscall(Sysmquery, a(addr), a(len), a(prot), a(flags), a(fd), a(pad), a(pos)) : void)
}
const closefrom = {fd
- -> (syscall(Sysclosefrom) : int)
+ -> (syscall(Sysclosefrom, a(fd)) : int)
}
const sigaltstack = {nss, oss
- -> (syscall(Syssigaltstack, a(oss)) : int)
+ -> (syscall(Syssigaltstack, a(nss), a(oss)) : int)
}
const shmget = {key, size, shmflg
- -> (syscall(Sysshmget, a(size), a(shmflg)) : int)
+ -> (syscall(Sysshmget, a(key), a(size), a(shmflg)) : int)
}
const semop = {semid, sops, nsops
- -> (syscall(Syssemop, a(sops), a(nsops)) : int)
+ -> (syscall(Syssemop, a(semid), a(sops), a(nsops)) : int)
}
const fhstat = {fhp, sb
- -> (syscall(Sysfhstat, a(sb)) : int)
+ -> (syscall(Sysfhstat, a(fhp), a(sb)) : int)
}
const __semctl = {semid, semnum, cmd, arg
- -> (syscall(Sys__semctl, a(semnum), a(cmd), a(arg)) : int)
+ -> (syscall(Sys__semctl, a(semid), a(semnum), a(cmd), a(arg)) : int)
}
const shmctl = {shmid, cmd, buf
- -> (syscall(Sysshmctl, a(cmd), a(buf)) : int)
+ -> (syscall(Sysshmctl, a(shmid), a(cmd), a(buf)) : int)
}
const msgctl = {msqid, cmd, buf
- -> (syscall(Sysmsgctl, a(cmd), a(buf)) : int)
+ -> (syscall(Sysmsgctl, a(msqid), a(cmd), a(buf)) : int)
}
const sched_yield = {
-> (syscall(Syssched_yield) : int)
@@ -1692,61 +1692,61 @@ const getthrid = {
-> (syscall(Sysgetthrid) : pid)
}
const __thrwakeup = {ident, n
- -> (syscall(Sys__thrwakeup, a(n)) : int)
+ -> (syscall(Sys__thrwakeup, a(ident), a(n)) : int)
}
const __threxit = {notdead
- -> (syscall(Sys__threxit) : void)
+ -> (syscall(Sys__threxit, a(notdead)) : void)
}
const __thrsigdivert = {sigmask, info, timeout
- -> (syscall(Sys__thrsigdivert, a(info), a(timeout)) : int)
+ -> (syscall(Sys__thrsigdivert, a(sigmask), a(info), a(timeout)) : int)
}
const adjfreq = {freq, oldfreq
- -> (syscall(Sysadjfreq, a(oldfreq)) : int)
+ -> (syscall(Sysadjfreq, a(freq), a(oldfreq)) : int)
}
const setrtable = {rtableid
- -> (syscall(Syssetrtable) : int)
+ -> (syscall(Syssetrtable, a(rtableid)) : int)
}
const getrtable = {
-> (syscall(Sysgetrtable) : int)
}
const faccessat = {fd, path, amode, flag
- -> (syscall(Sysfaccessat, a(path), a(amode), a(flag)) : int)
+ -> (syscall(Sysfaccessat, a(fd), a(path), a(amode), a(flag)) : int)
}
const fchmodat = {fd, path, mode, flag
- -> (syscall(Sysfchmodat, a(path), a(mode), a(flag)) : int)
+ -> (syscall(Sysfchmodat, a(fd), a(path), a(mode), a(flag)) : int)
}
const fchownat = {fd, path, uid, gid, flag
- -> (syscall(Sysfchownat, a(path), a(uid), a(gid), a(flag)) : int)
+ -> (syscall(Sysfchownat, a(fd), a(path), a(uid), a(gid), a(flag)) : int)
}
const linkat = {fd1, path1, fd2, path2, flag
- -> (syscall(Syslinkat, a(path1), a(fd2), a(path2), a(flag)) : int)
+ -> (syscall(Syslinkat, a(fd1), a(path1), a(fd2), a(path2), a(flag)) : int)
}
const mkdirat = {fd, path, mode
- -> (syscall(Sysmkdirat, a(path), a(mode)) : int)
+ -> (syscall(Sysmkdirat, a(fd), a(path), a(mode)) : int)
}
const mkfifoat = {fd, path, mode
- -> (syscall(Sysmkfifoat, a(path), a(mode)) : int)
+ -> (syscall(Sysmkfifoat, a(fd), a(path), a(mode)) : int)
}
const mknodat = {fd, path, mode, dev
- -> (syscall(Sysmknodat, a(path), a(mode), a(dev)) : int)
+ -> (syscall(Sysmknodat, a(fd), a(path), a(mode), a(dev)) : int)
}
const openat = {fd, path, flags, mode
- -> (syscall(Sysopenat, a(path), a(flags), a(mode)) : int)
+ -> (syscall(Sysopenat, a(fd), a(path), a(flags), a(mode)) : int)
}
const readlinkat = {fd, path, buf, count
- -> (syscall(Sysreadlinkat, a(path), a(buf), a(count)) : size)
+ -> (syscall(Sysreadlinkat, a(fd), a(path), a(buf), a(count)) : size)
}
const renameat = {fromfd, from, tofd, to
- -> (syscall(Sysrenameat, a(from), a(tofd), a(to)) : int)
+ -> (syscall(Sysrenameat, a(fromfd), a(from), a(tofd), a(to)) : int)
}
const symlinkat = {path, fd, link
- -> (syscall(Syssymlinkat, a(fd), a(link)) : int)
+ -> (syscall(Syssymlinkat, a(path), a(fd), a(link)) : int)
}
const unlinkat = {fd, path, flag
- -> (syscall(Sysunlinkat, a(path), a(flag)) : int)
+ -> (syscall(Sysunlinkat, a(fd), a(path), a(flag)) : int)
}
const __set_tcb = {tcb
- -> (syscall(Sys__set_tcb) : void)
+ -> (syscall(Sys__set_tcb, a(tcb)) : void)
}
const __get_tcb = {
-> (syscall(Sys__get_tcb) : void)
diff --git a/lib/sys/sys+openbsd:6.2-x64.myr b/lib/sys/sys+openbsd:6.2-x64.myr
new file mode 100644
index 0000000..4a1f0e5
--- /dev/null
+++ b/lib/sys/sys+openbsd:6.2-x64.myr
@@ -0,0 +1,1762 @@
+/*
+ generated-ish source
+ stitched for openbsd:6.2 arch:x64
+ edit with caution.
+ */
+pkg sys =
+ type size = int64 /* spans entire address space */
+ type usize = uint64 /* unsigned size */
+ type off = int64 /* file offsets */
+ type intptr = uint64/* can hold any pointer losslessly */
+ type time = int64 /* milliseconds since epoch */
+ type pid = int32 /* process id */
+ type scno = int64 /*syscall*/
+ type fdopt = int64 /* fd options */
+ type fd = int32 /* fd */
+ type whence = uint64 /* seek from whence */
+ type mprot = int64 /* memory protection */
+ type mopt = int64 /* memory mapping options */
+ type socktype = int64 /* socket type */
+ type sockproto = int64 /* socket protocol */
+ type sockopt = int32 /* socket option */
+ type sockfam = uint8 /* socket family */
+ type filemode = uint32
+ type filetype = uint8
+ type fcntlcmd = int64
+ type signo = int32
+ type sigflags = int32
+ type sigset = uint32
+ type msg = void
+
+ type clock = union
+ `Clockrealtime
+ `Clockmonotonic
+ `Clockproccputime
+ `Clockthreadcputime
+ `Clockuptime
+ ;;
+
+ type waitstatus = union
+ `Waitfail int32
+ `Waitexit int32
+ `Waitsig int32
+ `Waitstop int32
+ ;;
+
+ type rlimit = struct
+ cur : uint64 /* current (soft) limit */
+ max : uint64 /* maximum value for rlim_cur */
+ ;;
+
+ type timespec = struct
+ sec : uint64
+ nsec : uint64
+ ;;
+
+ type timeval = struct
+ sec : uint64
+ usec : uint64
+ ;;
+
+ type timezone = struct
+ minwest : int32 /* minutes west of Greenwich */
+ dsttime : int32 /* type of dst correction */
+ ;;
+
+ type pollfd = struct
+ fd : fd
+ events : uint16
+ revents : uint16
+ ;;
+
+ type itimerval = struct
+ interval : timeval /* timer interval */
+ value : timeval /* current value */
+ ;;
+
+ type sigaction = struct
+ handler : byte# /* code pointer */
+ mask : sigset
+ flags : sigflags
+ ;;
+ /*
+ * Information pushed on stack when a signal is delivered.
+ * This is used by the kernel to restore state following
+ * execution of the signal handler. It is also made available
+ * to the handler to allow it to restore state properly if
+ * a non-standard exit is performed.
+ */
+ type sigcontext = struct
+ /* plain match trapframe */
+ rdi : int64
+ rsi : int64
+ rdx : int64
+ rcx : int64
+ r8 : int64
+ r9 : int64
+ r10 : int64
+ r11 : int64
+ r12 : int64
+ r13 : int64
+ r14 : int64
+ r15 : int64
+ rbp : int64
+ rbx : int64
+ rax : int64
+ gs : int64
+ fs : int64
+ es : int64
+ ds : int64
+ trapno : int64
+ err : int64
+ rip : int64
+ cs : int64
+ rflags : int64
+ rsp : int64
+ ss : int64
+
+ fpstate : fxsave64#
+ __pad : int32
+ mask : int32
+ cookie : int64
+ ;;
+
+ type sigaltstack = struct
+ sp : void#
+ size : size
+ flags : int32
+ ;;
+
+ type fxsave64 = struct
+ fcw : int16
+ fsw : int16
+ ftw : int8
+ unused1 : int8
+ fop : int16
+ rip : int64
+ rdp : int64
+ mxcsr : int32
+ mxcsrmask : int32
+ st : int64[8][2] /* 8 normal FP regs */
+ xmm : int64[16][2] /* 16 SSE2 registers */
+ unused3 : int8[96]
+ ;;
+
+ const Simaxsz = 128
+ const Sipad = (Simaxsz / 4) - 3
+ type siginfo = struct
+ signo : int
+ code : int
+ errno : int
+ pad : int[Sipad]
+ ;;
+
+ type rusage = struct
+ utime : timeval /* user time */
+ stime : timeval /* system time */
+ maxrss : uint64 /* max resident set size*/
+ ixrss : uint64 /* shared text size */
+ idrss : uint64 /* unshared data size */
+ isrss : uint64 /* unshared stack size */
+ minflt : uint64 /* page reclaims */
+ majflt : uint64 /* page faults */
+ nswap : uint64 /* swaps */
+ inblock : uint64 /* block input ops */
+ oublock : uint64 /* block output ops */
+ msgsnd : uint64 /* messages sent */
+ msgrcv : uint64 /* messages received */
+ nsignals : uint64 /* signals received */
+ nvcsw : uint64 /* voluntary context switches */
+ nivcsw : uint64 /* involuntary context switches */
+ ;;
+
+ type tforkparams = struct
+ tcb : void#
+ tid : pid#
+ stk : byte#
+ ;;
+
+ type statbuf = struct
+ mode : filemode
+ dev : uint32
+ ino : uint64
+ nlink : uint32
+ uid : uint32
+ gid : uint32
+ rdev : uint32
+ atime : timespec
+ mtime : timespec
+ ctime : timespec
+ size : off
+ blocks : int64
+ blksize : uint32
+ flags : uint32
+ gen : uint32
+ birthtim : timespec
+ ;;
+
+ type semun = struct
+ semarr : void#
+ ;;
+
+ const Mfsnamelen = 16 /* length of fs type name, including nul */
+ const Mnamelen = 90 /* length of buffer for returned name */
+
+ type statfs = struct
+ flags : uint32 /* copy of mount flags */
+ bsize : uint32 /* file system block size */
+ iosize : uint32 /* optimal transfer block size */
+
+ /* unit is f_bsize */
+ blocks : uint64 /* total data blocks in file system */
+ bfree : uint64 /* free blocks in fs */
+ bavail : int64 /* free blocks avail to non-superuser */
+
+ files : int64 /* total file nodes in file system */
+ ffree : int64 /* free file nodes in fs */
+ favail : int64 /* free file nodes avail to non-root */
+
+ syncwr : int64 /* count of sync writes since mount */
+ syncrd : int64 /* count of sync reads since mount */
+ asyncwr : int64 /* count of async writes since mount */
+ asyncrd : int64 /* count of async reads since mount */
+
+ fsid : fsid /* file system id */
+ namemax : uint32 /* maximum filename length */
+ owner : uid /* user that mounted the file system */
+ ctime : uint64 /* last mount [-u] time */
+
+ fstypename : byte[Mfsnamelen]; /* fs type name */
+ mntonname : byte[Mnamelen]; /* directory on which mounted */
+ mntfromname : byte[Mnamelen]; /* mounted file system */
+ mntfromspec : byte[Mnamelen]; /* special for mount request */
+ ///union mount_info mount_info; /* per-filesystem mount options */
+ __mountinfo : byte[160]; /* storage for 'union mount_info' */
+ ;;
+
+ type utsname = struct
+ system : byte[32]
+ node : byte[32]
+ release : byte[32]
+ version : byte[32]
+ machine : byte[32]
+ ;;
+
+ type sockaddr = struct
+ len : byte
+ fam : sockfam
+ data : byte[14] /* what is the *actual* length? */
+ ;;
+
+ type sockaddr_in = struct
+ len : byte
+ fam : sockfam
+ port : uint16
+ addr : byte[4]
+ zero : byte[8]
+ ;;
+
+ type sockaddr_in6 = struct
+ len : byte
+ fam : sockfam
+ port : uint16
+ flow : uint32
+ addr : byte[16]
+ scope : uint32
+ ;;
+
+ type sockaddr_un = struct
+ len : uint8
+ fam : sockfam
+ path : byte[104]
+ ;;
+
+ type sockaddr_storage = struct
+ len : byte
+ fam : sockfam
+ __pad1 : byte[6]
+ __align : int64
+ __pad2 : byte[240]
+ ;;
+
+ type dirent = struct
+ fileno : uint64
+ off : uint64
+ reclen : uint16
+ ftype : uint8
+ namlen : uint8
+ __pad : byte[4]
+ name : byte[256]
+ ;;
+
+ type iovec = struct
+ base : byte#
+ len : uint64
+ ;;
+
+ /* open options */
+ const Ordonly : fdopt = 0x0
+ const Owronly : fdopt = 0x1
+ const Ordwr : fdopt = 0x2
+ const Oappend : fdopt = 0x8
+ const Ondelay : fdopt = 0x4
+ const Oshlock : fdopt = 0x10 /* open with shared file lock */
+ const Oexlock : fdopt = 0x20 /* open with exclusive file lock */
+ const Oasync : fdopt = 0x40 /* signal pgrp when data ready */
+ const Osync : fdopt = 0x80 /* backwards compatibility */
+ const Onofollow : fdopt = 0x100
+ const Ocreat : fdopt = 0x200
+ const Otrunc : fdopt = 0x400
+ const Oexcl : fdopt = 0x800
+ const Ocloexec : fdopt = 0x10000
+ const Odsync : fdopt = Osync /* synchronous data writes */
+ const Orsync : fdopt = Osync /* synchronous reads */
+ const Odir : fdopt = 0x20000
+
+ /* poll options */
+ const Pollin : uint16 = 0x0001
+ const Pollpri : uint16 = 0x0002
+ const Pollout : uint16 = 0x0004
+ const Pollerr : uint16 = 0x0008
+ const Pollhup : uint16 = 0x0010
+ const Pollnval : uint16 = 0x0020
+ const Pollnorm : uint16 = 0x0040
+ const Pollrdband: uint16 = 0x0080
+ const Pollwrband: uint16 = 0x0100
+
+ /* stat modes */
+ const Sifmt : filemode = 0xf000
+ const Sififo : filemode = 0x1000
+ const Sifchr : filemode = 0x2000
+ const Sifdir : filemode = 0x4000
+ const Sifblk : filemode = 0x6000
+ const Sifreg : filemode = 0x8000
+ const Siflnk : filemode = 0xa000
+ const Sifsock : filemode = 0xc000
+ const Sisvtx : filemode = 0x0200
+
+ /* mmap protection */
+ const Mprotnone : mprot = 0x0
+ const Mprotrd : mprot = 0x1
+ const Mprotwr : mprot = 0x2
+ const Mprotexec : mprot = 0x4
+ const Mprotrw : mprot = 0x3
+
+ /* mmap options */
+ const Mshared : mopt = 0x1
+ const Mpriv : mopt = 0x2
+ const Mfixed : mopt = 0x10
+ const Mfile : mopt = 0x0
+ const Manon : mopt = 0x1000
+ const Mnoreplace : mopt = 0x0800
+
+ /* file types */
+ const Dtunknown : filetype = 0
+ const Dtfifo : filetype = 1
+ const Dtchr : filetype = 2
+ const Dtdir : filetype = 4
+ const Dtblk : filetype = 6
+ const Dtreg : filetype = 8
+ const Dtlnk : filetype = 10
+ const Dtsock : filetype = 12
+
+ /* socket families. INCOMPLETE. */
+ const Afunspec : sockfam = 0
+ const Afunix : sockfam = 1
+ const Afinet : sockfam = 2
+ const Afinet6 : sockfam = 24
+
+ /* socket types. */
+ const Sockstream : socktype = 1
+ const Sockdgram : socktype = 2
+ const Sockraw : socktype = 3
+ const Sockrdm : socktype = 4
+ const Sockseqpacket : socktype = 5
+
+ /* socket options */
+ const Sodebug : sockopt = 0x0001 /* turn on debugging info recording */
+ const Soacceptconn : sockopt = 0x0002 /* socket has had listen() */
+ const Soreuseaddr : sockopt = 0x0004 /* allow local address reuse */
+ const Sokeepalive : sockopt = 0x0008 /* keep connections alive */
+ const Sodontroute : sockopt = 0x0010 /* just use interface addresses */
+ const Sobroadcast : sockopt = 0x0020 /* permit sending of broadcast msgs */
+ const Souseloopback : sockopt = 0x0040 /* bypass hardware when possible */
+ const Solinger : sockopt = 0x0080 /* linger on close if data present */
+ const Sooobinline : sockopt = 0x0100 /* leave received OOB data in line */
+ const Soreuseport : sockopt = 0x0200 /* allow local address & port reuse */
+ const Sotimestamp : sockopt = 0x0800 /* timestamp received dgram traffic */
+ const Sobindany : sockopt = 0x1000 /* allow bind to any address */
+ const Sosndbuf : sockopt = 0x1001 /* send buffer size */
+ const Sorcvbuf : sockopt = 0x1002 /* receive buffer size */
+ const Sosndlowat : sockopt = 0x1003 /* send low-water mark */
+ const Sorcvlowat : sockopt = 0x1004 /* receive low-water mark */
+ const Sosndtimeo : sockopt = 0x1005 /* send timeout */
+ const Sorcvtimeo : sockopt = 0x1006 /* receive timeout */
+ const Soerror : sockopt = 0x1007 /* get error status and clear */
+ const Sotype : sockopt = 0x1008 /* get socket type */
+ const Sonetproc : sockopt = 0x1020 /* multiplex; network processing */
+ const Sortable : sockopt = 0x1021 /* routing table to be used */
+ const Sopeercred : sockopt = 0x1022 /* get connect-time credentials */
+ const Sosplice : sockopt = 0x1023 /* splice data to other socket */
+
+ /* socket option levels */
+ const Solsocket : sockproto = 0xffff
+
+ /* network protocols */
+ const Ipproto_ip : sockproto = 0
+ const Ipproto_icmp : sockproto = 1
+ const Ipproto_tcp : sockproto = 6
+ const Ipproto_udp : sockproto = 17
+ const Ipproto_raw : sockproto = 255
+
+ const Seekset : whence = 0
+ const Seekcur : whence = 1
+ const Seekend : whence = 2
+
+ /* system specific constants */
+ const Maxpathlen : size = 1024
+
+ /* fcntl constants */
+ const Fdupfd : fcntlcmd = 0 /* duplicate file descriptor */
+ const Fgetfd : fcntlcmd = 1 /* get file descriptor flags */
+ const Fsetfd : fcntlcmd = 2 /* set file descriptor flags */
+ const Fgetfl : fcntlcmd = 3 /* get file status flags */
+ const Fsetfl : fcntlcmd = 4 /* set file status flags */
+ const Fgetown : fcntlcmd = 5 /* get SIGIO/SIGURG proc/pgrp */
+ const Fsetown : fcntlcmd = 6 /* set SIGIO/SIGURG proc/pgrp */
+ const Fogetlk : fcntlcmd = 7 /* get record locking information */
+ const Fosetlk : fcntlcmd = 8 /* set record locking information */
+
+ /* return value for a failed mapping */
+ const Mapbad : byte# = (-1 : byte#)
+
+ /* signal flags */
+ const Saonstack : sigflags = 0x0001 /* take signal on signal stack */
+ const Sarestart : sigflags = 0x0002 /* restart system on signal return */
+ const Saresethand : sigflags = 0x0004 /* reset to SIG_DFL when taking signal */
+ const Sanodefer : sigflags = 0x0010 /* don't mask the signal we're delivering */
+ const Sanocldwait : sigflags = 0x0020 /* don't create zombies (assign to pid 1) */
+ const Sanocldstop : sigflags = 0x0008 /* do not generate SIGCHLD on child stop */
+ const Sasiginfo : sigflags = 0x0040 /* generate siginfo_t */
+
+ /* signals */
+ const Sighup : signo = 1 /* hangup */
+ const Sigint : signo = 2 /* interrupt */
+ const Sigquit : signo = 3 /* quit */
+ const Sigill : signo = 4 /* illegal instruction (not reset when caught) */
+ const Sigtrap : signo = 5 /* trace trap (not reset when caught) */
+ const Sigabrt : signo = 6 /* abort() */
+ const Sigiot : signo = Sigabrt /* compatibility */
+ const Sigemt : signo = 7 /* EMT instruction */
+ const Sigfpe : signo = 8 /* floating point exception */
+ const Sigkill : signo = 9 /* kill (cannot be caught or ignored) */
+ const Sigbus : signo = 10 /* bus error */
+ const Sigsegv : signo = 11 /* segmentation violation */
+ const Sigsys : signo = 12 /* bad argument to system call */
+ const Sigpipe : signo = 13 /* write on a pipe with no one to read it */
+ const Sigalrm : signo = 14 /* alarm clock */
+ const Sigterm : signo = 15 /* software termination signal from kill */
+ const Sigurg : signo = 16 /* urgent condition on IO channel */
+ const Sigstop : signo = 17 /* sendable stop signal not from tty */
+ const Sigtstp : signo = 18 /* stop signal from tty */
+ const Sigcont : signo = 19 /* continue a stopped process */
+ const Sigchld : signo = 20 /* to parent on child stop or exit */
+ const Sigttin : signo = 21 /* to readers pgrp upon background tty read */
+ const Sigttou : signo = 22 /* like TTIN for output if (tp->t_local&LTOSTOP) */
+ const Sigio : signo = 23 /* input/output possible signal */
+ const Sigxcpu : signo = 24 /* exceeded CPU time limit */
+ const Sigxfsz : signo = 25 /* exceeded file size limit */
+ const Sigvtalrm : signo = 26 /* virtual time alarm */
+ const Sigprof : signo = 27 /* profiling time alarm */
+ const Sigwinch : signo = 28 /* window size changes */
+ const Siginfo : signo = 29 /* information request */
+ const Sigusr1 : signo = 30 /* user defined signal 1 */
+ const Sigusr2 : signo = 31 /* user defined signal 2 */
+ const Sigthr : signo = 32 /* thread library AST */
+
+ extern const syscall : (sc:scno, args:... -> int64)
+ extern var __cenvp : byte##
+ type dev = int32
+ type uid = uint32
+ type gid = uint32
+ type fd_mask = uint32
+ type uintptr = uint64
+ type clockid = int32
+ type id = uint32
+ type key = int64
+ type shmatt = int16
+
+ type tfork = struct
+ tcb : void#
+ tid : pid#
+ stack : void#
+
+ ;;
+
+ type msghdr = struct
+ name : void#
+ namelen : int32
+ iov : iovec#
+ iovlen : uint
+ control : void#
+ controllen : int32
+ flags : int
+
+ ;;
+
+ type fsid = struct
+ val : int32[2]
+
+ ;;
+
+ type fid = struct
+ len : uint16
+ reserved : uint16
+ data : byte[16]
+
+ ;;
+
+ type fhandle = struct
+ fsid : fsid
+ fid : fid
+
+ ;;
+
+ type fdset = struct
+ bits : fd_mask[32]
+
+ ;;
+
+ type kevent = struct
+ ident : uintptr
+ filter : int16
+ flags : uint16
+ fflags : uint
+ data : int64
+ udata : void#
+
+ ;;
+
+ type kbind = struct
+ addr : void#
+ size : size
+
+ ;;
+
+ type sembuf = struct
+ num : uint16
+ op : int16
+ flg : int16
+
+ ;;
+
+ type ipc_perm = struct
+ cuid : uid
+ cgid : gid
+ uid : uid
+ gid : gid
+ mode : filemode
+ seq : uint16
+ key : key
+
+ ;;
+
+ type shmid_ds = struct
+ perm : ipc_perm
+ segsz : int
+ lpid : pid
+ cpid : pid
+ nattch : shmatt
+ atime : time
+ atimensec : int64
+ dtime : time
+ dtimensec : int64
+ ctime : time
+ ctimensec : int64
+ internal : void#
+
+ ;;
+
+ type msqid_ds = struct
+ perm : ipc_perm
+ first : msg#
+ last : msg#
+ cbytes : uint64
+ qnum : uint64
+ qbytes : uint64
+ lspid : pid
+ lrpid : pid
+ stime : time
+ pad1 : int64
+ rtime : time
+ pad2 : int64
+ ctime : time
+ pad3 : int64
+ pad4 : int64[4]
+
+ ;;
+
+
+ const Futexwait : int = 1
+ const Futexwake : int = 2
+ const Futexrequeue : int = 3
+
+ const Sysexit : scno = 1
+ const Sysfork : scno = 2
+ const Sysread : scno = 3
+ const Syswrite : scno = 4
+ const Sysopen : scno = 5
+ const Sysclose : scno = 6
+ const Sysgetentropy : scno = 7
+ const Sys__tfork : scno = 8
+ const Syslink : scno = 9
+ const Sysunlink : scno = 10
+ const Syswait4 : scno = 11
+ const Syschdir : scno = 12
+ const Sysfchdir : scno = 13
+ const Sysmknod : scno = 14
+ const Syschmod : scno = 15
+ const Syschown : scno = 16
+ const Sysobreak : scno = 17
+ const Sysgetdtablecount : scno = 18
+ const Sysgetrusage : scno = 19
+ const Sysgetpid : scno = 20
+ const Sysmount : scno = 21
+ const Sysunmount : scno = 22
+ const Syssetuid : scno = 23
+ const Sysgetuid : scno = 24
+ const Sysgeteuid : scno = 25
+ const Sysptrace : scno = 26
+ const Sysrecvmsg : scno = 27
+ const Syssendmsg : scno = 28
+ const Sysrecvfrom : scno = 29
+ const Sysaccept : scno = 30
+ const Sysgetpeername : scno = 31
+ const Sysgetsockname : scno = 32
+ const Sysaccess : scno = 33
+ const Syschflags : scno = 34
+ const Sysfchflags : scno = 35
+ const Syssync : scno = 36
+ const Sysstat : scno = 38
+ const Sysgetppid : scno = 39
+ const Syslstat : scno = 40
+ const Sysdup : scno = 41
+ const Sysfstatat : scno = 42
+ const Sysgetegid : scno = 43
+ const Sysprofil : scno = 44
+ const Sysktrace : scno = 45
+ const Syssigaction : scno = 46
+ const Sysgetgid : scno = 47
+ const Syssigprocmask : scno = 48
+ const Syssetlogin : scno = 50
+ const Sysacct : scno = 51
+ const Syssigpending : scno = 52
+ const Sysfstat : scno = 53
+ const Sysioctl : scno = 54
+ const Sysreboot : scno = 55
+ const Sysrevoke : scno = 56
+ const Syssymlink : scno = 57
+ const Sysreadlink : scno = 58
+ const Sysexecve : scno = 59
+ const Sysumask : scno = 60
+ const Syschroot : scno = 61
+ const Sysgetfsstat : scno = 62
+ const Sysstatfs : scno = 63
+ const Sysfstatfs : scno = 64
+ const Sysfhstatfs : scno = 65
+ const Sysvfork : scno = 66
+ const Sysgettimeofday : scno = 67
+ const Syssettimeofday : scno = 68
+ const Syssetitimer : scno = 69
+ const Sysgetitimer : scno = 70
+ const Sysselect : scno = 71
+ const Syskevent : scno = 72
+ const Sysmunmap : scno = 73
+ const Sysmprotect : scno = 74
+ const Sysmadvise : scno = 75
+ const Sysutimes : scno = 76
+ const Sysfutimes : scno = 77
+ const Sysmincore : scno = 78
+ const Sysgetgroups : scno = 79
+ const Syssetgroups : scno = 80
+ const Sysgetpgrp : scno = 81
+ const Syssetpgid : scno = 82
+ const Sysfutex : scno = 83
+ const Sysutimensat : scno = 84
+ const Sysfutimens : scno = 85
+ const Syskbind : scno = 86
+ const Sysclock_gettime : scno = 87
+ const Sysclock_settime : scno = 88
+ const Sysclock_getres : scno = 89
+ const Sysdup2 : scno = 90
+ const Sysnanosleep : scno = 91
+ const Sysfcntl : scno = 92
+ const Sysaccept4 : scno = 93
+ const Sys__thrsleep : scno = 94
+ const Sysfsync : scno = 95
+ const Syssetpriority : scno = 96
+ const Syssocket : scno = 97
+ const Sysconnect : scno = 98
+ const Sysgetdents : scno = 99
+ const Sysgetpriority : scno = 100
+ const Syspipe2 : scno = 101
+ const Sysdup3 : scno = 102
+ const Syssigreturn : scno = 103
+ const Sysbind : scno = 104
+ const Syssetsockopt : scno = 105
+ const Syslisten : scno = 106
+ const Syschflagsat : scno = 107
+ const Syspledge : scno = 108
+ const Sysppoll : scno = 109
+ const Syspselect : scno = 110
+ const Syssigsuspend : scno = 111
+ const Syssendsyslog : scno = 112
+ const Sysfktrace : scno = 113
+ const Sysgetsockopt : scno = 118
+ const Systhrkill : scno = 119
+ const Sysreadv : scno = 120
+ const Syswritev : scno = 121
+ const Syskill : scno = 122
+ const Sysfchown : scno = 123
+ const Sysfchmod : scno = 124
+ const Syssetreuid : scno = 126
+ const Syssetregid : scno = 127
+ const Sysrename : scno = 128
+ const Sysflock : scno = 131
+ const Sysmkfifo : scno = 132
+ const Syssendto : scno = 133
+ const Sysshutdown : scno = 134
+ const Syssocketpair : scno = 135
+ const Sysmkdir : scno = 136
+ const Sysrmdir : scno = 137
+ const Sysadjtime : scno = 140
+ const Sysgetlogin_r : scno = 141
+ const Syssetsid : scno = 147
+ const Sysquotactl : scno = 148
+ const Sysnfssvc : scno = 155
+ const Sysgetfh : scno = 161
+ const Syssysarch : scno = 165
+ const Syspread : scno = 173
+ const Syspwrite : scno = 174
+ const Syssetgid : scno = 181
+ const Syssetegid : scno = 182
+ const Sysseteuid : scno = 183
+ const Syspathconf : scno = 191
+ const Sysfpathconf : scno = 192
+ const Sysswapctl : scno = 193
+ const Sysgetrlimit : scno = 194
+ const Syssetrlimit : scno = 195
+ const Sysmmap : scno = 197
+ const Syslseek : scno = 199
+ const Systruncate : scno = 200
+ const Sysftruncate : scno = 201
+ const Syssysctl : scno = 202
+ const Sysmlock : scno = 203
+ const Sysmunlock : scno = 204
+ const Sysgetpgid : scno = 207
+ const Sysutrace : scno = 209
+ const Syssemget : scno = 221
+ const Sysmsgget : scno = 225
+ const Sysmsgsnd : scno = 226
+ const Sysmsgrcv : scno = 227
+ const Sysshmat : scno = 228
+ const Sysshmdt : scno = 230
+ const Sysminherit : scno = 250
+ const Syspoll : scno = 252
+ const Sysissetugid : scno = 253
+ const Syslchown : scno = 254
+ const Sysgetsid : scno = 255
+ const Sysmsync : scno = 256
+ const Syspipe : scno = 263
+ const Sysfhopen : scno = 264
+ const Syspreadv : scno = 267
+ const Syspwritev : scno = 268
+ const Syskqueue : scno = 269
+ const Sysmlockall : scno = 271
+ const Sysmunlockall : scno = 272
+ const Sysgetresuid : scno = 281
+ const Syssetresuid : scno = 282
+ const Sysgetresgid : scno = 283
+ const Syssetresgid : scno = 284
+ const Sysmquery : scno = 286
+ const Sysclosefrom : scno = 287
+ const Syssigaltstack : scno = 288
+ const Sysshmget : scno = 289
+ const Syssemop : scno = 290
+ const Sysfhstat : scno = 294
+ const Sys__semctl : scno = 295
+ const Sysshmctl : scno = 296
+ const Sysmsgctl : scno = 297
+ const Syssched_yield : scno = 298
+ const Sysgetthrid : scno = 299
+ const Sys__thrwakeup : scno = 301
+ const Sys__threxit : scno = 302
+ const Sys__thrsigdivert : scno = 303
+ const Sys__getcwd : scno = 304
+ const Sysadjfreq : scno = 305
+ const Syssetrtable : scno = 310
+ const Sysgetrtable : scno = 311
+ const Sysfaccessat : scno = 313
+ const Sysfchmodat : scno = 314
+ const Sysfchownat : scno = 315
+ const Syslinkat : scno = 317
+ const Sysmkdirat : scno = 318
+ const Sysmkfifoat : scno = 319
+ const Sysmknodat : scno = 320
+ const Sysopenat : scno = 321
+ const Sysreadlinkat : scno = 322
+ const Sysrenameat : scno = 323
+ const Syssymlinkat : scno = 324
+ const Sysunlinkat : scno = 325
+ const Sys__set_tcb : scno = 329
+ const Sys__get_tcb : scno = 330
+
+ /* start manual overrides { */
+ const exit : (status:int -> void)
+ const getpid : ( -> pid)
+ const kill : (pid:pid, sig:int64 -> int64)
+ const fork : (-> pid)
+ const wait4 : (pid:pid, loc:int32#, opt : int64, usage:rusage# -> int64)
+ const waitpid : (pid:pid, loc:int32#, opt : int64 -> int64)
+ const execv : (cmd : byte[:], args : byte[:][:] -> int64)
+ const execve : (cmd : byte[:], args : byte[:][:], env : byte[:][:] -> int64)
+ const waitstatus : (st : int32 -> waitstatus)
+ extern const __tfork_thread : (tfp : tforkparams#, sz : size, fn : void#, arg : void# -> pid)
+ const open : (path:byte[:], opts:fdopt -> fd)
+ const openmode : (path:byte[:], opts:fdopt, mode:int64 -> fd)
+ const close : (fd:fd -> int64)
+ const creat : (path:byte[:], mode:int64 -> fd)
+ const unlink : (path:byte[:] -> int)
+ const read : (fd:fd, buf:byte[:] -> size)
+ const pread : (fd:fd, buf:byte[:], off : off -> size)
+ const readv : (fd:fd, iov:iovec[:] -> size)
+ const write : (fd:fd, buf:byte[:] -> size)
+ const pwrite : (fd:fd, buf:byte[:], off : off -> size)
+ const writev : (fd:fd, iov:iovec[:] -> size)
+ const lseek : (fd:fd, off : off, whence : whence -> int64)
+ const stat : (path:byte[:], sb:statbuf# -> int64)
+ const lstat : (path:byte[:], sb:statbuf# -> int64)
+ const fstat : (fd:fd, sb:statbuf# -> int64)
+ const mkdir : (path : byte[:], mode : int64 -> int64)
+ generic ioctl : (fd:fd, req : int64, arg:@a# -> int64)
+ const getdents : (fd : fd, buf : byte[:] -> int64)
+ const chdir : (p : byte[:] -> int64)
+ const __getcwd : (buf : byte[:] -> int64)
+ const poll : (pfd : pollfd[:], tm : int -> int)
+ const sigaction : (sig : signo, act : sigaction#, oact : sigaction# -> int)
+ const sigprocmask : (how : int32, set : sigset#, oset : sigset# -> int)
+ const pipe : (fds : fd[2]# -> int64)
+ const dup : (fd : fd -> fd)
+ const dup2 : (src : fd, dst : fd -> fd)
+ const fcntl : (fd : fd, cmd : fcntlcmd, args : byte# -> int64)
+ const socket : (dom : sockfam, stype : socktype, proto : sockproto -> fd)
+ const connect : (sock : fd, addr : sockaddr#, len : size -> int)
+ const accept : (sock : fd, addr : sockaddr#, len : size# -> fd)
+ const listen : (sock : fd, backlog : int -> int)
+ const bind : (sock : fd, addr : sockaddr#, len : size -> int)
+ const setsockopt : (sock : fd, lev : sockproto, opt : sockopt, val : void#, len : size -> int)
+ const getsockopt : (sock : fd, lev : sockproto, opt : sockopt, val : void#, len : size# -> int)
+ const munmap : (addr:byte#, len:size -> int64)
+ const mmap : (addr:byte#, len:size, prot:mprot, flags:mopt, fd:fd, off:off -> byte#)
+ const clock_getres : (clk : clock, ts : timespec# -> int32)
+ const clock_gettime : (clk : clock, ts : timespec# -> int32)
+ const clock_settime : (clk : clock, ts : timespec# -> int32)
+ const sleep : (time : uint64 -> int32)
+ const nanosleep : (req : timespec#, rem : timespec# -> int32)
+ const uname : (buf : utsname# -> int)
+ const sysctl : (mib : int[:], \
+ old : void#, oldsz : size#, \
+ new : void#, newsz : size# \
+ -> int)
+ extern const cstring : (str : byte[:] -> byte#)
+ extern const alloca : (sz : size -> byte#)
+ extern const __freebsd_pipe : (fds : fd[2]# -> int64)
+ /* } end manual overrides */
+
+ const getentropy : (buf : void#, nbyte : size -> int)
+ const __tfork : (param : tfork#, psize : size -> int)
+ const link : (path : byte#, link : byte# -> int)
+ const fchdir : (fd : int -> int)
+ const mknod : (path : byte#, mode : filemode, dev : dev -> int)
+ const chmod : (path : byte#, mode : filemode -> int)
+ const chown : (path : byte#, uid : uid, gid : gid -> int)
+ const obreak : (nsize : byte# -> int)
+ const getdtablecount : ( -> int)
+ const getrusage : (who : int, rusage : rusage# -> int)
+ const mount : (kind : byte#, path : byte#, flags : int, data : void# -> int)
+ const unmount : (path : byte#, flags : int -> int)
+ const setuid : (uid : uid -> int)
+ const getuid : ( -> uid)
+ const geteuid : ( -> uid)
+ const ptrace : (req : int, pid : pid, addr : void#, data : int -> int)
+ const recvmsg : (s : int, msg : msghdr#, flags : int -> size)
+ const sendmsg : (s : int, msg : msghdr#, flags : int -> size)
+ const recvfrom : (s : int, buf : void#, len : size, flags : int, from : sockaddr#, fromlenaddr : int32# -> size)
+ const getpeername : (fdes : int, asa : sockaddr#, alen : int32# -> int)
+ const getsockname : (fdes : int, asa : sockaddr#, alen : int32# -> int)
+ const access : (path : byte#, amode : int -> int)
+ const chflags : (path : byte#, flags : uint -> int)
+ const fchflags : (fd : int, flags : uint -> int)
+ const sync : ( -> void)
+ const getppid : ( -> pid)
+ const fstatat : (fd : int, path : byte#, buf : statbuf#, flag : int -> int)
+ const getegid : ( -> gid)
+ const profil : (samples : void#, size : size, offset : uint64, scale : uint -> int)
+ const ktrace : (fname : byte#, ops : int, facs : int, pid : pid -> int)
+ const getgid : ( -> gid)
+ const setlogin : (namebuf : byte# -> int)
+ const acct : (path : byte# -> int)
+ const sigpending : ( -> int)
+ const reboot : (opt : int -> int)
+ const revoke : (path : byte# -> int)
+ const symlink : (path : byte#, link : byte# -> int)
+ const readlink : (path : byte#, buf : byte#, count : size -> size)
+ const umask : (newmask : filemode -> filemode)
+ const chroot : (path : byte# -> int)
+ const getfsstat : (buf : statfs#, bufsize : size, flags : int -> int)
+ const statfs : (path : byte#, buf : statfs# -> int)
+ const fstatfs : (fd : int, buf : statfs# -> int)
+ const fhstatfs : (fhp : fhandle#, buf : statfs# -> int)
+ const vfork : ( -> int)
+ const gettimeofday : (tp : timeval#, tzp : timezone# -> int)
+ const settimeofday : (tv : timeval#, tzp : timezone# -> int)
+ const setitimer : (which : int, itv : itimerval#, oitv : itimerval# -> int)
+ const getitimer : (which : int, itv : itimerval# -> int)
+ const select : (nd : int, _in : fdset#, ou : fdset#, ex : fdset#, tv : timeval# -> int)
+ const kevent : (fd : int, changelist : kevent#, nchanges : int, eventlist : kevent#, nevents : int, timeout : timespec# -> int)
+ const mprotect : (addr : void#, len : size, prot : int -> int)
+ const madvise : (addr : void#, len : size, behav : int -> int)
+ const utimes : (path : byte#, tptr : timeval# -> int)
+ const futimes : (fd : int, tptr : timeval# -> int)
+ const mincore : (addr : void#, len : size, vec : byte# -> int)
+ const getgroups : (gidsetsize : int, gidset : gid# -> int)
+ const setgroups : (gidsetsize : int, gidset : gid# -> int)
+ const getpgrp : ( -> int)
+ const setpgid : (pid : pid, pgid : pid -> int)
+ const futex : (f : uint32#, op : int, val : int, timeout : timespec#, g : uint32# -> int)
+ const utimensat : (fd : int, path : byte#, times : timespec#, flag : int -> int)
+ const futimens : (fd : int, times : timespec# -> int)
+ const kbind : (param : kbind#, psize : size, proc_cookie : int64 -> int)
+ const accept4 : (s : int, name : sockaddr#, anamelen : int32#, flags : int -> int)
+ const __thrsleep : (ident : void#, clock_id : clockid, tp : timespec#, lock : void#, abort : int# -> int)
+ const fsync : (fd : int -> int)
+ const setpriority : (which : int, who : id, prio : int -> int)
+ const getpriority : (which : int, who : id -> int)
+ const pipe2 : (fdp : int#, flags : int -> int)
+ const dup3 : (from : int, to : int, flags : int -> int)
+ const sigreturn : (sigcntxp : sigcontext# -> int)
+ const chflagsat : (fd : int, path : byte#, flags : uint, atflags : int -> int)
+ const pledge : (request : byte#, paths : byte## -> int)
+ const ppoll : (fds : pollfd#, nfds : uint, ts : timespec#, mask : sigset# -> int)
+ const pselect : (nd : int, _in : fdset#, ou : fdset#, ex : fdset#, ts : timespec#, mask : sigset# -> int)
+ const sigsuspend : (mask : int -> int)
+ const sendsyslog : (buf : void#, nbyte : size, flags : int -> int)
+ const fktrace : (fd : int, ops : int, facs : int, pid : pid -> int)
+ const thrkill : (tid : pid, signum : int, tcb : void# -> int)
+ const fchown : (fd : int, uid : uid, gid : gid -> int)
+ const fchmod : (fd : int, mode : filemode -> int)
+ const setreuid : (ruid : uid, euid : uid -> int)
+ const setregid : (rgid : gid, egid : gid -> int)
+ const rename : (from : byte#, to : byte# -> int)
+ const flock : (fd : int, how : int -> int)
+ const mkfifo : (path : byte#, mode : filemode -> int)
+ const sendto : (s : int, buf : void#, len : size, flags : int, to : sockaddr#, tolen : int32 -> size)
+ const shutdown : (s : int, how : int -> int)
+ const socketpair : (domain : int, kind : int, protocol : int, rsv : int# -> int)
+ const rmdir : (path : byte# -> int)
+ const adjtime : (delta : timeval#, olddelta : timeval# -> int)
+ const getlogin_r : (namebuf : byte#, namelen : uint -> int)
+ const setsid : ( -> int)
+ const quotactl : (path : byte#, cmd : int, uid : int, arg : byte# -> int)
+ const nfssvc : (flag : int, argp : void# -> int)
+ const getfh : (fname : byte#, fhp : fhandle# -> int)
+ const sysarch : (op : int, parms : void# -> int)
+ const setgid : (gid : gid -> int)
+ const setegid : (egid : gid -> int)
+ const seteuid : (euid : uid -> int)
+ const pathconf : (path : byte#, name : int -> int64)
+ const fpathconf : (fd : int, name : int -> int64)
+ const swapctl : (cmd : int, arg : void#, misc : int -> int)
+ const getrlimit : (which : int, rlp : rlimit# -> int)
+ const setrlimit : (which : int, rlp : rlimit# -> int)
+ const truncate : (path : byte#, pad : int, length : off -> int)
+ const ftruncate : (fd : int, pad : int, length : off -> int)
+ const mlock : (addr : void#, len : size -> int)
+ const munlock : (addr : void#, len : size -> int)
+ const getpgid : (pid : pid -> pid)
+ const utrace : (label : byte#, addr : void#, len : size -> int)
+ const semget : (key : key, nsems : int, semflg : int -> int)
+ const msgget : (key : key, msgflg : int -> int)
+ const msgsnd : (msqid : int, msgp : void#, msgsz : size, msgflg : int -> int)
+ const msgrcv : (msqid : int, msgp : void#, msgsz : size, msgtyp : int64, msgflg : int -> int)
+ const shmat : (shmid : int, shmaddr : void#, shmflg : int -> void)
+ const shmdt : (shmaddr : void# -> int)
+ const minherit : (addr : void#, len : size, inherit : int -> int)
+ const issetugid : ( -> int)
+ const lchown : (path : byte#, uid : uid, gid : gid -> int)
+ const getsid : (pid : pid -> pid)
+ const msync : (addr : void#, len : size, flags : int -> int)
+ const fhopen : (fhp : fhandle#, flags : int -> int)
+ const preadv : (fd : int, iovp : iovec#, iovcnt : int, pad : int, offset : off -> size)
+ const pwritev : (fd : int, iovp : iovec#, iovcnt : int, pad : int, offset : off -> size)
+ const kqueue : ( -> int)
+ const mlockall : (flags : int -> int)
+ const munlockall : ( -> int)
+ const getresuid : (ruid : uid#, euid : uid#, suid : uid# -> int)
+ const setresuid : (ruid : uid, euid : uid, suid : uid -> int)
+ const getresgid : (rgid : gid#, egid : gid#, sgid : gid# -> int)
+ const setresgid : (rgid : gid, egid : gid, sgid : gid -> int)
+ const mquery : (addr : void#, len : size, prot : int, flags : int, fd : int, pad : int64, pos : off -> void)
+ const closefrom : (fd : int -> int)
+ const sigaltstack : (nss : sigaltstack#, oss : sigaltstack# -> int)
+ const shmget : (key : key, size : size, shmflg : int -> int)
+ const semop : (semid : int, sops : sembuf#, nsops : size -> int)
+ const fhstat : (fhp : fhandle#, sb : statbuf# -> int)
+ const __semctl : (semid : int, semnum : int, cmd : int, arg : semun# -> int)
+ const shmctl : (shmid : int, cmd : int, buf : shmid_ds# -> int)
+ const msgctl : (msqid : int, cmd : int, buf : msqid_ds# -> int)
+ const sched_yield : ( -> int)
+ const getthrid : ( -> pid)
+ const __thrwakeup : (ident : void#, n : int -> int)
+ const __threxit : (notdead : pid# -> void)
+ const __thrsigdivert : (sigmask : sigset, info : siginfo#, timeout : timespec# -> int)
+ const adjfreq : (freq : int64#, oldfreq : int64# -> int)
+ const setrtable : (rtableid : int -> int)
+ const getrtable : ( -> int)
+ const faccessat : (fd : int, path : byte#, amode : int, flag : int -> int)
+ const fchmodat : (fd : int, path : byte#, mode : filemode, flag : int -> int)
+ const fchownat : (fd : int, path : byte#, uid : uid, gid : gid, flag : int -> int)
+ const linkat : (fd1 : int, path1 : byte#, fd2 : int, path2 : byte#, flag : int -> int)
+ const mkdirat : (fd : int, path : byte#, mode : filemode -> int)
+ const mkfifoat : (fd : int, path : byte#, mode : filemode -> int)
+ const mknodat : (fd : int, path : byte#, mode : filemode, dev : dev -> int)
+ const openat : (fd : int, path : byte#, flags : int, mode : filemode -> int)
+ const readlinkat : (fd : int, path : byte#, buf : byte#, count : size -> size)
+ const renameat : (fromfd : int, from : byte#, tofd : int, to : byte# -> int)
+ const symlinkat : (path : byte#, fd : int, link : byte# -> int)
+ const unlinkat : (fd : int, path : byte#, flag : int -> int)
+ const __set_tcb : (tcb : void# -> void)
+ const __get_tcb : ( -> void)
+;;
+
+ /* start manual overrides { */
+ /* process control */
+ /* wrappers to extract wait status */
+
+ /* fd manipulation */
+
+ /* signals */
+
+ /* fd stuff */
+ /* NB: the C ABI uses '...' for the args. */
+
+ /* networking */
+
+ /* memory mapping */
+
+ /* time - doublecheck if this is right */
+
+ /* system information */
+
+ /*
+ wraps a syscall argument, converting it to 64 bits for the syscall function. This is
+ the same as casting, but more concise than writing a cast to uint64
+ */
+ generic a = {x : @t; -> (x : uint64)}
+
+
+
+ /* process management */
+ const exit = {status; syscall(Sysexit, a(status))}
+ const getpid = {; -> (syscall(Sysgetpid, 1) : pid)}
+ const kill = {pid, sig; -> syscall(Syskill, pid, sig)}
+ const fork = {; -> (syscall(Sysfork) : pid)}
+ const wait4 = {pid, loc, opt, usage; -> syscall(Syswait4, pid, loc, opt, usage)}
+ const waitpid = {pid, loc, opt;
+ -> wait4(pid, loc, opt, (0 : rusage#))
+ }
+
+ const execv = {cmd, args
+ var p, cargs, i
+
+ /* of course we fucking have to duplicate this code everywhere,
+ * since we want to stack allocate... */
+ p = alloca((args.len + 1)*sizeof(byte#))
+ cargs = (p : byte##)[:args.len + 1]
+ for i = 0; i < args.len; i++
+ cargs[i] = cstring(args[i])
+ ;;
+ cargs[args.len] = (0 : byte#)
+ -> syscall(Sysexecve, cstring(cmd), a(p), a(__cenvp))
+ }
+
+ const execve = {cmd, args, env
+ var cargs, cenv, i
+ var p
+
+ /* copy the args */
+ p = alloca((args.len + 1)*sizeof(byte#))
+ cargs = (p : byte##)[:args.len]
+ for i = 0; i < args.len; i++
+ cargs[i] = cstring(args[i])
+ ;;
+ cargs[args.len] = (0 : byte#)
+
+ /*
+ copy the env.
+ of course we fucking have to duplicate this code everywhere,
+ since we want to stack allocate...
+ */
+ p = alloca((env.len + 1)*sizeof(byte#))
+ cenv = (p : byte##)[:env.len]
+ for i = 0; i < env.len; i++
+ cenv[i] = cstring(env[i])
+ ;;
+ cenv[env.len] = (0 : byte#)
+
+ -> syscall(Sysexecve, cstring(cmd), a(p), a(cenv))
+ }
+
+ /* fd manipulation */
+ const open = {path, opts; -> (syscall(Sysopen, cstring(path), a(opts), a(0o777)) : fd)}
+ const openmode = {path, opts, mode; -> (syscall(Sysopen, cstring(path), a(opts), a(mode)) : fd)}
+ const close = {fd; -> syscall(Sysclose, a(fd))}
+ const creat = {path, mode; -> (openmode(path, Ocreat | Otrunc | Owronly, mode) : fd)}
+ const unlink = {path; -> (syscall(Sysunlink, cstring(path)) : int)}
+ const read = {fd, buf; -> (syscall(Sysread, a(fd), (buf : byte#), a(buf.len)) : size)}
+ const pread = {fd, buf, off; -> (syscall(Syspread, a(fd), (buf : byte#), a(buf.len), a(off)) : size)}
+ const readv = {fd, vec; -> (syscall(Sysreadv, a(fd), (vec : iovec#), a(vec.len)) : size)}
+ const write = {fd, buf; -> (syscall(Syswrite, a(fd), (buf : byte#), a(buf.len)) : size)}
+ const pwrite = {fd, buf, off; -> (syscall(Syspwrite, a(fd), (buf : byte#), a(buf.len), a(off)) : size)}
+ const writev = {fd, vec; -> (syscall(Syswritev, a(fd), (vec : iovec#), a(vec.len)) : size)}
+ const lseek = {fd, off, whence; -> syscall(Syslseek, a(fd), a(off), a(whence))}
+ const stat = {path, sb; -> syscall(Sysstat, cstring(path), a(sb))}
+ const lstat = {path, sb; -> syscall(Syslstat, cstring(path), a(sb))}
+ const fstat = {fd, sb; -> syscall(Sysfstat, a(fd), a(sb))}
+ const mkdir = {path, mode; -> (syscall(Sysmkdir, cstring(path), a(mode)) : int64)}
+ generic ioctl = {fd, req, arg; -> (syscall(Sysioctl, a(fd), a(req), a(arg)) : int64)}
+ const chdir = {dir; -> syscall(Syschdir, cstring(dir))}
+ const __getcwd = {buf; -> syscall(Sys__getcwd, a(buf), a(buf.len))}
+ const getdents = {fd, buf; -> (syscall(Sysgetdents, a(fd), a(buf), a(buf.len)) : int64)}
+
+ /* signals */
+ const sigaction = {sig, act, oact; -> (syscall(Syssigaction, a(sig), a(act), a(oact)) : int)}
+ const sigprocmask = {sig, act, oact; -> (syscall(Syssigprocmask, a(sig), a(act), a(oact)) : int)}
+
+ /* file stuff */
+ const pipe = {fds; -> syscall(Syspipe, fds)}
+ const dup = {fd; -> (syscall(Sysdup, a(fd)) : fd)}
+ const dup2 = {src, dst; -> (syscall(Sysdup2, a(src), a(dst)) : fd)}
+ const fcntl = {fd, cmd, args; -> syscall(Sysfcntl, a(fd), a(cmd), a(args))}
+ const poll = {pfd, tm; -> (syscall(Syspoll, (pfd : byte#), a(pfd.len), a(tm)) : int)}
+
+ /* networking */
+ const socket = {dom, stype, proto; -> (syscall(Syssocket, a(dom), a(stype), a(proto)) : fd)}
+ const connect = {sock, addr, len; -> (syscall(Sysconnect, a(sock), a(addr), a(len)) : int)}
+ const accept = {sock, addr, len; -> (syscall(Sysaccept, a(sock), a(addr), a(len)) : fd)}
+ const listen = {sock, backlog; -> (syscall(Syslisten, a(sock), a(backlog)) : int)}
+ const bind = {sock, addr, len; -> (syscall(Sysbind, a(sock), a(addr), a(len)) : int)}
+ const setsockopt = {sock, lev, opt, val, len; -> (syscall(Syssetsockopt, a(sock), a(lev), a(opt), a(val), a(len)) : int)}
+ const getsockopt = {sock, lev, opt, val, len; -> (syscall(Syssetsockopt, a(sock), a(lev), a(opt), a(val), a(len)) : int)}
+
+ /* memory management */
+ const munmap = {addr, len; -> syscall(Sysmunmap, a(addr), a(len))}
+ const mmap = {addr, len, prot, flags, fd, off;
+ /* the actual syscall has padding on the offset arg */
+ -> (syscall(Sysmmap, a(addr), a(len), a(prot), a(flags), a(fd), a(0), a(off)) : byte#)
+ }
+
+ /* time */
+ const clock_getres = {clk, ts; -> (syscall(Sysclock_getres, clockid(clk), a(ts)) : int32)}
+ const clock_gettime = {clk, ts; -> (syscall(Sysclock_gettime, clockid(clk), a(ts)) : int32)}
+ const clock_settime = {clk, ts; -> (syscall(Sysclock_settime, clockid(clk), a(ts)) : int32)}
+
+ const sleep = {time
+ var req, rem
+ req = [.sec = time, .nsec = 0]
+ -> nanosleep(&req, &rem)
+ }
+
+ const nanosleep = {req, rem; -> (syscall(Sysnanosleep, a(req), a(rem)) : int32)}
+
+
+ /* system information */
+ const uname = {buf
+ var mib : int[2]
+ var ret
+ var sys, syssz
+ var nod, nodsz
+ var rel, relsz
+ var ver, versz
+ var mach, machsz
+
+ ret = 0
+ mib[0] = 1 /* CTL_KERN */
+ mib[1] = 1 /* KERN_OSTYPE */
+ sys = (buf.system[:] : void#)
+ syssz = buf.system.len
+ ret = sysctl(mib[:], sys, &syssz, (0 : void#), (0 : size#))
+ if ret < 0
+ -> ret
+ ;;
+
+ mib[0] = 1 /* CTL_KERN */
+ mib[1] = 10 /* KERN_HOSTNAME */
+ nod = (buf.node[:] : void#)
+ nodsz = buf.node.len
+ ret = sysctl(mib[:], nod, &nodsz, (0 : void#), (0 : size#))
+ if ret < 0
+ -> ret
+ ;;
+
+ mib[0] = 1 /* CTL_KERN */
+ mib[1] = 2 /* KERN_OSRELEASE */
+ rel = (buf.release[:] : void#)
+ relsz = buf.release.len
+ ret = sysctl(mib[:], rel, &relsz, (0 : void#), (0 : size#))
+ if ret < 0
+ -> ret
+ ;;
+
+ mib[0] = 1 /* CTL_KERN */
+ mib[1] = 27 /* KERN_OSVERSION */
+ ver = (buf.version[:] : void#)
+ versz = buf.version.len
+ ret = sysctl(mib[:], ver, &versz, (0 : void#), (0 : size#))
+ if ret < 0
+ -> ret
+ ;;
+
+ mib[0] = 6 /* CTL_HW */
+ mib[1] = 1 /* HW_MACHINE */
+ mach = (buf.machine[:] : void#)
+ machsz = buf.machine.len
+ ret = sysctl(mib[:], mach, &machsz, (0 : void#), (0 : size#))
+ if ret < 0
+ -> ret
+ ;;
+
+ -> 0
+ }
+
+ const sysctl = {mib, old, oldsz, new, newsz
+ /* all args already passed through a() or ar ptrs */
+ -> (syscall(Syssysctl, \
+ (mib : int#), a(mib.len), old, oldsz, new, newsz) : int)
+ }
+
+ const clockid = {clk
+ match clk
+ | `Clockrealtime: -> 0
+ | `Clockproccputime: -> 2
+ | `Clockmonotonic: -> 3
+ | `Clockthreadcputime: -> 4
+ | `Clockuptime: -> 5
+ ;;
+ -> -1
+ }
+
+ const waitstatus = {st
+ if st < 0
+ -> `Waitfail st
+ ;;
+ match st & 0o177
+ | 0: -> `Waitexit (st >> 8)
+ | 0x7f:-> `Waitstop (st >> 8)
+ | sig: -> `Waitsig sig
+ ;;
+ }
+
+ /* } end manual overrides */
+const getentropy = {buf, nbyte
+ -> (syscall(Sysgetentropy, a(buf), a(nbyte)) : int)
+}
+const __tfork = {param, psize
+ -> (syscall(Sys__tfork, a(param), a(psize)) : int)
+}
+const link = {path, link
+ -> (syscall(Syslink, a(path), a(link)) : int)
+}
+const fchdir = {fd
+ -> (syscall(Sysfchdir, a(fd)) : int)
+}
+const mknod = {path, mode, dev
+ -> (syscall(Sysmknod, a(path), a(mode), a(dev)) : int)
+}
+const chmod = {path, mode
+ -> (syscall(Syschmod, a(path), a(mode)) : int)
+}
+const chown = {path, uid, gid
+ -> (syscall(Syschown, a(path), a(uid), a(gid)) : int)
+}
+const obreak = {nsize
+ -> (syscall(Sysobreak, a(nsize)) : int)
+}
+const getdtablecount = {
+ -> (syscall(Sysgetdtablecount) : int)
+}
+const getrusage = {who, rusage
+ -> (syscall(Sysgetrusage, a(who), a(rusage)) : int)
+}
+const mount = {kind, path, flags, data
+ -> (syscall(Sysmount, a(kind), a(path), a(flags), a(data)) : int)
+}
+const unmount = {path, flags
+ -> (syscall(Sysunmount, a(path), a(flags)) : int)
+}
+const setuid = {uid
+ -> (syscall(Syssetuid, a(uid)) : int)
+}
+const getuid = {
+ -> (syscall(Sysgetuid) : uid)
+}
+const geteuid = {
+ -> (syscall(Sysgeteuid) : uid)
+}
+const ptrace = {req, pid, addr, data
+ -> (syscall(Sysptrace, a(req), a(pid), a(addr), a(data)) : int)
+}
+const recvmsg = {s, msg, flags
+ -> (syscall(Sysrecvmsg, a(s), a(msg), a(flags)) : size)
+}
+const sendmsg = {s, msg, flags
+ -> (syscall(Syssendmsg, a(s), a(msg), a(flags)) : size)
+}
+const recvfrom = {s, buf, len, flags, from, fromlenaddr
+ -> (syscall(Sysrecvfrom, a(s), a(buf), a(len), a(flags), a(from), a(fromlenaddr)) : size)
+}
+const getpeername = {fdes, asa, alen
+ -> (syscall(Sysgetpeername, a(fdes), a(asa), a(alen)) : int)
+}
+const getsockname = {fdes, asa, alen
+ -> (syscall(Sysgetsockname, a(fdes), a(asa), a(alen)) : int)
+}
+const access = {path, amode
+ -> (syscall(Sysaccess, a(path), a(amode)) : int)
+}
+const chflags = {path, flags
+ -> (syscall(Syschflags, a(path), a(flags)) : int)
+}
+const fchflags = {fd, flags
+ -> (syscall(Sysfchflags, a(fd), a(flags)) : int)
+}
+const sync = {
+ -> (syscall(Syssync) : void)
+}
+const getppid = {
+ -> (syscall(Sysgetppid) : pid)
+}
+const fstatat = {fd, path, buf, flag
+ -> (syscall(Sysfstatat, a(fd), a(path), a(buf), a(flag)) : int)
+}
+const getegid = {
+ -> (syscall(Sysgetegid) : gid)
+}
+const profil = {samples, size, offset, scale
+ -> (syscall(Sysprofil, a(samples), a(size), a(offset), a(scale)) : int)
+}
+const ktrace = {fname, ops, facs, pid
+ -> (syscall(Sysktrace, a(fname), a(ops), a(facs), a(pid)) : int)
+}
+const getgid = {
+ -> (syscall(Sysgetgid) : gid)
+}
+const setlogin = {namebuf
+ -> (syscall(Syssetlogin, a(namebuf)) : int)
+}
+const acct = {path
+ -> (syscall(Sysacct, a(path)) : int)
+}
+const sigpending = {
+ -> (syscall(Syssigpending) : int)
+}
+const reboot = {opt
+ -> (syscall(Sysreboot, a(opt)) : int)
+}
+const revoke = {path
+ -> (syscall(Sysrevoke, a(path)) : int)
+}
+const symlink = {path, link
+ -> (syscall(Syssymlink, a(path), a(link)) : int)
+}
+const readlink = {path, buf, count
+ -> (syscall(Sysreadlink, a(path), a(buf), a(count)) : size)
+}
+const umask = {newmask
+ -> (syscall(Sysumask, a(newmask)) : filemode)
+}
+const chroot = {path
+ -> (syscall(Syschroot, a(path)) : int)
+}
+const getfsstat = {buf, bufsize, flags
+ -> (syscall(Sysgetfsstat, a(buf), a(bufsize), a(flags)) : int)
+}
+const statfs = {path, buf
+ -> (syscall(Sysstatfs, a(path), a(buf)) : int)
+}
+const fstatfs = {fd, buf
+ -> (syscall(Sysfstatfs, a(fd), a(buf)) : int)
+}
+const fhstatfs = {fhp, buf
+ -> (syscall(Sysfhstatfs, a(fhp), a(buf)) : int)
+}
+const vfork = {
+ -> (syscall(Sysvfork) : int)
+}
+const gettimeofday = {tp, tzp
+ -> (syscall(Sysgettimeofday, a(tp), a(tzp)) : int)
+}
+const settimeofday = {tv, tzp
+ -> (syscall(Syssettimeofday, a(tv), a(tzp)) : int)
+}
+const setitimer = {which, itv, oitv
+ -> (syscall(Syssetitimer, a(which), a(itv), a(oitv)) : int)
+}
+const getitimer = {which, itv
+ -> (syscall(Sysgetitimer, a(which), a(itv)) : int)
+}
+const select = {nd, _in, ou, ex, tv
+ -> (syscall(Sysselect, a(nd), a(_in), a(ou), a(ex), a(tv)) : int)
+}
+const kevent = {fd, changelist, nchanges, eventlist, nevents, timeout
+ -> (syscall(Syskevent, a(fd), a(changelist), a(nchanges), a(eventlist), a(nevents), a(timeout)) : int)
+}
+const mprotect = {addr, len, prot
+ -> (syscall(Sysmprotect, a(addr), a(len), a(prot)) : int)
+}
+const madvise = {addr, len, behav
+ -> (syscall(Sysmadvise, a(addr), a(len), a(behav)) : int)
+}
+const utimes = {path, tptr
+ -> (syscall(Sysutimes, a(path), a(tptr)) : int)
+}
+const futimes = {fd, tptr
+ -> (syscall(Sysfutimes, a(fd), a(tptr)) : int)
+}
+const mincore = {addr, len, vec
+ -> (syscall(Sysmincore, a(addr), a(len), a(vec)) : int)
+}
+const getgroups = {gidsetsize, gidset
+ -> (syscall(Sysgetgroups, a(gidsetsize), a(gidset)) : int)
+}
+const setgroups = {gidsetsize, gidset
+ -> (syscall(Syssetgroups, a(gidsetsize), a(gidset)) : int)
+}
+const getpgrp = {
+ -> (syscall(Sysgetpgrp) : int)
+}
+const setpgid = {pid, pgid
+ -> (syscall(Syssetpgid, a(pid), a(pgid)) : int)
+}
+const futex = {f, op, val, timeout, g
+ -> (syscall(Sysfutex, a(f), a(op), a(val), a(timeout), a(g)) : int)
+}
+const utimensat = {fd, path, times, flag
+ -> (syscall(Sysutimensat, a(fd), a(path), a(times), a(flag)) : int)
+}
+const futimens = {fd, times
+ -> (syscall(Sysfutimens, a(fd), a(times)) : int)
+}
+const kbind = {param, psize, proc_cookie
+ -> (syscall(Syskbind, a(param), a(psize), a(proc_cookie)) : int)
+}
+const accept4 = {s, name, anamelen, flags
+ -> (syscall(Sysaccept4, a(s), a(name), a(anamelen), a(flags)) : int)
+}
+const __thrsleep = {ident, clock_id, tp, lock, abort
+ -> (syscall(Sys__thrsleep, a(ident), a(clock_id), a(tp), a(lock), a(abort)) : int)
+}
+const fsync = {fd
+ -> (syscall(Sysfsync, a(fd)) : int)
+}
+const setpriority = {which, who, prio
+ -> (syscall(Syssetpriority, a(which), a(who), a(prio)) : int)
+}
+const getpriority = {which, who
+ -> (syscall(Sysgetpriority, a(which), a(who)) : int)
+}
+const pipe2 = {fdp, flags
+ -> (syscall(Syspipe2, a(fdp), a(flags)) : int)
+}
+const dup3 = {from, to, flags
+ -> (syscall(Sysdup3, a(from), a(to), a(flags)) : int)
+}
+const sigreturn = {sigcntxp
+ -> (syscall(Syssigreturn, a(sigcntxp)) : int)
+}
+const chflagsat = {fd, path, flags, atflags
+ -> (syscall(Syschflagsat, a(fd), a(path), a(flags), a(atflags)) : int)
+}
+const pledge = {request, paths
+ -> (syscall(Syspledge, a(request), a(paths)) : int)
+}
+const ppoll = {fds, nfds, ts, mask
+ -> (syscall(Sysppoll, a(fds), a(nfds), a(ts), a(mask)) : int)
+}
+const pselect = {nd, _in, ou, ex, ts, mask
+ -> (syscall(Syspselect, a(nd), a(_in), a(ou), a(ex), a(ts), a(mask)) : int)
+}
+const sigsuspend = {mask
+ -> (syscall(Syssigsuspend, a(mask)) : int)
+}
+const sendsyslog = {buf, nbyte, flags
+ -> (syscall(Syssendsyslog, a(buf), a(nbyte), a(flags)) : int)
+}
+const fktrace = {fd, ops, facs, pid
+ -> (syscall(Sysfktrace, a(fd), a(ops), a(facs), a(pid)) : int)
+}
+const thrkill = {tid, signum, tcb
+ -> (syscall(Systhrkill, a(tid), a(signum), a(tcb)) : int)
+}
+const fchown = {fd, uid, gid
+ -> (syscall(Sysfchown, a(fd), a(uid), a(gid)) : int)
+}
+const fchmod = {fd, mode
+ -> (syscall(Sysfchmod, a(fd), a(mode)) : int)
+}
+const setreuid = {ruid, euid
+ -> (syscall(Syssetreuid, a(ruid), a(euid)) : int)
+}
+const setregid = {rgid, egid
+ -> (syscall(Syssetregid, a(rgid), a(egid)) : int)
+}
+const rename = {from, to
+ -> (syscall(Sysrename, a(from), a(to)) : int)
+}
+const flock = {fd, how
+ -> (syscall(Sysflock, a(fd), a(how)) : int)
+}
+const mkfifo = {path, mode
+ -> (syscall(Sysmkfifo, a(path), a(mode)) : int)
+}
+const sendto = {s, buf, len, flags, to, tolen
+ -> (syscall(Syssendto, a(s), a(buf), a(len), a(flags), a(to), a(tolen)) : size)
+}
+const shutdown = {s, how
+ -> (syscall(Sysshutdown, a(s), a(how)) : int)
+}
+const socketpair = {domain, kind, protocol, rsv
+ -> (syscall(Syssocketpair, a(domain), a(kind), a(protocol), a(rsv)) : int)
+}
+const rmdir = {path
+ -> (syscall(Sysrmdir, a(path)) : int)
+}
+const adjtime = {delta, olddelta
+ -> (syscall(Sysadjtime, a(delta), a(olddelta)) : int)
+}
+const getlogin_r = {namebuf, namelen
+ -> (syscall(Sysgetlogin_r, a(namebuf), a(namelen)) : int)
+}
+const setsid = {
+ -> (syscall(Syssetsid) : int)
+}
+const quotactl = {path, cmd, uid, arg
+ -> (syscall(Sysquotactl, a(path), a(cmd), a(uid), a(arg)) : int)
+}
+const nfssvc = {flag, argp
+ -> (syscall(Sysnfssvc, a(flag), a(argp)) : int)
+}
+const getfh = {fname, fhp
+ -> (syscall(Sysgetfh, a(fname), a(fhp)) : int)
+}
+const sysarch = {op, parms
+ -> (syscall(Syssysarch, a(op), a(parms)) : int)
+}
+const setgid = {gid
+ -> (syscall(Syssetgid, a(gid)) : int)
+}
+const setegid = {egid
+ -> (syscall(Syssetegid, a(egid)) : int)
+}
+const seteuid = {euid
+ -> (syscall(Sysseteuid, a(euid)) : int)
+}
+const pathconf = {path, name
+ -> (syscall(Syspathconf, a(path), a(name)) : int64)
+}
+const fpathconf = {fd, name
+ -> (syscall(Sysfpathconf, a(fd), a(name)) : int64)
+}
+const swapctl = {cmd, arg, misc
+ -> (syscall(Sysswapctl, a(cmd), a(arg), a(misc)) : int)
+}
+const getrlimit = {which, rlp
+ -> (syscall(Sysgetrlimit, a(which), a(rlp)) : int)
+}
+const setrlimit = {which, rlp
+ -> (syscall(Syssetrlimit, a(which), a(rlp)) : int)
+}
+const truncate = {path, pad, length
+ -> (syscall(Systruncate, a(path), a(pad), a(length)) : int)
+}
+const ftruncate = {fd, pad, length
+ -> (syscall(Sysftruncate, a(fd), a(pad), a(length)) : int)
+}
+const mlock = {addr, len
+ -> (syscall(Sysmlock, a(addr), a(len)) : int)
+}
+const munlock = {addr, len
+ -> (syscall(Sysmunlock, a(addr), a(len)) : int)
+}
+const getpgid = {pid
+ -> (syscall(Sysgetpgid, a(pid)) : pid)
+}
+const utrace = {label, addr, len
+ -> (syscall(Sysutrace, a(label), a(addr), a(len)) : int)
+}
+const semget = {key, nsems, semflg
+ -> (syscall(Syssemget, a(key), a(nsems), a(semflg)) : int)
+}
+const msgget = {key, msgflg
+ -> (syscall(Sysmsgget, a(key), a(msgflg)) : int)
+}
+const msgsnd = {msqid, msgp, msgsz, msgflg
+ -> (syscall(Sysmsgsnd, a(msqid), a(msgp), a(msgsz), a(msgflg)) : int)
+}
+const msgrcv = {msqid, msgp, msgsz, msgtyp, msgflg
+ -> (syscall(Sysmsgrcv, a(msqid), a(msgp), a(msgsz), a(msgtyp), a(msgflg)) : int)
+}
+const shmat = {shmid, shmaddr, shmflg
+ -> (syscall(Sysshmat, a(shmid), a(shmaddr), a(shmflg)) : void)
+}
+const shmdt = {shmaddr
+ -> (syscall(Sysshmdt, a(shmaddr)) : int)
+}
+const minherit = {addr, len, inherit
+ -> (syscall(Sysminherit, a(addr), a(len), a(inherit)) : int)
+}
+const issetugid = {
+ -> (syscall(Sysissetugid) : int)
+}
+const lchown = {path, uid, gid
+ -> (syscall(Syslchown, a(path), a(uid), a(gid)) : int)
+}
+const getsid = {pid
+ -> (syscall(Sysgetsid, a(pid)) : pid)
+}
+const msync = {addr, len, flags
+ -> (syscall(Sysmsync, a(addr), a(len), a(flags)) : int)
+}
+const fhopen = {fhp, flags
+ -> (syscall(Sysfhopen, a(fhp), a(flags)) : int)
+}
+const preadv = {fd, iovp, iovcnt, pad, offset
+ -> (syscall(Syspreadv, a(fd), a(iovp), a(iovcnt), a(pad), a(offset)) : size)
+}
+const pwritev = {fd, iovp, iovcnt, pad, offset
+ -> (syscall(Syspwritev, a(fd), a(iovp), a(iovcnt), a(pad), a(offset)) : size)
+}
+const kqueue = {
+ -> (syscall(Syskqueue) : int)
+}
+const mlockall = {flags
+ -> (syscall(Sysmlockall, a(flags)) : int)
+}
+const munlockall = {
+ -> (syscall(Sysmunlockall) : int)
+}
+const getresuid = {ruid, euid, suid
+ -> (syscall(Sysgetresuid, a(ruid), a(euid), a(suid)) : int)
+}
+const setresuid = {ruid, euid, suid
+ -> (syscall(Syssetresuid, a(ruid), a(euid), a(suid)) : int)
+}
+const getresgid = {rgid, egid, sgid
+ -> (syscall(Sysgetresgid, a(rgid), a(egid), a(sgid)) : int)
+}
+const setresgid = {rgid, egid, sgid
+ -> (syscall(Syssetresgid, a(rgid), a(egid), a(sgid)) : int)
+}
+const mquery = {addr, len, prot, flags, fd, pad, pos
+ -> (syscall(Sysmquery, a(addr), a(len), a(prot), a(flags), a(fd), a(pad), a(pos)) : void)
+}
+const closefrom = {fd
+ -> (syscall(Sysclosefrom, a(fd)) : int)
+}
+const sigaltstack = {nss, oss
+ -> (syscall(Syssigaltstack, a(nss), a(oss)) : int)
+}
+const shmget = {key, size, shmflg
+ -> (syscall(Sysshmget, a(key), a(size), a(shmflg)) : int)
+}
+const semop = {semid, sops, nsops
+ -> (syscall(Syssemop, a(semid), a(sops), a(nsops)) : int)
+}
+const fhstat = {fhp, sb
+ -> (syscall(Sysfhstat, a(fhp), a(sb)) : int)
+}
+const __semctl = {semid, semnum, cmd, arg
+ -> (syscall(Sys__semctl, a(semid), a(semnum), a(cmd), a(arg)) : int)
+}
+const shmctl = {shmid, cmd, buf
+ -> (syscall(Sysshmctl, a(shmid), a(cmd), a(buf)) : int)
+}
+const msgctl = {msqid, cmd, buf
+ -> (syscall(Sysmsgctl, a(msqid), a(cmd), a(buf)) : int)
+}
+const sched_yield = {
+ -> (syscall(Syssched_yield) : int)
+}
+const getthrid = {
+ -> (syscall(Sysgetthrid) : pid)
+}
+const __thrwakeup = {ident, n
+ -> (syscall(Sys__thrwakeup, a(ident), a(n)) : int)
+}
+const __threxit = {notdead
+ -> (syscall(Sys__threxit, a(notdead)) : void)
+}
+const __thrsigdivert = {sigmask, info, timeout
+ -> (syscall(Sys__thrsigdivert, a(sigmask), a(info), a(timeout)) : int)
+}
+const adjfreq = {freq, oldfreq
+ -> (syscall(Sysadjfreq, a(freq), a(oldfreq)) : int)
+}
+const setrtable = {rtableid
+ -> (syscall(Syssetrtable, a(rtableid)) : int)
+}
+const getrtable = {
+ -> (syscall(Sysgetrtable) : int)
+}
+const faccessat = {fd, path, amode, flag
+ -> (syscall(Sysfaccessat, a(fd), a(path), a(amode), a(flag)) : int)
+}
+const fchmodat = {fd, path, mode, flag
+ -> (syscall(Sysfchmodat, a(fd), a(path), a(mode), a(flag)) : int)
+}
+const fchownat = {fd, path, uid, gid, flag
+ -> (syscall(Sysfchownat, a(fd), a(path), a(uid), a(gid), a(flag)) : int)
+}
+const linkat = {fd1, path1, fd2, path2, flag
+ -> (syscall(Syslinkat, a(fd1), a(path1), a(fd2), a(path2), a(flag)) : int)
+}
+const mkdirat = {fd, path, mode
+ -> (syscall(Sysmkdirat, a(fd), a(path), a(mode)) : int)
+}
+const mkfifoat = {fd, path, mode
+ -> (syscall(Sysmkfifoat, a(fd), a(path), a(mode)) : int)
+}
+const mknodat = {fd, path, mode, dev
+ -> (syscall(Sysmknodat, a(fd), a(path), a(mode), a(dev)) : int)
+}
+const openat = {fd, path, flags, mode
+ -> (syscall(Sysopenat, a(fd), a(path), a(flags), a(mode)) : int)
+}
+const readlinkat = {fd, path, buf, count
+ -> (syscall(Sysreadlinkat, a(fd), a(path), a(buf), a(count)) : size)
+}
+const renameat = {fromfd, from, tofd, to
+ -> (syscall(Sysrenameat, a(fromfd), a(from), a(tofd), a(to)) : int)
+}
+const symlinkat = {path, fd, link
+ -> (syscall(Syssymlinkat, a(path), a(fd), a(link)) : int)
+}
+const unlinkat = {fd, path, flag
+ -> (syscall(Sysunlinkat, a(fd), a(path), a(flag)) : int)
+}
+const __set_tcb = {tcb
+ -> (syscall(Sys__set_tcb, a(tcb)) : void)
+}
+const __get_tcb = {
+ -> (syscall(Sys__get_tcb) : void)
+}
diff --git a/lib/sys/sys+osx-x64.myr b/lib/sys/sys+osx-x64.myr
index 2c42094..3de3875 100644
--- a/lib/sys/sys+osx-x64.myr
+++ b/lib/sys/sys+osx-x64.myr
@@ -840,7 +840,7 @@ extern const __osx_fork : (-> pid)
extern const __osx_pipe : (fd : fd[2]# -> int64)
extern const __osx_getpid : (-> pid)
extern const __osx_lseek : (fd:fd, off:off, whence:whence -> off)
-extern const __osx_gettimeofday : (tv : timeval#, tz : timezone# -> int)
+extern const __osx_gettimeofday : (tv : timeval#, tz : timezone#, abstime : uint64# -> int)
/*
extern const __osx_ptrace
extern const __osx_signalstack
@@ -988,7 +988,7 @@ const mmap = {addr, len, prot, flags, fd, off;
-> (syscall(Sysmmap, a(addr), a(len), a(prot), a(flags), a(fd), a(off)) : byte#)}
/* time */
-const gettimeofday = {tv, tz; -> (__osx_gettimeofday(tv, tz) : int)}
+const gettimeofday = {tv, tz; -> (__osx_gettimeofday(tv, tz, (0 : uint64#)) : int)}
const settimeofday = {tv, tz; -> (syscall(Syssettimeofday, a(tv), a(tz)) : int)}
/* faked with gettimeofday */
diff --git a/lib/sys/sys+plan9-x64.myr b/lib/sys/sys+plan9-x64.myr
index a42a0a2..c49bde1 100644
--- a/lib/sys/sys+plan9-x64.myr
+++ b/lib/sys/sys+plan9-x64.myr
@@ -27,8 +27,8 @@ pkg sys =
const Maxerr : size = 128
- const Ordonly : fdopt = 0
- const Owronly : fdopt = 1
+ const Oread : fdopt = 0
+ const Owrite : fdopt = 1
const Ordwr : fdopt = 2
const Oexec : fdopt = 3
diff --git a/lib/sys/syscall+netbsd-x64.s b/lib/sys/syscall+netbsd-x64.s
new file mode 100644
index 0000000..3b25573
--- /dev/null
+++ b/lib/sys/syscall+netbsd-x64.s
@@ -0,0 +1,76 @@
+.globl sys$syscall
+sys$syscall:
+ /*
+ hack: We load 6 args regardless of
+ how many we actually have. This may
+ load junk values, but if the syscall
+ doesn't use them, it's going to be
+ harmless.
+ */
+ movq %rdi,%rax
+ /* 8(%rsp): hidden type arg */
+ movq 16(%rsp),%rdi
+ movq 24(%rsp),%rsi
+ movq 32(%rsp),%rdx
+ movq 40(%rsp),%r10
+ movq 48(%rsp),%r8
+ movq 56(%rsp),%r9
+ /*
+ if there syscalls are more than 6
+ args (eg, mmap), the remaining args
+ are on the stack, with 8 dummy bytes
+ for a return address.
+ */
+ movq 64(%rsp),%rbx
+ pushq %rbx
+ pushq %rbx
+
+ syscall
+ jae .success
+ negq %rax
+
+.success:
+ addq $16,%rsp
+ ret
+
+.globl sys$__netbsd_pipe
+sys$__netbsd_pipe:
+ movq $0x2a,%rax
+ syscall
+
+ jae .pipesuccess
+ negq %rax
+
+.pipesuccess:
+ movl %eax,(%rdi)
+ movl %edx,4(%rdi)
+ xorq %rax,%rax
+ ret
+
+/* __tfork_thread(tfp : tforkparams#, sz : size, fn : void#, arg : void#-> tid) */
+.globl sys$__tfork_thread
+sys$__tfork_thread:
+ /* syscall */
+ movq %rdx, %r8
+ movq %rcx, %r9
+ movq $8, %rax
+ syscall
+ jb .failparent
+
+ /* are we in the parent? */
+ cmpq $0,%rax
+ jnz .doneparent
+
+ /* call the function and __threxit */
+ movq %r9, %rdi
+ callq *%r8
+
+ movq $302,%rax
+ xorq %rdi,%rdi
+ syscall
+
+.failparent:
+ negq %rax
+
+.doneparent:
+ ret
diff --git a/lib/sys/syscall+osx-x64.s b/lib/sys/syscall+osx-x64.s
index 5984c24..2618413 100644
--- a/lib/sys/syscall+osx-x64.s
+++ b/lib/sys/syscall+osx-x64.s
@@ -87,10 +87,15 @@ _sys$__osx_gettimeofday:
jae .gettimeofdaysuccess
negq %rax
+ ret
.gettimeofdaysuccess:
- movq %rax, (%rdi)
+ cmpq $0,%rax
+ je .noreg
+
+ movq %rax,0(%rdi)
movl %edx,8(%rdi)
xorq %rax,%rax
+.noreg:
ret
diff --git a/lib/sys/syserrno+netbsd.myr b/lib/sys/syserrno+netbsd.myr
new file mode 100644
index 0000000..e48f893
--- /dev/null
+++ b/lib/sys/syserrno+netbsd.myr
@@ -0,0 +1,123 @@
+pkg sys =
+ type errno = int
+
+ const Eperm : errno = -1 /* Operation not permitted */
+ const Enoent : errno = -2 /* No such file or directory */
+ const Esrch : errno = -3 /* No such process */
+ const Eintr : errno = -4 /* Interrupted system call */
+ const Eio : errno = -5 /* Input/output error */
+ const Enxio : errno = -6 /* Device not configured */
+ const E2big : errno = -7 /* Argument list too long */
+ const Enoexec : errno = -8 /* Exec format error */
+ const Ebadf : errno = -9 /* Bad file descriptor */
+ const Echild : errno = -10 /* No child processes */
+ const Edeadlk : errno = -11 /* Resource deadlock avoided */
+ /* 11 was EAGAIN */
+ const Enomem : errno = -12 /* Cannot allocate memory */
+ const Eacces : errno = -13 /* Permission denied */
+ const Efault : errno = -14 /* Bad address */
+ const Enotblk : errno = -15 /* Block device required */
+ const Ebusy : errno = -16 /* Device busy */
+ const Eexist : errno = -17 /* File exists */
+ const Exdev : errno = -18 /* Cross-device link */
+ const Enodev : errno = -19 /* Operation not supported by device */
+ const Enotdir : errno = -20 /* Not a directory */
+ const Eisdir : errno = -21 /* Is a directory */
+ const Einval : errno = -22 /* Invalid argument */
+ const Enfile : errno = -23 /* Too many open files in system */
+ const Emfile : errno = -24 /* Too many open files */
+ const Enotty : errno = -25 /* Inappropriate ioctl for device */
+ const Etxtbsy : errno = -26 /* Text file busy */
+ const Efbig : errno = -27 /* File too large */
+ const Enospc : errno = -28 /* No space left on device */
+ const Espipe : errno = -29 /* Illegal seek */
+ const Erofs : errno = -30 /* Read-only filesystem */
+ const Emlink : errno = -31 /* Too many links */
+ const Epipe : errno = -32 /* Broken pipe */
+
+ /* math software */
+ const Edom : errno = -33 /* Numerical argument out of domain */
+ const Erange : errno = -34 /* Result too large */
+
+ /* non-blocking and interrupt i/o */
+ const Eagain : errno = -35 /* Resource temporarily unavailable */
+ const Einprogress : errno = -36 /* Operation now in progress */
+ const Ealready : errno = -37 /* Operation already in progress */
+
+ /* ipc/network software -- argument errors */
+ const Enotsock : errno = -38 /* Socket operation on non-socket */
+ const Edestaddrreq : errno = -39 /* Destination address required */
+ const Emsgsize : errno = -40 /* Message too long */
+ const Eprototype : errno = -41 /* Protocol wrong type for socket */
+ const Enoprotoopt : errno = -42 /* Protocol not available */
+ const Eprotonosupport : errno = -43 /* Protocol not supported */
+ const Esocktnosupport : errno = -44 /* Socket type not supported */
+ const Eopnotsupp : errno = -45 /* Operation not supported */
+ const Epfnosupport : errno = -46 /* Protocol family not supported */
+ const Eafnosupport : errno = -47 /* Address family not supported by protocol family */
+ const Eaddrinuse : errno = -48 /* Address already in use */
+ const Eaddrnotavail : errno = -49 /* Can't assign requested address */
+
+ /* ipc/network software -- operational errors */
+ const Enetdown : errno = -50 /* Network is down */
+ const Enetunreach : errno = -51 /* Network is unreachable */
+ const Enetreset : errno = -52 /* Network dropped connection on reset */
+ const Econnaborted : errno = -53 /* Software caused connection abort */
+ const Econnreset : errno = -54 /* Connection reset by peer */
+ const Enobufs : errno = -55 /* No buffer space available */
+ const Eisconn : errno = -56 /* Socket is already connected */
+ const Enotconn : errno = -57 /* Socket is not connected */
+ const Eshutdown : errno = -58 /* Can't send after socket shutdown */
+ const Etoomanyrefs : errno = -59 /* Too many references: can't splice */
+ const Etimedout : errno = -60 /* Operation timed out */
+ const Econnrefused : errno = -61 /* Connection refused */
+
+ const Eloop : errno = -62 /* Too many levels of symbolic links */
+ const Enametoolong : errno = -63 /* File name too long */
+
+ /* should be rearranged */
+ const Ehostdown : errno = -64 /* Host is down */
+ const Ehostunreach : errno = -65 /* No route to host */
+ const Enotempty : errno = -66 /* Directory not empty */
+
+ /* quotas & mush */
+ const Eproclim : errno = -67 /* Too many processes */
+ const Eusers : errno = -68 /* Too many users */
+ const Edquot : errno = -69 /* Disc quota exceeded */
+
+ /* Network File System */
+ const Estale : errno = -70 /* Stale NFS file handle */
+ const Eremote : errno = -71 /* Too many levels of remote in path */
+ const Ebadrpc : errno = -72 /* RPC struct is bad */
+ const Erpcmismatch : errno = -73 /* RPC version wrong */
+ const Eprogunavail : errno = -74 /* RPC prog. not avail */
+ const Eprogmismatch : errno = -75 /* Program version wrong */
+ const Eprocunavail : errno = -76 /* Bad procedure for program */
+
+ const Enolck : errno = -77 /* No locks available */
+ const Enosys : errno = -78 /* Function not implemented */
+
+ const Eftype : errno = -79 /* Inappropriate file type or format */
+ const Eauth : errno = -80 /* Authentication error */
+ const Eneedauth : errno = -81 /* Need authenticator */
+ const Eidrm : errno = -82 /* Identifier removed */
+ const Enomsg : errno = -83 /* No message of desired type */
+ const Eoverflow : errno = -84 /* Value too large to be stored in data type */
+ const Ecanceled : errno = -85 /* Operation canceled */
+ const Eilseq : errno = -86 /* Illegal byte sequence */
+ const Enoattr : errno = -87 /* Attribute not found */
+
+ const Edoofus : errno = -88 /* Programming error */
+
+ const Ebadmsg : errno = -89 /* Bad message */
+ const Emultihop : errno = -90 /* Multihop attempted */
+ const Enolink : errno = -91 /* Link has been severed */
+ const Eproto : errno = -92 /* Protocol error */
+
+ const Enotcapable : errno = -93 /* Capabilities insufficient */
+ const Ecapmode : errno = -94 /* Not permitted in capability mode */
+ const Enotrecoverable : errno = -95 /* State not recoverable */
+ const Eownerdead : errno = -96 /* Previous owner died */
+
+ const Elast : errno = -96 /* Must be equal largest errno */
+;;
diff --git a/lib/testr/testr.myr b/lib/testr/testr.myr
index 22a271c..19cdad6 100644
--- a/lib/testr/testr.myr
+++ b/lib/testr/testr.myr
@@ -13,6 +13,7 @@ pkg testr =
;;
const run : (specs : spec[:] -> void)
+ const bench : (specs : spec[:] -> void)
const ok : (ctx : ctx# -> void)
const fail : (ctx : ctx#, msg : byte[:], args : ... -> void)
const check : (ctx : ctx#, cond : bool, msg : byte[:], args : ... -> void)
@@ -20,10 +21,17 @@ pkg testr =
const softfail : (ctx : ctx#, msg : byte[:], args : ... -> void)
;;
+const bench = {specs
+ std.put("MTEST {}\n", specs.len)
+ for s : specs
+ benchspec(&s)
+ ;;
+}
+
const run = {specs
std.put("MTEST {}\n", specs.len)
for s : specs
- runspec(&s)
+ testspec(&s)
;;
}
@@ -60,13 +68,62 @@ const softfail = {ctx, msg, args
}
const softfailv = {ctx, msg, ap
- ctx.ok = false
- ctx.reason = std.fmtv(msg, ap)
+ /* keep the first failure */
+ if ctx.ok
+ ctx.ok = false
+ ctx.reason = std.fmtv(msg, ap)
+ ;;
+}
+
+const benchspec = {ts
+ var avg, m, d, n, nsamp
+ var start, dt
+ var ctx : ctx
+ var jmpbuf
+
+ ctx.ok = true
+ ctx.reason = ""
+ ctx.jmpbuf = &jmpbuf
+
+ avg = 0.0;
+ m = 0.0;
+ n = 0.0;
+ nsamp = 0
+ std.put("test {} <<{{!\n", ts.name)
+ if !std.setjmp(&jmpbuf)
+ /* estimate samples */
+ start = std.now()
+ ts.fn(&ctx)
+ dt = (std.now() - start : flt64)
+
+ if dt == 0.0
+ nsamp = 1000_000
+ else
+ nsamp = (100_000.0/dt : int64)
+ nsamp = std.max(10, nsamp)
+ ;;
+
+ for var i = 0; i < nsamp; i++
+ n +=1.0;
+ start = std.now()
+ ts.fn(&ctx)
+ dt = (std.now() - start : flt64)/1_000_000.0
+ d = (dt - avg);
+ avg = avg + d/n;
+ m = m + d*(dt - avg);
+ ;;
+ ;;
+
+ if ctx.ok
+ std.put("!}}>> timing {} {} {}\n", nsamp, avg, m)
+ else
+ std.put("!}}>> fail {}\n", ctx.reason)
+ std.slfree(ctx.reason)
+ ;;
}
-const runspec = {ts
+const testspec = {ts
var ctx : ctx
- var status, reason
var jmpbuf
ctx.ok = true
@@ -79,12 +136,9 @@ const runspec = {ts
;;
if ctx.ok
- status = "ok"
- reason = ""
+ std.put("!}}>> ok\n")
else
- status = "fail"
- reason = ctx.reason
+ std.put("!}}>> fail {}\n", ctx.reason)
+ std.slfree(ctx.reason)
;;
- std.put("!}}>> {} {}\n", status, reason)
- std.slfree(reason)
}
diff --git a/lib/thread/bld.sub b/lib/thread/bld.sub
index 02e5e50..f386162 100644
--- a/lib/thread/bld.sub
+++ b/lib/thread/bld.sub
@@ -8,16 +8,17 @@ lib thread =
# linux impl of basic thread primitives
#condvar+linux.myr
+ exit+linux-x64.s
mutex+linux.myr
+ ncpu+linux.myr
spawn+linux.myr
- exit+linux-x64.s
# freebsd impl of thread primitives
#condvar+freebsd.myr
+ exit+freebsd-x64.s
mutex+freebsd.myr
- spawn+freebsd.myr
ncpu+freebsd.myr
- exit+freebsd-x64.s
+ spawn+freebsd.myr
# netbsd impl of thread primitives
#condvar+netbsd.myr
@@ -33,14 +34,16 @@ lib thread =
# 9front impl of thread primitives
#condvar+plan9.myr
+ atomic-impl+plan9-x64.s
mutex+plan9.myr
- spawn+plan9.myr
ncpu+plan9.myr
- atomic-impl+plan9-x64.s
+ spawn+plan9.myr
# openbsd impl of thread primitives
- spawn+openbsd.myr
exit+openbsd-x64.s
+ mutex+openbsd:6.2.myr
+ ncpu+openbsd.myr
+ spawn+openbsd.myr
atomic-impl+x64.s
atomic.myr
diff --git a/lib/thread/mutex+openbsd:6.2.myr b/lib/thread/mutex+openbsd:6.2.myr
new file mode 100644
index 0000000..f2648f5
--- /dev/null
+++ b/lib/thread/mutex+openbsd:6.2.myr
@@ -0,0 +1,76 @@
+use std
+use sys
+
+use "atomic"
+use "common"
+
+pkg thread =
+ type mutex = struct
+ _state : uint32
+ ;;
+
+ const mkmtx : (-> mutex)
+ const mtxlock : (mtx : mutex# -> void)
+ const mtxtrylock : (mtx : mutex# -> bool)
+ const mtxunlock : (mtx : mutex# -> void)
+
+ pkglocal const Unlocked : uint32 = 0
+ pkglocal const Locked : uint32 = 1
+ pkglocal const Contended : uint32 = 2
+;;
+
+var nspin = 10 /* FIXME: pick a sane number, based on CPU count */
+
+const mkmtx = {
+ -> [._state = Unlocked]
+}
+
+const mtxlock = {mtx
+ var c
+
+ /*
+ Uncontended case: we get an unlocked mutex, and we lock it.
+ */
+ c = Locked
+ for var i = 0; i < nspin; i++
+ c = xcas(&mtx._state, Unlocked, Locked)
+ if c == Unlocked
+ -> void
+ ;;
+ ;;
+
+ /*
+ Contended case: we set the lock state to Contended. This indicates that there
+ the lock is locked, and we potentially have threads waiting on it, which means
+ that we will need to wake them up.
+ */
+ if c == Locked
+ c = xchg(&mtx._state, Contended)
+ ;;
+
+ while c != Unlocked
+ sys.futex(&mtx._state, sys.Futexwait, (Contended : int), Zptr, Zptr)
+ c = xchg(&mtx._state, Contended)
+ ;;
+}
+
+const mtxtrylock = {mtx
+ -> xcas(&mtx._state, Unlocked, Locked) == Unlocked
+}
+
+const mtxunlock = {mtx
+ /*
+ Uncontended case: If the mutex state is not contended, and we still
+ are uncontended by the xchg() call, then it's safe to simply return;
+ nobody was waiting for us.
+ */
+ if mtx._state == Contended
+ mtx._state = Unlocked
+ elif xchg(&mtx._state, Unlocked) == Locked
+ -> void
+ ;;
+
+ /* wake one thread */
+ sys.futex(&mtx._state, sys.Futexwake, 1, Zptr, Zptr)
+}
+
diff --git a/lib/thread/ncpu+linux.myr b/lib/thread/ncpu+linux.myr
new file mode 100644
index 0000000..5c2ea15
--- /dev/null
+++ b/lib/thread/ncpu+linux.myr
@@ -0,0 +1,30 @@
+use std
+use sys
+
+pkg thread =
+ const ncpu : (-> int)
+;;
+
+const ncpu = {
+ var cpubuf : uint64[4]
+ var n
+
+ sys.sched_getaffinity(sys.getpid(), sizeof(uint64[4]), (&cpubuf : uint64#))
+ n = 0
+ for b : cpubuf[:]
+ if b != 0
+ n += count(b)
+ ;;
+ ;;
+ -> n
+}
+
+const count = {b
+ var n = 0
+ for var i = 0; i < 8*sizeof(uint64); i++
+ if b & (1<<i) != 0
+ n++
+ ;;
+ ;;
+ -> n
+}
diff --git a/lib/thread/ncpu+openbsd.myr b/lib/thread/ncpu+openbsd.myr
new file mode 100644
index 0000000..1aa3dc1
--- /dev/null
+++ b/lib/thread/ncpu+openbsd.myr
@@ -0,0 +1,23 @@
+use std
+use sys
+
+pkg thread =
+ const ncpu : (-> int)
+;;
+
+const ncpu = {
+ var mib : int[2]
+ var ncpu : int
+ var ncpusz
+ var res
+
+ mib[0] = 6 /* CTL_HW */
+ mib[1] = 3 /* HW_NCPU */
+ ncpusz = sizeof(int)
+
+ res = sys.sysctl(mib[:], (&ncpu : void#), &ncpusz, (0 : void#), (0 : sys.size#))
+ if res < 0 || ncpu <= 0
+ -> 1
+ ;;
+ -> ncpu
+}
diff --git a/lib/thread/ncpu+plan9.myr b/lib/thread/ncpu+plan9.myr
index 25d09cb..a13725c 100644
--- a/lib/thread/ncpu+plan9.myr
+++ b/lib/thread/ncpu+plan9.myr
@@ -5,7 +5,7 @@ pkg thread =
;;
const ncpu = {
- match std.intparse(std.getenvv("NPROC", ""))
+ match std.intparse(std.getenvv("NPROC", "1"))
| `std.Some n: -> n
| `std.None: -> 1
;;
diff --git a/lib/thread/spawn+osx.myr b/lib/thread/spawn+osx.myr
index bedaa42..4e99598 100644
--- a/lib/thread/spawn+osx.myr
+++ b/lib/thread/spawn+osx.myr
@@ -34,15 +34,41 @@ const spawn = {fn
}
const spawnstk = {fn, sz
- var tid : tid, ret
+ var stk : byte#, tid, ret
+ var szp, f, tos, env, envsz
+ stk = getstk(sz)
+ if stk == sys.Mapbad
+ -> `std.Err "couldn't get stack"
+ ;;
+ tid = -1
+
+ /* find top of stack */
+ tos = (stk : std.intptr) + (sz : std.intptr)
+
+ /* store the stack size */
+ tos -= sizeof(sys.size)
+ sz -= sizeof(sys.size)
+ szp = (tos : sys.size#)
+ szp# = Stacksz
+
+ /* store the function we call */
+ envsz = std.fnenvsz(fn)
+ tos -= (envsz : std.intptr)
+ sz -= (envsz : sys.size)
+ env = tos
+ tos -= sizeof((->void))
+ sz -= sizeof((->void))
+ f = (tos : (->void)#)
+ f# = std.fnbdup(fn, (env : byte#)[:envsz])
+ var repr = (&fn : int64[2]#)#
ret = sys.bsdthread_create( \
- (fn : void#), \
- envptr(&fn), \
- (sz : void#), \
- (0 : void#), \
- 0)
+ (tramp : void#), \ /* start */
+ (tos : void#), \ /* arg */
+ (tos : void#), \ /* stack */
+ (0 : void#), \ /* pthread struct */
+ 0x01000000) /* flags (PTHREAD_START_CUSTOM): don't alloc stack in kernel */
if ret == (-1 : void#)
-> `std.Err "couldn't spawn thread"
@@ -50,10 +76,24 @@ const spawnstk = {fn, sz
-> `std.Ok (ret : tid)
}
-const envptr = {fn
- var repr : std.intptr[2]
+const getstk = {sz
+ var p, m
- repr = (fn : std.intptr[2]#)#
- -> (repr[0] : void#)
+ std.put("allocating stack {x}\n", sz)
+ p = sys.mmap((0 : byte#), sz, sys.Mprotrw, sys.Mpriv | sys.Manon, -1, 0)
+ if p == sys.Mapbad
+ -> p
+ ;;
+ m = (p : std.intptr)
+ -> (m : byte#)
}
+/*
+ thread trampoline, called by `start`. We set up the args
+ for the closure and env on the stack, and then we call it
+ from here, doing the cleanup and exit at the end.
+*/
+const tramp = {f : (-> void)#
+ f#()
+ exit()
+}
diff --git a/lib/thread/start+osx-x64.s b/lib/thread/start+osx-x64.s
index bc62d08..bb497bb 100644
--- a/lib/thread/start+osx-x64.s
+++ b/lib/thread/start+osx-x64.s
@@ -1,22 +1,41 @@
-// The entry point for thread start, registered with bsdthread_register
-// %rdi: pthread (0, for us)
-// %rsi: mach thread port (ignored)
-// %rdx: func
-// %rcx: env
-// %r8: stack
-// %r9: flags (= 0)
-// %rsp: stack - C_64_REDZONE_LEN (= stack - 128)
+# The entry point for thread start, registered with bsdthread_register
+# %rdi: pthread (0, for us)
+# %rsi: mach thread port (ignored)
+# %rdx: func
+# %rcx: env
+# %r8: stack
+# %r9: flags (= 0)
+# %rsp: stack - C_64_REDZONE_LEN (= stack - 128)
.globl _thread$start
_thread$start:
/* call the function */
-# movq %r8, %rsp /* set up stack */
- movq %rcx, %rax /* set up env */
+ movq %r8, %rsp /* set up stack */
+ movq %rcx,%rdi
callq *%rdx /* call function */
+
+/*
+const thread.exit : (stacksz : std.size -> void)
+NOTE: must be called from the bottom of the stack, since
+we assume that %rbp is in the top 4k of the stack.
+*/
+.globl _thread$exit
+_thread$exit:
+ /* find top of stack */
+ movq %rbp,%rdi /* addr */
+ andq $~0xfff,%rdi /* align it */
+ addq $0x1000,%rdi
+
+ /* munmap(base, size) */
+ movq $0x2000049,%rax /* munmap */
+ movq -8(%rdi),%rsi /* size */
+ subq %rsi,%rdi /* move to base ptr */
+ syscall
/* exit the thread */
movq $0x2000169, %rax /* Sysbsdthread_terminate */
- movq %rsp, %rdi /* stack */
+ movq $0, %rdi /* stack */
movq $0, %rsi /* len */
movq $0, %rdx /* sem */
syscall
+
diff --git a/lib/thread/test/mutex.myr b/lib/thread/test/mutex.myr
index eb15a5e..fd58df1 100644
--- a/lib/thread/test/mutex.myr
+++ b/lib/thread/test/mutex.myr
@@ -27,7 +27,6 @@ const incvar = {
for var i = 0; i < 1000; i++
thread.mtxlock(&mtx)
val++
- std.put("val: {}\n", val)
thread.mtxunlock(&mtx)
;;
thread.xadd(&done, 1)
diff --git a/mbld/deps.myr b/mbld/deps.myr
index e4f0bd2..1ad1b22 100644
--- a/mbld/deps.myr
+++ b/mbld/deps.myr
@@ -105,6 +105,13 @@ const myrdeps = {b, name, mt
n.wdir = std.sldup(mt.dir)
std.slpush(&n.cmd, std.pathjoin([b.basedir, opt_objdir, mt.dir, mt.name][:]))
+ elif mt.isbench
+ n = node(g, mt.name)
+ depends(g, n, to)
+ addnode(g, "bench", n)
+
+ n.wdir = std.sldup(mt.dir)
+ std.slpush(&n.cmd, std.pathjoin([b.basedir, opt_objdir, mt.dir, mt.name][:]))
else
addnode(g, "all", go)
go.instdir = config.Binpath
@@ -140,7 +147,7 @@ const myrdeps = {b, name, mt
depends(g, n, d)
;;
for `Xdep d : deps
- scrapelib(b, d, mt.incpath)
+ scrapelib(b, mt.name, d, mt.incpath)
xdepends(b, g, n, d)
std.slpush(&libs, d)
;;
@@ -218,6 +225,10 @@ const cmddeps = {b, name, ct
a = std.htgetv(b.deps.targs, "test", [][:])
std.slpush(&a, n)
std.htput(b.deps.targs, "test", a)
+ elif ct.isbench
+ a = std.htgetv(b.deps.targs, "bench", [][:])
+ std.slpush(&a, n)
+ std.htput(b.deps.targs, "bench", a)
elif gen
pid = run(ct.cmd, ct.dir)
match std.wait(pid)
@@ -264,10 +275,19 @@ const datdeps = {b, name, dt
const addtests = {b, name, mt
for f : mt.inputs
addtest(b, mt, f)
+ addbench(b, mt, f)
;;
}
const addtest = {b, mt, f
+ addalt(b, mt, "test", f)
+}
+
+const addbench = {b, mt, f
+ addalt(b, mt, "bench", f)
+}
+
+const addalt = {b, mt, kind, f
var libs, deps
var sp, tp, op
var s, t, o
@@ -280,7 +300,7 @@ const addtest = {b, mt, f
*/
g = b.deps
s = changesuffix(f, ".myr")
- sp = std.pathjoin([mt.dir, "test", s][:])
+ sp = std.pathjoin([mt.dir, kind, s][:])
std.slfree(s)
if !std.fexists(sp)
std.slfree(sp)
@@ -291,11 +311,11 @@ const addtest = {b, mt, f
leaf(g, sp)
t = changesuffix(f, "")
- tp = std.pathjoin([opt_objdir, mt.dir, "test", t][:])
+ tp = std.pathjoin([opt_objdir, mt.dir, kind, t][:])
std.slfree(t)
o = changesuffix(f, config.Objsuffix)
- op = std.pathjoin([opt_objdir, mt.dir, "test", o][:])
+ op = std.pathjoin([opt_objdir, mt.dir, kind, o][:])
std.slfree(o)
n = node(g, sp)
@@ -309,7 +329,7 @@ const addtest = {b, mt, f
depends(g, n, d)
;;
for `Xdep d : deps
- scrapelib(b, d, mt.incpath)
+ scrapelib(b, mt.name, d, mt.incpath)
xdepends(b, g, n, d)
std.slpush(&libs, d)
;;
@@ -325,9 +345,9 @@ const addtest = {b, mt, f
n = node(g, tp)
depends(g, n, tp)
n.wdir = std.sldup(std.dirname(std.dirname(sp)))
- std.slpush(&n.cmd, std.pathjoin([b.basedir, opt_objdir, mt.dir, "test", std.basename(tp)][:]))
+ std.slpush(&n.cmd, std.pathjoin([b.basedir, opt_objdir, mt.dir, kind, std.basename(tp)][:]))
- addnode(g, "test", n)
+ addnode(g, kind, n)
}
const resolve = {b
@@ -354,7 +374,7 @@ const resolve = {b
const edge = {g, n, e
match std.htget(g.gen, e)
| `std.None:
- std.fatal("nothing satisfies {} for {}\n", e, n.lbl)
+ std.fatal("{}: missing build rule for {}\n", n.lbl, e)
| `std.Some d:
std.slpush(&n.ndep, d)
std.slpush(&d.ngen, n)
@@ -382,6 +402,9 @@ const checkloop = {g, n, visited, looped, stk
const musecmd = {b, n, mt, mu
std.slpush(&n.cmd, std.sldup(opt_muse))
+ for o : opt_museflags
+ std.slpush(&n.cmd, o)
+ ;;
std.slpush(&n.cmd, std.sldup("-o"))
std.slpush(&n.cmd, std.sldup(mu))
std.slpush(&n.cmd, std.sldup("-p"))
@@ -405,6 +428,9 @@ const linkcmd = {b, n, mt, bin, libs, dynlibs, istest
for c : config.Linkcmd
std.slpush(&n.cmd, std.sldup(c))
;;
+ for o : opt_ldflags
+ std.slpush(&n.cmd, o)
+ ;;
std.slpush(&n.cmd, std.sldup(bin))
if mt.ldscript.len > 0
std.slpush(&n.cmd, std.sldup("-T"))
@@ -439,6 +465,9 @@ const linkcmd = {b, n, mt, bin, libs, dynlibs, istest
const myrcmd = {b, n, mt, src, istest
std.slpush(&n.cmd, std.sldup(opt_mc))
+ for o : opt_mcflags
+ std.slpush(&n.cmd, o)
+ ;;
if opt_objdir.len > 0
pushopt(&n.cmd, "-O", std.sldup(opt_objdir))
;;
diff --git a/mbld/libs.myr b/mbld/libs.myr
index f99b0b2..487d110 100644
--- a/mbld/libs.myr
+++ b/mbld/libs.myr
@@ -16,10 +16,13 @@ pkg bld =
dep : byte[:][:], \
dyndep : byte[:][:] -> void)
- const scrapelib : (b : build#, libs : byte[:], incs : byte[:][:] -> void)
+ const scrapelib : (b : build#, \
+ targ : byte[:], \
+ libs : byte[:], \
+ incs : byte[:][:] -> void)
;;
-const Abiversion = 13
+const Abiversion = 14
const builtlib = {b, mt, dep, dyndep
var ldep, l, u
@@ -37,12 +40,12 @@ const builtlib = {b, mt, dep, dyndep
std.slfree(l)
std.slfree(u)
for d : dep
- scrapelib(b, d, mt.incpath)
+ scrapelib(b, mt.name, d, mt.incpath)
;;
std.htput(b.libs, mt.name, ldep)
}
-const scrapelib = {b, lib, incs
+const scrapelib = {b, targ, lib, incs
var dep, dyndep, ldep
var f, dir
@@ -50,18 +53,16 @@ const scrapelib = {b, lib, incs
-> void
;;
- (f, dir) = openlib(lib, incs)
+ (f, dir) = openlib(lib, targ, incs)
match bio.getc(f)
- | `bio.Ok 'U': /* ok */
- | `bio.Ok _: std.fput(1, "{}: not a usefile\n", lib)
- | `bio.Err e: std.fatal("{}: error reading: {}\n", lib, e)
- | `bio.Eof: std.fatal("{}: truncated\n", lib)
+ | `std.Ok 'U': /* ok */
+ | `std.Ok _: std.fput(1, "{}/{}: not a usefile\n", dir, lib)
+ | `std.Err e: std.fatal("{}/{}: error reading: {}\n", dir, lib, e)
;;
match bio.getbe32(f)
- | `bio.Ok Abiversion: /* nothing: version matches. */
- | `bio.Ok v: std.fput(1, "{}: mismatched abi {}\n", lib, v)
- | `bio.Err e: std.fatal("{}: error reading: {}\n", lib, e)
- | `bio.Eof: std.fatal("{}: truncated\n", lib)
+ | `std.Ok Abiversion: /* nothing: version matches. */
+ | `std.Ok v: std.fput(1, "{}/{}: mismatched abi {}\n", dir, lib, v)
+ | `std.Err e: std.fatal("{}/{}: error reading: {}\n", dir, lib, e)
;;
std.slfree(rdstr(f))
@@ -69,10 +70,10 @@ const scrapelib = {b, lib, incs
dyndep = [][:]
while true
match bio.getc(f)
- | `bio.Ok 'L': std.slpush(&dep, rdstr(f))
- | `bio.Ok 'X': std.slpush(&dyndep, rdstr(f))
- | `bio.Err e: std.fatal("{}: error reading {}", lib, e)
- | _: break;
+ | `std.Ok 'L': std.slpush(&dep, rdstr(f))
+ | `std.Ok 'X': std.slpush(&dyndep, rdstr(f))
+ | `std.Err e: std.fatal("{}: error reading {}\n", lib, e)
+ | _: break
;;
;;
bio.close(f)
@@ -87,11 +88,11 @@ const scrapelib = {b, lib, incs
std.htput(b.libs, lib, ldep)
for d : dep
- scrapelib(b, d, incs)
+ scrapelib(b, targ, d, incs)
;;
}
-const openlib = {lib, incs : byte[:][:]
+const openlib = {lib, targ, incs
var path, libname
path = ""
@@ -107,11 +108,11 @@ const openlib = {lib, incs : byte[:][:]
-> (file, p)
| `std.Err m:
;;
- std.fatal("{} does not exist in {j=, }\n", lib, incs)
+ std.fatal("{}: {} does not exist in {j=, }\n", targ, lib, incs)
;;
std.slfree(path)
;;
- std.fatal("{} does not exist in {j= }\n", lib, incs)
+ std.fatal("{}: {} does not exist in {j= }\n", targ, lib, incs)
}
const addlibs = {b, sl, libs, incs
@@ -176,11 +177,10 @@ const rdstr = {f -> byte[:]
var sl
match bio.getbe32(f)
- | `bio.Ok l:
+ | `std.Ok l:
len = l
sl = std.slalloc(len)
- | `bio.Eof: std.fatal("end of file while reading string")
- | `bio.Err e: std.fatal("error while reading string: {}", e)
+ | `std.Err e: std.fatal("error while reading string: {}", e)
;;
bio.read(f, sl)
-> sl
diff --git a/mbld/main.myr b/mbld/main.myr
index 50aa373..606ae3b 100644
--- a/mbld/main.myr
+++ b/mbld/main.myr
@@ -96,6 +96,7 @@ const main = {args : byte[:][:]
| "install": r = bld.install(b)
| "uninstall": r = bld.uninstall(b)
| "test": r = bld.test(b, cmd.args[1:])
+ | "bench": r = bld.bench(b, cmd.args[1:])
| "list": r = show(b, cmd.args[1:])
| _:
ok = true
@@ -120,6 +121,7 @@ const buildimm = {b, targ, inputs
.incpath=bld.opt_incpaths,
.libdeps=[][:]
]
+ bld.opt_objdir = ""
std.slpush(&b.all, "__out__")
std.htput(b.targs, "__out__", `bld.Bin &mt)
bld.deps(b)
diff --git a/mbld/mbld.1 b/mbld/mbld.1
index f95898c..3efbeba 100644
--- a/mbld/mbld.1
+++ b/mbld/mbld.1
@@ -36,10 +36,6 @@ The myrbuild options are:
Print a summary of the available options.
.TP
-.B -c
-cleans the code before building. This applies to both
-
-.TP
.B -b \fIbinname\fP
Compile source into a binary named 'name'. If neither this option nor
the '-l' option are given, myrbuild will create a binary called 'a.out'.
diff --git a/mbld/opts.myr b/mbld/opts.myr
index ca11d56..6b5e4c5 100644
--- a/mbld/opts.myr
+++ b/mbld/opts.myr
@@ -4,18 +4,21 @@ use thread
use "config"
pkg bld =
- var opt_arch : byte[:]
- var opt_sys : byte[:]
- var opt_sysvers : (int, int, int)
- var opt_runtime : byte[:]
- var opt_genasm : bool
+ var opt_arch : byte[:]
+ var opt_sys : byte[:]
+ var opt_sysvers : (int, int, int)
+ var opt_runtime : byte[:]
+ var opt_genasm : bool
var opt_incpaths : byte[:][:]
+ var opt_mcflags : byte[:][:]
+ var opt_museflags : byte[:][:]
+ var opt_ldflags : byte[:][:]
var opt_instbase : byte[:]
- var opt_destdir : byte[:]
- var opt_objdir : byte[:]
- var opt_maxproc : std.size
- var opt_debug : bool
- var opt_silent : bool
+ var opt_destdir : byte[:]
+ var opt_objdir : byte[:]
+ var opt_maxproc : std.size
+ var opt_debug : bool
+ var opt_silent : bool
/* undocumented/unsupported opts */
var opt_mc : byte[:]
@@ -29,25 +32,26 @@ pkg bld =
const parseversion : (v : byte[:] -> (int, int, int))
;;
-var opt_arch = ""
-var opt_sys = ""
-var opt_binname = ""
-var opt_libname = ""
-var opt_runtime = ""
+var opt_arch = ""
+var opt_sys = ""
+var opt_binname = ""
+var opt_libname = ""
+var opt_runtime = ""
var opt_incpaths /* FIXME: taking a constant slice is a nonconstant initializer */
var opt_instbase = ""
-var opt_destdir = ""
+var opt_destdir = ""
var opt_sysvers
-var opt_debug = false
-var opt_mc = "6m"
-var opt_as = "as"
-var opt_muse = "muse"
-var opt_ld = "ld"
-var opt_ar = "ar"
-var opt_objdir = "obj"
-var opt_genasm = false
-var opt_silent = false
-var opt_maxproc = 1
+var opt_debug = false
+var opt_mc = "6m"
+var opt_as = "as"
+var opt_muse = "muse"
+var opt_mcflags = [][:]
+var opt_museflags = [][:]
+var opt_ldflags = [][:]
+var opt_objdir = "obj"
+var opt_genasm = false
+var opt_silent = false
+var opt_maxproc = 1
const initopts = {
var si
@@ -78,6 +82,18 @@ const initopts = {
opt_mc = std.getenvv("MYR_MC", "6m")
opt_muse = std.getenvv("MYR_MUSE", "muse")
opt_runtime = std.getenvv("MYR_RT", "")
+ match std.getenv("MYR_MCFLAGS")
+ | `std.Some s: opt_mcflags = std.strtok(s)
+ | `std.None: /* ok */
+ ;;
+ match std.getenv("MYR_MUSEFLAGS")
+ | `std.Some s: opt_mcflags = std.strtok(s)
+ | `std.None: /* ok */
+ ;;
+ match std.getenv("MYR_LDFLAGS")
+ | `std.Some s: opt_ldflags = std.strtok(s)
+ | `std.None: /* ok */
+ ;;
if opt_runtime.len == 0
opt_runtime = std.pathjoin([opt_instbase, config.Libpath, config.Runtime][:])
;;
@@ -89,7 +105,7 @@ const parseversion = {v
i = 0
a = [0, 0, 0]
- for e in std.bysplit(v, ".")
+ for e : std.bysplit(v, ".")
match std.intparse(e)
| `std.Some n: a[i++] = n
| `std.None: continue
diff --git a/mbld/parse.myr b/mbld/parse.myr
index dcc60e7..0f1d053 100644
--- a/mbld/parse.myr
+++ b/mbld/parse.myr
@@ -191,6 +191,7 @@ const target = {b, p
| `std.Some "bin": bintarget(b, p)
| `std.Some "lib": libtarget(b, p)
| `std.Some "test": testtarget(b, p)
+ | `std.Some "bench": benchtarget(b, p)
| `std.Some "gen": cmdtarget(b, p, "gen", false)
| `std.Some "cmd": cmdtarget(b, p, "cmd", true)
| `std.Some "data": datatarget(b, p, "data")
@@ -291,6 +292,15 @@ const testtarget = {b, p
addtarg(p, b, t.name, t.tags, `Bin t)
}
+/* benchtarget: myrtarget */
+const benchtarget = {b, p
+ var t
+ t = myrtarget(b, p, "bench")
+ t.isbench = true
+ t.install = false
+ addtarg(p, b, t.name, t.tags, `Bin t)
+}
+
/* mantarget: anontarget */
const mantarget = {b, p
var targ
@@ -315,7 +325,7 @@ const subtarget = {b, p
/* gentarget: wordlist {attrs} = wordlist ;; */
const cmdtarget = {b, p, cmd, iscmd
var outlist, deplist, cmdlist, tags
- var durable, istest
+ var durable, istest, isbench
var attrs
var gt
@@ -350,12 +360,14 @@ const cmdtarget = {b, p, cmd, iscmd
durable = false
istest = false
+ isbench = false
deplist = [][:]
tags = [][:]
for elt : attrs
match elt
| ("durable", ""): durable = true
| ("test", ""): istest = true
+ | ("bench", ""): isbench = true
| ("notest", ""): istest = false
| ("dep", depname): std.slpush(&deplist, depname)
| ("tag", tag): std.slpush(&tags, tag)
@@ -371,6 +383,7 @@ const cmdtarget = {b, p, cmd, iscmd
.gen=outlist,
.durable=durable,
.istest=istest,
+ .isbench=isbench,
.deps=deplist,
.cmd=cmdlist,
.tags=tags,
@@ -391,7 +404,7 @@ myrtarget: name '=' inputlist ';;'
const myrtarget = {b, p, targ
var ldscript, runtime, install, incpath, tags
var libdeps, name, inputs, attrs
- var istest
+ var istest, isbench
var fsel
match word(p)
@@ -432,6 +445,7 @@ const myrtarget = {b, p, targ
incpath = [][:]
tags = [][:]
istest = false
+ isbench = false
for elt : attrs
match elt
| ("ldscript", lds): ldscript = std.sldup(lds)
@@ -441,6 +455,7 @@ const myrtarget = {b, p, targ
| ("inst", ""): install = true
| ("noinst", ""): install = false
| ("test", ""): istest = true
+ | ("bench", ""): isbench = true
| ("notest", ""): istest = false
| (invalid, ""): std.fatal("{}: invalid attr '{}'\n", targ, invalid)
| (invalid, attr): std.fatal("{}: invalid attr '{} = {}'\n", targ, invalid, attr)
@@ -456,6 +471,7 @@ const myrtarget = {b, p, targ
.libdeps=libdeps,
.islib=false,
.istest=istest,
+ .isbench=isbench,
/* attrs */
.tags=tags,
.install=install,
@@ -638,26 +654,44 @@ const wordlist = {p
}
/* word: /wordchar*/
+/* word: /wordchar*/
const word = {p
var c, n
var start
skipspace(p)
+
c = peekc(p)
- n = 0
- start = p.rest
- while p.rest.len > 0
- c = peekc(p)
- if c == '\\'
- c = getc(p)
- ;;
- if wordchar(c)
+ if c == '"'
+ n = 0
+ getc(p)
+ start = p.rest
+ while p.rest.len > 0
+ c = peekc(p)
+ if c == '"'
+ getc(p)
+ goto done
+ elif c == '\\'
+ c = getc(p)
+ ;;
getc(p)
n += std.charlen(c)
- else
- break
+ ;;
+ failparse(p, "input ended within quoted word\n")
+ else
+ n = 0
+ start = p.rest
+ while p.rest.len > 0
+ c = peekc(p)
+ if wordchar(c)
+ getc(p)
+ n += std.charlen(c)
+ else
+ break
+ ;;
;;
;;
+:done
if n > 0
-> `std.Some std.sldup(start[:n])
else
diff --git a/mbld/subtest.myr b/mbld/subtest.myr
index 2b929f5..f631895 100644
--- a/mbld/subtest.myr
+++ b/mbld/subtest.myr
@@ -18,7 +18,7 @@ var footpat
const __init__ = {
planpat = std.try(regex.compile("MTEST\\s+(-?\\d+)\\s*"))
headpat = std.try(regex.compile("test\\s+(.*)<<{!\\s*"))
- footpat = std.try(regex.compile("!}>>\\s*(ok|fail\\s*(.*))\\s*"))
+ footpat = std.try(regex.compile("!}>>\\s*(ok|fail|timing)\\s*(.*)\\s*"))
}
const showsub = {b, cmd, fd, logfd, failed
@@ -29,9 +29,11 @@ const showsub = {b, cmd, fd, logfd, failed
log = bio.mkfile(logfd, bio.Wr)
res = `std.None
match bio.readln(f)
- | `bio.Err e: std.fatal("error reading subfile: {}\n", e)
- | `bio.Eof: -> `std.None
- | `bio.Ok ln:
+ | `std.Err `bio.Eof:
+ -> `std.None
+ | `std.Err e:
+ std.fatal("error reading subfile: {}\n", e)
+ | `std.Ok ln:
match testplan(ln)
| `std.None:
bio.write(log, ln)
@@ -75,7 +77,7 @@ const showtests = {b, cmd, failed, f, log, ntests
curtest = ""
nresults = 0
mbldput("\n")
- for ln in bio.byline(f)
+ for ln : bio.byline(f)
ln = std.strstrip(ln)
match testhead(ln)
| `std.None:
@@ -87,11 +89,14 @@ const showtests = {b, cmd, failed, f, log, ntests
match testfoot(ln)
| `std.None:
- | `std.Some `std.Ok _:
- endtest(b, cmd, &curtest, failed, &nresults, true, "")
+ | `std.Some `Timing (niter, avg, stddev):
+ showbench(b, &curtest, &nresults, niter, avg, stddev)
+ continue
+ | `std.Some `Pass:
+ passtest(b, &curtest, &nresults)
continue
- | `std.Some `std.Err m:
- endtest(b, cmd, &curtest, failed, &nresults, false, m)
+ | `std.Some `Fail m:
+ failtest(b, cmd, &curtest, failed, &nresults, m)
ok = false
continue
;;
@@ -133,25 +138,50 @@ const starttest = {curtest, t
curtest# = t
}
-const endtest = {b, cmd, curtest, failed, nresults, pass, msg
- var p
+const passtest = {b, curtest, nresults
+ donetest(b, curtest, nresults)
+ mbldput("PASS\n")
+}
- if curtest#.len == 0
- std.fatal("malformed input: test ended without start\n")
- ;;
+const showbench = {b, curtest, nresults, niter, avg, stddev
+ var scale, unit
+ donetest(b, curtest, nresults)
+ (scale, unit) = displayscale(avg)
+ std.put("BENCH:\t{}{} (σ^2: {})\n", avg*scale, unit, stddev*scale);
+}
- if pass
- mbldput("PASS\n")
- else
- if msg.len > 0
- mbldput("FAIL {}\n", msg)
- else
- mbldput("FAIL\n")
+const units = [
+ "s",
+ "ms",
+ "μs",
+ "ns",
+]
+const displayscale = {val
+ var scale
+
+ scale = 1.0
+ for var i = 0; i < units.len; i++
+ if val*scale > 1.0
+ -> (scale, units[i])
;;
- p = std.pathcat(cmd, curtest#)
- std.slpush(failed, p)
+ scale *= 1000.0
;;
+ -> (scale, units[units.len - 1])
+}
+
+const failtest = {b, cmd, curtest, failed, nresults, msg
+ var p
+ p = std.pathcat(cmd, curtest#)
+ donetest(b, curtest, nresults)
+ mbldput("FAIL {}\n", msg)
+ std.slpush(failed, p)
+}
+
+const donetest = {b, curtest, nresults
+ if curtest#.len == 0
+ std.fatal("malformed input: test ended without start\n")
+ ;;
std.slfree(curtest#)
curtest# = ""
nresults#++
@@ -183,16 +213,44 @@ const testhead = {ln
;;
}
-const testfoot : (ln : byte[:] -> std.option(std.result(void, byte[:]))) = {ln
+const testfoot = {ln
match regex.exec(footpat, ln)
| `std.Some m:
- if std.sleq(m[1], "ok")
- -> `std.Some `std.Ok void
- else
- -> `std.Some `std.Err std.sldup(m[2])
+ match m[1]
+ | "timing": -> parsetiming(m[2])
+ | "ok": -> `std.Some `Pass
+ | "fail": -> `std.Some `Fail std.sldup(m[2])
+ | junk: -> `std.Some `Fail std.fmt("garbled : {}", junk)
;;
| `std.None:
-> `std.None
;;
}
+const parsetiming = {tm
+ var niter, avg, stddev
+ var sp, buf : byte[:][3]
+
+ sp = std.bstrtok(buf[:], tm)
+ if sp.len != 3
+ -> `std.None
+ ;;
+
+ match std.intparse(sp[0])
+ | `std.Some n: niter = n
+ | `std.None: -> `std.None
+ ;;
+
+ match std.flt64parse(sp[1])
+ | `std.Some n: avg = n
+ | `std.None: -> `std.None
+ ;;
+
+ match std.flt64parse(sp[2])
+ | `std.Some n: stddev = n
+ | `std.None: -> `std.None
+ ;;
+
+ -> `std.Some `Timing (niter, avg, stddev)
+}
+
diff --git a/mbld/test.myr b/mbld/test.myr
index 292cc58..4d4b2ed 100644
--- a/mbld/test.myr
+++ b/mbld/test.myr
@@ -10,17 +10,26 @@ use "config"
pkg bld =
const test : (b : build#, targs : byte[:][:] -> bool)
+ const bench : (b : build#, targs : byte[:][:] -> bool)
;;
const test = {b, targs
+ -> go(b, targs, "test", false)
+}
+
+const bench = {b, targs
+ -> go(b, targs, "bench", true)
+}
+
+const go = {b, targs, kind, isbench
var failed, ok
var tests
- if !buildtarg(b, "test")
+ if !buildtarg(b, kind)
std.exit(1)
;;
if targs.len == 0
- tests = std.htgetv(b.deps.targs, "test", [][:])
+ tests = std.htgetv(b.deps.targs, kind, [][:])
else
tests = [][:]
for t : targs
@@ -33,7 +42,7 @@ const test = {b, targs
ok = true
failed = [][:]
for t : tests
- if !runtest(b, t, &failed)
+ if !runtest(b, t, isbench, &failed)
ok = false
;;
;;
@@ -62,7 +71,7 @@ const printfailed = {failed
;;
}
-const runtest = {b, n, failed
+const runtest = {b, n, isbench, failed
var dir, res, log, logfd
var sub
@@ -75,7 +84,7 @@ const runtest = {b, n, failed
std.fatal("\nunable to run test: {}\n", m)
| `std.Ok (pid, infd, outfd):
log = std.strcat(std.basename(n.lbl), ".log")
- logfd = std.try(std.openmode(log, std.Owronly | std.Ocreat, 0o644))
+ logfd = std.try(std.openmode(log, std.Owrite | std.Ocreat, 0o644))
sub = showsub(b, n.lbl, outfd, logfd, failed)
std.slfree(log)
std.close(infd)
@@ -91,7 +100,13 @@ const runtest = {b, n, failed
/* if we have subtests, we've already printed the output */
match sub
| `std.Some r: res = r
- | `std.None: mbldput("PASS\n")
+ | `std.None:
+ if isbench
+ mbldput("MISSING TIMING\n")
+ res = false
+ else
+ mbldput("PASS\n")
+ ;;
;;
;;
if !res
diff --git a/mbld/types.myr b/mbld/types.myr
index 307712d..7731cb4 100644
--- a/mbld/types.myr
+++ b/mbld/types.myr
@@ -45,6 +45,7 @@ pkg bld =
islib : bool
istest : bool
+ isbench : bool
install : bool
;;
@@ -57,6 +58,7 @@ pkg bld =
tags : byte[:][:]
durable : bool
istest : bool
+ isbench : bool
;;
type mantarg = struct
@@ -82,6 +84,12 @@ pkg bld =
genar : byte[:]
;;
+ type testresult = union
+ `Pass
+ `Fail byte[:]
+ `Timing (int, flt64, flt64)
+ ;;
+
type depgraph = struct
/* the edges of the graph from both ends */
targs : std.htab(byte[:], node#[:])#
diff --git a/mbldwrap.sh b/mbldwrap.sh
index 33bc8dd..4a9b5c2 100755
--- a/mbldwrap.sh
+++ b/mbldwrap.sh
@@ -7,17 +7,22 @@ if test `uname` = Plan9; then
export MYR_MUSE=`pwd`/muse/$O.out
export MYR_MC=`pwd`/6/$O.out
export MYR_RT=`pwd`/rt/_myrrt.$O
- BOOT="./mk/bootstrap/bootstrap+`uname -s`-`uname -m`.sh"
else
export MYR_MUSE=muse
export MYR_MC=6m
export MYR_RT=`pwd`/rt/_myrrt.o
- BOOT="./mk/bootstrap/bootstrap+`uname -s`-`uname -m`.sh"
fi
-if [ -f mbld/mbld ] || [ -f obj/mbld/mbld ]; then
- ./obj/mbld/mbld $@ || ./mbld/mbld $@ || mbld $@ || \
- (echo "Unable to run mbld $@; have you build successfully"; false)
+if [ -f obj/mbld/mbld ]; then
+ MBLD=obj/mbld/mbld
+elif [ -f mbld/mbld ]; then
+ MBLD=mbld/mbld
else
- mbld || $BOOT
+ MBLD=$(command -v mbld)
+fi
+
+if [ -z "$MBLD" ]; then
+ echo 'could not find mbld: did you run "make bootstrap"?'
+else
+ $MBLD $@
fi
diff --git a/mi/flatten.c b/mi/flatten.c
index 335baa4..d449806 100644
--- a/mi/flatten.c
+++ b/mi/flatten.c
@@ -891,7 +891,7 @@ flattentraititer(Flattenctx *s, Node *n)
Loop l;
Node *lbody, *lclean, *lstep, *lmatch, *lend;
Node *done, *val, *iter, *valptr, *iterptr;
- Node *func, *call, *dcl;
+ Node *func, *call, *dcl, *seq;
Trait *tr;
val = temp(s, n->iterstmt.elt);
@@ -915,7 +915,8 @@ flattentraititer(Flattenctx *s, Node *n)
s->loop.lbrk = lend;
s->loop.body = n->iterstmt.body->block.scope;
- append(s, asn(iter, n->iterstmt.seq));
+ seq = rval(s, n->iterstmt.seq);
+ append(s, asn(iter, seq));
jmp(s, lstep);
flatten(s, lbody);
/* body */
diff --git a/mk/bootstrap/bootstrap+Darwin-x86_64.sh b/mk/bootstrap/bootstrap+Darwin-x86_64.sh
index f217f2e..f6a2e60 100755
--- a/mk/bootstrap/bootstrap+Darwin-x86_64.sh
+++ b/mk/bootstrap/bootstrap+Darwin-x86_64.sh
@@ -2,140 +2,141 @@
# This script is generated by genbootstrap.sh
# to regenerate, run "make bootstrap"
pwd=`pwd`
-echo $pwd/6/6m -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/config.myr && $pwd/6/6m -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/config.myr &&\
-echo as -g -o lib/thread/start.o lib/thread/start+osx-x64.s && as -g -o lib/thread/start.o lib/thread/start+osx-x64.s &&\
-echo as -g -o lib/thread/atomic-impl.o lib/thread/atomic-impl+x64.s && as -g -o lib/thread/atomic-impl.o lib/thread/atomic-impl+x64.s &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/endian.myr && $pwd/6/6m -I . -I lib/sys lib/std/endian.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/result.myr && $pwd/6/6m -I . -I lib/sys lib/std/result.myr &&\
-echo as -g -o lib/std/sjlj-impl.o lib/std/sjlj-impl+posixy-x64.s && as -g -o lib/std/sjlj-impl.o lib/std/sjlj-impl+posixy-x64.s &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/extremum.myr && $pwd/6/6m -I . -I lib/sys lib/std/extremum.myr &&\
-echo as -g -o lib/std/memops-impl.o lib/std/memops-impl+posixy-x64.s && as -g -o lib/std/memops-impl.o lib/std/memops-impl+posixy-x64.s &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/swap.myr && $pwd/6/6m -I . -I lib/sys lib/std/swap.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/slfill.myr && $pwd/6/6m -I . -I lib/sys lib/std/slfill.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/clear.myr && $pwd/6/6m -I . -I lib/sys lib/std/clear.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/sjlj.myr && $pwd/6/6m -I . -I lib/sys lib/std/sjlj.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/fltbits.myr && $pwd/6/6m -I . -I lib/sys lib/std/fltbits.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/option.myr && $pwd/6/6m -I . -I lib/sys lib/std/option.myr &&\
-echo as -g -o lib/std/getbp.o lib/std/getbp+posixy-x64.s && as -g -o lib/std/getbp.o lib/std/getbp+posixy-x64.s &&\
-echo as -g -o lib/sys/syscall.o lib/sys/syscall+osx-x64.s && as -g -o lib/sys/syscall.o lib/sys/syscall+osx-x64.s &&\
-echo $pwd/6/6m lib/sys/systypes.myr && $pwd/6/6m lib/sys/systypes.myr &&\
-echo $pwd/6/6m lib/sys/sys+osx-x64.myr && $pwd/6/6m lib/sys/sys+osx-x64.myr &&\
-echo $pwd/6/6m lib/sys/ifreq+osx.myr && $pwd/6/6m lib/sys/ifreq+osx.myr &&\
-echo as -g -o lib/sys/util.o lib/sys/util+posixy-x64.s && as -g -o lib/sys/util.o lib/sys/util+posixy-x64.s &&\
-echo $pwd/6/6m lib/sys/syserrno+osx.myr && $pwd/6/6m lib/sys/syserrno+osx.myr &&\
-echo ar -rcs lib/sys/libsys.a lib/sys/syserrno.o lib/sys/util.o lib/sys/sys.o lib/sys/systypes.o lib/sys/syscall.o lib/sys/ifreq.o && ar -rcs lib/sys/libsys.a lib/sys/syserrno.o lib/sys/util.o lib/sys/sys.o lib/sys/systypes.o lib/sys/syscall.o lib/sys/ifreq.o &&\
-echo $pwd/muse/muse -o lib/sys/libsys.use -p sys lib/sys/syserrno.use lib/sys/sys.use lib/sys/systypes.use lib/sys/ifreq.use && $pwd/muse/muse -o lib/sys/libsys.use -p sys lib/sys/syserrno.use lib/sys/sys.use lib/sys/systypes.use lib/sys/ifreq.use &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/types.myr && $pwd/6/6m -I . -I lib/sys lib/std/types.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/strfind.myr && $pwd/6/6m -I . -I lib/sys lib/std/strfind.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/units.myr && $pwd/6/6m -I . -I lib/sys lib/std/units.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/backtrace+x64.myr && $pwd/6/6m -I . -I lib/sys lib/std/backtrace+x64.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/memops.myr && $pwd/6/6m -I . -I lib/sys lib/std/memops.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/sleq.myr && $pwd/6/6m -I . -I lib/sys lib/std/sleq.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/hassuffix.myr && $pwd/6/6m -I . -I lib/sys lib/std/hassuffix.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/cstrconv.myr && $pwd/6/6m -I . -I lib/sys lib/std/cstrconv.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/errno.myr && $pwd/6/6m -I . -I lib/sys lib/std/errno.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/syswrap+posixy.myr && $pwd/6/6m -I . -I lib/sys lib/std/syswrap+posixy.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/writeall.myr && $pwd/6/6m -I . -I lib/sys lib/std/writeall.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/consts.myr && $pwd/6/6m -I . -I lib/sys lib/std/consts.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/mkpath.myr && $pwd/6/6m -I . -I lib/sys lib/std/mkpath.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/blat.myr && $pwd/6/6m -I . -I lib/sys lib/std/blat.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/readall.myr && $pwd/6/6m -I . -I lib/sys lib/std/readall.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/now.myr && $pwd/6/6m -I . -I lib/sys lib/std/now.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/die.myr && $pwd/6/6m -I . -I lib/sys lib/std/die.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/slcp.myr && $pwd/6/6m -I . -I lib/sys lib/std/slcp.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/syswrap-ss+osx.myr && $pwd/6/6m -I . -I lib/sys lib/std/syswrap-ss+osx.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/sleep.myr && $pwd/6/6m -I . -I lib/sys lib/std/sleep.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/threadhooks.myr && $pwd/6/6m -I . -I lib/sys lib/std/threadhooks.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/bytealloc.myr && $pwd/6/6m -I . -I lib/sys lib/std/bytealloc.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/alloc.myr && $pwd/6/6m -I . -I lib/sys lib/std/alloc.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/getcwd.myr && $pwd/6/6m -I . -I lib/sys lib/std/getcwd.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/slpop.myr && $pwd/6/6m -I . -I lib/sys lib/std/slpop.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/mk.myr && $pwd/6/6m -I . -I lib/sys lib/std/mk.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/strjoin.myr && $pwd/6/6m -I . -I lib/sys lib/std/strjoin.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/htab.myr && $pwd/6/6m -I . -I lib/sys lib/std/htab.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/slput.myr && $pwd/6/6m -I . -I lib/sys lib/std/slput.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/slpush.myr && $pwd/6/6m -I . -I lib/sys lib/std/slpush.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/slurp.myr && $pwd/6/6m -I . -I lib/sys lib/std/slurp.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/sljoin.myr && $pwd/6/6m -I . -I lib/sys lib/std/sljoin.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/sldup.myr && $pwd/6/6m -I . -I lib/sys lib/std/sldup.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/fndup.myr && $pwd/6/6m -I . -I lib/sys lib/std/fndup.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/dir+osx.myr && $pwd/6/6m -I . -I lib/sys lib/std/dir+osx.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/diriter.myr && $pwd/6/6m -I . -I lib/sys lib/std/diriter.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/dirname.myr && $pwd/6/6m -I . -I lib/sys lib/std/dirname.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/putint.myr && $pwd/6/6m -I . -I lib/sys lib/std/putint.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/utf.myr && $pwd/6/6m -I . -I lib/sys lib/std/utf.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/strbuf.myr && $pwd/6/6m -I . -I lib/sys lib/std/strbuf.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/striter.myr && $pwd/6/6m -I . -I lib/sys lib/std/striter.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/chartype.myr && $pwd/6/6m -I . -I lib/sys lib/std/chartype.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/cmp.myr && $pwd/6/6m -I . -I lib/sys lib/std/cmp.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/search.myr && $pwd/6/6m -I . -I lib/sys lib/std/search.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/hasprefix.myr && $pwd/6/6m -I . -I lib/sys lib/std/hasprefix.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/bigint.myr && $pwd/6/6m -I . -I lib/sys lib/std/bigint.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/fltfmt.myr && $pwd/6/6m -I . -I lib/sys lib/std/fltfmt.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/chomp.myr && $pwd/6/6m -I . -I lib/sys lib/std/chomp.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/intparse.myr && $pwd/6/6m -I . -I lib/sys lib/std/intparse.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/fltparse.myr && $pwd/6/6m -I . -I lib/sys lib/std/fltparse.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/sort.myr && $pwd/6/6m -I . -I lib/sys lib/std/sort.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/hashfuncs.myr && $pwd/6/6m -I . -I lib/sys lib/std/hashfuncs.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/bitset.myr && $pwd/6/6m -I . -I lib/sys lib/std/bitset.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/strstrip.myr && $pwd/6/6m -I . -I lib/sys lib/std/strstrip.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/strsplit.myr && $pwd/6/6m -I . -I lib/sys lib/std/strsplit.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/getint.myr && $pwd/6/6m -I . -I lib/sys lib/std/getint.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/introspect.myr && $pwd/6/6m -I . -I lib/sys lib/std/introspect.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/varargs.myr && $pwd/6/6m -I . -I lib/sys lib/std/varargs.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/fmt.myr && $pwd/6/6m -I . -I lib/sys lib/std/fmt.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/pathjoin.myr && $pwd/6/6m -I . -I lib/sys lib/std/pathjoin.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/try.myr && $pwd/6/6m -I . -I lib/sys lib/std/try.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/netaddr.myr && $pwd/6/6m -I . -I lib/sys lib/std/netaddr.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/env+posixy.myr && $pwd/6/6m -I . -I lib/sys lib/std/env+posixy.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/execvp.myr && $pwd/6/6m -I . -I lib/sys lib/std/execvp.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/iterutil.myr && $pwd/6/6m -I . -I lib/sys lib/std/iterutil.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/assert.myr && $pwd/6/6m -I . -I lib/sys lib/std/assert.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/rand.myr && $pwd/6/6m -I . -I lib/sys lib/std/rand.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/mktemp.myr && $pwd/6/6m -I . -I lib/sys lib/std/mktemp.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/optparse.myr && $pwd/6/6m -I . -I lib/sys lib/std/optparse.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/ipparse.myr && $pwd/6/6m -I . -I lib/sys lib/std/ipparse.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/resolve+posixy.myr && $pwd/6/6m -I . -I lib/sys lib/std/resolve+posixy.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/dialparse+posixy.myr && $pwd/6/6m -I . -I lib/sys lib/std/dialparse+posixy.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/listen+posixy.myr && $pwd/6/6m -I . -I lib/sys lib/std/listen+posixy.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/dial+posixy.myr && $pwd/6/6m -I . -I lib/sys lib/std/dial+posixy.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/fmtfuncs.myr && $pwd/6/6m -I . -I lib/sys lib/std/fmtfuncs.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/wait+posixy.myr && $pwd/6/6m -I . -I lib/sys lib/std/wait+posixy.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/spork.myr && $pwd/6/6m -I . -I lib/sys lib/std/spork.myr &&\
-echo ar -rcs lib/std/libstd.a lib/std/die.o lib/std/hassuffix.o lib/std/sldup.o lib/std/getbp.o lib/std/now.o lib/std/sljoin.o lib/std/readall.o lib/std/cstrconv.o lib/std/slurp.o lib/std/wait.o lib/std/dirname.o lib/std/option.o lib/std/errno.o lib/std/intparse.o lib/std/rand.o lib/std/introspect.o lib/std/syswrap.o lib/std/fltbits.o lib/std/fltparse.o lib/std/strstrip.o lib/std/dir.o lib/std/slpush.o lib/std/memops.o lib/std/ipparse.o lib/std/dialparse.o lib/std/execvp.o lib/std/sjlj.o lib/std/slput.o lib/std/getint.o lib/std/spork.o lib/std/htab.o lib/std/blat.o lib/std/alloc.o lib/std/optparse.o lib/std/chartype.o lib/std/varargs.o lib/std/backtrace.o lib/std/syswrap-ss.o lib/std/slfill.o lib/std/bytealloc.o lib/std/diriter.o lib/std/swap.o lib/std/assert.o lib/std/utf.o lib/std/sort.o lib/std/hashfuncs.o lib/std/clear.o lib/std/striter.o lib/std/dial.o lib/std/iterutil.o lib/std/strjoin.o lib/std/mk.o lib/std/mktemp.o lib/std/chomp.o lib/std/units.o lib/std/memops-impl.o lib/std/fndup.o lib/std/putint.o lib/std/types.o lib/std/mkpath.o lib/std/listen.o lib/std/bigint.o lib/std/fmtfuncs.o lib/std/env.o lib/std/fmt.o lib/std/resolve.o lib/std/extremum.o lib/std/consts.o lib/std/sleq.o lib/std/strbuf.o lib/std/threadhooks.o lib/std/slpop.o lib/std/sjlj-impl.o lib/std/result.o lib/std/strfind.o lib/std/slcp.o lib/std/netaddr.o lib/std/sleep.o lib/std/hasprefix.o lib/std/try.o lib/std/search.o lib/std/writeall.o lib/std/cmp.o lib/std/endian.o lib/std/getcwd.o lib/std/bitset.o lib/std/pathjoin.o lib/std/fltfmt.o lib/std/strsplit.o && ar -rcs lib/std/libstd.a lib/std/die.o lib/std/hassuffix.o lib/std/sldup.o lib/std/getbp.o lib/std/now.o lib/std/sljoin.o lib/std/readall.o lib/std/cstrconv.o lib/std/slurp.o lib/std/wait.o lib/std/dirname.o lib/std/option.o lib/std/errno.o lib/std/intparse.o lib/std/rand.o lib/std/introspect.o lib/std/syswrap.o lib/std/fltbits.o lib/std/fltparse.o lib/std/strstrip.o lib/std/dir.o lib/std/slpush.o lib/std/memops.o lib/std/ipparse.o lib/std/dialparse.o lib/std/execvp.o lib/std/sjlj.o lib/std/slput.o lib/std/getint.o lib/std/spork.o lib/std/htab.o lib/std/blat.o lib/std/alloc.o lib/std/optparse.o lib/std/chartype.o lib/std/varargs.o lib/std/backtrace.o lib/std/syswrap-ss.o lib/std/slfill.o lib/std/bytealloc.o lib/std/diriter.o lib/std/swap.o lib/std/assert.o lib/std/utf.o lib/std/sort.o lib/std/hashfuncs.o lib/std/clear.o lib/std/striter.o lib/std/dial.o lib/std/iterutil.o lib/std/strjoin.o lib/std/mk.o lib/std/mktemp.o lib/std/chomp.o lib/std/units.o lib/std/memops-impl.o lib/std/fndup.o lib/std/putint.o lib/std/types.o lib/std/mkpath.o lib/std/listen.o lib/std/bigint.o lib/std/fmtfuncs.o lib/std/env.o lib/std/fmt.o lib/std/resolve.o lib/std/extremum.o lib/std/consts.o lib/std/sleq.o lib/std/strbuf.o lib/std/threadhooks.o lib/std/slpop.o lib/std/sjlj-impl.o lib/std/result.o lib/std/strfind.o lib/std/slcp.o lib/std/netaddr.o lib/std/sleep.o lib/std/hasprefix.o lib/std/try.o lib/std/search.o lib/std/writeall.o lib/std/cmp.o lib/std/endian.o lib/std/getcwd.o lib/std/bitset.o lib/std/pathjoin.o lib/std/fltfmt.o lib/std/strsplit.o &&\
-echo $pwd/muse/muse -o lib/std/libstd.use -p std lib/std/die.use lib/std/hassuffix.use lib/std/sldup.use lib/std/now.use lib/std/sljoin.use lib/std/readall.use lib/std/cstrconv.use lib/std/slurp.use lib/std/wait.use lib/std/dirname.use lib/std/option.use lib/std/errno.use lib/std/intparse.use lib/std/rand.use lib/std/introspect.use lib/std/syswrap.use lib/std/fltbits.use lib/std/fltparse.use lib/std/strstrip.use lib/std/dir.use lib/std/slpush.use lib/std/memops.use lib/std/ipparse.use lib/std/dialparse.use lib/std/execvp.use lib/std/sjlj.use lib/std/slput.use lib/std/getint.use lib/std/spork.use lib/std/htab.use lib/std/blat.use lib/std/alloc.use lib/std/optparse.use lib/std/chartype.use lib/std/varargs.use lib/std/backtrace.use lib/std/syswrap-ss.use lib/std/slfill.use lib/std/bytealloc.use lib/std/diriter.use lib/std/swap.use lib/std/assert.use lib/std/utf.use lib/std/sort.use lib/std/hashfuncs.use lib/std/clear.use lib/std/striter.use lib/std/dial.use lib/std/iterutil.use lib/std/strjoin.use lib/std/mk.use lib/std/mktemp.use lib/std/chomp.use lib/std/units.use lib/std/fndup.use lib/std/putint.use lib/std/types.use lib/std/mkpath.use lib/std/listen.use lib/std/bigint.use lib/std/fmtfuncs.use lib/std/env.use lib/std/fmt.use lib/std/resolve.use lib/std/extremum.use lib/std/consts.use lib/std/sleq.use lib/std/strbuf.use lib/std/threadhooks.use lib/std/slpop.use lib/std/result.use lib/std/strfind.use lib/std/slcp.use lib/std/netaddr.use lib/std/sleep.use lib/std/hasprefix.use lib/std/try.use lib/std/search.use lib/std/writeall.use lib/std/cmp.use lib/std/endian.use lib/std/getcwd.use lib/std/bitset.use lib/std/pathjoin.use lib/std/fltfmt.use lib/std/strsplit.use && $pwd/muse/muse -o lib/std/libstd.use -p std lib/std/die.use lib/std/hassuffix.use lib/std/sldup.use lib/std/now.use lib/std/sljoin.use lib/std/readall.use lib/std/cstrconv.use lib/std/slurp.use lib/std/wait.use lib/std/dirname.use lib/std/option.use lib/std/errno.use lib/std/intparse.use lib/std/rand.use lib/std/introspect.use lib/std/syswrap.use lib/std/fltbits.use lib/std/fltparse.use lib/std/strstrip.use lib/std/dir.use lib/std/slpush.use lib/std/memops.use lib/std/ipparse.use lib/std/dialparse.use lib/std/execvp.use lib/std/sjlj.use lib/std/slput.use lib/std/getint.use lib/std/spork.use lib/std/htab.use lib/std/blat.use lib/std/alloc.use lib/std/optparse.use lib/std/chartype.use lib/std/varargs.use lib/std/backtrace.use lib/std/syswrap-ss.use lib/std/slfill.use lib/std/bytealloc.use lib/std/diriter.use lib/std/swap.use lib/std/assert.use lib/std/utf.use lib/std/sort.use lib/std/hashfuncs.use lib/std/clear.use lib/std/striter.use lib/std/dial.use lib/std/iterutil.use lib/std/strjoin.use lib/std/mk.use lib/std/mktemp.use lib/std/chomp.use lib/std/units.use lib/std/fndup.use lib/std/putint.use lib/std/types.use lib/std/mkpath.use lib/std/listen.use lib/std/bigint.use lib/std/fmtfuncs.use lib/std/env.use lib/std/fmt.use lib/std/resolve.use lib/std/extremum.use lib/std/consts.use lib/std/sleq.use lib/std/strbuf.use lib/std/threadhooks.use lib/std/slpop.use lib/std/result.use lib/std/strfind.use lib/std/slcp.use lib/std/netaddr.use lib/std/sleep.use lib/std/hasprefix.use lib/std/try.use lib/std/search.use lib/std/writeall.use lib/std/cmp.use lib/std/endian.use lib/std/getcwd.use lib/std/bitset.use lib/std/pathjoin.use lib/std/fltfmt.use lib/std/strsplit.use &&\
-echo $pwd/6/6m -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/types.myr && $pwd/6/6m -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/types.myr &&\
-echo $pwd/6/6m -I lib/sys -I lib/std lib/thread/common.myr && $pwd/6/6m -I lib/sys -I lib/std lib/thread/common.myr &&\
-echo $pwd/6/6m -I lib/sys -I lib/std lib/thread/atomic.myr && $pwd/6/6m -I lib/sys -I lib/std lib/thread/atomic.myr &&\
-echo $pwd/6/6m -I lib/sys -I lib/std lib/thread/mutex.myr && $pwd/6/6m -I lib/sys -I lib/std lib/thread/mutex.myr &&\
-echo $pwd/6/6m -I lib/sys -I lib/std lib/thread/hookstd.myr && $pwd/6/6m -I lib/sys -I lib/std lib/thread/hookstd.myr &&\
-echo $pwd/6/6m -I lib/sys -I lib/std lib/thread/ncpu.myr && $pwd/6/6m -I lib/sys -I lib/std lib/thread/ncpu.myr &&\
-echo $pwd/6/6m -I lib/sys -I lib/std lib/thread/spawn+osx.myr && $pwd/6/6m -I lib/sys -I lib/std lib/thread/spawn+osx.myr &&\
-echo ar -rcs lib/thread/libthread.a lib/thread/mutex.o lib/thread/spawn.o lib/thread/ncpu.o lib/thread/hookstd.o lib/thread/atomic-impl.o lib/thread/start.o lib/thread/atomic.o lib/thread/common.o && ar -rcs lib/thread/libthread.a lib/thread/mutex.o lib/thread/spawn.o lib/thread/ncpu.o lib/thread/hookstd.o lib/thread/atomic-impl.o lib/thread/start.o lib/thread/atomic.o lib/thread/common.o &&\
-echo $pwd/muse/muse -o lib/thread/libthread.use -p thread lib/thread/mutex.use lib/thread/spawn.use lib/thread/ncpu.use lib/thread/hookstd.use lib/thread/atomic.use lib/thread/common.use && $pwd/muse/muse -o lib/thread/libthread.use -p thread lib/thread/mutex.use lib/thread/spawn.use lib/thread/ncpu.use lib/thread/hookstd.use lib/thread/atomic.use lib/thread/common.use &&\
-echo $pwd/6/6m -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/opts.myr && $pwd/6/6m -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/opts.myr &&\
-echo $pwd/6/6m -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/syssel.myr && $pwd/6/6m -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/syssel.myr &&\
-echo $pwd/6/6m -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/util.myr && $pwd/6/6m -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/util.myr &&\
-echo $pwd/6/6m -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/parse.myr && $pwd/6/6m -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/parse.myr &&\
-echo $pwd/6/6m -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/build.myr && $pwd/6/6m -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/build.myr &&\
-echo $pwd/6/6m -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/install.myr && $pwd/6/6m -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/install.myr &&\
-echo $pwd/6/6m -I lib/std -I lib/sys lib/bio/bio.myr && $pwd/6/6m -I lib/std -I lib/sys lib/bio/bio.myr &&\
-echo $pwd/6/6m -I lib/std -I lib/sys lib/bio/mem.myr && $pwd/6/6m -I lib/std -I lib/sys lib/bio/mem.myr &&\
-echo $pwd/6/6m -I lib/std -I lib/sys lib/bio/puti.myr && $pwd/6/6m -I lib/std -I lib/sys lib/bio/puti.myr &&\
-echo $pwd/6/6m -I lib/std -I lib/sys lib/bio/iter.myr && $pwd/6/6m -I lib/std -I lib/sys lib/bio/iter.myr &&\
-echo $pwd/6/6m -I lib/std -I lib/sys lib/bio/geti.myr && $pwd/6/6m -I lib/std -I lib/sys lib/bio/geti.myr &&\
-echo ar -rcs lib/bio/libbio.a lib/bio/bio.o lib/bio/geti.o lib/bio/iter.o lib/bio/puti.o lib/bio/mem.o && ar -rcs lib/bio/libbio.a lib/bio/bio.o lib/bio/geti.o lib/bio/iter.o lib/bio/puti.o lib/bio/mem.o &&\
-echo $pwd/muse/muse -o lib/bio/libbio.use -p bio lib/bio/bio.use lib/bio/geti.use lib/bio/iter.use lib/bio/puti.use lib/bio/mem.use && $pwd/muse/muse -o lib/bio/libbio.use -p bio lib/bio/bio.use lib/bio/geti.use lib/bio/iter.use lib/bio/puti.use lib/bio/mem.use &&\
-echo $pwd/6/6m -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/libs.myr && $pwd/6/6m -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/libs.myr &&\
-echo $pwd/6/6m -I lib/sys -I lib/std lib/regex/types.myr && $pwd/6/6m -I lib/sys -I lib/std lib/regex/types.myr &&\
-echo $pwd/6/6m -I lib/sys -I lib/std lib/regex/interp.myr && $pwd/6/6m -I lib/sys -I lib/std lib/regex/interp.myr &&\
-echo $pwd/6/6m -I lib/sys -I lib/std lib/regex/ranges.myr && $pwd/6/6m -I lib/sys -I lib/std lib/regex/ranges.myr &&\
-echo $pwd/6/6m -I lib/sys -I lib/std lib/regex/compile.myr && $pwd/6/6m -I lib/sys -I lib/std lib/regex/compile.myr &&\
-echo ar -rcs lib/regex/libregex.a lib/regex/interp.o lib/regex/ranges.o lib/regex/compile.o lib/regex/types.o && ar -rcs lib/regex/libregex.a lib/regex/interp.o lib/regex/ranges.o lib/regex/compile.o lib/regex/types.o &&\
-echo $pwd/muse/muse -o lib/regex/libregex.use -p regex lib/regex/interp.use lib/regex/ranges.use lib/regex/compile.use lib/regex/types.use && $pwd/muse/muse -o lib/regex/libregex.use -p regex lib/regex/interp.use lib/regex/ranges.use lib/regex/compile.use lib/regex/types.use &&\
-echo $pwd/6/6m -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/deps.myr && $pwd/6/6m -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/deps.myr &&\
-echo $pwd/6/6m -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/subtest.myr && $pwd/6/6m -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/subtest.myr &&\
-echo $pwd/6/6m -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/test.myr && $pwd/6/6m -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/test.myr &&\
-echo $pwd/6/6m -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/main.myr && $pwd/6/6m -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/main.myr &&\
-echo ld -pagezero_size 0x100000000 -macosx_version_min 10.6 -o mbld/mbld $pwd/rt/_myrrt.o mbld/types.o mbld/config.o mbld/build.o mbld/libs.o mbld/install.o mbld/test.o mbld/util.o mbld/main.o mbld/subtest.o mbld/opts.o mbld/parse.o mbld/syssel.o mbld/deps.o -Llib/thread -lthread -Llib/regex -lregex -Llib/bio -lbio -Llib/std -lstd -Llib/sys -lsys -macosx_version_min 10.6 && ld -pagezero_size 0x100000000 -macosx_version_min 10.6 -o mbld/mbld $pwd/rt/_myrrt.o mbld/types.o mbld/config.o mbld/build.o mbld/libs.o mbld/install.o mbld/test.o mbld/util.o mbld/main.o mbld/subtest.o mbld/opts.o mbld/parse.o mbld/syssel.o mbld/deps.o -Llib/thread -lthread -Llib/regex -lregex -Llib/bio -lbio -Llib/std -lstd -Llib/sys -lsys -macosx_version_min 10.6 &&\
+set -x
+ $pwd/6/6m -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/config.myr
+ as -g -o lib/thread/start.o lib/thread/start+osx-x64.s
+ as -g -o lib/thread/atomic-impl.o lib/thread/atomic-impl+x64.s
+ as -g -o lib/std/getbp.o lib/std/getbp+posixy-x64.s
+ $pwd/6/6m -I . -I lib/sys lib/std/option.myr
+ as -g -o lib/std/memops-impl.o lib/std/memops-impl+posixy-x64.s
+ $pwd/6/6m -I . -I lib/sys lib/std/fltbits.myr
+ as -g -o lib/std/sjlj-impl.o lib/std/sjlj-impl+posixy-x64.s
+ $pwd/6/6m -I . -I lib/sys lib/std/endian.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/extremum.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/sjlj.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/swap.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/slfill.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/clear.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/result.myr
+ as -g -o lib/sys/syscall.o lib/sys/syscall+osx-x64.s
+ $pwd/6/6m lib/sys/systypes.myr
+ $pwd/6/6m lib/sys/sys+osx-x64.myr
+ $pwd/6/6m lib/sys/ifreq+osx.myr
+ as -g -o lib/sys/util.o lib/sys/util+posixy-x64.s
+ $pwd/6/6m lib/sys/syserrno+osx.myr
+ ar -rcs lib/sys/libsys.a lib/sys/sys.o lib/sys/syserrno.o lib/sys/util.o lib/sys/systypes.o lib/sys/ifreq.o lib/sys/syscall.o
+ $pwd/muse/muse -o lib/sys/libsys.use -p sys lib/sys/sys.use lib/sys/syserrno.use lib/sys/systypes.use lib/sys/ifreq.use
+ $pwd/6/6m -I . -I lib/sys lib/std/errno.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/types.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/strfind.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/memops.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/sleq.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/hassuffix.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/backtrace+x64.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/units.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/cstrconv.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/syswrap+posixy.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/mkpath.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/now.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/consts.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/die.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/slcp.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/syswrap-ss+osx.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/sleep.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/chartype.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/utf.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/cmp.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/sort.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/search.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/hasprefix.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/chomp.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/striter.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/intparse.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/strstrip.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/introspect.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/varargs.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/wait+posixy.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/threadhooks.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/bytealloc.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/alloc.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/slurp.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/mk.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/slput.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/htab.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/slpush.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/strsplit.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/strbuf.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/sldup.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/bigint.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/fltparse.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/fltfmt.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/dirname.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/dir+osx.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/diriter.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/fndup.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/strjoin.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/getcwd.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/slpop.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/sljoin.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/getint.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/hashfuncs.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/bitset.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/putint.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/readall.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/blat.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/writeall.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/fmt.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/env+posixy.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/execvp.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/spork.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/assert.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/rand.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/pathjoin.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/mktemp.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/optparse.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/netaddr.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/iterutil.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/ipparse.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/fmtfuncs.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/resolve+posixy.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/dialparse+posixy.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/dial+posixy.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/listen+posixy.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/try.myr
+ ar -rcs lib/std/libstd.a lib/std/resolve.o lib/std/result.o lib/std/try.o lib/std/ipparse.o lib/std/alloc.o lib/std/iterutil.o lib/std/putint.o lib/std/sleq.o lib/std/sljoin.o lib/std/slpop.o lib/std/syswrap.o lib/std/getint.o lib/std/strsplit.o lib/std/slfill.o lib/std/writeall.o lib/std/fltfmt.o lib/std/hasprefix.o lib/std/swap.o lib/std/fmt.o lib/std/netaddr.o lib/std/varargs.o lib/std/diriter.o lib/std/getcwd.o lib/std/blat.o lib/std/optparse.o lib/std/pathjoin.o lib/std/readall.o lib/std/strjoin.o lib/std/threadhooks.o lib/std/sjlj.o lib/std/extremum.o lib/std/endian.o lib/std/rand.o lib/std/sldup.o lib/std/sleep.o lib/std/wait.o lib/std/introspect.o lib/std/fltparse.o lib/std/fndup.o lib/std/strbuf.o lib/std/assert.o lib/std/spork.o lib/std/slpush.o lib/std/strstrip.o lib/std/htab.o lib/std/hashfuncs.o lib/std/slput.o lib/std/sjlj-impl.o lib/std/fltbits.o lib/std/striter.o lib/std/types.o lib/std/cstrconv.o lib/std/units.o lib/std/backtrace.o lib/std/syswrap-ss.o lib/std/die.o lib/std/mk.o lib/std/hassuffix.o lib/std/memops-impl.o lib/std/utf.o lib/std/slurp.o lib/std/dialparse.o lib/std/bytealloc.o lib/std/mktemp.o lib/std/consts.o lib/std/chomp.o lib/std/dir.o lib/std/search.o lib/std/memops.o lib/std/fmtfuncs.o lib/std/strfind.o lib/std/env.o lib/std/dirname.o lib/std/clear.o lib/std/listen.o lib/std/sort.o lib/std/cmp.o lib/std/now.o lib/std/intparse.o lib/std/mkpath.o lib/std/option.o lib/std/dial.o lib/std/errno.o lib/std/chartype.o lib/std/bigint.o lib/std/bitset.o lib/std/getbp.o lib/std/slcp.o lib/std/execvp.o
+ $pwd/muse/muse -o lib/std/libstd.use -p std lib/std/resolve.use lib/std/result.use lib/std/try.use lib/std/ipparse.use lib/std/alloc.use lib/std/iterutil.use lib/std/putint.use lib/std/sleq.use lib/std/sljoin.use lib/std/slpop.use lib/std/syswrap.use lib/std/getint.use lib/std/strsplit.use lib/std/slfill.use lib/std/writeall.use lib/std/fltfmt.use lib/std/hasprefix.use lib/std/swap.use lib/std/fmt.use lib/std/netaddr.use lib/std/varargs.use lib/std/diriter.use lib/std/getcwd.use lib/std/blat.use lib/std/optparse.use lib/std/pathjoin.use lib/std/readall.use lib/std/strjoin.use lib/std/threadhooks.use lib/std/sjlj.use lib/std/extremum.use lib/std/endian.use lib/std/rand.use lib/std/sldup.use lib/std/sleep.use lib/std/wait.use lib/std/introspect.use lib/std/fltparse.use lib/std/fndup.use lib/std/strbuf.use lib/std/assert.use lib/std/spork.use lib/std/slpush.use lib/std/strstrip.use lib/std/htab.use lib/std/hashfuncs.use lib/std/slput.use lib/std/fltbits.use lib/std/striter.use lib/std/types.use lib/std/cstrconv.use lib/std/units.use lib/std/backtrace.use lib/std/syswrap-ss.use lib/std/die.use lib/std/mk.use lib/std/hassuffix.use lib/std/utf.use lib/std/slurp.use lib/std/dialparse.use lib/std/bytealloc.use lib/std/mktemp.use lib/std/consts.use lib/std/chomp.use lib/std/dir.use lib/std/search.use lib/std/memops.use lib/std/fmtfuncs.use lib/std/strfind.use lib/std/env.use lib/std/dirname.use lib/std/clear.use lib/std/listen.use lib/std/sort.use lib/std/cmp.use lib/std/now.use lib/std/intparse.use lib/std/mkpath.use lib/std/option.use lib/std/dial.use lib/std/errno.use lib/std/chartype.use lib/std/bigint.use lib/std/bitset.use lib/std/slcp.use lib/std/execvp.use
+ $pwd/6/6m -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/types.myr
+ $pwd/6/6m -I lib/sys -I lib/std lib/regex/types.myr
+ $pwd/6/6m -I lib/sys -I lib/std lib/regex/interp.myr
+ $pwd/6/6m -I lib/std -I lib/sys lib/bio/bio.myr
+ $pwd/6/6m -I lib/std -I lib/sys lib/bio/iter.myr
+ $pwd/6/6m -I lib/std -I lib/sys lib/bio/mem.myr
+ $pwd/6/6m -I lib/std -I lib/sys lib/bio/geti.myr
+ $pwd/6/6m -I lib/std -I lib/sys lib/bio/puti.myr
+ ar -rcs lib/bio/libbio.a lib/bio/puti.o lib/bio/geti.o lib/bio/mem.o lib/bio/bio.o lib/bio/iter.o
+ $pwd/muse/muse -o lib/bio/libbio.use -p bio lib/bio/puti.use lib/bio/geti.use lib/bio/mem.use lib/bio/bio.use lib/bio/iter.use
+ $pwd/6/6m -I lib/sys -I lib/std lib/thread/spawn+osx.myr
+ $pwd/6/6m -I lib/sys -I lib/std lib/thread/ncpu.myr
+ $pwd/6/6m -I lib/sys -I lib/std lib/thread/common.myr
+ $pwd/6/6m -I lib/sys -I lib/std lib/thread/atomic.myr
+ $pwd/6/6m -I lib/sys -I lib/std lib/thread/mutex.myr
+ $pwd/6/6m -I lib/sys -I lib/std lib/thread/hookstd.myr
+ ar -rcs lib/thread/libthread.a lib/thread/mutex.o lib/thread/atomic.o lib/thread/atomic-impl.o lib/thread/hookstd.o lib/thread/common.o lib/thread/ncpu.o lib/thread/start.o lib/thread/spawn.o
+ $pwd/muse/muse -o lib/thread/libthread.use -p thread lib/thread/mutex.use lib/thread/atomic.use lib/thread/hookstd.use lib/thread/common.use lib/thread/ncpu.use lib/thread/spawn.use
+ $pwd/6/6m -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/opts.myr
+ $pwd/6/6m -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/syssel.myr
+ $pwd/6/6m -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/libs.myr
+ $pwd/6/6m -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/util.myr
+ $pwd/6/6m -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/build.myr
+ $pwd/6/6m -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/install.myr
+ $pwd/6/6m -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/parse.myr
+ $pwd/6/6m -I lib/sys -I lib/std lib/regex/ranges.myr
+ $pwd/6/6m -I lib/sys -I lib/std lib/regex/compile.myr
+ ar -rcs lib/regex/libregex.a lib/regex/interp.o lib/regex/ranges.o lib/regex/types.o lib/regex/compile.o
+ $pwd/muse/muse -o lib/regex/libregex.use -p regex lib/regex/interp.use lib/regex/ranges.use lib/regex/types.use lib/regex/compile.use
+ $pwd/6/6m -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/subtest.myr
+ $pwd/6/6m -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/test.myr
+ $pwd/6/6m -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/deps.myr
+ $pwd/6/6m -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/main.myr
+ ld -pagezero_size 0x100000000 -macosx_version_min 10.6 -o mbld/mbld $pwd/rt/_myrrt.o mbld/deps.o mbld/main.o mbld/util.o mbld/libs.o mbld/syssel.o mbld/config.o mbld/opts.o mbld/subtest.o mbld/types.o mbld/test.o mbld/install.o mbld/parse.o mbld/build.o -Llib/thread -lthread -Llib/bio -lbio -Llib/regex -lregex -Llib/std -lstd -Llib/sys -lsys -macosx_version_min 10.6
true
diff --git a/mk/bootstrap/bootstrap+FreeBSD-amd64.sh b/mk/bootstrap/bootstrap+FreeBSD-amd64.sh
index 1f97e27..c6adb9b 100755
--- a/mk/bootstrap/bootstrap+FreeBSD-amd64.sh
+++ b/mk/bootstrap/bootstrap+FreeBSD-amd64.sh
@@ -6,137 +6,137 @@ set -x
$pwd/6/6m -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/config.myr
as -g -o lib/thread/exit.o lib/thread/exit+freebsd-x64.s
as -g -o lib/thread/atomic-impl.o lib/thread/atomic-impl+x64.s
- $pwd/6/6m -I . -I lib/sys lib/std/endian.myr
- $pwd/6/6m -I . -I lib/sys lib/std/result.myr
+ as -g -o lib/std/getbp.o lib/std/getbp+posixy-x64.s
+ $pwd/6/6m -I . -I lib/sys lib/std/option.myr
+ as -g -o lib/std/memops-impl.o lib/std/memops-impl+posixy-x64.s
+ $pwd/6/6m -I . -I lib/sys lib/std/fltbits.myr
as -g -o lib/std/sjlj-impl.o lib/std/sjlj-impl+posixy-x64.s
+ $pwd/6/6m -I . -I lib/sys lib/std/endian.myr
$pwd/6/6m -I . -I lib/sys lib/std/extremum.myr
- as -g -o lib/std/memops-impl.o lib/std/memops-impl+posixy-x64.s
+ $pwd/6/6m -I . -I lib/sys lib/std/sjlj.myr
$pwd/6/6m -I . -I lib/sys lib/std/swap.myr
$pwd/6/6m -I . -I lib/sys lib/std/slfill.myr
$pwd/6/6m -I . -I lib/sys lib/std/clear.myr
- $pwd/6/6m -I . -I lib/sys lib/std/sjlj.myr
- $pwd/6/6m -I . -I lib/sys lib/std/fltbits.myr
- $pwd/6/6m -I . -I lib/sys lib/std/option.myr
- as -g -o lib/std/getbp.o lib/std/getbp+posixy-x64.s
- $pwd/6/6m lib/sys/ifreq+freebsd.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/result.myr
as -g -o lib/sys/syscall.o lib/sys/syscall+freebsd-x64.s
+ $pwd/6/6m lib/sys/ifreq+freebsd.myr
$pwd/6/6m lib/sys/systypes.myr
- $pwd/6/6m lib/sys/sys+freebsd-x64.myr
as -g -o lib/sys/util.o lib/sys/util+posixy-x64.s
$pwd/6/6m lib/sys/syserrno+freebsd.myr
- ar -rcs lib/sys/libsys.a lib/sys/syserrno.o lib/sys/util.o lib/sys/sys.o lib/sys/systypes.o lib/sys/syscall.o lib/sys/ifreq.o
- $pwd/muse/muse -o lib/sys/libsys.use -p sys lib/sys/syserrno.use lib/sys/sys.use lib/sys/systypes.use lib/sys/ifreq.use
+ $pwd/6/6m lib/sys/sys+freebsd-x64.myr
+ ar -rcs lib/sys/libsys.a lib/sys/sys.o lib/sys/syserrno.o lib/sys/util.o lib/sys/systypes.o lib/sys/ifreq.o lib/sys/syscall.o
+ $pwd/muse/muse -o lib/sys/libsys.use -p sys lib/sys/sys.use lib/sys/syserrno.use lib/sys/systypes.use lib/sys/ifreq.use
+ $pwd/6/6m -I . -I lib/sys lib/std/errno.myr
$pwd/6/6m -I . -I lib/sys lib/std/types.myr
$pwd/6/6m -I . -I lib/sys lib/std/strfind.myr
- $pwd/6/6m -I . -I lib/sys lib/std/units.myr
- $pwd/6/6m -I . -I lib/sys lib/std/backtrace+x64.myr
$pwd/6/6m -I . -I lib/sys lib/std/memops.myr
$pwd/6/6m -I . -I lib/sys lib/std/sleq.myr
$pwd/6/6m -I . -I lib/sys lib/std/hassuffix.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/backtrace+x64.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/units.myr
$pwd/6/6m -I . -I lib/sys lib/std/cstrconv.myr
- $pwd/6/6m -I . -I lib/sys lib/std/errno.myr
$pwd/6/6m -I . -I lib/sys lib/std/syswrap+posixy.myr
- $pwd/6/6m -I . -I lib/sys lib/std/writeall.myr
- $pwd/6/6m -I . -I lib/sys lib/std/consts.myr
$pwd/6/6m -I . -I lib/sys lib/std/mkpath.myr
- $pwd/6/6m -I . -I lib/sys lib/std/blat.myr
- $pwd/6/6m -I . -I lib/sys lib/std/readall.myr
$pwd/6/6m -I . -I lib/sys lib/std/now.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/consts.myr
$pwd/6/6m -I . -I lib/sys lib/std/die.myr
$pwd/6/6m -I . -I lib/sys lib/std/slcp.myr
$pwd/6/6m -I . -I lib/sys lib/std/syswrap-ss+freebsd.myr
$pwd/6/6m -I . -I lib/sys lib/std/sleep.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/chartype.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/utf.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/cmp.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/sort.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/search.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/hasprefix.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/chomp.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/striter.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/intparse.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/strstrip.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/introspect.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/varargs.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/wait+posixy.myr
$pwd/6/6m -I . -I lib/sys lib/std/threadhooks.myr
$pwd/6/6m -I . -I lib/sys lib/std/bytealloc.myr
$pwd/6/6m -I . -I lib/sys lib/std/alloc.myr
- $pwd/6/6m -I . -I lib/sys lib/std/getcwd.myr
- $pwd/6/6m -I . -I lib/sys lib/std/slpop.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/slurp.myr
$pwd/6/6m -I . -I lib/sys lib/std/mk.myr
- $pwd/6/6m -I . -I lib/sys lib/std/strjoin.myr
- $pwd/6/6m -I . -I lib/sys lib/std/htab.myr
$pwd/6/6m -I . -I lib/sys lib/std/slput.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/htab.myr
$pwd/6/6m -I . -I lib/sys lib/std/slpush.myr
- $pwd/6/6m -I . -I lib/sys lib/std/slurp.myr
- $pwd/6/6m -I . -I lib/sys lib/std/sljoin.myr
- $pwd/6/6m -I . -I lib/sys lib/std/sldup.myr
- $pwd/6/6m -I . -I lib/sys lib/std/fndup.myr
- $pwd/6/6m -I . -I lib/sys lib/std/dir+freebsd.myr
- $pwd/6/6m -I . -I lib/sys lib/std/diriter.myr
- $pwd/6/6m -I . -I lib/sys lib/std/dirname.myr
- $pwd/6/6m -I . -I lib/sys lib/std/putint.myr
- $pwd/6/6m -I . -I lib/sys lib/std/utf.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/strsplit.myr
$pwd/6/6m -I . -I lib/sys lib/std/strbuf.myr
- $pwd/6/6m -I . -I lib/sys lib/std/striter.myr
- $pwd/6/6m -I . -I lib/sys lib/std/chartype.myr
- $pwd/6/6m -I . -I lib/sys lib/std/cmp.myr
- $pwd/6/6m -I . -I lib/sys lib/std/search.myr
- $pwd/6/6m -I . -I lib/sys lib/std/hasprefix.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/sldup.myr
$pwd/6/6m -I . -I lib/sys lib/std/bigint.myr
- $pwd/6/6m -I . -I lib/sys lib/std/fltfmt.myr
- $pwd/6/6m -I . -I lib/sys lib/std/chomp.myr
- $pwd/6/6m -I . -I lib/sys lib/std/intparse.myr
$pwd/6/6m -I . -I lib/sys lib/std/fltparse.myr
- $pwd/6/6m -I . -I lib/sys lib/std/sort.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/fltfmt.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/dirname.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/dir+freebsd.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/diriter.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/fndup.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/strjoin.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/getcwd.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/slpop.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/sljoin.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/getint.myr
$pwd/6/6m -I . -I lib/sys lib/std/hashfuncs.myr
$pwd/6/6m -I . -I lib/sys lib/std/bitset.myr
- $pwd/6/6m -I . -I lib/sys lib/std/strstrip.myr
- $pwd/6/6m -I . -I lib/sys lib/std/strsplit.myr
- $pwd/6/6m -I . -I lib/sys lib/std/getint.myr
- $pwd/6/6m -I . -I lib/sys lib/std/introspect.myr
- $pwd/6/6m -I . -I lib/sys lib/std/varargs.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/putint.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/readall.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/blat.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/writeall.myr
$pwd/6/6m -I . -I lib/sys lib/std/fmt.myr
- $pwd/6/6m -I . -I lib/sys lib/std/pathjoin.myr
- $pwd/6/6m -I . -I lib/sys lib/std/try.myr
- $pwd/6/6m -I . -I lib/sys lib/std/netaddr.myr
$pwd/6/6m -I . -I lib/sys lib/std/env+posixy.myr
$pwd/6/6m -I . -I lib/sys lib/std/execvp.myr
- $pwd/6/6m -I . -I lib/sys lib/std/iterutil.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/spork.myr
$pwd/6/6m -I . -I lib/sys lib/std/assert.myr
$pwd/6/6m -I . -I lib/sys lib/std/rand.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/pathjoin.myr
$pwd/6/6m -I . -I lib/sys lib/std/mktemp.myr
$pwd/6/6m -I . -I lib/sys lib/std/optparse.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/netaddr.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/iterutil.myr
$pwd/6/6m -I . -I lib/sys lib/std/ipparse.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/fmtfuncs.myr
$pwd/6/6m -I . -I lib/sys lib/std/resolve+posixy.myr
$pwd/6/6m -I . -I lib/sys lib/std/dialparse+posixy.myr
- $pwd/6/6m -I . -I lib/sys lib/std/listen+posixy.myr
$pwd/6/6m -I . -I lib/sys lib/std/dial+posixy.myr
- $pwd/6/6m -I . -I lib/sys lib/std/fmtfuncs.myr
- $pwd/6/6m -I . -I lib/sys lib/std/wait+posixy.myr
- $pwd/6/6m -I . -I lib/sys lib/std/spork.myr
- ar -rcs lib/std/libstd.a lib/std/die.o lib/std/hassuffix.o lib/std/sldup.o lib/std/getbp.o lib/std/now.o lib/std/sljoin.o lib/std/readall.o lib/std/cstrconv.o lib/std/slurp.o lib/std/wait.o lib/std/dirname.o lib/std/option.o lib/std/errno.o lib/std/intparse.o lib/std/rand.o lib/std/introspect.o lib/std/syswrap.o lib/std/fltbits.o lib/std/fltparse.o lib/std/strstrip.o lib/std/dir.o lib/std/slpush.o lib/std/memops.o lib/std/ipparse.o lib/std/dialparse.o lib/std/execvp.o lib/std/sjlj.o lib/std/slput.o lib/std/getint.o lib/std/spork.o lib/std/htab.o lib/std/blat.o lib/std/alloc.o lib/std/optparse.o lib/std/chartype.o lib/std/varargs.o lib/std/backtrace.o lib/std/syswrap-ss.o lib/std/slfill.o lib/std/bytealloc.o lib/std/diriter.o lib/std/swap.o lib/std/assert.o lib/std/utf.o lib/std/sort.o lib/std/hashfuncs.o lib/std/clear.o lib/std/striter.o lib/std/dial.o lib/std/iterutil.o lib/std/strjoin.o lib/std/mk.o lib/std/mktemp.o lib/std/chomp.o lib/std/units.o lib/std/memops-impl.o lib/std/fndup.o lib/std/putint.o lib/std/types.o lib/std/mkpath.o lib/std/listen.o lib/std/bigint.o lib/std/fmtfuncs.o lib/std/env.o lib/std/fmt.o lib/std/resolve.o lib/std/extremum.o lib/std/consts.o lib/std/sleq.o lib/std/strbuf.o lib/std/threadhooks.o lib/std/slpop.o lib/std/sjlj-impl.o lib/std/result.o lib/std/strfind.o lib/std/slcp.o lib/std/netaddr.o lib/std/sleep.o lib/std/hasprefix.o lib/std/try.o lib/std/search.o lib/std/writeall.o lib/std/cmp.o lib/std/endian.o lib/std/getcwd.o lib/std/bitset.o lib/std/pathjoin.o lib/std/fltfmt.o lib/std/strsplit.o
- $pwd/muse/muse -o lib/std/libstd.use -p std lib/std/die.use lib/std/hassuffix.use lib/std/sldup.use lib/std/now.use lib/std/sljoin.use lib/std/readall.use lib/std/cstrconv.use lib/std/slurp.use lib/std/wait.use lib/std/dirname.use lib/std/option.use lib/std/errno.use lib/std/intparse.use lib/std/rand.use lib/std/introspect.use lib/std/syswrap.use lib/std/fltbits.use lib/std/fltparse.use lib/std/strstrip.use lib/std/dir.use lib/std/slpush.use lib/std/memops.use lib/std/ipparse.use lib/std/dialparse.use lib/std/execvp.use lib/std/sjlj.use lib/std/slput.use lib/std/getint.use lib/std/spork.use lib/std/htab.use lib/std/blat.use lib/std/alloc.use lib/std/optparse.use lib/std/chartype.use lib/std/varargs.use lib/std/backtrace.use lib/std/syswrap-ss.use lib/std/slfill.use lib/std/bytealloc.use lib/std/diriter.use lib/std/swap.use lib/std/assert.use lib/std/utf.use lib/std/sort.use lib/std/hashfuncs.use lib/std/clear.use lib/std/striter.use lib/std/dial.use lib/std/iterutil.use lib/std/strjoin.use lib/std/mk.use lib/std/mktemp.use lib/std/chomp.use lib/std/units.use lib/std/fndup.use lib/std/putint.use lib/std/types.use lib/std/mkpath.use lib/std/listen.use lib/std/bigint.use lib/std/fmtfuncs.use lib/std/env.use lib/std/fmt.use lib/std/resolve.use lib/std/extremum.use lib/std/consts.use lib/std/sleq.use lib/std/strbuf.use lib/std/threadhooks.use lib/std/slpop.use lib/std/result.use lib/std/strfind.use lib/std/slcp.use lib/std/netaddr.use lib/std/sleep.use lib/std/hasprefix.use lib/std/try.use lib/std/search.use lib/std/writeall.use lib/std/cmp.use lib/std/endian.use lib/std/getcwd.use lib/std/bitset.use lib/std/pathjoin.use lib/std/fltfmt.use lib/std/strsplit.use
+ $pwd/6/6m -I . -I lib/sys lib/std/listen+posixy.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/try.myr
+ ar -rcs lib/std/libstd.a lib/std/resolve.o lib/std/result.o lib/std/try.o lib/std/ipparse.o lib/std/alloc.o lib/std/iterutil.o lib/std/putint.o lib/std/sleq.o lib/std/sljoin.o lib/std/slpop.o lib/std/syswrap.o lib/std/getint.o lib/std/strsplit.o lib/std/slfill.o lib/std/writeall.o lib/std/fltfmt.o lib/std/hasprefix.o lib/std/swap.o lib/std/fmt.o lib/std/netaddr.o lib/std/varargs.o lib/std/diriter.o lib/std/getcwd.o lib/std/blat.o lib/std/optparse.o lib/std/pathjoin.o lib/std/readall.o lib/std/strjoin.o lib/std/threadhooks.o lib/std/sjlj.o lib/std/extremum.o lib/std/endian.o lib/std/rand.o lib/std/sldup.o lib/std/sleep.o lib/std/wait.o lib/std/introspect.o lib/std/fltparse.o lib/std/fndup.o lib/std/strbuf.o lib/std/assert.o lib/std/spork.o lib/std/slpush.o lib/std/strstrip.o lib/std/htab.o lib/std/hashfuncs.o lib/std/slput.o lib/std/sjlj-impl.o lib/std/fltbits.o lib/std/striter.o lib/std/types.o lib/std/cstrconv.o lib/std/units.o lib/std/backtrace.o lib/std/syswrap-ss.o lib/std/die.o lib/std/mk.o lib/std/hassuffix.o lib/std/memops-impl.o lib/std/utf.o lib/std/slurp.o lib/std/dialparse.o lib/std/bytealloc.o lib/std/mktemp.o lib/std/consts.o lib/std/chomp.o lib/std/dir.o lib/std/search.o lib/std/memops.o lib/std/fmtfuncs.o lib/std/strfind.o lib/std/env.o lib/std/dirname.o lib/std/clear.o lib/std/listen.o lib/std/sort.o lib/std/cmp.o lib/std/now.o lib/std/intparse.o lib/std/mkpath.o lib/std/option.o lib/std/dial.o lib/std/errno.o lib/std/chartype.o lib/std/bigint.o lib/std/bitset.o lib/std/getbp.o lib/std/slcp.o lib/std/execvp.o
+ $pwd/muse/muse -o lib/std/libstd.use -p std lib/std/resolve.use lib/std/result.use lib/std/try.use lib/std/ipparse.use lib/std/alloc.use lib/std/iterutil.use lib/std/putint.use lib/std/sleq.use lib/std/sljoin.use lib/std/slpop.use lib/std/syswrap.use lib/std/getint.use lib/std/strsplit.use lib/std/slfill.use lib/std/writeall.use lib/std/fltfmt.use lib/std/hasprefix.use lib/std/swap.use lib/std/fmt.use lib/std/netaddr.use lib/std/varargs.use lib/std/diriter.use lib/std/getcwd.use lib/std/blat.use lib/std/optparse.use lib/std/pathjoin.use lib/std/readall.use lib/std/strjoin.use lib/std/threadhooks.use lib/std/sjlj.use lib/std/extremum.use lib/std/endian.use lib/std/rand.use lib/std/sldup.use lib/std/sleep.use lib/std/wait.use lib/std/introspect.use lib/std/fltparse.use lib/std/fndup.use lib/std/strbuf.use lib/std/assert.use lib/std/spork.use lib/std/slpush.use lib/std/strstrip.use lib/std/htab.use lib/std/hashfuncs.use lib/std/slput.use lib/std/fltbits.use lib/std/striter.use lib/std/types.use lib/std/cstrconv.use lib/std/units.use lib/std/backtrace.use lib/std/syswrap-ss.use lib/std/die.use lib/std/mk.use lib/std/hassuffix.use lib/std/utf.use lib/std/slurp.use lib/std/dialparse.use lib/std/bytealloc.use lib/std/mktemp.use lib/std/consts.use lib/std/chomp.use lib/std/dir.use lib/std/search.use lib/std/memops.use lib/std/fmtfuncs.use lib/std/strfind.use lib/std/env.use lib/std/dirname.use lib/std/clear.use lib/std/listen.use lib/std/sort.use lib/std/cmp.use lib/std/now.use lib/std/intparse.use lib/std/mkpath.use lib/std/option.use lib/std/dial.use lib/std/errno.use lib/std/chartype.use lib/std/bigint.use lib/std/bitset.use lib/std/slcp.use lib/std/execvp.use
$pwd/6/6m -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/types.myr
+ $pwd/6/6m -I lib/sys -I lib/std lib/regex/types.myr
+ $pwd/6/6m -I lib/sys -I lib/std lib/regex/interp.myr
+ $pwd/6/6m -I lib/std -I lib/sys lib/bio/bio.myr
+ $pwd/6/6m -I lib/std -I lib/sys lib/bio/iter.myr
+ $pwd/6/6m -I lib/std -I lib/sys lib/bio/mem.myr
+ $pwd/6/6m -I lib/std -I lib/sys lib/bio/geti.myr
+ $pwd/6/6m -I lib/std -I lib/sys lib/bio/puti.myr
+ ar -rcs lib/bio/libbio.a lib/bio/puti.o lib/bio/geti.o lib/bio/mem.o lib/bio/bio.o lib/bio/iter.o
+ $pwd/muse/muse -o lib/bio/libbio.use -p bio lib/bio/puti.use lib/bio/geti.use lib/bio/mem.use lib/bio/bio.use lib/bio/iter.use
+ $pwd/6/6m -I lib/sys -I lib/std lib/thread/spawn+freebsd.myr
+ $pwd/6/6m -I lib/sys -I lib/std lib/thread/ncpu+freebsd.myr
$pwd/6/6m -I lib/sys -I lib/std lib/thread/common.myr
$pwd/6/6m -I lib/sys -I lib/std lib/thread/atomic.myr
$pwd/6/6m -I lib/sys -I lib/std lib/thread/mutex+freebsd.myr
$pwd/6/6m -I lib/sys -I lib/std lib/thread/hookstd.myr
- $pwd/6/6m -I lib/sys -I lib/std lib/thread/ncpu+freebsd.myr
- $pwd/6/6m -I lib/sys -I lib/std lib/thread/spawn+freebsd.myr
- ar -rcs lib/thread/libthread.a lib/thread/mutex.o lib/thread/spawn.o lib/thread/ncpu.o lib/thread/hookstd.o lib/thread/atomic-impl.o lib/thread/atomic.o lib/thread/common.o lib/thread/exit.o
- $pwd/muse/muse -o lib/thread/libthread.use -p thread lib/thread/mutex.use lib/thread/spawn.use lib/thread/ncpu.use lib/thread/hookstd.use lib/thread/atomic.use lib/thread/common.use
+ ar -rcs lib/thread/libthread.a lib/thread/mutex.o lib/thread/atomic.o lib/thread/atomic-impl.o lib/thread/hookstd.o lib/thread/common.o lib/thread/ncpu.o lib/thread/exit.o lib/thread/spawn.o
+ $pwd/muse/muse -o lib/thread/libthread.use -p thread lib/thread/mutex.use lib/thread/atomic.use lib/thread/hookstd.use lib/thread/common.use lib/thread/ncpu.use lib/thread/spawn.use
$pwd/6/6m -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/opts.myr
$pwd/6/6m -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/syssel.myr
+ $pwd/6/6m -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/libs.myr
$pwd/6/6m -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/util.myr
- $pwd/6/6m -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/parse.myr
$pwd/6/6m -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/build.myr
$pwd/6/6m -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/install.myr
- $pwd/6/6m -I lib/std -I lib/sys lib/bio/bio.myr
- $pwd/6/6m -I lib/std -I lib/sys lib/bio/mem.myr
- $pwd/6/6m -I lib/std -I lib/sys lib/bio/puti.myr
- $pwd/6/6m -I lib/std -I lib/sys lib/bio/iter.myr
- $pwd/6/6m -I lib/std -I lib/sys lib/bio/geti.myr
- ar -rcs lib/bio/libbio.a lib/bio/bio.o lib/bio/geti.o lib/bio/iter.o lib/bio/puti.o lib/bio/mem.o
- $pwd/muse/muse -o lib/bio/libbio.use -p bio lib/bio/bio.use lib/bio/geti.use lib/bio/iter.use lib/bio/puti.use lib/bio/mem.use
- $pwd/6/6m -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/libs.myr
- $pwd/6/6m -I lib/sys -I lib/std lib/regex/types.myr
- $pwd/6/6m -I lib/sys -I lib/std lib/regex/interp.myr
+ $pwd/6/6m -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/parse.myr
$pwd/6/6m -I lib/sys -I lib/std lib/regex/ranges.myr
$pwd/6/6m -I lib/sys -I lib/std lib/regex/compile.myr
- ar -rcs lib/regex/libregex.a lib/regex/interp.o lib/regex/ranges.o lib/regex/compile.o lib/regex/types.o
- $pwd/muse/muse -o lib/regex/libregex.use -p regex lib/regex/interp.use lib/regex/ranges.use lib/regex/compile.use lib/regex/types.use
- $pwd/6/6m -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/deps.myr
+ ar -rcs lib/regex/libregex.a lib/regex/interp.o lib/regex/ranges.o lib/regex/types.o lib/regex/compile.o
+ $pwd/muse/muse -o lib/regex/libregex.use -p regex lib/regex/interp.use lib/regex/ranges.use lib/regex/types.use lib/regex/compile.use
$pwd/6/6m -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/subtest.myr
$pwd/6/6m -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/test.myr
+ $pwd/6/6m -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/deps.myr
$pwd/6/6m -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/main.myr
- ld -o mbld/mbld $pwd/rt/_myrrt.o mbld/types.o mbld/config.o mbld/build.o mbld/libs.o mbld/install.o mbld/test.o mbld/util.o mbld/main.o mbld/subtest.o mbld/opts.o mbld/parse.o mbld/syssel.o mbld/deps.o -Llib/thread -lthread -Llib/regex -lregex -Llib/bio -lbio -Llib/std -lstd -Llib/sys -lsys
+ ld -o mbld/mbld $pwd/rt/_myrrt.o mbld/deps.o mbld/main.o mbld/util.o mbld/libs.o mbld/syssel.o mbld/config.o mbld/opts.o mbld/subtest.o mbld/types.o mbld/test.o mbld/install.o mbld/parse.o mbld/build.o -Llib/thread -lthread -Llib/bio -lbio -Llib/regex -lregex -Llib/std -lstd -Llib/sys -lsys
true
diff --git a/mk/bootstrap/bootstrap+Linux-x86_64.sh b/mk/bootstrap/bootstrap+Linux-x86_64.sh
index 549eea5..270baa7 100755
--- a/mk/bootstrap/bootstrap+Linux-x86_64.sh
+++ b/mk/bootstrap/bootstrap+Linux-x86_64.sh
@@ -2,140 +2,141 @@
# This script is generated by genbootstrap.sh
# to regenerate, run "make bootstrap"
pwd=`pwd`
-echo $pwd/6/6m -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/config.myr && $pwd/6/6m -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/config.myr &&\
-echo as -g -o lib/thread/exit.o lib/thread/exit+linux-x64.s && as -g -o lib/thread/exit.o lib/thread/exit+linux-x64.s &&\
-echo as -g -o lib/thread/atomic-impl.o lib/thread/atomic-impl+x64.s && as -g -o lib/thread/atomic-impl.o lib/thread/atomic-impl+x64.s &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/endian.myr && $pwd/6/6m -I . -I lib/sys lib/std/endian.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/result.myr && $pwd/6/6m -I . -I lib/sys lib/std/result.myr &&\
-echo as -g -o lib/std/sjlj-impl.o lib/std/sjlj-impl+posixy-x64.s && as -g -o lib/std/sjlj-impl.o lib/std/sjlj-impl+posixy-x64.s &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/extremum.myr && $pwd/6/6m -I . -I lib/sys lib/std/extremum.myr &&\
-echo as -g -o lib/std/memops-impl.o lib/std/memops-impl+posixy-x64.s && as -g -o lib/std/memops-impl.o lib/std/memops-impl+posixy-x64.s &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/swap.myr && $pwd/6/6m -I . -I lib/sys lib/std/swap.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/slfill.myr && $pwd/6/6m -I . -I lib/sys lib/std/slfill.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/clear.myr && $pwd/6/6m -I . -I lib/sys lib/std/clear.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/sjlj.myr && $pwd/6/6m -I . -I lib/sys lib/std/sjlj.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/fltbits.myr && $pwd/6/6m -I . -I lib/sys lib/std/fltbits.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/option.myr && $pwd/6/6m -I . -I lib/sys lib/std/option.myr &&\
-echo as -g -o lib/std/getbp.o lib/std/getbp+posixy-x64.s && as -g -o lib/std/getbp.o lib/std/getbp+posixy-x64.s &&\
-echo as -g -o lib/sys/syscall.o lib/sys/syscall+linux-x64.s && as -g -o lib/sys/syscall.o lib/sys/syscall+linux-x64.s &&\
-echo $pwd/6/6m lib/sys/systypes.myr && $pwd/6/6m lib/sys/systypes.myr &&\
-echo $pwd/6/6m lib/sys/sys+linux-x64.myr && $pwd/6/6m lib/sys/sys+linux-x64.myr &&\
-echo $pwd/6/6m lib/sys/ifreq+linux.myr && $pwd/6/6m lib/sys/ifreq+linux.myr &&\
-echo as -g -o lib/sys/util.o lib/sys/util+posixy-x64.s && as -g -o lib/sys/util.o lib/sys/util+posixy-x64.s &&\
-echo $pwd/6/6m lib/sys/syserrno+linux.myr && $pwd/6/6m lib/sys/syserrno+linux.myr &&\
-echo ar -rcs lib/sys/libsys.a lib/sys/syserrno.o lib/sys/util.o lib/sys/sys.o lib/sys/systypes.o lib/sys/syscall.o lib/sys/ifreq.o && ar -rcs lib/sys/libsys.a lib/sys/syserrno.o lib/sys/util.o lib/sys/sys.o lib/sys/systypes.o lib/sys/syscall.o lib/sys/ifreq.o &&\
-echo $pwd/muse/muse -o lib/sys/libsys.use -p sys lib/sys/syserrno.use lib/sys/sys.use lib/sys/systypes.use lib/sys/ifreq.use && $pwd/muse/muse -o lib/sys/libsys.use -p sys lib/sys/syserrno.use lib/sys/sys.use lib/sys/systypes.use lib/sys/ifreq.use &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/types.myr && $pwd/6/6m -I . -I lib/sys lib/std/types.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/strfind.myr && $pwd/6/6m -I . -I lib/sys lib/std/strfind.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/units.myr && $pwd/6/6m -I . -I lib/sys lib/std/units.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/backtrace+x64.myr && $pwd/6/6m -I . -I lib/sys lib/std/backtrace+x64.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/memops.myr && $pwd/6/6m -I . -I lib/sys lib/std/memops.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/sleq.myr && $pwd/6/6m -I . -I lib/sys lib/std/sleq.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/hassuffix.myr && $pwd/6/6m -I . -I lib/sys lib/std/hassuffix.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/cstrconv.myr && $pwd/6/6m -I . -I lib/sys lib/std/cstrconv.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/errno.myr && $pwd/6/6m -I . -I lib/sys lib/std/errno.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/syswrap-ss+linux.myr && $pwd/6/6m -I . -I lib/sys lib/std/syswrap-ss+linux.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/sleep.myr && $pwd/6/6m -I . -I lib/sys lib/std/sleep.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/syswrap+posixy.myr && $pwd/6/6m -I . -I lib/sys lib/std/syswrap+posixy.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/writeall.myr && $pwd/6/6m -I . -I lib/sys lib/std/writeall.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/consts.myr && $pwd/6/6m -I . -I lib/sys lib/std/consts.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/mkpath.myr && $pwd/6/6m -I . -I lib/sys lib/std/mkpath.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/blat.myr && $pwd/6/6m -I . -I lib/sys lib/std/blat.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/readall.myr && $pwd/6/6m -I . -I lib/sys lib/std/readall.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/now.myr && $pwd/6/6m -I . -I lib/sys lib/std/now.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/die.myr && $pwd/6/6m -I . -I lib/sys lib/std/die.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/slcp.myr && $pwd/6/6m -I . -I lib/sys lib/std/slcp.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/threadhooks.myr && $pwd/6/6m -I . -I lib/sys lib/std/threadhooks.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/bytealloc.myr && $pwd/6/6m -I . -I lib/sys lib/std/bytealloc.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/alloc.myr && $pwd/6/6m -I . -I lib/sys lib/std/alloc.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/getcwd.myr && $pwd/6/6m -I . -I lib/sys lib/std/getcwd.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/slpop.myr && $pwd/6/6m -I . -I lib/sys lib/std/slpop.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/mk.myr && $pwd/6/6m -I . -I lib/sys lib/std/mk.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/strjoin.myr && $pwd/6/6m -I . -I lib/sys lib/std/strjoin.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/htab.myr && $pwd/6/6m -I . -I lib/sys lib/std/htab.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/slput.myr && $pwd/6/6m -I . -I lib/sys lib/std/slput.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/slpush.myr && $pwd/6/6m -I . -I lib/sys lib/std/slpush.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/slurp.myr && $pwd/6/6m -I . -I lib/sys lib/std/slurp.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/sljoin.myr && $pwd/6/6m -I . -I lib/sys lib/std/sljoin.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/sldup.myr && $pwd/6/6m -I . -I lib/sys lib/std/sldup.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/fndup.myr && $pwd/6/6m -I . -I lib/sys lib/std/fndup.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/dir+linux.myr && $pwd/6/6m -I . -I lib/sys lib/std/dir+linux.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/diriter.myr && $pwd/6/6m -I . -I lib/sys lib/std/diriter.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/dirname.myr && $pwd/6/6m -I . -I lib/sys lib/std/dirname.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/putint.myr && $pwd/6/6m -I . -I lib/sys lib/std/putint.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/utf.myr && $pwd/6/6m -I . -I lib/sys lib/std/utf.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/strbuf.myr && $pwd/6/6m -I . -I lib/sys lib/std/strbuf.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/striter.myr && $pwd/6/6m -I . -I lib/sys lib/std/striter.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/chartype.myr && $pwd/6/6m -I . -I lib/sys lib/std/chartype.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/cmp.myr && $pwd/6/6m -I . -I lib/sys lib/std/cmp.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/search.myr && $pwd/6/6m -I . -I lib/sys lib/std/search.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/hasprefix.myr && $pwd/6/6m -I . -I lib/sys lib/std/hasprefix.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/bigint.myr && $pwd/6/6m -I . -I lib/sys lib/std/bigint.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/fltfmt.myr && $pwd/6/6m -I . -I lib/sys lib/std/fltfmt.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/chomp.myr && $pwd/6/6m -I . -I lib/sys lib/std/chomp.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/intparse.myr && $pwd/6/6m -I . -I lib/sys lib/std/intparse.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/fltparse.myr && $pwd/6/6m -I . -I lib/sys lib/std/fltparse.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/sort.myr && $pwd/6/6m -I . -I lib/sys lib/std/sort.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/hashfuncs.myr && $pwd/6/6m -I . -I lib/sys lib/std/hashfuncs.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/bitset.myr && $pwd/6/6m -I . -I lib/sys lib/std/bitset.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/strstrip.myr && $pwd/6/6m -I . -I lib/sys lib/std/strstrip.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/strsplit.myr && $pwd/6/6m -I . -I lib/sys lib/std/strsplit.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/getint.myr && $pwd/6/6m -I . -I lib/sys lib/std/getint.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/introspect.myr && $pwd/6/6m -I . -I lib/sys lib/std/introspect.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/varargs.myr && $pwd/6/6m -I . -I lib/sys lib/std/varargs.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/fmt.myr && $pwd/6/6m -I . -I lib/sys lib/std/fmt.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/pathjoin.myr && $pwd/6/6m -I . -I lib/sys lib/std/pathjoin.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/try.myr && $pwd/6/6m -I . -I lib/sys lib/std/try.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/netaddr.myr && $pwd/6/6m -I . -I lib/sys lib/std/netaddr.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/env+posixy.myr && $pwd/6/6m -I . -I lib/sys lib/std/env+posixy.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/execvp.myr && $pwd/6/6m -I . -I lib/sys lib/std/execvp.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/iterutil.myr && $pwd/6/6m -I . -I lib/sys lib/std/iterutil.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/assert.myr && $pwd/6/6m -I . -I lib/sys lib/std/assert.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/rand.myr && $pwd/6/6m -I . -I lib/sys lib/std/rand.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/mktemp.myr && $pwd/6/6m -I . -I lib/sys lib/std/mktemp.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/optparse.myr && $pwd/6/6m -I . -I lib/sys lib/std/optparse.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/ipparse.myr && $pwd/6/6m -I . -I lib/sys lib/std/ipparse.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/resolve+posixy.myr && $pwd/6/6m -I . -I lib/sys lib/std/resolve+posixy.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/dialparse+posixy.myr && $pwd/6/6m -I . -I lib/sys lib/std/dialparse+posixy.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/listen+posixy.myr && $pwd/6/6m -I . -I lib/sys lib/std/listen+posixy.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/dial+posixy.myr && $pwd/6/6m -I . -I lib/sys lib/std/dial+posixy.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/fmtfuncs.myr && $pwd/6/6m -I . -I lib/sys lib/std/fmtfuncs.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/wait+posixy.myr && $pwd/6/6m -I . -I lib/sys lib/std/wait+posixy.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/spork.myr && $pwd/6/6m -I . -I lib/sys lib/std/spork.myr &&\
-echo ar -rcs lib/std/libstd.a lib/std/die.o lib/std/hassuffix.o lib/std/sldup.o lib/std/getbp.o lib/std/now.o lib/std/sljoin.o lib/std/readall.o lib/std/cstrconv.o lib/std/slurp.o lib/std/wait.o lib/std/dirname.o lib/std/option.o lib/std/errno.o lib/std/intparse.o lib/std/rand.o lib/std/introspect.o lib/std/syswrap.o lib/std/fltbits.o lib/std/fltparse.o lib/std/strstrip.o lib/std/dir.o lib/std/slpush.o lib/std/memops.o lib/std/ipparse.o lib/std/dialparse.o lib/std/execvp.o lib/std/sjlj.o lib/std/slput.o lib/std/getint.o lib/std/spork.o lib/std/htab.o lib/std/blat.o lib/std/alloc.o lib/std/optparse.o lib/std/chartype.o lib/std/varargs.o lib/std/backtrace.o lib/std/syswrap-ss.o lib/std/slfill.o lib/std/bytealloc.o lib/std/diriter.o lib/std/swap.o lib/std/assert.o lib/std/utf.o lib/std/sort.o lib/std/hashfuncs.o lib/std/clear.o lib/std/striter.o lib/std/dial.o lib/std/iterutil.o lib/std/strjoin.o lib/std/mk.o lib/std/mktemp.o lib/std/chomp.o lib/std/units.o lib/std/memops-impl.o lib/std/fndup.o lib/std/putint.o lib/std/types.o lib/std/mkpath.o lib/std/listen.o lib/std/bigint.o lib/std/fmtfuncs.o lib/std/env.o lib/std/fmt.o lib/std/resolve.o lib/std/extremum.o lib/std/consts.o lib/std/sleq.o lib/std/strbuf.o lib/std/threadhooks.o lib/std/slpop.o lib/std/sjlj-impl.o lib/std/result.o lib/std/strfind.o lib/std/slcp.o lib/std/netaddr.o lib/std/sleep.o lib/std/hasprefix.o lib/std/try.o lib/std/search.o lib/std/writeall.o lib/std/cmp.o lib/std/endian.o lib/std/getcwd.o lib/std/bitset.o lib/std/pathjoin.o lib/std/fltfmt.o lib/std/strsplit.o && ar -rcs lib/std/libstd.a lib/std/die.o lib/std/hassuffix.o lib/std/sldup.o lib/std/getbp.o lib/std/now.o lib/std/sljoin.o lib/std/readall.o lib/std/cstrconv.o lib/std/slurp.o lib/std/wait.o lib/std/dirname.o lib/std/option.o lib/std/errno.o lib/std/intparse.o lib/std/rand.o lib/std/introspect.o lib/std/syswrap.o lib/std/fltbits.o lib/std/fltparse.o lib/std/strstrip.o lib/std/dir.o lib/std/slpush.o lib/std/memops.o lib/std/ipparse.o lib/std/dialparse.o lib/std/execvp.o lib/std/sjlj.o lib/std/slput.o lib/std/getint.o lib/std/spork.o lib/std/htab.o lib/std/blat.o lib/std/alloc.o lib/std/optparse.o lib/std/chartype.o lib/std/varargs.o lib/std/backtrace.o lib/std/syswrap-ss.o lib/std/slfill.o lib/std/bytealloc.o lib/std/diriter.o lib/std/swap.o lib/std/assert.o lib/std/utf.o lib/std/sort.o lib/std/hashfuncs.o lib/std/clear.o lib/std/striter.o lib/std/dial.o lib/std/iterutil.o lib/std/strjoin.o lib/std/mk.o lib/std/mktemp.o lib/std/chomp.o lib/std/units.o lib/std/memops-impl.o lib/std/fndup.o lib/std/putint.o lib/std/types.o lib/std/mkpath.o lib/std/listen.o lib/std/bigint.o lib/std/fmtfuncs.o lib/std/env.o lib/std/fmt.o lib/std/resolve.o lib/std/extremum.o lib/std/consts.o lib/std/sleq.o lib/std/strbuf.o lib/std/threadhooks.o lib/std/slpop.o lib/std/sjlj-impl.o lib/std/result.o lib/std/strfind.o lib/std/slcp.o lib/std/netaddr.o lib/std/sleep.o lib/std/hasprefix.o lib/std/try.o lib/std/search.o lib/std/writeall.o lib/std/cmp.o lib/std/endian.o lib/std/getcwd.o lib/std/bitset.o lib/std/pathjoin.o lib/std/fltfmt.o lib/std/strsplit.o &&\
-echo $pwd/muse/muse -o lib/std/libstd.use -p std lib/std/die.use lib/std/hassuffix.use lib/std/sldup.use lib/std/now.use lib/std/sljoin.use lib/std/readall.use lib/std/cstrconv.use lib/std/slurp.use lib/std/wait.use lib/std/dirname.use lib/std/option.use lib/std/errno.use lib/std/intparse.use lib/std/rand.use lib/std/introspect.use lib/std/syswrap.use lib/std/fltbits.use lib/std/fltparse.use lib/std/strstrip.use lib/std/dir.use lib/std/slpush.use lib/std/memops.use lib/std/ipparse.use lib/std/dialparse.use lib/std/execvp.use lib/std/sjlj.use lib/std/slput.use lib/std/getint.use lib/std/spork.use lib/std/htab.use lib/std/blat.use lib/std/alloc.use lib/std/optparse.use lib/std/chartype.use lib/std/varargs.use lib/std/backtrace.use lib/std/syswrap-ss.use lib/std/slfill.use lib/std/bytealloc.use lib/std/diriter.use lib/std/swap.use lib/std/assert.use lib/std/utf.use lib/std/sort.use lib/std/hashfuncs.use lib/std/clear.use lib/std/striter.use lib/std/dial.use lib/std/iterutil.use lib/std/strjoin.use lib/std/mk.use lib/std/mktemp.use lib/std/chomp.use lib/std/units.use lib/std/fndup.use lib/std/putint.use lib/std/types.use lib/std/mkpath.use lib/std/listen.use lib/std/bigint.use lib/std/fmtfuncs.use lib/std/env.use lib/std/fmt.use lib/std/resolve.use lib/std/extremum.use lib/std/consts.use lib/std/sleq.use lib/std/strbuf.use lib/std/threadhooks.use lib/std/slpop.use lib/std/result.use lib/std/strfind.use lib/std/slcp.use lib/std/netaddr.use lib/std/sleep.use lib/std/hasprefix.use lib/std/try.use lib/std/search.use lib/std/writeall.use lib/std/cmp.use lib/std/endian.use lib/std/getcwd.use lib/std/bitset.use lib/std/pathjoin.use lib/std/fltfmt.use lib/std/strsplit.use && $pwd/muse/muse -o lib/std/libstd.use -p std lib/std/die.use lib/std/hassuffix.use lib/std/sldup.use lib/std/now.use lib/std/sljoin.use lib/std/readall.use lib/std/cstrconv.use lib/std/slurp.use lib/std/wait.use lib/std/dirname.use lib/std/option.use lib/std/errno.use lib/std/intparse.use lib/std/rand.use lib/std/introspect.use lib/std/syswrap.use lib/std/fltbits.use lib/std/fltparse.use lib/std/strstrip.use lib/std/dir.use lib/std/slpush.use lib/std/memops.use lib/std/ipparse.use lib/std/dialparse.use lib/std/execvp.use lib/std/sjlj.use lib/std/slput.use lib/std/getint.use lib/std/spork.use lib/std/htab.use lib/std/blat.use lib/std/alloc.use lib/std/optparse.use lib/std/chartype.use lib/std/varargs.use lib/std/backtrace.use lib/std/syswrap-ss.use lib/std/slfill.use lib/std/bytealloc.use lib/std/diriter.use lib/std/swap.use lib/std/assert.use lib/std/utf.use lib/std/sort.use lib/std/hashfuncs.use lib/std/clear.use lib/std/striter.use lib/std/dial.use lib/std/iterutil.use lib/std/strjoin.use lib/std/mk.use lib/std/mktemp.use lib/std/chomp.use lib/std/units.use lib/std/fndup.use lib/std/putint.use lib/std/types.use lib/std/mkpath.use lib/std/listen.use lib/std/bigint.use lib/std/fmtfuncs.use lib/std/env.use lib/std/fmt.use lib/std/resolve.use lib/std/extremum.use lib/std/consts.use lib/std/sleq.use lib/std/strbuf.use lib/std/threadhooks.use lib/std/slpop.use lib/std/result.use lib/std/strfind.use lib/std/slcp.use lib/std/netaddr.use lib/std/sleep.use lib/std/hasprefix.use lib/std/try.use lib/std/search.use lib/std/writeall.use lib/std/cmp.use lib/std/endian.use lib/std/getcwd.use lib/std/bitset.use lib/std/pathjoin.use lib/std/fltfmt.use lib/std/strsplit.use &&\
-echo $pwd/6/6m -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/types.myr && $pwd/6/6m -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/types.myr &&\
-echo $pwd/6/6m -I lib/sys -I lib/std lib/thread/common.myr && $pwd/6/6m -I lib/sys -I lib/std lib/thread/common.myr &&\
-echo $pwd/6/6m -I lib/sys -I lib/std lib/thread/atomic.myr && $pwd/6/6m -I lib/sys -I lib/std lib/thread/atomic.myr &&\
-echo $pwd/6/6m -I lib/sys -I lib/std lib/thread/mutex+linux.myr && $pwd/6/6m -I lib/sys -I lib/std lib/thread/mutex+linux.myr &&\
-echo $pwd/6/6m -I lib/sys -I lib/std lib/thread/hookstd.myr && $pwd/6/6m -I lib/sys -I lib/std lib/thread/hookstd.myr &&\
-echo $pwd/6/6m -I lib/sys -I lib/std lib/thread/ncpu.myr && $pwd/6/6m -I lib/sys -I lib/std lib/thread/ncpu.myr &&\
-echo $pwd/6/6m -I lib/sys -I lib/std lib/thread/spawn+linux.myr && $pwd/6/6m -I lib/sys -I lib/std lib/thread/spawn+linux.myr &&\
-echo ar -rcs lib/thread/libthread.a lib/thread/mutex.o lib/thread/spawn.o lib/thread/ncpu.o lib/thread/hookstd.o lib/thread/atomic-impl.o lib/thread/atomic.o lib/thread/common.o lib/thread/exit.o && ar -rcs lib/thread/libthread.a lib/thread/mutex.o lib/thread/spawn.o lib/thread/ncpu.o lib/thread/hookstd.o lib/thread/atomic-impl.o lib/thread/atomic.o lib/thread/common.o lib/thread/exit.o &&\
-echo $pwd/muse/muse -o lib/thread/libthread.use -p thread lib/thread/mutex.use lib/thread/spawn.use lib/thread/ncpu.use lib/thread/hookstd.use lib/thread/atomic.use lib/thread/common.use && $pwd/muse/muse -o lib/thread/libthread.use -p thread lib/thread/mutex.use lib/thread/spawn.use lib/thread/ncpu.use lib/thread/hookstd.use lib/thread/atomic.use lib/thread/common.use &&\
-echo $pwd/6/6m -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/opts.myr && $pwd/6/6m -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/opts.myr &&\
-echo $pwd/6/6m -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/syssel.myr && $pwd/6/6m -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/syssel.myr &&\
-echo $pwd/6/6m -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/util.myr && $pwd/6/6m -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/util.myr &&\
-echo $pwd/6/6m -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/parse.myr && $pwd/6/6m -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/parse.myr &&\
-echo $pwd/6/6m -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/build.myr && $pwd/6/6m -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/build.myr &&\
-echo $pwd/6/6m -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/install.myr && $pwd/6/6m -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/install.myr &&\
-echo $pwd/6/6m -I lib/std -I lib/sys lib/bio/bio.myr && $pwd/6/6m -I lib/std -I lib/sys lib/bio/bio.myr &&\
-echo $pwd/6/6m -I lib/std -I lib/sys lib/bio/mem.myr && $pwd/6/6m -I lib/std -I lib/sys lib/bio/mem.myr &&\
-echo $pwd/6/6m -I lib/std -I lib/sys lib/bio/puti.myr && $pwd/6/6m -I lib/std -I lib/sys lib/bio/puti.myr &&\
-echo $pwd/6/6m -I lib/std -I lib/sys lib/bio/iter.myr && $pwd/6/6m -I lib/std -I lib/sys lib/bio/iter.myr &&\
-echo $pwd/6/6m -I lib/std -I lib/sys lib/bio/geti.myr && $pwd/6/6m -I lib/std -I lib/sys lib/bio/geti.myr &&\
-echo ar -rcs lib/bio/libbio.a lib/bio/bio.o lib/bio/geti.o lib/bio/iter.o lib/bio/puti.o lib/bio/mem.o && ar -rcs lib/bio/libbio.a lib/bio/bio.o lib/bio/geti.o lib/bio/iter.o lib/bio/puti.o lib/bio/mem.o &&\
-echo $pwd/muse/muse -o lib/bio/libbio.use -p bio lib/bio/bio.use lib/bio/geti.use lib/bio/iter.use lib/bio/puti.use lib/bio/mem.use && $pwd/muse/muse -o lib/bio/libbio.use -p bio lib/bio/bio.use lib/bio/geti.use lib/bio/iter.use lib/bio/puti.use lib/bio/mem.use &&\
-echo $pwd/6/6m -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/libs.myr && $pwd/6/6m -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/libs.myr &&\
-echo $pwd/6/6m -I lib/sys -I lib/std lib/regex/types.myr && $pwd/6/6m -I lib/sys -I lib/std lib/regex/types.myr &&\
-echo $pwd/6/6m -I lib/sys -I lib/std lib/regex/interp.myr && $pwd/6/6m -I lib/sys -I lib/std lib/regex/interp.myr &&\
-echo $pwd/6/6m -I lib/sys -I lib/std lib/regex/ranges.myr && $pwd/6/6m -I lib/sys -I lib/std lib/regex/ranges.myr &&\
-echo $pwd/6/6m -I lib/sys -I lib/std lib/regex/compile.myr && $pwd/6/6m -I lib/sys -I lib/std lib/regex/compile.myr &&\
-echo ar -rcs lib/regex/libregex.a lib/regex/interp.o lib/regex/ranges.o lib/regex/compile.o lib/regex/types.o && ar -rcs lib/regex/libregex.a lib/regex/interp.o lib/regex/ranges.o lib/regex/compile.o lib/regex/types.o &&\
-echo $pwd/muse/muse -o lib/regex/libregex.use -p regex lib/regex/interp.use lib/regex/ranges.use lib/regex/compile.use lib/regex/types.use && $pwd/muse/muse -o lib/regex/libregex.use -p regex lib/regex/interp.use lib/regex/ranges.use lib/regex/compile.use lib/regex/types.use &&\
-echo $pwd/6/6m -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/deps.myr && $pwd/6/6m -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/deps.myr &&\
-echo $pwd/6/6m -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/subtest.myr && $pwd/6/6m -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/subtest.myr &&\
-echo $pwd/6/6m -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/test.myr && $pwd/6/6m -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/test.myr &&\
-echo $pwd/6/6m -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/main.myr && $pwd/6/6m -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/main.myr &&\
-echo ld -o mbld/mbld $pwd/rt/_myrrt.o mbld/types.o mbld/config.o mbld/build.o mbld/libs.o mbld/install.o mbld/test.o mbld/util.o mbld/main.o mbld/subtest.o mbld/opts.o mbld/parse.o mbld/syssel.o mbld/deps.o -Llib/thread -lthread -Llib/regex -lregex -Llib/bio -lbio -Llib/std -lstd -Llib/sys -lsys && ld -o mbld/mbld $pwd/rt/_myrrt.o mbld/types.o mbld/config.o mbld/build.o mbld/libs.o mbld/install.o mbld/test.o mbld/util.o mbld/main.o mbld/subtest.o mbld/opts.o mbld/parse.o mbld/syssel.o mbld/deps.o -Llib/thread -lthread -Llib/regex -lregex -Llib/bio -lbio -Llib/std -lstd -Llib/sys -lsys &&\
+set -x
+ $pwd/6/6m -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/config.myr
+ as -g -o lib/thread/exit.o lib/thread/exit+linux-x64.s
+ as -g -o lib/thread/atomic-impl.o lib/thread/atomic-impl+x64.s
+ as -g -o lib/std/getbp.o lib/std/getbp+posixy-x64.s
+ $pwd/6/6m -I . -I lib/sys lib/std/option.myr
+ as -g -o lib/std/memops-impl.o lib/std/memops-impl+posixy-x64.s
+ $pwd/6/6m -I . -I lib/sys lib/std/fltbits.myr
+ as -g -o lib/std/sjlj-impl.o lib/std/sjlj-impl+posixy-x64.s
+ $pwd/6/6m -I . -I lib/sys lib/std/endian.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/extremum.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/sjlj.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/swap.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/slfill.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/clear.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/result.myr
+ as -g -o lib/sys/syscall.o lib/sys/syscall+linux-x64.s
+ $pwd/6/6m lib/sys/systypes.myr
+ as -g -o lib/sys/util.o lib/sys/util+posixy-x64.s
+ $pwd/6/6m lib/sys/syserrno+linux.myr
+ $pwd/6/6m lib/sys/sys+linux-x64.myr
+ $pwd/6/6m lib/sys/ifreq+linux.myr
+ ar -rcs lib/sys/libsys.a lib/sys/sys.o lib/sys/syserrno.o lib/sys/util.o lib/sys/systypes.o lib/sys/ifreq.o lib/sys/syscall.o
+ $pwd/muse/muse -o lib/sys/libsys.use -p sys lib/sys/sys.use lib/sys/syserrno.use lib/sys/systypes.use lib/sys/ifreq.use
+ $pwd/6/6m -I . -I lib/sys lib/std/errno.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/types.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/strfind.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/memops.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/sleq.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/hassuffix.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/syswrap-ss+linux.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/sleep.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/backtrace+x64.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/units.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/cstrconv.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/syswrap+posixy.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/mkpath.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/now.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/consts.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/die.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/slcp.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/chartype.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/utf.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/cmp.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/sort.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/search.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/hasprefix.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/chomp.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/striter.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/intparse.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/strstrip.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/introspect.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/varargs.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/wait+posixy.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/threadhooks.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/bytealloc.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/alloc.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/slurp.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/mk.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/slput.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/htab.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/slpush.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/strsplit.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/strbuf.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/sldup.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/bigint.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/fltparse.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/fltfmt.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/dirname.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/dir+linux.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/diriter.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/fndup.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/strjoin.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/getcwd.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/slpop.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/sljoin.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/getint.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/hashfuncs.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/bitset.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/putint.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/readall.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/blat.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/writeall.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/fmt.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/env+posixy.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/execvp.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/spork.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/assert.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/rand.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/pathjoin.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/mktemp.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/optparse.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/netaddr.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/iterutil.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/ipparse.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/fmtfuncs.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/resolve+posixy.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/dialparse+posixy.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/dial+posixy.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/listen+posixy.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/try.myr
+ ar -rcs lib/std/libstd.a lib/std/resolve.o lib/std/result.o lib/std/try.o lib/std/ipparse.o lib/std/alloc.o lib/std/iterutil.o lib/std/putint.o lib/std/sleq.o lib/std/sljoin.o lib/std/slpop.o lib/std/syswrap.o lib/std/getint.o lib/std/strsplit.o lib/std/slfill.o lib/std/writeall.o lib/std/fltfmt.o lib/std/hasprefix.o lib/std/swap.o lib/std/fmt.o lib/std/netaddr.o lib/std/varargs.o lib/std/diriter.o lib/std/getcwd.o lib/std/blat.o lib/std/optparse.o lib/std/pathjoin.o lib/std/readall.o lib/std/strjoin.o lib/std/threadhooks.o lib/std/sjlj.o lib/std/extremum.o lib/std/endian.o lib/std/rand.o lib/std/sldup.o lib/std/sleep.o lib/std/wait.o lib/std/introspect.o lib/std/fltparse.o lib/std/fndup.o lib/std/strbuf.o lib/std/assert.o lib/std/spork.o lib/std/slpush.o lib/std/strstrip.o lib/std/htab.o lib/std/hashfuncs.o lib/std/slput.o lib/std/sjlj-impl.o lib/std/fltbits.o lib/std/striter.o lib/std/types.o lib/std/cstrconv.o lib/std/units.o lib/std/backtrace.o lib/std/syswrap-ss.o lib/std/die.o lib/std/mk.o lib/std/hassuffix.o lib/std/memops-impl.o lib/std/utf.o lib/std/slurp.o lib/std/dialparse.o lib/std/bytealloc.o lib/std/mktemp.o lib/std/consts.o lib/std/chomp.o lib/std/dir.o lib/std/search.o lib/std/memops.o lib/std/fmtfuncs.o lib/std/strfind.o lib/std/env.o lib/std/dirname.o lib/std/clear.o lib/std/listen.o lib/std/sort.o lib/std/cmp.o lib/std/now.o lib/std/intparse.o lib/std/mkpath.o lib/std/option.o lib/std/dial.o lib/std/errno.o lib/std/chartype.o lib/std/bigint.o lib/std/bitset.o lib/std/getbp.o lib/std/slcp.o lib/std/execvp.o
+ $pwd/muse/muse -o lib/std/libstd.use -p std lib/std/resolve.use lib/std/result.use lib/std/try.use lib/std/ipparse.use lib/std/alloc.use lib/std/iterutil.use lib/std/putint.use lib/std/sleq.use lib/std/sljoin.use lib/std/slpop.use lib/std/syswrap.use lib/std/getint.use lib/std/strsplit.use lib/std/slfill.use lib/std/writeall.use lib/std/fltfmt.use lib/std/hasprefix.use lib/std/swap.use lib/std/fmt.use lib/std/netaddr.use lib/std/varargs.use lib/std/diriter.use lib/std/getcwd.use lib/std/blat.use lib/std/optparse.use lib/std/pathjoin.use lib/std/readall.use lib/std/strjoin.use lib/std/threadhooks.use lib/std/sjlj.use lib/std/extremum.use lib/std/endian.use lib/std/rand.use lib/std/sldup.use lib/std/sleep.use lib/std/wait.use lib/std/introspect.use lib/std/fltparse.use lib/std/fndup.use lib/std/strbuf.use lib/std/assert.use lib/std/spork.use lib/std/slpush.use lib/std/strstrip.use lib/std/htab.use lib/std/hashfuncs.use lib/std/slput.use lib/std/fltbits.use lib/std/striter.use lib/std/types.use lib/std/cstrconv.use lib/std/units.use lib/std/backtrace.use lib/std/syswrap-ss.use lib/std/die.use lib/std/mk.use lib/std/hassuffix.use lib/std/utf.use lib/std/slurp.use lib/std/dialparse.use lib/std/bytealloc.use lib/std/mktemp.use lib/std/consts.use lib/std/chomp.use lib/std/dir.use lib/std/search.use lib/std/memops.use lib/std/fmtfuncs.use lib/std/strfind.use lib/std/env.use lib/std/dirname.use lib/std/clear.use lib/std/listen.use lib/std/sort.use lib/std/cmp.use lib/std/now.use lib/std/intparse.use lib/std/mkpath.use lib/std/option.use lib/std/dial.use lib/std/errno.use lib/std/chartype.use lib/std/bigint.use lib/std/bitset.use lib/std/slcp.use lib/std/execvp.use
+ $pwd/6/6m -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/types.myr
+ $pwd/6/6m -I lib/sys -I lib/std lib/regex/types.myr
+ $pwd/6/6m -I lib/sys -I lib/std lib/regex/interp.myr
+ $pwd/6/6m -I lib/std -I lib/sys lib/bio/bio.myr
+ $pwd/6/6m -I lib/std -I lib/sys lib/bio/iter.myr
+ $pwd/6/6m -I lib/std -I lib/sys lib/bio/mem.myr
+ $pwd/6/6m -I lib/std -I lib/sys lib/bio/geti.myr
+ $pwd/6/6m -I lib/std -I lib/sys lib/bio/puti.myr
+ ar -rcs lib/bio/libbio.a lib/bio/puti.o lib/bio/geti.o lib/bio/mem.o lib/bio/bio.o lib/bio/iter.o
+ $pwd/muse/muse -o lib/bio/libbio.use -p bio lib/bio/puti.use lib/bio/geti.use lib/bio/mem.use lib/bio/bio.use lib/bio/iter.use
+ $pwd/6/6m -I lib/sys -I lib/std lib/thread/spawn+linux.myr
+ $pwd/6/6m -I lib/sys -I lib/std lib/thread/ncpu+linux.myr
+ $pwd/6/6m -I lib/sys -I lib/std lib/thread/common.myr
+ $pwd/6/6m -I lib/sys -I lib/std lib/thread/atomic.myr
+ $pwd/6/6m -I lib/sys -I lib/std lib/thread/mutex+linux.myr
+ $pwd/6/6m -I lib/sys -I lib/std lib/thread/hookstd.myr
+ ar -rcs lib/thread/libthread.a lib/thread/mutex.o lib/thread/atomic.o lib/thread/atomic-impl.o lib/thread/hookstd.o lib/thread/common.o lib/thread/ncpu.o lib/thread/exit.o lib/thread/spawn.o
+ $pwd/muse/muse -o lib/thread/libthread.use -p thread lib/thread/mutex.use lib/thread/atomic.use lib/thread/hookstd.use lib/thread/common.use lib/thread/ncpu.use lib/thread/spawn.use
+ $pwd/6/6m -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/opts.myr
+ $pwd/6/6m -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/syssel.myr
+ $pwd/6/6m -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/libs.myr
+ $pwd/6/6m -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/util.myr
+ $pwd/6/6m -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/build.myr
+ $pwd/6/6m -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/install.myr
+ $pwd/6/6m -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/parse.myr
+ $pwd/6/6m -I lib/sys -I lib/std lib/regex/ranges.myr
+ $pwd/6/6m -I lib/sys -I lib/std lib/regex/compile.myr
+ ar -rcs lib/regex/libregex.a lib/regex/interp.o lib/regex/ranges.o lib/regex/types.o lib/regex/compile.o
+ $pwd/muse/muse -o lib/regex/libregex.use -p regex lib/regex/interp.use lib/regex/ranges.use lib/regex/types.use lib/regex/compile.use
+ $pwd/6/6m -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/subtest.myr
+ $pwd/6/6m -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/test.myr
+ $pwd/6/6m -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/deps.myr
+ $pwd/6/6m -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/main.myr
+ ld -o mbld/mbld $pwd/rt/_myrrt.o mbld/deps.o mbld/main.o mbld/util.o mbld/libs.o mbld/syssel.o mbld/config.o mbld/opts.o mbld/subtest.o mbld/types.o mbld/test.o mbld/install.o mbld/parse.o mbld/build.o -Llib/thread -lthread -Llib/bio -lbio -Llib/regex -lregex -Llib/std -lstd -Llib/sys -lsys
true
diff --git a/mk/bootstrap/bootstrap+NetBSD-amd64.sh b/mk/bootstrap/bootstrap+NetBSD-amd64.sh
index e463000..5850aeb 100755
--- a/mk/bootstrap/bootstrap+NetBSD-amd64.sh
+++ b/mk/bootstrap/bootstrap+NetBSD-amd64.sh
@@ -2,139 +2,140 @@
# This script is generated by genbootstrap.sh
# to regenerate, run "make bootstrap"
pwd=`pwd`
-echo $pwd/6/6m -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/config.myr && $pwd/6/6m -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/config.myr &&\
-echo as -g -o lib/thread/atomic-impl.o lib/thread/atomic-impl+x64.s && as -g -o lib/thread/atomic-impl.o lib/thread/atomic-impl+x64.s &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/endian.myr && $pwd/6/6m -I . -I lib/sys lib/std/endian.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/result.myr && $pwd/6/6m -I . -I lib/sys lib/std/result.myr &&\
-echo as -g -o lib/std/sjlj-impl.o lib/std/sjlj-impl+posixy-x64.s && as -g -o lib/std/sjlj-impl.o lib/std/sjlj-impl+posixy-x64.s &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/extremum.myr && $pwd/6/6m -I . -I lib/sys lib/std/extremum.myr &&\
-echo as -g -o lib/std/memops-impl.o lib/std/memops-impl+posixy-x64.s && as -g -o lib/std/memops-impl.o lib/std/memops-impl+posixy-x64.s &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/swap.myr && $pwd/6/6m -I . -I lib/sys lib/std/swap.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/slfill.myr && $pwd/6/6m -I . -I lib/sys lib/std/slfill.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/clear.myr && $pwd/6/6m -I . -I lib/sys lib/std/clear.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/sjlj.myr && $pwd/6/6m -I . -I lib/sys lib/std/sjlj.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/fltbits.myr && $pwd/6/6m -I . -I lib/sys lib/std/fltbits.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/option.myr && $pwd/6/6m -I . -I lib/sys lib/std/option.myr &&\
-echo as -g -o lib/std/getbp.o lib/std/getbp+posixy-x64.s && as -g -o lib/std/getbp.o lib/std/getbp+posixy-x64.s &&\
-echo $pwd/6/6m lib/sys/ifreq+netbsd.myr && $pwd/6/6m lib/sys/ifreq+netbsd.myr &&\
-echo as -g -o lib/sys/syscall.o lib/sys/syscall+netbsd-x64.s && as -g -o lib/sys/syscall.o lib/sys/syscall+netbsd-x64.s &&\
-echo $pwd/6/6m lib/sys/systypes.myr && $pwd/6/6m lib/sys/systypes.myr &&\
-echo $pwd/6/6m lib/sys/sys+netbsd-x64.myr && $pwd/6/6m lib/sys/sys+netbsd-x64.myr &&\
-echo as -g -o lib/sys/util.o lib/sys/util+posixy-x64.s && as -g -o lib/sys/util.o lib/sys/util+posixy-x64.s &&\
-echo $pwd/6/6m lib/sys/syserrno+netbsd.myr && $pwd/6/6m lib/sys/syserrno+netbsd.myr &&\
-echo ar -rcs lib/sys/libsys.a lib/sys/syserrno.o lib/sys/util.o lib/sys/sys.o lib/sys/systypes.o lib/sys/syscall.o lib/sys/ifreq.o && ar -rcs lib/sys/libsys.a lib/sys/syserrno.o lib/sys/util.o lib/sys/sys.o lib/sys/systypes.o lib/sys/syscall.o lib/sys/ifreq.o &&\
-echo $pwd/muse/muse -o lib/sys/libsys.use -p sys lib/sys/syserrno.use lib/sys/sys.use lib/sys/systypes.use lib/sys/ifreq.use && $pwd/muse/muse -o lib/sys/libsys.use -p sys lib/sys/syserrno.use lib/sys/sys.use lib/sys/systypes.use lib/sys/ifreq.use &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/types.myr && $pwd/6/6m -I . -I lib/sys lib/std/types.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/strfind.myr && $pwd/6/6m -I . -I lib/sys lib/std/strfind.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/units.myr && $pwd/6/6m -I . -I lib/sys lib/std/units.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/backtrace+x64.myr && $pwd/6/6m -I . -I lib/sys lib/std/backtrace+x64.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/memops.myr && $pwd/6/6m -I . -I lib/sys lib/std/memops.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/sleq.myr && $pwd/6/6m -I . -I lib/sys lib/std/sleq.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/hassuffix.myr && $pwd/6/6m -I . -I lib/sys lib/std/hassuffix.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/cstrconv.myr && $pwd/6/6m -I . -I lib/sys lib/std/cstrconv.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/errno.myr && $pwd/6/6m -I . -I lib/sys lib/std/errno.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/syswrap+posixy.myr && $pwd/6/6m -I . -I lib/sys lib/std/syswrap+posixy.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/writeall.myr && $pwd/6/6m -I . -I lib/sys lib/std/writeall.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/consts.myr && $pwd/6/6m -I . -I lib/sys lib/std/consts.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/mkpath.myr && $pwd/6/6m -I . -I lib/sys lib/std/mkpath.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/blat.myr && $pwd/6/6m -I . -I lib/sys lib/std/blat.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/readall.myr && $pwd/6/6m -I . -I lib/sys lib/std/readall.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/now.myr && $pwd/6/6m -I . -I lib/sys lib/std/now.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/die.myr && $pwd/6/6m -I . -I lib/sys lib/std/die.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/slcp.myr && $pwd/6/6m -I . -I lib/sys lib/std/slcp.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/syswrap-ss+netbsd.myr && $pwd/6/6m -I . -I lib/sys lib/std/syswrap-ss+netbsd.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/sleep.myr && $pwd/6/6m -I . -I lib/sys lib/std/sleep.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/threadhooks.myr && $pwd/6/6m -I . -I lib/sys lib/std/threadhooks.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/bytealloc.myr && $pwd/6/6m -I . -I lib/sys lib/std/bytealloc.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/alloc.myr && $pwd/6/6m -I . -I lib/sys lib/std/alloc.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/getcwd.myr && $pwd/6/6m -I . -I lib/sys lib/std/getcwd.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/slpop.myr && $pwd/6/6m -I . -I lib/sys lib/std/slpop.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/mk.myr && $pwd/6/6m -I . -I lib/sys lib/std/mk.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/strjoin.myr && $pwd/6/6m -I . -I lib/sys lib/std/strjoin.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/htab.myr && $pwd/6/6m -I . -I lib/sys lib/std/htab.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/slput.myr && $pwd/6/6m -I . -I lib/sys lib/std/slput.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/slpush.myr && $pwd/6/6m -I . -I lib/sys lib/std/slpush.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/slurp.myr && $pwd/6/6m -I . -I lib/sys lib/std/slurp.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/sljoin.myr && $pwd/6/6m -I . -I lib/sys lib/std/sljoin.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/sldup.myr && $pwd/6/6m -I . -I lib/sys lib/std/sldup.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/fndup.myr && $pwd/6/6m -I . -I lib/sys lib/std/fndup.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/dir+netbsd.myr && $pwd/6/6m -I . -I lib/sys lib/std/dir+netbsd.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/diriter.myr && $pwd/6/6m -I . -I lib/sys lib/std/diriter.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/dirname.myr && $pwd/6/6m -I . -I lib/sys lib/std/dirname.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/putint.myr && $pwd/6/6m -I . -I lib/sys lib/std/putint.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/utf.myr && $pwd/6/6m -I . -I lib/sys lib/std/utf.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/strbuf.myr && $pwd/6/6m -I . -I lib/sys lib/std/strbuf.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/striter.myr && $pwd/6/6m -I . -I lib/sys lib/std/striter.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/chartype.myr && $pwd/6/6m -I . -I lib/sys lib/std/chartype.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/cmp.myr && $pwd/6/6m -I . -I lib/sys lib/std/cmp.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/search.myr && $pwd/6/6m -I . -I lib/sys lib/std/search.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/hasprefix.myr && $pwd/6/6m -I . -I lib/sys lib/std/hasprefix.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/bigint.myr && $pwd/6/6m -I . -I lib/sys lib/std/bigint.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/fltfmt.myr && $pwd/6/6m -I . -I lib/sys lib/std/fltfmt.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/chomp.myr && $pwd/6/6m -I . -I lib/sys lib/std/chomp.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/intparse.myr && $pwd/6/6m -I . -I lib/sys lib/std/intparse.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/fltparse.myr && $pwd/6/6m -I . -I lib/sys lib/std/fltparse.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/sort.myr && $pwd/6/6m -I . -I lib/sys lib/std/sort.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/hashfuncs.myr && $pwd/6/6m -I . -I lib/sys lib/std/hashfuncs.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/bitset.myr && $pwd/6/6m -I . -I lib/sys lib/std/bitset.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/strstrip.myr && $pwd/6/6m -I . -I lib/sys lib/std/strstrip.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/strsplit.myr && $pwd/6/6m -I . -I lib/sys lib/std/strsplit.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/getint.myr && $pwd/6/6m -I . -I lib/sys lib/std/getint.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/introspect.myr && $pwd/6/6m -I . -I lib/sys lib/std/introspect.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/varargs.myr && $pwd/6/6m -I . -I lib/sys lib/std/varargs.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/fmt.myr && $pwd/6/6m -I . -I lib/sys lib/std/fmt.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/pathjoin.myr && $pwd/6/6m -I . -I lib/sys lib/std/pathjoin.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/try.myr && $pwd/6/6m -I . -I lib/sys lib/std/try.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/netaddr.myr && $pwd/6/6m -I . -I lib/sys lib/std/netaddr.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/env+posixy.myr && $pwd/6/6m -I . -I lib/sys lib/std/env+posixy.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/execvp.myr && $pwd/6/6m -I . -I lib/sys lib/std/execvp.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/iterutil.myr && $pwd/6/6m -I . -I lib/sys lib/std/iterutil.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/assert.myr && $pwd/6/6m -I . -I lib/sys lib/std/assert.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/rand.myr && $pwd/6/6m -I . -I lib/sys lib/std/rand.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/mktemp.myr && $pwd/6/6m -I . -I lib/sys lib/std/mktemp.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/optparse.myr && $pwd/6/6m -I . -I lib/sys lib/std/optparse.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/ipparse.myr && $pwd/6/6m -I . -I lib/sys lib/std/ipparse.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/resolve+posixy.myr && $pwd/6/6m -I . -I lib/sys lib/std/resolve+posixy.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/dialparse+posixy.myr && $pwd/6/6m -I . -I lib/sys lib/std/dialparse+posixy.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/listen+posixy.myr && $pwd/6/6m -I . -I lib/sys lib/std/listen+posixy.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/dial+posixy.myr && $pwd/6/6m -I . -I lib/sys lib/std/dial+posixy.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/fmtfuncs.myr && $pwd/6/6m -I . -I lib/sys lib/std/fmtfuncs.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/wait+posixy.myr && $pwd/6/6m -I . -I lib/sys lib/std/wait+posixy.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/spork.myr && $pwd/6/6m -I . -I lib/sys lib/std/spork.myr &&\
-echo ar -rcs lib/std/libstd.a lib/std/die.o lib/std/hassuffix.o lib/std/sldup.o lib/std/getbp.o lib/std/now.o lib/std/sljoin.o lib/std/readall.o lib/std/cstrconv.o lib/std/slurp.o lib/std/wait.o lib/std/dirname.o lib/std/option.o lib/std/errno.o lib/std/intparse.o lib/std/rand.o lib/std/introspect.o lib/std/syswrap.o lib/std/fltbits.o lib/std/fltparse.o lib/std/strstrip.o lib/std/dir.o lib/std/slpush.o lib/std/memops.o lib/std/ipparse.o lib/std/dialparse.o lib/std/execvp.o lib/std/sjlj.o lib/std/slput.o lib/std/getint.o lib/std/spork.o lib/std/htab.o lib/std/blat.o lib/std/alloc.o lib/std/optparse.o lib/std/chartype.o lib/std/varargs.o lib/std/backtrace.o lib/std/syswrap-ss.o lib/std/slfill.o lib/std/bytealloc.o lib/std/diriter.o lib/std/swap.o lib/std/assert.o lib/std/utf.o lib/std/sort.o lib/std/hashfuncs.o lib/std/clear.o lib/std/striter.o lib/std/dial.o lib/std/iterutil.o lib/std/strjoin.o lib/std/mk.o lib/std/mktemp.o lib/std/chomp.o lib/std/units.o lib/std/memops-impl.o lib/std/fndup.o lib/std/putint.o lib/std/types.o lib/std/mkpath.o lib/std/listen.o lib/std/bigint.o lib/std/fmtfuncs.o lib/std/env.o lib/std/fmt.o lib/std/resolve.o lib/std/extremum.o lib/std/consts.o lib/std/sleq.o lib/std/strbuf.o lib/std/threadhooks.o lib/std/slpop.o lib/std/sjlj-impl.o lib/std/result.o lib/std/strfind.o lib/std/slcp.o lib/std/netaddr.o lib/std/sleep.o lib/std/hasprefix.o lib/std/try.o lib/std/search.o lib/std/writeall.o lib/std/cmp.o lib/std/endian.o lib/std/getcwd.o lib/std/bitset.o lib/std/pathjoin.o lib/std/fltfmt.o lib/std/strsplit.o && ar -rcs lib/std/libstd.a lib/std/die.o lib/std/hassuffix.o lib/std/sldup.o lib/std/getbp.o lib/std/now.o lib/std/sljoin.o lib/std/readall.o lib/std/cstrconv.o lib/std/slurp.o lib/std/wait.o lib/std/dirname.o lib/std/option.o lib/std/errno.o lib/std/intparse.o lib/std/rand.o lib/std/introspect.o lib/std/syswrap.o lib/std/fltbits.o lib/std/fltparse.o lib/std/strstrip.o lib/std/dir.o lib/std/slpush.o lib/std/memops.o lib/std/ipparse.o lib/std/dialparse.o lib/std/execvp.o lib/std/sjlj.o lib/std/slput.o lib/std/getint.o lib/std/spork.o lib/std/htab.o lib/std/blat.o lib/std/alloc.o lib/std/optparse.o lib/std/chartype.o lib/std/varargs.o lib/std/backtrace.o lib/std/syswrap-ss.o lib/std/slfill.o lib/std/bytealloc.o lib/std/diriter.o lib/std/swap.o lib/std/assert.o lib/std/utf.o lib/std/sort.o lib/std/hashfuncs.o lib/std/clear.o lib/std/striter.o lib/std/dial.o lib/std/iterutil.o lib/std/strjoin.o lib/std/mk.o lib/std/mktemp.o lib/std/chomp.o lib/std/units.o lib/std/memops-impl.o lib/std/fndup.o lib/std/putint.o lib/std/types.o lib/std/mkpath.o lib/std/listen.o lib/std/bigint.o lib/std/fmtfuncs.o lib/std/env.o lib/std/fmt.o lib/std/resolve.o lib/std/extremum.o lib/std/consts.o lib/std/sleq.o lib/std/strbuf.o lib/std/threadhooks.o lib/std/slpop.o lib/std/sjlj-impl.o lib/std/result.o lib/std/strfind.o lib/std/slcp.o lib/std/netaddr.o lib/std/sleep.o lib/std/hasprefix.o lib/std/try.o lib/std/search.o lib/std/writeall.o lib/std/cmp.o lib/std/endian.o lib/std/getcwd.o lib/std/bitset.o lib/std/pathjoin.o lib/std/fltfmt.o lib/std/strsplit.o &&\
-echo $pwd/muse/muse -o lib/std/libstd.use -p std lib/std/die.use lib/std/hassuffix.use lib/std/sldup.use lib/std/now.use lib/std/sljoin.use lib/std/readall.use lib/std/cstrconv.use lib/std/slurp.use lib/std/wait.use lib/std/dirname.use lib/std/option.use lib/std/errno.use lib/std/intparse.use lib/std/rand.use lib/std/introspect.use lib/std/syswrap.use lib/std/fltbits.use lib/std/fltparse.use lib/std/strstrip.use lib/std/dir.use lib/std/slpush.use lib/std/memops.use lib/std/ipparse.use lib/std/dialparse.use lib/std/execvp.use lib/std/sjlj.use lib/std/slput.use lib/std/getint.use lib/std/spork.use lib/std/htab.use lib/std/blat.use lib/std/alloc.use lib/std/optparse.use lib/std/chartype.use lib/std/varargs.use lib/std/backtrace.use lib/std/syswrap-ss.use lib/std/slfill.use lib/std/bytealloc.use lib/std/diriter.use lib/std/swap.use lib/std/assert.use lib/std/utf.use lib/std/sort.use lib/std/hashfuncs.use lib/std/clear.use lib/std/striter.use lib/std/dial.use lib/std/iterutil.use lib/std/strjoin.use lib/std/mk.use lib/std/mktemp.use lib/std/chomp.use lib/std/units.use lib/std/fndup.use lib/std/putint.use lib/std/types.use lib/std/mkpath.use lib/std/listen.use lib/std/bigint.use lib/std/fmtfuncs.use lib/std/env.use lib/std/fmt.use lib/std/resolve.use lib/std/extremum.use lib/std/consts.use lib/std/sleq.use lib/std/strbuf.use lib/std/threadhooks.use lib/std/slpop.use lib/std/result.use lib/std/strfind.use lib/std/slcp.use lib/std/netaddr.use lib/std/sleep.use lib/std/hasprefix.use lib/std/try.use lib/std/search.use lib/std/writeall.use lib/std/cmp.use lib/std/endian.use lib/std/getcwd.use lib/std/bitset.use lib/std/pathjoin.use lib/std/fltfmt.use lib/std/strsplit.use && $pwd/muse/muse -o lib/std/libstd.use -p std lib/std/die.use lib/std/hassuffix.use lib/std/sldup.use lib/std/now.use lib/std/sljoin.use lib/std/readall.use lib/std/cstrconv.use lib/std/slurp.use lib/std/wait.use lib/std/dirname.use lib/std/option.use lib/std/errno.use lib/std/intparse.use lib/std/rand.use lib/std/introspect.use lib/std/syswrap.use lib/std/fltbits.use lib/std/fltparse.use lib/std/strstrip.use lib/std/dir.use lib/std/slpush.use lib/std/memops.use lib/std/ipparse.use lib/std/dialparse.use lib/std/execvp.use lib/std/sjlj.use lib/std/slput.use lib/std/getint.use lib/std/spork.use lib/std/htab.use lib/std/blat.use lib/std/alloc.use lib/std/optparse.use lib/std/chartype.use lib/std/varargs.use lib/std/backtrace.use lib/std/syswrap-ss.use lib/std/slfill.use lib/std/bytealloc.use lib/std/diriter.use lib/std/swap.use lib/std/assert.use lib/std/utf.use lib/std/sort.use lib/std/hashfuncs.use lib/std/clear.use lib/std/striter.use lib/std/dial.use lib/std/iterutil.use lib/std/strjoin.use lib/std/mk.use lib/std/mktemp.use lib/std/chomp.use lib/std/units.use lib/std/fndup.use lib/std/putint.use lib/std/types.use lib/std/mkpath.use lib/std/listen.use lib/std/bigint.use lib/std/fmtfuncs.use lib/std/env.use lib/std/fmt.use lib/std/resolve.use lib/std/extremum.use lib/std/consts.use lib/std/sleq.use lib/std/strbuf.use lib/std/threadhooks.use lib/std/slpop.use lib/std/result.use lib/std/strfind.use lib/std/slcp.use lib/std/netaddr.use lib/std/sleep.use lib/std/hasprefix.use lib/std/try.use lib/std/search.use lib/std/writeall.use lib/std/cmp.use lib/std/endian.use lib/std/getcwd.use lib/std/bitset.use lib/std/pathjoin.use lib/std/fltfmt.use lib/std/strsplit.use &&\
-echo $pwd/6/6m -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/types.myr && $pwd/6/6m -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/types.myr &&\
-echo $pwd/6/6m -I lib/sys -I lib/std lib/thread/common.myr && $pwd/6/6m -I lib/sys -I lib/std lib/thread/common.myr &&\
-echo $pwd/6/6m -I lib/sys -I lib/std lib/thread/atomic.myr && $pwd/6/6m -I lib/sys -I lib/std lib/thread/atomic.myr &&\
-echo $pwd/6/6m -I lib/sys -I lib/std lib/thread/mutex.myr && $pwd/6/6m -I lib/sys -I lib/std lib/thread/mutex.myr &&\
-echo $pwd/6/6m -I lib/sys -I lib/std lib/thread/hookstd.myr && $pwd/6/6m -I lib/sys -I lib/std lib/thread/hookstd.myr &&\
-echo $pwd/6/6m -I lib/sys -I lib/std lib/thread/ncpu.myr && $pwd/6/6m -I lib/sys -I lib/std lib/thread/ncpu.myr &&\
-echo $pwd/6/6m -I lib/sys -I lib/std lib/thread/spawn+netbsd.myr && $pwd/6/6m -I lib/sys -I lib/std lib/thread/spawn+netbsd.myr &&\
-echo ar -rcs lib/thread/libthread.a lib/thread/mutex.o lib/thread/spawn.o lib/thread/ncpu.o lib/thread/hookstd.o lib/thread/atomic-impl.o lib/thread/atomic.o lib/thread/common.o && ar -rcs lib/thread/libthread.a lib/thread/mutex.o lib/thread/spawn.o lib/thread/ncpu.o lib/thread/hookstd.o lib/thread/atomic-impl.o lib/thread/atomic.o lib/thread/common.o &&\
-echo $pwd/muse/muse -o lib/thread/libthread.use -p thread lib/thread/mutex.use lib/thread/spawn.use lib/thread/ncpu.use lib/thread/hookstd.use lib/thread/atomic.use lib/thread/common.use && $pwd/muse/muse -o lib/thread/libthread.use -p thread lib/thread/mutex.use lib/thread/spawn.use lib/thread/ncpu.use lib/thread/hookstd.use lib/thread/atomic.use lib/thread/common.use &&\
-echo $pwd/6/6m -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/opts.myr && $pwd/6/6m -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/opts.myr &&\
-echo $pwd/6/6m -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/syssel.myr && $pwd/6/6m -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/syssel.myr &&\
-echo $pwd/6/6m -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/util.myr && $pwd/6/6m -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/util.myr &&\
-echo $pwd/6/6m -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/parse.myr && $pwd/6/6m -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/parse.myr &&\
-echo $pwd/6/6m -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/build.myr && $pwd/6/6m -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/build.myr &&\
-echo $pwd/6/6m -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/install.myr && $pwd/6/6m -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/install.myr &&\
-echo $pwd/6/6m -I lib/std -I lib/sys lib/bio/bio.myr && $pwd/6/6m -I lib/std -I lib/sys lib/bio/bio.myr &&\
-echo $pwd/6/6m -I lib/std -I lib/sys lib/bio/mem.myr && $pwd/6/6m -I lib/std -I lib/sys lib/bio/mem.myr &&\
-echo $pwd/6/6m -I lib/std -I lib/sys lib/bio/puti.myr && $pwd/6/6m -I lib/std -I lib/sys lib/bio/puti.myr &&\
-echo $pwd/6/6m -I lib/std -I lib/sys lib/bio/iter.myr && $pwd/6/6m -I lib/std -I lib/sys lib/bio/iter.myr &&\
-echo $pwd/6/6m -I lib/std -I lib/sys lib/bio/geti.myr && $pwd/6/6m -I lib/std -I lib/sys lib/bio/geti.myr &&\
-echo ar -rcs lib/bio/libbio.a lib/bio/bio.o lib/bio/geti.o lib/bio/iter.o lib/bio/puti.o lib/bio/mem.o && ar -rcs lib/bio/libbio.a lib/bio/bio.o lib/bio/geti.o lib/bio/iter.o lib/bio/puti.o lib/bio/mem.o &&\
-echo $pwd/muse/muse -o lib/bio/libbio.use -p bio lib/bio/bio.use lib/bio/geti.use lib/bio/iter.use lib/bio/puti.use lib/bio/mem.use && $pwd/muse/muse -o lib/bio/libbio.use -p bio lib/bio/bio.use lib/bio/geti.use lib/bio/iter.use lib/bio/puti.use lib/bio/mem.use &&\
-echo $pwd/6/6m -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/libs.myr && $pwd/6/6m -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/libs.myr &&\
-echo $pwd/6/6m -I lib/sys -I lib/std lib/regex/types.myr && $pwd/6/6m -I lib/sys -I lib/std lib/regex/types.myr &&\
-echo $pwd/6/6m -I lib/sys -I lib/std lib/regex/interp.myr && $pwd/6/6m -I lib/sys -I lib/std lib/regex/interp.myr &&\
-echo $pwd/6/6m -I lib/sys -I lib/std lib/regex/ranges.myr && $pwd/6/6m -I lib/sys -I lib/std lib/regex/ranges.myr &&\
-echo $pwd/6/6m -I lib/sys -I lib/std lib/regex/compile.myr && $pwd/6/6m -I lib/sys -I lib/std lib/regex/compile.myr &&\
-echo ar -rcs lib/regex/libregex.a lib/regex/interp.o lib/regex/ranges.o lib/regex/compile.o lib/regex/types.o && ar -rcs lib/regex/libregex.a lib/regex/interp.o lib/regex/ranges.o lib/regex/compile.o lib/regex/types.o &&\
-echo $pwd/muse/muse -o lib/regex/libregex.use -p regex lib/regex/interp.use lib/regex/ranges.use lib/regex/compile.use lib/regex/types.use && $pwd/muse/muse -o lib/regex/libregex.use -p regex lib/regex/interp.use lib/regex/ranges.use lib/regex/compile.use lib/regex/types.use &&\
-echo $pwd/6/6m -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/deps.myr && $pwd/6/6m -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/deps.myr &&\
-echo $pwd/6/6m -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/subtest.myr && $pwd/6/6m -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/subtest.myr &&\
-echo $pwd/6/6m -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/test.myr && $pwd/6/6m -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/test.myr &&\
-echo $pwd/6/6m -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/main.myr && $pwd/6/6m -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/main.myr &&\
-echo ld -o mbld/mbld $pwd/rt/_myrrt.o mbld/types.o mbld/config.o mbld/build.o mbld/libs.o mbld/install.o mbld/test.o mbld/util.o mbld/main.o mbld/subtest.o mbld/opts.o mbld/parse.o mbld/syssel.o mbld/deps.o -Llib/thread -lthread -Llib/regex -lregex -Llib/bio -lbio -Llib/std -lstd -Llib/sys -lsys && ld -o mbld/mbld $pwd/rt/_myrrt.o mbld/types.o mbld/config.o mbld/build.o mbld/libs.o mbld/install.o mbld/test.o mbld/util.o mbld/main.o mbld/subtest.o mbld/opts.o mbld/parse.o mbld/syssel.o mbld/deps.o -Llib/thread -lthread -Llib/regex -lregex -Llib/bio -lbio -Llib/std -lstd -Llib/sys -lsys &&\
+set -x
+ $pwd/6/6m -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/config.myr
+ as -g -o lib/thread/atomic-impl.o lib/thread/atomic-impl+x64.s
+ as -g -o lib/std/getbp.o lib/std/getbp+posixy-x64.s
+ $pwd/6/6m -I . -I lib/sys lib/std/option.myr
+ as -g -o lib/std/memops-impl.o lib/std/memops-impl+posixy-x64.s
+ $pwd/6/6m -I . -I lib/sys lib/std/fltbits.myr
+ as -g -o lib/std/sjlj-impl.o lib/std/sjlj-impl+posixy-x64.s
+ $pwd/6/6m -I . -I lib/sys lib/std/endian.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/extremum.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/sjlj.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/swap.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/slfill.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/clear.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/result.myr
+ as -g -o lib/sys/syscall.o lib/sys/syscall+netbsd-x64.s
+ $pwd/6/6m lib/sys/ifreq+netbsd.myr
+ $pwd/6/6m lib/sys/systypes.myr
+ $pwd/6/6m lib/sys/sys+netbsd-x64.myr
+ as -g -o lib/sys/util.o lib/sys/util+posixy-x64.s
+ $pwd/6/6m lib/sys/syserrno+netbsd.myr
+ ar -rcs lib/sys/libsys.a lib/sys/sys.o lib/sys/syserrno.o lib/sys/util.o lib/sys/systypes.o lib/sys/ifreq.o lib/sys/syscall.o
+ $pwd/muse/muse -o lib/sys/libsys.use -p sys lib/sys/sys.use lib/sys/syserrno.use lib/sys/systypes.use lib/sys/ifreq.use
+ $pwd/6/6m -I . -I lib/sys lib/std/errno.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/types.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/strfind.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/memops.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/sleq.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/hassuffix.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/backtrace+x64.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/units.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/cstrconv.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/syswrap+posixy.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/mkpath.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/now.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/consts.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/die.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/slcp.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/syswrap-ss+netbsd.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/sleep.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/chartype.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/utf.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/cmp.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/sort.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/search.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/hasprefix.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/chomp.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/striter.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/intparse.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/strstrip.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/introspect.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/varargs.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/wait+posixy.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/threadhooks.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/bytealloc.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/alloc.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/slurp.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/mk.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/slput.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/htab.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/slpush.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/strsplit.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/strbuf.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/sldup.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/bigint.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/fltparse.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/fltfmt.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/dirname.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/dir+netbsd.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/diriter.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/fndup.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/strjoin.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/getcwd.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/slpop.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/sljoin.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/getint.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/hashfuncs.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/bitset.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/putint.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/readall.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/blat.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/writeall.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/fmt.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/env+posixy.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/execvp.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/spork.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/assert.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/rand.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/pathjoin.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/mktemp.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/optparse.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/netaddr.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/iterutil.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/ipparse.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/fmtfuncs.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/resolve+posixy.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/dialparse+posixy.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/dial+posixy.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/listen+posixy.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/try.myr
+ ar -rcs lib/std/libstd.a lib/std/resolve.o lib/std/result.o lib/std/try.o lib/std/ipparse.o lib/std/alloc.o lib/std/iterutil.o lib/std/putint.o lib/std/sleq.o lib/std/sljoin.o lib/std/slpop.o lib/std/syswrap.o lib/std/getint.o lib/std/strsplit.o lib/std/slfill.o lib/std/writeall.o lib/std/fltfmt.o lib/std/hasprefix.o lib/std/swap.o lib/std/fmt.o lib/std/netaddr.o lib/std/varargs.o lib/std/diriter.o lib/std/getcwd.o lib/std/blat.o lib/std/optparse.o lib/std/pathjoin.o lib/std/readall.o lib/std/strjoin.o lib/std/threadhooks.o lib/std/sjlj.o lib/std/extremum.o lib/std/endian.o lib/std/rand.o lib/std/sldup.o lib/std/sleep.o lib/std/wait.o lib/std/introspect.o lib/std/fltparse.o lib/std/fndup.o lib/std/strbuf.o lib/std/assert.o lib/std/spork.o lib/std/slpush.o lib/std/strstrip.o lib/std/htab.o lib/std/hashfuncs.o lib/std/slput.o lib/std/sjlj-impl.o lib/std/fltbits.o lib/std/striter.o lib/std/types.o lib/std/cstrconv.o lib/std/units.o lib/std/backtrace.o lib/std/syswrap-ss.o lib/std/die.o lib/std/mk.o lib/std/hassuffix.o lib/std/memops-impl.o lib/std/utf.o lib/std/slurp.o lib/std/dialparse.o lib/std/bytealloc.o lib/std/mktemp.o lib/std/consts.o lib/std/chomp.o lib/std/dir.o lib/std/search.o lib/std/memops.o lib/std/fmtfuncs.o lib/std/strfind.o lib/std/env.o lib/std/dirname.o lib/std/clear.o lib/std/listen.o lib/std/sort.o lib/std/cmp.o lib/std/now.o lib/std/intparse.o lib/std/mkpath.o lib/std/option.o lib/std/dial.o lib/std/errno.o lib/std/chartype.o lib/std/bigint.o lib/std/bitset.o lib/std/getbp.o lib/std/slcp.o lib/std/execvp.o
+ $pwd/muse/muse -o lib/std/libstd.use -p std lib/std/resolve.use lib/std/result.use lib/std/try.use lib/std/ipparse.use lib/std/alloc.use lib/std/iterutil.use lib/std/putint.use lib/std/sleq.use lib/std/sljoin.use lib/std/slpop.use lib/std/syswrap.use lib/std/getint.use lib/std/strsplit.use lib/std/slfill.use lib/std/writeall.use lib/std/fltfmt.use lib/std/hasprefix.use lib/std/swap.use lib/std/fmt.use lib/std/netaddr.use lib/std/varargs.use lib/std/diriter.use lib/std/getcwd.use lib/std/blat.use lib/std/optparse.use lib/std/pathjoin.use lib/std/readall.use lib/std/strjoin.use lib/std/threadhooks.use lib/std/sjlj.use lib/std/extremum.use lib/std/endian.use lib/std/rand.use lib/std/sldup.use lib/std/sleep.use lib/std/wait.use lib/std/introspect.use lib/std/fltparse.use lib/std/fndup.use lib/std/strbuf.use lib/std/assert.use lib/std/spork.use lib/std/slpush.use lib/std/strstrip.use lib/std/htab.use lib/std/hashfuncs.use lib/std/slput.use lib/std/fltbits.use lib/std/striter.use lib/std/types.use lib/std/cstrconv.use lib/std/units.use lib/std/backtrace.use lib/std/syswrap-ss.use lib/std/die.use lib/std/mk.use lib/std/hassuffix.use lib/std/utf.use lib/std/slurp.use lib/std/dialparse.use lib/std/bytealloc.use lib/std/mktemp.use lib/std/consts.use lib/std/chomp.use lib/std/dir.use lib/std/search.use lib/std/memops.use lib/std/fmtfuncs.use lib/std/strfind.use lib/std/env.use lib/std/dirname.use lib/std/clear.use lib/std/listen.use lib/std/sort.use lib/std/cmp.use lib/std/now.use lib/std/intparse.use lib/std/mkpath.use lib/std/option.use lib/std/dial.use lib/std/errno.use lib/std/chartype.use lib/std/bigint.use lib/std/bitset.use lib/std/slcp.use lib/std/execvp.use
+ $pwd/6/6m -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/types.myr
+ $pwd/6/6m -I lib/sys -I lib/std lib/regex/types.myr
+ $pwd/6/6m -I lib/sys -I lib/std lib/regex/interp.myr
+ $pwd/6/6m -I lib/std -I lib/sys lib/bio/bio.myr
+ $pwd/6/6m -I lib/std -I lib/sys lib/bio/iter.myr
+ $pwd/6/6m -I lib/std -I lib/sys lib/bio/mem.myr
+ $pwd/6/6m -I lib/std -I lib/sys lib/bio/geti.myr
+ $pwd/6/6m -I lib/std -I lib/sys lib/bio/puti.myr
+ ar -rcs lib/bio/libbio.a lib/bio/puti.o lib/bio/geti.o lib/bio/mem.o lib/bio/bio.o lib/bio/iter.o
+ $pwd/muse/muse -o lib/bio/libbio.use -p bio lib/bio/puti.use lib/bio/geti.use lib/bio/mem.use lib/bio/bio.use lib/bio/iter.use
+ $pwd/6/6m -I lib/sys -I lib/std lib/thread/spawn+netbsd.myr
+ $pwd/6/6m -I lib/sys -I lib/std lib/thread/ncpu.myr
+ $pwd/6/6m -I lib/sys -I lib/std lib/thread/common.myr
+ $pwd/6/6m -I lib/sys -I lib/std lib/thread/atomic.myr
+ $pwd/6/6m -I lib/sys -I lib/std lib/thread/mutex.myr
+ $pwd/6/6m -I lib/sys -I lib/std lib/thread/hookstd.myr
+ ar -rcs lib/thread/libthread.a lib/thread/mutex.o lib/thread/atomic.o lib/thread/atomic-impl.o lib/thread/hookstd.o lib/thread/common.o lib/thread/ncpu.o lib/thread/spawn.o
+ $pwd/muse/muse -o lib/thread/libthread.use -p thread lib/thread/mutex.use lib/thread/atomic.use lib/thread/hookstd.use lib/thread/common.use lib/thread/ncpu.use lib/thread/spawn.use
+ $pwd/6/6m -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/opts.myr
+ $pwd/6/6m -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/syssel.myr
+ $pwd/6/6m -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/libs.myr
+ $pwd/6/6m -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/util.myr
+ $pwd/6/6m -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/build.myr
+ $pwd/6/6m -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/install.myr
+ $pwd/6/6m -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/parse.myr
+ $pwd/6/6m -I lib/sys -I lib/std lib/regex/ranges.myr
+ $pwd/6/6m -I lib/sys -I lib/std lib/regex/compile.myr
+ ar -rcs lib/regex/libregex.a lib/regex/interp.o lib/regex/ranges.o lib/regex/types.o lib/regex/compile.o
+ $pwd/muse/muse -o lib/regex/libregex.use -p regex lib/regex/interp.use lib/regex/ranges.use lib/regex/types.use lib/regex/compile.use
+ $pwd/6/6m -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/subtest.myr
+ $pwd/6/6m -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/test.myr
+ $pwd/6/6m -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/deps.myr
+ $pwd/6/6m -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/main.myr
+ ld -o mbld/mbld $pwd/rt/_myrrt.o mbld/deps.o mbld/main.o mbld/util.o mbld/libs.o mbld/syssel.o mbld/config.o mbld/opts.o mbld/subtest.o mbld/types.o mbld/test.o mbld/install.o mbld/parse.o mbld/build.o -Llib/thread -lthread -Llib/bio -lbio -Llib/regex -lregex -Llib/std -lstd -Llib/sys -lsys
true
diff --git a/mk/bootstrap/bootstrap+OpenBSD-amd64.sh b/mk/bootstrap/bootstrap+OpenBSD-amd64.sh
index 5665f0b..177556c 100755
--- a/mk/bootstrap/bootstrap+OpenBSD-amd64.sh
+++ b/mk/bootstrap/bootstrap+OpenBSD-amd64.sh
@@ -2,140 +2,141 @@
# This script is generated by genbootstrap.sh
# to regenerate, run "make bootstrap"
pwd=`pwd`
-echo $pwd/6/6m -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/config.myr && $pwd/6/6m -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/config.myr &&\
-echo as -g -o lib/thread/exit.o lib/thread/exit+openbsd-x64.s && as -g -o lib/thread/exit.o lib/thread/exit+openbsd-x64.s &&\
-echo as -g -o lib/thread/atomic-impl.o lib/thread/atomic-impl+x64.s && as -g -o lib/thread/atomic-impl.o lib/thread/atomic-impl+x64.s &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/endian.myr && $pwd/6/6m -I . -I lib/sys lib/std/endian.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/result.myr && $pwd/6/6m -I . -I lib/sys lib/std/result.myr &&\
-echo as -g -o lib/std/sjlj-impl.o lib/std/sjlj-impl+posixy-x64.s && as -g -o lib/std/sjlj-impl.o lib/std/sjlj-impl+posixy-x64.s &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/extremum.myr && $pwd/6/6m -I . -I lib/sys lib/std/extremum.myr &&\
-echo as -g -o lib/std/memops-impl.o lib/std/memops-impl+posixy-x64.s && as -g -o lib/std/memops-impl.o lib/std/memops-impl+posixy-x64.s &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/swap.myr && $pwd/6/6m -I . -I lib/sys lib/std/swap.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/slfill.myr && $pwd/6/6m -I . -I lib/sys lib/std/slfill.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/clear.myr && $pwd/6/6m -I . -I lib/sys lib/std/clear.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/sjlj.myr && $pwd/6/6m -I . -I lib/sys lib/std/sjlj.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/fltbits.myr && $pwd/6/6m -I . -I lib/sys lib/std/fltbits.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/option.myr && $pwd/6/6m -I . -I lib/sys lib/std/option.myr &&\
-echo as -g -o lib/std/getbp.o lib/std/getbp+posixy-x64.s && as -g -o lib/std/getbp.o lib/std/getbp+posixy-x64.s &&\
-echo $pwd/6/6m lib/sys/ifreq+openbsd.myr && $pwd/6/6m lib/sys/ifreq+openbsd.myr &&\
-echo as -g -o lib/sys/syscall.o lib/sys/syscall+openbsd-x64.s && as -g -o lib/sys/syscall.o lib/sys/syscall+openbsd-x64.s &&\
-echo $pwd/6/6m lib/sys/systypes.myr && $pwd/6/6m lib/sys/systypes.myr &&\
-echo $pwd/6/6m lib/sys/sys+openbsd-x64.myr && $pwd/6/6m lib/sys/sys+openbsd-x64.myr &&\
-echo as -g -o lib/sys/util.o lib/sys/util+posixy-x64.s && as -g -o lib/sys/util.o lib/sys/util+posixy-x64.s &&\
-echo $pwd/6/6m lib/sys/syserrno+openbsd.myr && $pwd/6/6m lib/sys/syserrno+openbsd.myr &&\
-echo ar -rcs lib/sys/libsys.a lib/sys/syserrno.o lib/sys/util.o lib/sys/sys.o lib/sys/systypes.o lib/sys/syscall.o lib/sys/ifreq.o && ar -rcs lib/sys/libsys.a lib/sys/syserrno.o lib/sys/util.o lib/sys/sys.o lib/sys/systypes.o lib/sys/syscall.o lib/sys/ifreq.o &&\
-echo $pwd/muse/muse -o lib/sys/libsys.use -p sys lib/sys/syserrno.use lib/sys/sys.use lib/sys/systypes.use lib/sys/ifreq.use && $pwd/muse/muse -o lib/sys/libsys.use -p sys lib/sys/syserrno.use lib/sys/sys.use lib/sys/systypes.use lib/sys/ifreq.use &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/types.myr && $pwd/6/6m -I . -I lib/sys lib/std/types.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/strfind.myr && $pwd/6/6m -I . -I lib/sys lib/std/strfind.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/units.myr && $pwd/6/6m -I . -I lib/sys lib/std/units.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/backtrace+x64.myr && $pwd/6/6m -I . -I lib/sys lib/std/backtrace+x64.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/memops.myr && $pwd/6/6m -I . -I lib/sys lib/std/memops.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/sleq.myr && $pwd/6/6m -I . -I lib/sys lib/std/sleq.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/hassuffix.myr && $pwd/6/6m -I . -I lib/sys lib/std/hassuffix.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/cstrconv.myr && $pwd/6/6m -I . -I lib/sys lib/std/cstrconv.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/errno.myr && $pwd/6/6m -I . -I lib/sys lib/std/errno.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/syswrap+posixy.myr && $pwd/6/6m -I . -I lib/sys lib/std/syswrap+posixy.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/writeall.myr && $pwd/6/6m -I . -I lib/sys lib/std/writeall.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/consts.myr && $pwd/6/6m -I . -I lib/sys lib/std/consts.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/mkpath.myr && $pwd/6/6m -I . -I lib/sys lib/std/mkpath.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/blat.myr && $pwd/6/6m -I . -I lib/sys lib/std/blat.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/readall.myr && $pwd/6/6m -I . -I lib/sys lib/std/readall.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/now.myr && $pwd/6/6m -I . -I lib/sys lib/std/now.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/die.myr && $pwd/6/6m -I . -I lib/sys lib/std/die.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/slcp.myr && $pwd/6/6m -I . -I lib/sys lib/std/slcp.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/syswrap-ss+openbsd.myr && $pwd/6/6m -I . -I lib/sys lib/std/syswrap-ss+openbsd.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/sleep.myr && $pwd/6/6m -I . -I lib/sys lib/std/sleep.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/threadhooks.myr && $pwd/6/6m -I . -I lib/sys lib/std/threadhooks.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/bytealloc.myr && $pwd/6/6m -I . -I lib/sys lib/std/bytealloc.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/alloc.myr && $pwd/6/6m -I . -I lib/sys lib/std/alloc.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/getcwd.myr && $pwd/6/6m -I . -I lib/sys lib/std/getcwd.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/slpop.myr && $pwd/6/6m -I . -I lib/sys lib/std/slpop.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/mk.myr && $pwd/6/6m -I . -I lib/sys lib/std/mk.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/strjoin.myr && $pwd/6/6m -I . -I lib/sys lib/std/strjoin.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/htab.myr && $pwd/6/6m -I . -I lib/sys lib/std/htab.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/slput.myr && $pwd/6/6m -I . -I lib/sys lib/std/slput.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/slpush.myr && $pwd/6/6m -I . -I lib/sys lib/std/slpush.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/slurp.myr && $pwd/6/6m -I . -I lib/sys lib/std/slurp.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/sljoin.myr && $pwd/6/6m -I . -I lib/sys lib/std/sljoin.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/sldup.myr && $pwd/6/6m -I . -I lib/sys lib/std/sldup.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/fndup.myr && $pwd/6/6m -I . -I lib/sys lib/std/fndup.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/dir+openbsd.myr && $pwd/6/6m -I . -I lib/sys lib/std/dir+openbsd.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/diriter.myr && $pwd/6/6m -I . -I lib/sys lib/std/diriter.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/dirname.myr && $pwd/6/6m -I . -I lib/sys lib/std/dirname.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/putint.myr && $pwd/6/6m -I . -I lib/sys lib/std/putint.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/utf.myr && $pwd/6/6m -I . -I lib/sys lib/std/utf.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/strbuf.myr && $pwd/6/6m -I . -I lib/sys lib/std/strbuf.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/striter.myr && $pwd/6/6m -I . -I lib/sys lib/std/striter.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/chartype.myr && $pwd/6/6m -I . -I lib/sys lib/std/chartype.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/cmp.myr && $pwd/6/6m -I . -I lib/sys lib/std/cmp.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/search.myr && $pwd/6/6m -I . -I lib/sys lib/std/search.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/hasprefix.myr && $pwd/6/6m -I . -I lib/sys lib/std/hasprefix.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/bigint.myr && $pwd/6/6m -I . -I lib/sys lib/std/bigint.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/fltfmt.myr && $pwd/6/6m -I . -I lib/sys lib/std/fltfmt.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/chomp.myr && $pwd/6/6m -I . -I lib/sys lib/std/chomp.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/intparse.myr && $pwd/6/6m -I . -I lib/sys lib/std/intparse.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/fltparse.myr && $pwd/6/6m -I . -I lib/sys lib/std/fltparse.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/sort.myr && $pwd/6/6m -I . -I lib/sys lib/std/sort.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/hashfuncs.myr && $pwd/6/6m -I . -I lib/sys lib/std/hashfuncs.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/bitset.myr && $pwd/6/6m -I . -I lib/sys lib/std/bitset.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/strstrip.myr && $pwd/6/6m -I . -I lib/sys lib/std/strstrip.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/strsplit.myr && $pwd/6/6m -I . -I lib/sys lib/std/strsplit.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/getint.myr && $pwd/6/6m -I . -I lib/sys lib/std/getint.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/introspect.myr && $pwd/6/6m -I . -I lib/sys lib/std/introspect.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/varargs.myr && $pwd/6/6m -I . -I lib/sys lib/std/varargs.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/fmt.myr && $pwd/6/6m -I . -I lib/sys lib/std/fmt.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/pathjoin.myr && $pwd/6/6m -I . -I lib/sys lib/std/pathjoin.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/try.myr && $pwd/6/6m -I . -I lib/sys lib/std/try.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/netaddr.myr && $pwd/6/6m -I . -I lib/sys lib/std/netaddr.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/env+posixy.myr && $pwd/6/6m -I . -I lib/sys lib/std/env+posixy.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/execvp.myr && $pwd/6/6m -I . -I lib/sys lib/std/execvp.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/iterutil.myr && $pwd/6/6m -I . -I lib/sys lib/std/iterutil.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/assert.myr && $pwd/6/6m -I . -I lib/sys lib/std/assert.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/rand.myr && $pwd/6/6m -I . -I lib/sys lib/std/rand.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/mktemp.myr && $pwd/6/6m -I . -I lib/sys lib/std/mktemp.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/optparse.myr && $pwd/6/6m -I . -I lib/sys lib/std/optparse.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/ipparse.myr && $pwd/6/6m -I . -I lib/sys lib/std/ipparse.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/resolve+posixy.myr && $pwd/6/6m -I . -I lib/sys lib/std/resolve+posixy.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/dialparse+posixy.myr && $pwd/6/6m -I . -I lib/sys lib/std/dialparse+posixy.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/listen+posixy.myr && $pwd/6/6m -I . -I lib/sys lib/std/listen+posixy.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/dial+posixy.myr && $pwd/6/6m -I . -I lib/sys lib/std/dial+posixy.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/fmtfuncs.myr && $pwd/6/6m -I . -I lib/sys lib/std/fmtfuncs.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/wait+posixy.myr && $pwd/6/6m -I . -I lib/sys lib/std/wait+posixy.myr &&\
-echo $pwd/6/6m -I . -I lib/sys lib/std/spork.myr && $pwd/6/6m -I . -I lib/sys lib/std/spork.myr &&\
-echo ar -rcs lib/std/libstd.a lib/std/die.o lib/std/hassuffix.o lib/std/sldup.o lib/std/getbp.o lib/std/now.o lib/std/sljoin.o lib/std/readall.o lib/std/cstrconv.o lib/std/slurp.o lib/std/wait.o lib/std/dirname.o lib/std/option.o lib/std/errno.o lib/std/intparse.o lib/std/rand.o lib/std/introspect.o lib/std/syswrap.o lib/std/fltbits.o lib/std/fltparse.o lib/std/strstrip.o lib/std/dir.o lib/std/slpush.o lib/std/memops.o lib/std/ipparse.o lib/std/dialparse.o lib/std/execvp.o lib/std/sjlj.o lib/std/slput.o lib/std/getint.o lib/std/spork.o lib/std/htab.o lib/std/blat.o lib/std/alloc.o lib/std/optparse.o lib/std/chartype.o lib/std/varargs.o lib/std/backtrace.o lib/std/syswrap-ss.o lib/std/slfill.o lib/std/bytealloc.o lib/std/diriter.o lib/std/swap.o lib/std/assert.o lib/std/utf.o lib/std/sort.o lib/std/hashfuncs.o lib/std/clear.o lib/std/striter.o lib/std/dial.o lib/std/iterutil.o lib/std/strjoin.o lib/std/mk.o lib/std/mktemp.o lib/std/chomp.o lib/std/units.o lib/std/memops-impl.o lib/std/fndup.o lib/std/putint.o lib/std/types.o lib/std/mkpath.o lib/std/listen.o lib/std/bigint.o lib/std/fmtfuncs.o lib/std/env.o lib/std/fmt.o lib/std/resolve.o lib/std/extremum.o lib/std/consts.o lib/std/sleq.o lib/std/strbuf.o lib/std/threadhooks.o lib/std/slpop.o lib/std/sjlj-impl.o lib/std/result.o lib/std/strfind.o lib/std/slcp.o lib/std/netaddr.o lib/std/sleep.o lib/std/hasprefix.o lib/std/try.o lib/std/search.o lib/std/writeall.o lib/std/cmp.o lib/std/endian.o lib/std/getcwd.o lib/std/bitset.o lib/std/pathjoin.o lib/std/fltfmt.o lib/std/strsplit.o && ar -rcs lib/std/libstd.a lib/std/die.o lib/std/hassuffix.o lib/std/sldup.o lib/std/getbp.o lib/std/now.o lib/std/sljoin.o lib/std/readall.o lib/std/cstrconv.o lib/std/slurp.o lib/std/wait.o lib/std/dirname.o lib/std/option.o lib/std/errno.o lib/std/intparse.o lib/std/rand.o lib/std/introspect.o lib/std/syswrap.o lib/std/fltbits.o lib/std/fltparse.o lib/std/strstrip.o lib/std/dir.o lib/std/slpush.o lib/std/memops.o lib/std/ipparse.o lib/std/dialparse.o lib/std/execvp.o lib/std/sjlj.o lib/std/slput.o lib/std/getint.o lib/std/spork.o lib/std/htab.o lib/std/blat.o lib/std/alloc.o lib/std/optparse.o lib/std/chartype.o lib/std/varargs.o lib/std/backtrace.o lib/std/syswrap-ss.o lib/std/slfill.o lib/std/bytealloc.o lib/std/diriter.o lib/std/swap.o lib/std/assert.o lib/std/utf.o lib/std/sort.o lib/std/hashfuncs.o lib/std/clear.o lib/std/striter.o lib/std/dial.o lib/std/iterutil.o lib/std/strjoin.o lib/std/mk.o lib/std/mktemp.o lib/std/chomp.o lib/std/units.o lib/std/memops-impl.o lib/std/fndup.o lib/std/putint.o lib/std/types.o lib/std/mkpath.o lib/std/listen.o lib/std/bigint.o lib/std/fmtfuncs.o lib/std/env.o lib/std/fmt.o lib/std/resolve.o lib/std/extremum.o lib/std/consts.o lib/std/sleq.o lib/std/strbuf.o lib/std/threadhooks.o lib/std/slpop.o lib/std/sjlj-impl.o lib/std/result.o lib/std/strfind.o lib/std/slcp.o lib/std/netaddr.o lib/std/sleep.o lib/std/hasprefix.o lib/std/try.o lib/std/search.o lib/std/writeall.o lib/std/cmp.o lib/std/endian.o lib/std/getcwd.o lib/std/bitset.o lib/std/pathjoin.o lib/std/fltfmt.o lib/std/strsplit.o &&\
-echo $pwd/muse/muse -o lib/std/libstd.use -p std lib/std/die.use lib/std/hassuffix.use lib/std/sldup.use lib/std/now.use lib/std/sljoin.use lib/std/readall.use lib/std/cstrconv.use lib/std/slurp.use lib/std/wait.use lib/std/dirname.use lib/std/option.use lib/std/errno.use lib/std/intparse.use lib/std/rand.use lib/std/introspect.use lib/std/syswrap.use lib/std/fltbits.use lib/std/fltparse.use lib/std/strstrip.use lib/std/dir.use lib/std/slpush.use lib/std/memops.use lib/std/ipparse.use lib/std/dialparse.use lib/std/execvp.use lib/std/sjlj.use lib/std/slput.use lib/std/getint.use lib/std/spork.use lib/std/htab.use lib/std/blat.use lib/std/alloc.use lib/std/optparse.use lib/std/chartype.use lib/std/varargs.use lib/std/backtrace.use lib/std/syswrap-ss.use lib/std/slfill.use lib/std/bytealloc.use lib/std/diriter.use lib/std/swap.use lib/std/assert.use lib/std/utf.use lib/std/sort.use lib/std/hashfuncs.use lib/std/clear.use lib/std/striter.use lib/std/dial.use lib/std/iterutil.use lib/std/strjoin.use lib/std/mk.use lib/std/mktemp.use lib/std/chomp.use lib/std/units.use lib/std/fndup.use lib/std/putint.use lib/std/types.use lib/std/mkpath.use lib/std/listen.use lib/std/bigint.use lib/std/fmtfuncs.use lib/std/env.use lib/std/fmt.use lib/std/resolve.use lib/std/extremum.use lib/std/consts.use lib/std/sleq.use lib/std/strbuf.use lib/std/threadhooks.use lib/std/slpop.use lib/std/result.use lib/std/strfind.use lib/std/slcp.use lib/std/netaddr.use lib/std/sleep.use lib/std/hasprefix.use lib/std/try.use lib/std/search.use lib/std/writeall.use lib/std/cmp.use lib/std/endian.use lib/std/getcwd.use lib/std/bitset.use lib/std/pathjoin.use lib/std/fltfmt.use lib/std/strsplit.use && $pwd/muse/muse -o lib/std/libstd.use -p std lib/std/die.use lib/std/hassuffix.use lib/std/sldup.use lib/std/now.use lib/std/sljoin.use lib/std/readall.use lib/std/cstrconv.use lib/std/slurp.use lib/std/wait.use lib/std/dirname.use lib/std/option.use lib/std/errno.use lib/std/intparse.use lib/std/rand.use lib/std/introspect.use lib/std/syswrap.use lib/std/fltbits.use lib/std/fltparse.use lib/std/strstrip.use lib/std/dir.use lib/std/slpush.use lib/std/memops.use lib/std/ipparse.use lib/std/dialparse.use lib/std/execvp.use lib/std/sjlj.use lib/std/slput.use lib/std/getint.use lib/std/spork.use lib/std/htab.use lib/std/blat.use lib/std/alloc.use lib/std/optparse.use lib/std/chartype.use lib/std/varargs.use lib/std/backtrace.use lib/std/syswrap-ss.use lib/std/slfill.use lib/std/bytealloc.use lib/std/diriter.use lib/std/swap.use lib/std/assert.use lib/std/utf.use lib/std/sort.use lib/std/hashfuncs.use lib/std/clear.use lib/std/striter.use lib/std/dial.use lib/std/iterutil.use lib/std/strjoin.use lib/std/mk.use lib/std/mktemp.use lib/std/chomp.use lib/std/units.use lib/std/fndup.use lib/std/putint.use lib/std/types.use lib/std/mkpath.use lib/std/listen.use lib/std/bigint.use lib/std/fmtfuncs.use lib/std/env.use lib/std/fmt.use lib/std/resolve.use lib/std/extremum.use lib/std/consts.use lib/std/sleq.use lib/std/strbuf.use lib/std/threadhooks.use lib/std/slpop.use lib/std/result.use lib/std/strfind.use lib/std/slcp.use lib/std/netaddr.use lib/std/sleep.use lib/std/hasprefix.use lib/std/try.use lib/std/search.use lib/std/writeall.use lib/std/cmp.use lib/std/endian.use lib/std/getcwd.use lib/std/bitset.use lib/std/pathjoin.use lib/std/fltfmt.use lib/std/strsplit.use &&\
-echo $pwd/6/6m -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/types.myr && $pwd/6/6m -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/types.myr &&\
-echo $pwd/6/6m -I lib/sys -I lib/std lib/thread/common.myr && $pwd/6/6m -I lib/sys -I lib/std lib/thread/common.myr &&\
-echo $pwd/6/6m -I lib/sys -I lib/std lib/thread/atomic.myr && $pwd/6/6m -I lib/sys -I lib/std lib/thread/atomic.myr &&\
-echo $pwd/6/6m -I lib/sys -I lib/std lib/thread/mutex.myr && $pwd/6/6m -I lib/sys -I lib/std lib/thread/mutex.myr &&\
-echo $pwd/6/6m -I lib/sys -I lib/std lib/thread/hookstd.myr && $pwd/6/6m -I lib/sys -I lib/std lib/thread/hookstd.myr &&\
-echo $pwd/6/6m -I lib/sys -I lib/std lib/thread/ncpu.myr && $pwd/6/6m -I lib/sys -I lib/std lib/thread/ncpu.myr &&\
-echo $pwd/6/6m -I lib/sys -I lib/std lib/thread/spawn+openbsd.myr && $pwd/6/6m -I lib/sys -I lib/std lib/thread/spawn+openbsd.myr &&\
-echo ar -rcs lib/thread/libthread.a lib/thread/mutex.o lib/thread/spawn.o lib/thread/ncpu.o lib/thread/hookstd.o lib/thread/atomic-impl.o lib/thread/atomic.o lib/thread/common.o lib/thread/exit.o && ar -rcs lib/thread/libthread.a lib/thread/mutex.o lib/thread/spawn.o lib/thread/ncpu.o lib/thread/hookstd.o lib/thread/atomic-impl.o lib/thread/atomic.o lib/thread/common.o lib/thread/exit.o &&\
-echo $pwd/muse/muse -o lib/thread/libthread.use -p thread lib/thread/mutex.use lib/thread/spawn.use lib/thread/ncpu.use lib/thread/hookstd.use lib/thread/atomic.use lib/thread/common.use && $pwd/muse/muse -o lib/thread/libthread.use -p thread lib/thread/mutex.use lib/thread/spawn.use lib/thread/ncpu.use lib/thread/hookstd.use lib/thread/atomic.use lib/thread/common.use &&\
-echo $pwd/6/6m -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/opts.myr && $pwd/6/6m -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/opts.myr &&\
-echo $pwd/6/6m -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/syssel.myr && $pwd/6/6m -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/syssel.myr &&\
-echo $pwd/6/6m -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/util.myr && $pwd/6/6m -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/util.myr &&\
-echo $pwd/6/6m -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/parse.myr && $pwd/6/6m -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/parse.myr &&\
-echo $pwd/6/6m -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/build.myr && $pwd/6/6m -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/build.myr &&\
-echo $pwd/6/6m -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/install.myr && $pwd/6/6m -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/install.myr &&\
-echo $pwd/6/6m -I lib/std -I lib/sys lib/bio/bio.myr && $pwd/6/6m -I lib/std -I lib/sys lib/bio/bio.myr &&\
-echo $pwd/6/6m -I lib/std -I lib/sys lib/bio/mem.myr && $pwd/6/6m -I lib/std -I lib/sys lib/bio/mem.myr &&\
-echo $pwd/6/6m -I lib/std -I lib/sys lib/bio/puti.myr && $pwd/6/6m -I lib/std -I lib/sys lib/bio/puti.myr &&\
-echo $pwd/6/6m -I lib/std -I lib/sys lib/bio/iter.myr && $pwd/6/6m -I lib/std -I lib/sys lib/bio/iter.myr &&\
-echo $pwd/6/6m -I lib/std -I lib/sys lib/bio/geti.myr && $pwd/6/6m -I lib/std -I lib/sys lib/bio/geti.myr &&\
-echo ar -rcs lib/bio/libbio.a lib/bio/bio.o lib/bio/geti.o lib/bio/iter.o lib/bio/puti.o lib/bio/mem.o && ar -rcs lib/bio/libbio.a lib/bio/bio.o lib/bio/geti.o lib/bio/iter.o lib/bio/puti.o lib/bio/mem.o &&\
-echo $pwd/muse/muse -o lib/bio/libbio.use -p bio lib/bio/bio.use lib/bio/geti.use lib/bio/iter.use lib/bio/puti.use lib/bio/mem.use && $pwd/muse/muse -o lib/bio/libbio.use -p bio lib/bio/bio.use lib/bio/geti.use lib/bio/iter.use lib/bio/puti.use lib/bio/mem.use &&\
-echo $pwd/6/6m -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/libs.myr && $pwd/6/6m -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/libs.myr &&\
-echo $pwd/6/6m -I lib/sys -I lib/std lib/regex/types.myr && $pwd/6/6m -I lib/sys -I lib/std lib/regex/types.myr &&\
-echo $pwd/6/6m -I lib/sys -I lib/std lib/regex/interp.myr && $pwd/6/6m -I lib/sys -I lib/std lib/regex/interp.myr &&\
-echo $pwd/6/6m -I lib/sys -I lib/std lib/regex/ranges.myr && $pwd/6/6m -I lib/sys -I lib/std lib/regex/ranges.myr &&\
-echo $pwd/6/6m -I lib/sys -I lib/std lib/regex/compile.myr && $pwd/6/6m -I lib/sys -I lib/std lib/regex/compile.myr &&\
-echo ar -rcs lib/regex/libregex.a lib/regex/interp.o lib/regex/ranges.o lib/regex/compile.o lib/regex/types.o && ar -rcs lib/regex/libregex.a lib/regex/interp.o lib/regex/ranges.o lib/regex/compile.o lib/regex/types.o &&\
-echo $pwd/muse/muse -o lib/regex/libregex.use -p regex lib/regex/interp.use lib/regex/ranges.use lib/regex/compile.use lib/regex/types.use && $pwd/muse/muse -o lib/regex/libregex.use -p regex lib/regex/interp.use lib/regex/ranges.use lib/regex/compile.use lib/regex/types.use &&\
-echo $pwd/6/6m -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/deps.myr && $pwd/6/6m -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/deps.myr &&\
-echo $pwd/6/6m -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/subtest.myr && $pwd/6/6m -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/subtest.myr &&\
-echo $pwd/6/6m -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/test.myr && $pwd/6/6m -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/test.myr &&\
-echo $pwd/6/6m -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/main.myr && $pwd/6/6m -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/main.myr &&\
-echo ld -static -nopie -o mbld/mbld $pwd/rt/_myrrt.o mbld/types.o mbld/config.o mbld/build.o mbld/libs.o mbld/install.o mbld/test.o mbld/util.o mbld/main.o mbld/subtest.o mbld/opts.o mbld/parse.o mbld/syssel.o mbld/deps.o -Llib/thread -lthread -Llib/regex -lregex -Llib/bio -lbio -Llib/std -lstd -Llib/sys -lsys && ld -static -nopie -o mbld/mbld $pwd/rt/_myrrt.o mbld/types.o mbld/config.o mbld/build.o mbld/libs.o mbld/install.o mbld/test.o mbld/util.o mbld/main.o mbld/subtest.o mbld/opts.o mbld/parse.o mbld/syssel.o mbld/deps.o -Llib/thread -lthread -Llib/regex -lregex -Llib/bio -lbio -Llib/std -lstd -Llib/sys -lsys &&\
+set -x
+ $pwd/6/6m -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/config.myr
+ as -g -o lib/thread/exit.o lib/thread/exit+openbsd-x64.s
+ as -g -o lib/thread/atomic-impl.o lib/thread/atomic-impl+x64.s
+ as -g -o lib/std/getbp.o lib/std/getbp+posixy-x64.s
+ $pwd/6/6m -I . -I lib/sys lib/std/option.myr
+ as -g -o lib/std/memops-impl.o lib/std/memops-impl+posixy-x64.s
+ $pwd/6/6m -I . -I lib/sys lib/std/fltbits.myr
+ as -g -o lib/std/sjlj-impl.o lib/std/sjlj-impl+posixy-x64.s
+ $pwd/6/6m -I . -I lib/sys lib/std/endian.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/extremum.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/sjlj.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/swap.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/slfill.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/clear.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/result.myr
+ as -g -o lib/sys/syscall.o lib/sys/syscall+openbsd-x64.s
+ $pwd/6/6m lib/sys/ifreq+openbsd.myr
+ $pwd/6/6m lib/sys/systypes.myr
+ as -g -o lib/sys/util.o lib/sys/util+posixy-x64.s
+ $pwd/6/6m lib/sys/syserrno+openbsd.myr
+ $pwd/6/6m lib/sys/sys+openbsd:6.1-x64.myr
+ ar -rcs lib/sys/libsys.a lib/sys/sys.o lib/sys/syserrno.o lib/sys/util.o lib/sys/systypes.o lib/sys/ifreq.o lib/sys/syscall.o
+ $pwd/muse/muse -o lib/sys/libsys.use -p sys lib/sys/sys.use lib/sys/syserrno.use lib/sys/systypes.use lib/sys/ifreq.use
+ $pwd/6/6m -I . -I lib/sys lib/std/errno.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/types.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/strfind.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/memops.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/sleq.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/hassuffix.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/backtrace+x64.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/units.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/cstrconv.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/syswrap+posixy.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/mkpath.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/now.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/consts.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/die.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/slcp.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/syswrap-ss+openbsd.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/sleep.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/chartype.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/utf.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/cmp.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/sort.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/search.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/hasprefix.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/chomp.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/striter.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/intparse.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/strstrip.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/introspect.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/varargs.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/wait+posixy.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/threadhooks.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/bytealloc.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/alloc.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/slurp.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/mk.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/slput.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/htab.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/slpush.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/strsplit.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/strbuf.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/sldup.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/bigint.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/fltparse.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/fltfmt.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/dirname.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/dir+openbsd.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/diriter.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/fndup.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/strjoin.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/getcwd.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/slpop.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/sljoin.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/getint.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/hashfuncs.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/bitset.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/putint.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/readall.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/blat.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/writeall.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/fmt.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/env+posixy.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/execvp.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/spork.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/assert.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/rand.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/pathjoin.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/mktemp.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/optparse.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/netaddr.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/iterutil.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/ipparse.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/fmtfuncs.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/resolve+posixy.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/dialparse+posixy.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/dial+posixy.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/listen+posixy.myr
+ $pwd/6/6m -I . -I lib/sys lib/std/try.myr
+ ar -rcs lib/std/libstd.a lib/std/resolve.o lib/std/result.o lib/std/try.o lib/std/ipparse.o lib/std/alloc.o lib/std/iterutil.o lib/std/putint.o lib/std/sleq.o lib/std/sljoin.o lib/std/slpop.o lib/std/syswrap.o lib/std/getint.o lib/std/strsplit.o lib/std/slfill.o lib/std/writeall.o lib/std/fltfmt.o lib/std/hasprefix.o lib/std/swap.o lib/std/fmt.o lib/std/netaddr.o lib/std/varargs.o lib/std/diriter.o lib/std/getcwd.o lib/std/blat.o lib/std/optparse.o lib/std/pathjoin.o lib/std/readall.o lib/std/strjoin.o lib/std/threadhooks.o lib/std/sjlj.o lib/std/extremum.o lib/std/endian.o lib/std/rand.o lib/std/sldup.o lib/std/sleep.o lib/std/wait.o lib/std/introspect.o lib/std/fltparse.o lib/std/fndup.o lib/std/strbuf.o lib/std/assert.o lib/std/spork.o lib/std/slpush.o lib/std/strstrip.o lib/std/htab.o lib/std/hashfuncs.o lib/std/slput.o lib/std/sjlj-impl.o lib/std/fltbits.o lib/std/striter.o lib/std/types.o lib/std/cstrconv.o lib/std/units.o lib/std/backtrace.o lib/std/syswrap-ss.o lib/std/die.o lib/std/mk.o lib/std/hassuffix.o lib/std/memops-impl.o lib/std/utf.o lib/std/slurp.o lib/std/dialparse.o lib/std/bytealloc.o lib/std/mktemp.o lib/std/consts.o lib/std/chomp.o lib/std/dir.o lib/std/search.o lib/std/memops.o lib/std/fmtfuncs.o lib/std/strfind.o lib/std/env.o lib/std/dirname.o lib/std/clear.o lib/std/listen.o lib/std/sort.o lib/std/cmp.o lib/std/now.o lib/std/intparse.o lib/std/mkpath.o lib/std/option.o lib/std/dial.o lib/std/errno.o lib/std/chartype.o lib/std/bigint.o lib/std/bitset.o lib/std/getbp.o lib/std/slcp.o lib/std/execvp.o
+ $pwd/muse/muse -o lib/std/libstd.use -p std lib/std/resolve.use lib/std/result.use lib/std/try.use lib/std/ipparse.use lib/std/alloc.use lib/std/iterutil.use lib/std/putint.use lib/std/sleq.use lib/std/sljoin.use lib/std/slpop.use lib/std/syswrap.use lib/std/getint.use lib/std/strsplit.use lib/std/slfill.use lib/std/writeall.use lib/std/fltfmt.use lib/std/hasprefix.use lib/std/swap.use lib/std/fmt.use lib/std/netaddr.use lib/std/varargs.use lib/std/diriter.use lib/std/getcwd.use lib/std/blat.use lib/std/optparse.use lib/std/pathjoin.use lib/std/readall.use lib/std/strjoin.use lib/std/threadhooks.use lib/std/sjlj.use lib/std/extremum.use lib/std/endian.use lib/std/rand.use lib/std/sldup.use lib/std/sleep.use lib/std/wait.use lib/std/introspect.use lib/std/fltparse.use lib/std/fndup.use lib/std/strbuf.use lib/std/assert.use lib/std/spork.use lib/std/slpush.use lib/std/strstrip.use lib/std/htab.use lib/std/hashfuncs.use lib/std/slput.use lib/std/fltbits.use lib/std/striter.use lib/std/types.use lib/std/cstrconv.use lib/std/units.use lib/std/backtrace.use lib/std/syswrap-ss.use lib/std/die.use lib/std/mk.use lib/std/hassuffix.use lib/std/utf.use lib/std/slurp.use lib/std/dialparse.use lib/std/bytealloc.use lib/std/mktemp.use lib/std/consts.use lib/std/chomp.use lib/std/dir.use lib/std/search.use lib/std/memops.use lib/std/fmtfuncs.use lib/std/strfind.use lib/std/env.use lib/std/dirname.use lib/std/clear.use lib/std/listen.use lib/std/sort.use lib/std/cmp.use lib/std/now.use lib/std/intparse.use lib/std/mkpath.use lib/std/option.use lib/std/dial.use lib/std/errno.use lib/std/chartype.use lib/std/bigint.use lib/std/bitset.use lib/std/slcp.use lib/std/execvp.use
+ $pwd/6/6m -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/types.myr
+ $pwd/6/6m -I lib/sys -I lib/std lib/regex/types.myr
+ $pwd/6/6m -I lib/sys -I lib/std lib/regex/interp.myr
+ $pwd/6/6m -I lib/std -I lib/sys lib/bio/bio.myr
+ $pwd/6/6m -I lib/std -I lib/sys lib/bio/iter.myr
+ $pwd/6/6m -I lib/std -I lib/sys lib/bio/mem.myr
+ $pwd/6/6m -I lib/std -I lib/sys lib/bio/geti.myr
+ $pwd/6/6m -I lib/std -I lib/sys lib/bio/puti.myr
+ ar -rcs lib/bio/libbio.a lib/bio/puti.o lib/bio/geti.o lib/bio/mem.o lib/bio/bio.o lib/bio/iter.o
+ $pwd/muse/muse -o lib/bio/libbio.use -p bio lib/bio/puti.use lib/bio/geti.use lib/bio/mem.use lib/bio/bio.use lib/bio/iter.use
+ $pwd/6/6m -I lib/sys -I lib/std lib/thread/spawn+openbsd.myr
+ $pwd/6/6m -I lib/sys -I lib/std lib/thread/ncpu.myr
+ $pwd/6/6m -I lib/sys -I lib/std lib/thread/common.myr
+ $pwd/6/6m -I lib/sys -I lib/std lib/thread/atomic.myr
+ $pwd/6/6m -I lib/sys -I lib/std lib/thread/mutex.myr
+ $pwd/6/6m -I lib/sys -I lib/std lib/thread/hookstd.myr
+ ar -rcs lib/thread/libthread.a lib/thread/mutex.o lib/thread/atomic.o lib/thread/atomic-impl.o lib/thread/hookstd.o lib/thread/common.o lib/thread/ncpu.o lib/thread/exit.o lib/thread/spawn.o
+ $pwd/muse/muse -o lib/thread/libthread.use -p thread lib/thread/mutex.use lib/thread/atomic.use lib/thread/hookstd.use lib/thread/common.use lib/thread/ncpu.use lib/thread/spawn.use
+ $pwd/6/6m -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/opts.myr
+ $pwd/6/6m -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/syssel.myr
+ $pwd/6/6m -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/libs.myr
+ $pwd/6/6m -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/util.myr
+ $pwd/6/6m -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/build.myr
+ $pwd/6/6m -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/install.myr
+ $pwd/6/6m -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/parse.myr
+ $pwd/6/6m -I lib/sys -I lib/std lib/regex/ranges.myr
+ $pwd/6/6m -I lib/sys -I lib/std lib/regex/compile.myr
+ ar -rcs lib/regex/libregex.a lib/regex/interp.o lib/regex/ranges.o lib/regex/types.o lib/regex/compile.o
+ $pwd/muse/muse -o lib/regex/libregex.use -p regex lib/regex/interp.use lib/regex/ranges.use lib/regex/types.use lib/regex/compile.use
+ $pwd/6/6m -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/subtest.myr
+ $pwd/6/6m -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/test.myr
+ $pwd/6/6m -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/deps.myr
+ $pwd/6/6m -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/main.myr
+ ld -static -nopie -o mbld/mbld $pwd/rt/_myrrt.o mbld/deps.o mbld/main.o mbld/util.o mbld/libs.o mbld/syssel.o mbld/config.o mbld/opts.o mbld/subtest.o mbld/types.o mbld/test.o mbld/install.o mbld/parse.o mbld/build.o -Llib/thread -lthread -Llib/bio -lbio -Llib/regex -lregex -Llib/std -lstd -Llib/sys -lsys
true
diff --git a/mk/bootstrap/bootstrap+Plan9-amd64.sh b/mk/bootstrap/bootstrap+Plan9-amd64.sh
index 4726f51..84e7e95 100755
--- a/mk/bootstrap/bootstrap+Plan9-amd64.sh
+++ b/mk/bootstrap/bootstrap+Plan9-amd64.sh
@@ -2,136 +2,138 @@
# This script is generated by genbootstrap.sh
# to regenerate, run "make bootstrap"
pwd=`pwd`
-echo $pwd/6/6.out -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/config+plan9-x64.myr && $pwd/6/6.out -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/config+plan9-x64.myr &&\
-echo 6a -o lib/thread/atomic-impl.6 lib/thread/atomic-impl+plan9-x64.s && 6a -o lib/thread/atomic-impl.6 lib/thread/atomic-impl+plan9-x64.s &&\
-echo $pwd/6/6.out -I . -I lib/sys lib/std/endian.myr && $pwd/6/6.out -I . -I lib/sys lib/std/endian.myr &&\
-echo $pwd/6/6.out -I . -I lib/sys lib/std/result.myr && $pwd/6/6.out -I . -I lib/sys lib/std/result.myr &&\
-echo 6a -o lib/std/sjlj-impl.6 lib/std/sjlj-impl+plan9-x64.s && 6a -o lib/std/sjlj-impl.6 lib/std/sjlj-impl+plan9-x64.s &&\
-echo $pwd/6/6.out -I . -I lib/sys lib/std/extremum.myr && $pwd/6/6.out -I . -I lib/sys lib/std/extremum.myr &&\
-echo $pwd/6/6.out -I . -I lib/sys lib/std/resolve+plan9.myr && $pwd/6/6.out -I . -I lib/sys lib/std/resolve+plan9.myr &&\
-echo 6a -o lib/std/memops-impl.6 lib/std/memops-impl+plan9-x64.s && 6a -o lib/std/memops-impl.6 lib/std/memops-impl+plan9-x64.s &&\
-echo $pwd/6/6.out -I . -I lib/sys lib/std/swap.myr && $pwd/6/6.out -I . -I lib/sys lib/std/swap.myr &&\
-echo $pwd/6/6.out -I . -I lib/sys lib/std/slfill.myr && $pwd/6/6.out -I . -I lib/sys lib/std/slfill.myr &&\
-echo $pwd/6/6.out -I . -I lib/sys lib/std/clear.myr && $pwd/6/6.out -I . -I lib/sys lib/std/clear.myr &&\
-echo $pwd/6/6.out -I . -I lib/sys lib/std/sjlj.myr && $pwd/6/6.out -I . -I lib/sys lib/std/sjlj.myr &&\
-echo $pwd/6/6.out -I . -I lib/sys lib/std/fltbits.myr && $pwd/6/6.out -I . -I lib/sys lib/std/fltbits.myr &&\
-echo $pwd/6/6.out -I . -I lib/sys lib/std/errno+plan9.myr && $pwd/6/6.out -I . -I lib/sys lib/std/errno+plan9.myr &&\
-echo $pwd/6/6.out -I . -I lib/sys lib/std/option.myr && $pwd/6/6.out -I . -I lib/sys lib/std/option.myr &&\
-echo 6a -o lib/std/getbp.6 lib/std/getbp+plan9-x64.s && 6a -o lib/std/getbp.6 lib/std/getbp+plan9-x64.s &&\
-echo $pwd/6/6.out lib/sys/ifreq+plan9.myr && $pwd/6/6.out lib/sys/ifreq+plan9.myr &&\
-echo 6a -o lib/sys/syscall.6 lib/sys/syscall+plan9-x64.s && 6a -o lib/sys/syscall.6 lib/sys/syscall+plan9-x64.s &&\
-echo $pwd/6/6.out lib/sys/systypes.myr && $pwd/6/6.out lib/sys/systypes.myr &&\
-echo $pwd/6/6.out lib/sys/sys+plan9-x64.myr && $pwd/6/6.out lib/sys/sys+plan9-x64.myr &&\
-echo $pwd/muse/6.out -o lib/sys/libsys.use -p sys lib/sys/sys.use lib/sys/systypes.use lib/sys/ifreq.use && $pwd/muse/6.out -o lib/sys/libsys.use -p sys lib/sys/sys.use lib/sys/systypes.use lib/sys/ifreq.use &&\
-echo 6a -o lib/sys/util.6 lib/sys/util+plan9-x64.s && 6a -o lib/sys/util.6 lib/sys/util+plan9-x64.s &&\
-echo ar u lib/sys/libsys.a lib/sys/util.6 lib/sys/sys.6 lib/sys/systypes.6 lib/sys/syscall.6 lib/sys/ifreq.6 && ar u lib/sys/libsys.a lib/sys/util.6 lib/sys/sys.6 lib/sys/systypes.6 lib/sys/syscall.6 lib/sys/ifreq.6 &&\
-echo $pwd/6/6.out -I . -I lib/sys lib/std/types.myr && $pwd/6/6.out -I . -I lib/sys lib/std/types.myr &&\
-echo $pwd/6/6.out -I . -I lib/sys lib/std/strfind.myr && $pwd/6/6.out -I . -I lib/sys lib/std/strfind.myr &&\
-echo $pwd/6/6.out -I . -I lib/sys lib/std/units.myr && $pwd/6/6.out -I . -I lib/sys lib/std/units.myr &&\
-echo $pwd/6/6.out -I . -I lib/sys lib/std/backtrace+x64.myr && $pwd/6/6.out -I . -I lib/sys lib/std/backtrace+x64.myr &&\
-echo $pwd/6/6.out -I . -I lib/sys lib/std/memops.myr && $pwd/6/6.out -I . -I lib/sys lib/std/memops.myr &&\
-echo $pwd/6/6.out -I . -I lib/sys lib/std/sleq.myr && $pwd/6/6.out -I . -I lib/sys lib/std/sleq.myr &&\
-echo $pwd/6/6.out -I . -I lib/sys lib/std/hassuffix.myr && $pwd/6/6.out -I . -I lib/sys lib/std/hassuffix.myr &&\
-echo $pwd/6/6.out -I . -I lib/sys lib/std/cstrconv.myr && $pwd/6/6.out -I . -I lib/sys lib/std/cstrconv.myr &&\
-echo $pwd/6/6.out -I . -I lib/sys lib/std/syswrap-ss+plan9.myr && $pwd/6/6.out -I . -I lib/sys lib/std/syswrap-ss+plan9.myr &&\
-echo $pwd/6/6.out -I . -I lib/sys lib/std/sleep.myr && $pwd/6/6.out -I . -I lib/sys lib/std/sleep.myr &&\
-echo $pwd/6/6.out -I . -I lib/sys lib/std/syswrap+plan9.myr && $pwd/6/6.out -I . -I lib/sys lib/std/syswrap+plan9.myr &&\
-echo $pwd/6/6.out -I . -I lib/sys lib/std/writeall.myr && $pwd/6/6.out -I . -I lib/sys lib/std/writeall.myr &&\
-echo $pwd/6/6.out -I . -I lib/sys lib/std/consts.myr && $pwd/6/6.out -I . -I lib/sys lib/std/consts.myr &&\
-echo $pwd/6/6.out -I . -I lib/sys lib/std/mkpath.myr && $pwd/6/6.out -I . -I lib/sys lib/std/mkpath.myr &&\
-echo $pwd/6/6.out -I . -I lib/sys lib/std/blat.myr && $pwd/6/6.out -I . -I lib/sys lib/std/blat.myr &&\
-echo $pwd/6/6.out -I . -I lib/sys lib/std/readall.myr && $pwd/6/6.out -I . -I lib/sys lib/std/readall.myr &&\
-echo $pwd/6/6.out -I . -I lib/sys lib/std/now.myr && $pwd/6/6.out -I . -I lib/sys lib/std/now.myr &&\
-echo $pwd/6/6.out -I . -I lib/sys lib/std/die.myr && $pwd/6/6.out -I . -I lib/sys lib/std/die.myr &&\
-echo $pwd/6/6.out -I . -I lib/sys lib/std/slcp.myr && $pwd/6/6.out -I . -I lib/sys lib/std/slcp.myr &&\
-echo $pwd/6/6.out -I . -I lib/sys lib/std/threadhooks.myr && $pwd/6/6.out -I . -I lib/sys lib/std/threadhooks.myr &&\
-echo $pwd/6/6.out -I . -I lib/sys lib/std/bytealloc.myr && $pwd/6/6.out -I . -I lib/sys lib/std/bytealloc.myr &&\
-echo $pwd/6/6.out -I . -I lib/sys lib/std/alloc.myr && $pwd/6/6.out -I . -I lib/sys lib/std/alloc.myr &&\
-echo $pwd/6/6.out -I . -I lib/sys lib/std/getcwd.myr && $pwd/6/6.out -I . -I lib/sys lib/std/getcwd.myr &&\
-echo $pwd/6/6.out -I . -I lib/sys lib/std/slpop.myr && $pwd/6/6.out -I . -I lib/sys lib/std/slpop.myr &&\
-echo $pwd/6/6.out -I . -I lib/sys lib/std/mk.myr && $pwd/6/6.out -I . -I lib/sys lib/std/mk.myr &&\
-echo $pwd/6/6.out -I . -I lib/sys lib/std/strjoin.myr && $pwd/6/6.out -I . -I lib/sys lib/std/strjoin.myr &&\
-echo $pwd/6/6.out -I . -I lib/sys lib/std/htab.myr && $pwd/6/6.out -I . -I lib/sys lib/std/htab.myr &&\
-echo $pwd/6/6.out -I . -I lib/sys lib/std/slput.myr && $pwd/6/6.out -I . -I lib/sys lib/std/slput.myr &&\
-echo $pwd/6/6.out -I . -I lib/sys lib/std/slpush.myr && $pwd/6/6.out -I . -I lib/sys lib/std/slpush.myr &&\
-echo $pwd/6/6.out -I . -I lib/sys lib/std/slurp.myr && $pwd/6/6.out -I . -I lib/sys lib/std/slurp.myr &&\
-echo $pwd/6/6.out -I . -I lib/sys lib/std/sljoin.myr && $pwd/6/6.out -I . -I lib/sys lib/std/sljoin.myr &&\
-echo $pwd/6/6.out -I . -I lib/sys lib/std/sldup.myr && $pwd/6/6.out -I . -I lib/sys lib/std/sldup.myr &&\
-echo $pwd/6/6.out -I . -I lib/sys lib/std/fndup.myr && $pwd/6/6.out -I . -I lib/sys lib/std/fndup.myr &&\
-echo $pwd/6/6.out -I . -I lib/sys lib/std/dir+plan9.myr && $pwd/6/6.out -I . -I lib/sys lib/std/dir+plan9.myr &&\
-echo $pwd/6/6.out -I . -I lib/sys lib/std/diriter.myr && $pwd/6/6.out -I . -I lib/sys lib/std/diriter.myr &&\
-echo $pwd/6/6.out -I . -I lib/sys lib/std/dirname.myr && $pwd/6/6.out -I . -I lib/sys lib/std/dirname.myr &&\
-echo $pwd/6/6.out -I . -I lib/sys lib/std/putint.myr && $pwd/6/6.out -I . -I lib/sys lib/std/putint.myr &&\
-echo $pwd/6/6.out -I . -I lib/sys lib/std/utf.myr && $pwd/6/6.out -I . -I lib/sys lib/std/utf.myr &&\
-echo $pwd/6/6.out -I . -I lib/sys lib/std/strbuf.myr && $pwd/6/6.out -I . -I lib/sys lib/std/strbuf.myr &&\
-echo $pwd/6/6.out -I . -I lib/sys lib/std/striter.myr && $pwd/6/6.out -I . -I lib/sys lib/std/striter.myr &&\
-echo $pwd/6/6.out -I . -I lib/sys lib/std/chartype.myr && $pwd/6/6.out -I . -I lib/sys lib/std/chartype.myr &&\
-echo $pwd/6/6.out -I . -I lib/sys lib/std/cmp.myr && $pwd/6/6.out -I . -I lib/sys lib/std/cmp.myr &&\
-echo $pwd/6/6.out -I . -I lib/sys lib/std/search.myr && $pwd/6/6.out -I . -I lib/sys lib/std/search.myr &&\
-echo $pwd/6/6.out -I . -I lib/sys lib/std/hasprefix.myr && $pwd/6/6.out -I . -I lib/sys lib/std/hasprefix.myr &&\
-echo $pwd/6/6.out -I . -I lib/sys lib/std/bigint.myr && $pwd/6/6.out -I . -I lib/sys lib/std/bigint.myr &&\
-echo $pwd/6/6.out -I . -I lib/sys lib/std/fltfmt.myr && $pwd/6/6.out -I . -I lib/sys lib/std/fltfmt.myr &&\
-echo $pwd/6/6.out -I . -I lib/sys lib/std/chomp.myr && $pwd/6/6.out -I . -I lib/sys lib/std/chomp.myr &&\
-echo $pwd/6/6.out -I . -I lib/sys lib/std/intparse.myr && $pwd/6/6.out -I . -I lib/sys lib/std/intparse.myr &&\
-echo $pwd/6/6.out -I . -I lib/sys lib/std/fltparse.myr && $pwd/6/6.out -I . -I lib/sys lib/std/fltparse.myr &&\
-echo $pwd/6/6.out -I . -I lib/sys lib/std/sort.myr && $pwd/6/6.out -I . -I lib/sys lib/std/sort.myr &&\
-echo $pwd/6/6.out -I . -I lib/sys lib/std/hashfuncs.myr && $pwd/6/6.out -I . -I lib/sys lib/std/hashfuncs.myr &&\
-echo $pwd/6/6.out -I . -I lib/sys lib/std/bitset.myr && $pwd/6/6.out -I . -I lib/sys lib/std/bitset.myr &&\
-echo $pwd/6/6.out -I . -I lib/sys lib/std/strstrip.myr && $pwd/6/6.out -I . -I lib/sys lib/std/strstrip.myr &&\
-echo $pwd/6/6.out -I . -I lib/sys lib/std/strsplit.myr && $pwd/6/6.out -I . -I lib/sys lib/std/strsplit.myr &&\
-echo $pwd/6/6.out -I . -I lib/sys lib/std/getint.myr && $pwd/6/6.out -I . -I lib/sys lib/std/getint.myr &&\
-echo $pwd/6/6.out -I . -I lib/sys lib/std/introspect.myr && $pwd/6/6.out -I . -I lib/sys lib/std/introspect.myr &&\
-echo $pwd/6/6.out -I . -I lib/sys lib/std/varargs.myr && $pwd/6/6.out -I . -I lib/sys lib/std/varargs.myr &&\
-echo $pwd/6/6.out -I . -I lib/sys lib/std/fmt.myr && $pwd/6/6.out -I . -I lib/sys lib/std/fmt.myr &&\
-echo $pwd/6/6.out -I . -I lib/sys lib/std/pathjoin.myr && $pwd/6/6.out -I . -I lib/sys lib/std/pathjoin.myr &&\
-echo $pwd/6/6.out -I . -I lib/sys lib/std/dial+plan9.myr && $pwd/6/6.out -I . -I lib/sys lib/std/dial+plan9.myr &&\
-echo $pwd/6/6.out -I . -I lib/sys lib/std/try.myr && $pwd/6/6.out -I . -I lib/sys lib/std/try.myr &&\
-echo $pwd/6/6.out -I . -I lib/sys lib/std/netaddr.myr && $pwd/6/6.out -I . -I lib/sys lib/std/netaddr.myr &&\
-echo $pwd/6/6.out -I . -I lib/sys lib/std/env+plan9.myr && $pwd/6/6.out -I . -I lib/sys lib/std/env+plan9.myr &&\
-echo $pwd/6/6.out -I . -I lib/sys lib/std/execvp.myr && $pwd/6/6.out -I . -I lib/sys lib/std/execvp.myr &&\
-echo $pwd/6/6.out -I . -I lib/sys lib/std/iterutil.myr && $pwd/6/6.out -I . -I lib/sys lib/std/iterutil.myr &&\
-echo $pwd/6/6.out -I . -I lib/sys lib/std/assert.myr && $pwd/6/6.out -I . -I lib/sys lib/std/assert.myr &&\
-echo $pwd/6/6.out -I . -I lib/sys lib/std/rand.myr && $pwd/6/6.out -I . -I lib/sys lib/std/rand.myr &&\
-echo $pwd/6/6.out -I . -I lib/sys lib/std/mktemp.myr && $pwd/6/6.out -I . -I lib/sys lib/std/mktemp.myr &&\
-echo $pwd/6/6.out -I . -I lib/sys lib/std/optparse.myr && $pwd/6/6.out -I . -I lib/sys lib/std/optparse.myr &&\
-echo $pwd/6/6.out -I . -I lib/sys lib/std/ipparse.myr && $pwd/6/6.out -I . -I lib/sys lib/std/ipparse.myr &&\
-echo $pwd/6/6.out -I . -I lib/sys lib/std/fmtfuncs.myr && $pwd/6/6.out -I . -I lib/sys lib/std/fmtfuncs.myr &&\
-echo $pwd/6/6.out -I . -I lib/sys lib/std/wait+plan9.myr && $pwd/6/6.out -I . -I lib/sys lib/std/wait+plan9.myr &&\
-echo $pwd/6/6.out -I . -I lib/sys lib/std/spork.myr && $pwd/6/6.out -I . -I lib/sys lib/std/spork.myr &&\
-echo ar u lib/std/libstd.a lib/std/die.6 lib/std/hassuffix.6 lib/std/sldup.6 lib/std/getbp.6 lib/std/now.6 lib/std/sljoin.6 lib/std/readall.6 lib/std/cstrconv.6 lib/std/slurp.6 lib/std/wait.6 lib/std/dirname.6 lib/std/option.6 lib/std/errno.6 lib/std/intparse.6 lib/std/rand.6 lib/std/introspect.6 lib/std/syswrap.6 lib/std/fltbits.6 lib/std/fltparse.6 lib/std/strstrip.6 lib/std/dir.6 lib/std/slpush.6 lib/std/memops.6 lib/std/ipparse.6 lib/std/execvp.6 lib/std/sjlj.6 lib/std/slput.6 lib/std/getint.6 lib/std/spork.6 lib/std/htab.6 lib/std/blat.6 lib/std/alloc.6 lib/std/optparse.6 lib/std/chartype.6 lib/std/varargs.6 lib/std/backtrace.6 lib/std/syswrap-ss.6 lib/std/slfill.6 lib/std/bytealloc.6 lib/std/diriter.6 lib/std/swap.6 lib/std/assert.6 lib/std/utf.6 lib/std/sort.6 lib/std/hashfuncs.6 lib/std/clear.6 lib/std/striter.6 lib/std/dial.6 lib/std/iterutil.6 lib/std/strjoin.6 lib/std/mk.6 lib/std/mktemp.6 lib/std/chomp.6 lib/std/units.6 lib/std/memops-impl.6 lib/std/fndup.6 lib/std/putint.6 lib/std/types.6 lib/std/mkpath.6 lib/std/bigint.6 lib/std/fmtfuncs.6 lib/std/env.6 lib/std/fmt.6 lib/std/resolve.6 lib/std/extremum.6 lib/std/consts.6 lib/std/sleq.6 lib/std/strbuf.6 lib/std/threadhooks.6 lib/std/slpop.6 lib/std/sjlj-impl.6 lib/std/result.6 lib/std/strfind.6 lib/std/slcp.6 lib/std/netaddr.6 lib/std/sleep.6 lib/std/hasprefix.6 lib/std/try.6 lib/std/search.6 lib/std/writeall.6 lib/std/cmp.6 lib/std/endian.6 lib/std/getcwd.6 lib/std/bitset.6 lib/std/pathjoin.6 lib/std/fltfmt.6 lib/std/strsplit.6 && ar u lib/std/libstd.a lib/std/die.6 lib/std/hassuffix.6 lib/std/sldup.6 lib/std/getbp.6 lib/std/now.6 lib/std/sljoin.6 lib/std/readall.6 lib/std/cstrconv.6 lib/std/slurp.6 lib/std/wait.6 lib/std/dirname.6 lib/std/option.6 lib/std/errno.6 lib/std/intparse.6 lib/std/rand.6 lib/std/introspect.6 lib/std/syswrap.6 lib/std/fltbits.6 lib/std/fltparse.6 lib/std/strstrip.6 lib/std/dir.6 lib/std/slpush.6 lib/std/memops.6 lib/std/ipparse.6 lib/std/execvp.6 lib/std/sjlj.6 lib/std/slput.6 lib/std/getint.6 lib/std/spork.6 lib/std/htab.6 lib/std/blat.6 lib/std/alloc.6 lib/std/optparse.6 lib/std/chartype.6 lib/std/varargs.6 lib/std/backtrace.6 lib/std/syswrap-ss.6 lib/std/slfill.6 lib/std/bytealloc.6 lib/std/diriter.6 lib/std/swap.6 lib/std/assert.6 lib/std/utf.6 lib/std/sort.6 lib/std/hashfuncs.6 lib/std/clear.6 lib/std/striter.6 lib/std/dial.6 lib/std/iterutil.6 lib/std/strjoin.6 lib/std/mk.6 lib/std/mktemp.6 lib/std/chomp.6 lib/std/units.6 lib/std/memops-impl.6 lib/std/fndup.6 lib/std/putint.6 lib/std/types.6 lib/std/mkpath.6 lib/std/bigint.6 lib/std/fmtfuncs.6 lib/std/env.6 lib/std/fmt.6 lib/std/resolve.6 lib/std/extremum.6 lib/std/consts.6 lib/std/sleq.6 lib/std/strbuf.6 lib/std/threadhooks.6 lib/std/slpop.6 lib/std/sjlj-impl.6 lib/std/result.6 lib/std/strfind.6 lib/std/slcp.6 lib/std/netaddr.6 lib/std/sleep.6 lib/std/hasprefix.6 lib/std/try.6 lib/std/search.6 lib/std/writeall.6 lib/std/cmp.6 lib/std/endian.6 lib/std/getcwd.6 lib/std/bitset.6 lib/std/pathjoin.6 lib/std/fltfmt.6 lib/std/strsplit.6 &&\
-echo $pwd/muse/6.out -o lib/std/libstd.use -p std lib/std/die.use lib/std/hassuffix.use lib/std/sldup.use lib/std/now.use lib/std/sljoin.use lib/std/readall.use lib/std/cstrconv.use lib/std/slurp.use lib/std/wait.use lib/std/dirname.use lib/std/option.use lib/std/errno.use lib/std/intparse.use lib/std/rand.use lib/std/introspect.use lib/std/syswrap.use lib/std/fltbits.use lib/std/fltparse.use lib/std/strstrip.use lib/std/dir.use lib/std/slpush.use lib/std/memops.use lib/std/ipparse.use lib/std/execvp.use lib/std/sjlj.use lib/std/slput.use lib/std/getint.use lib/std/spork.use lib/std/htab.use lib/std/blat.use lib/std/alloc.use lib/std/optparse.use lib/std/chartype.use lib/std/varargs.use lib/std/backtrace.use lib/std/syswrap-ss.use lib/std/slfill.use lib/std/bytealloc.use lib/std/diriter.use lib/std/swap.use lib/std/assert.use lib/std/utf.use lib/std/sort.use lib/std/hashfuncs.use lib/std/clear.use lib/std/striter.use lib/std/dial.use lib/std/iterutil.use lib/std/strjoin.use lib/std/mk.use lib/std/mktemp.use lib/std/chomp.use lib/std/units.use lib/std/fndup.use lib/std/putint.use lib/std/types.use lib/std/mkpath.use lib/std/bigint.use lib/std/fmtfuncs.use lib/std/env.use lib/std/fmt.use lib/std/resolve.use lib/std/extremum.use lib/std/consts.use lib/std/sleq.use lib/std/strbuf.use lib/std/threadhooks.use lib/std/slpop.use lib/std/result.use lib/std/strfind.use lib/std/slcp.use lib/std/netaddr.use lib/std/sleep.use lib/std/hasprefix.use lib/std/try.use lib/std/search.use lib/std/writeall.use lib/std/cmp.use lib/std/endian.use lib/std/getcwd.use lib/std/bitset.use lib/std/pathjoin.use lib/std/fltfmt.use lib/std/strsplit.use && $pwd/muse/6.out -o lib/std/libstd.use -p std lib/std/die.use lib/std/hassuffix.use lib/std/sldup.use lib/std/now.use lib/std/sljoin.use lib/std/readall.use lib/std/cstrconv.use lib/std/slurp.use lib/std/wait.use lib/std/dirname.use lib/std/option.use lib/std/errno.use lib/std/intparse.use lib/std/rand.use lib/std/introspect.use lib/std/syswrap.use lib/std/fltbits.use lib/std/fltparse.use lib/std/strstrip.use lib/std/dir.use lib/std/slpush.use lib/std/memops.use lib/std/ipparse.use lib/std/execvp.use lib/std/sjlj.use lib/std/slput.use lib/std/getint.use lib/std/spork.use lib/std/htab.use lib/std/blat.use lib/std/alloc.use lib/std/optparse.use lib/std/chartype.use lib/std/varargs.use lib/std/backtrace.use lib/std/syswrap-ss.use lib/std/slfill.use lib/std/bytealloc.use lib/std/diriter.use lib/std/swap.use lib/std/assert.use lib/std/utf.use lib/std/sort.use lib/std/hashfuncs.use lib/std/clear.use lib/std/striter.use lib/std/dial.use lib/std/iterutil.use lib/std/strjoin.use lib/std/mk.use lib/std/mktemp.use lib/std/chomp.use lib/std/units.use lib/std/fndup.use lib/std/putint.use lib/std/types.use lib/std/mkpath.use lib/std/bigint.use lib/std/fmtfuncs.use lib/std/env.use lib/std/fmt.use lib/std/resolve.use lib/std/extremum.use lib/std/consts.use lib/std/sleq.use lib/std/strbuf.use lib/std/threadhooks.use lib/std/slpop.use lib/std/result.use lib/std/strfind.use lib/std/slcp.use lib/std/netaddr.use lib/std/sleep.use lib/std/hasprefix.use lib/std/try.use lib/std/search.use lib/std/writeall.use lib/std/cmp.use lib/std/endian.use lib/std/getcwd.use lib/std/bitset.use lib/std/pathjoin.use lib/std/fltfmt.use lib/std/strsplit.use &&\
-echo $pwd/6/6.out -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/types.myr && $pwd/6/6.out -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/types.myr &&\
-echo $pwd/6/6.out -I lib/sys -I lib/std lib/thread/common.myr && $pwd/6/6.out -I lib/sys -I lib/std lib/thread/common.myr &&\
-echo $pwd/6/6.out -I lib/sys -I lib/std lib/thread/atomic.myr && $pwd/6/6.out -I lib/sys -I lib/std lib/thread/atomic.myr &&\
-echo $pwd/6/6.out -I lib/sys -I lib/std lib/thread/mutex+plan9.myr && $pwd/6/6.out -I lib/sys -I lib/std lib/thread/mutex+plan9.myr &&\
-echo $pwd/6/6.out -I lib/sys -I lib/std lib/thread/hookstd.myr && $pwd/6/6.out -I lib/sys -I lib/std lib/thread/hookstd.myr &&\
-echo $pwd/6/6.out -I lib/sys -I lib/std lib/thread/ncpu+plan9.myr && $pwd/6/6.out -I lib/sys -I lib/std lib/thread/ncpu+plan9.myr &&\
-echo $pwd/6/6.out -I lib/sys -I lib/std lib/thread/spawn+plan9.myr && $pwd/6/6.out -I lib/sys -I lib/std lib/thread/spawn+plan9.myr &&\
-echo ar u lib/thread/libthread.a lib/thread/mutex.6 lib/thread/spawn.6 lib/thread/ncpu.6 lib/thread/hookstd.6 lib/thread/atomic-impl.6 lib/thread/atomic.6 lib/thread/common.6 && ar u lib/thread/libthread.a lib/thread/mutex.6 lib/thread/spawn.6 lib/thread/ncpu.6 lib/thread/hookstd.6 lib/thread/atomic-impl.6 lib/thread/atomic.6 lib/thread/common.6 &&\
-echo $pwd/muse/6.out -o lib/thread/libthread.use -p thread lib/thread/mutex.use lib/thread/spawn.use lib/thread/ncpu.use lib/thread/hookstd.use lib/thread/atomic.use lib/thread/common.use && $pwd/muse/6.out -o lib/thread/libthread.use -p thread lib/thread/mutex.use lib/thread/spawn.use lib/thread/ncpu.use lib/thread/hookstd.use lib/thread/atomic.use lib/thread/common.use &&\
-echo $pwd/6/6.out -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/opts.myr && $pwd/6/6.out -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/opts.myr &&\
-echo $pwd/6/6.out -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/syssel.myr && $pwd/6/6.out -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/syssel.myr &&\
-echo $pwd/6/6.out -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/util.myr && $pwd/6/6.out -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/util.myr &&\
-echo $pwd/6/6.out -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/parse.myr && $pwd/6/6.out -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/parse.myr &&\
-echo $pwd/6/6.out -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/build.myr && $pwd/6/6.out -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/build.myr &&\
-echo $pwd/6/6.out -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/install.myr && $pwd/6/6.out -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/install.myr &&\
-echo $pwd/6/6.out -I lib/std -I lib/sys lib/bio/bio.myr && $pwd/6/6.out -I lib/std -I lib/sys lib/bio/bio.myr &&\
-echo $pwd/6/6.out -I lib/std -I lib/sys lib/bio/mem.myr && $pwd/6/6.out -I lib/std -I lib/sys lib/bio/mem.myr &&\
-echo $pwd/6/6.out -I lib/std -I lib/sys lib/bio/puti.myr && $pwd/6/6.out -I lib/std -I lib/sys lib/bio/puti.myr &&\
-echo $pwd/6/6.out -I lib/std -I lib/sys lib/bio/iter.myr && $pwd/6/6.out -I lib/std -I lib/sys lib/bio/iter.myr &&\
-echo $pwd/6/6.out -I lib/std -I lib/sys lib/bio/geti.myr && $pwd/6/6.out -I lib/std -I lib/sys lib/bio/geti.myr &&\
-echo ar u lib/bio/libbio.a lib/bio/bio.6 lib/bio/geti.6 lib/bio/iter.6 lib/bio/puti.6 lib/bio/mem.6 && ar u lib/bio/libbio.a lib/bio/bio.6 lib/bio/geti.6 lib/bio/iter.6 lib/bio/puti.6 lib/bio/mem.6 &&\
-echo $pwd/muse/6.out -o lib/bio/libbio.use -p bio lib/bio/bio.use lib/bio/geti.use lib/bio/iter.use lib/bio/puti.use lib/bio/mem.use && $pwd/muse/6.out -o lib/bio/libbio.use -p bio lib/bio/bio.use lib/bio/geti.use lib/bio/iter.use lib/bio/puti.use lib/bio/mem.use &&\
-echo $pwd/6/6.out -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/libs.myr && $pwd/6/6.out -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/libs.myr &&\
-echo $pwd/6/6.out -I lib/sys -I lib/std lib/regex/types.myr && $pwd/6/6.out -I lib/sys -I lib/std lib/regex/types.myr &&\
-echo $pwd/6/6.out -I lib/sys -I lib/std lib/regex/interp.myr && $pwd/6/6.out -I lib/sys -I lib/std lib/regex/interp.myr &&\
-echo $pwd/6/6.out -I lib/sys -I lib/std lib/regex/ranges.myr && $pwd/6/6.out -I lib/sys -I lib/std lib/regex/ranges.myr &&\
-echo $pwd/6/6.out -I lib/sys -I lib/std lib/regex/compile.myr && $pwd/6/6.out -I lib/sys -I lib/std lib/regex/compile.myr &&\
-echo ar u lib/regex/libregex.a lib/regex/interp.6 lib/regex/ranges.6 lib/regex/compile.6 lib/regex/types.6 && ar u lib/regex/libregex.a lib/regex/interp.6 lib/regex/ranges.6 lib/regex/compile.6 lib/regex/types.6 &&\
-echo $pwd/muse/6.out -o lib/regex/libregex.use -p regex lib/regex/interp.use lib/regex/ranges.use lib/regex/compile.use lib/regex/types.use && $pwd/muse/6.out -o lib/regex/libregex.use -p regex lib/regex/interp.use lib/regex/ranges.use lib/regex/compile.use lib/regex/types.use &&\
-echo $pwd/6/6.out -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/deps.myr && $pwd/6/6.out -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/deps.myr &&\
-echo $pwd/6/6.out -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/subtest.myr && $pwd/6/6.out -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/subtest.myr &&\
-echo $pwd/6/6.out -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/test.myr && $pwd/6/6.out -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/test.myr &&\
-echo $pwd/6/6.out -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/main.myr && $pwd/6/6.out -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/main.myr &&\
-echo 6l -lo mbld/mbld $pwd/rt/_myrrt.6 mbld/types.6 mbld/config.6 mbld/build.6 mbld/libs.6 mbld/install.6 mbld/test.6 mbld/util.6 mbld/main.6 mbld/subtest.6 mbld/opts.6 mbld/parse.6 mbld/syssel.6 mbld/deps.6 lib/thread/libthread.a lib/regex/libregex.a lib/bio/libbio.a lib/std/libstd.a lib/sys/libsys.a && 6l -lo mbld/mbld $pwd/rt/_myrrt.6 mbld/types.6 mbld/config.6 mbld/build.6 mbld/libs.6 mbld/install.6 mbld/test.6 mbld/util.6 mbld/main.6 mbld/subtest.6 mbld/opts.6 mbld/parse.6 mbld/syssel.6 mbld/deps.6 lib/thread/libthread.a lib/regex/libregex.a lib/bio/libbio.a lib/std/libstd.a lib/sys/libsys.a &&\
+set -x
+ $pwd/6/6.out -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/config+plan9-x64.myr
+ 6a -o lib/thread/atomic-impl.6 lib/thread/atomic-impl+plan9-x64.s
+ 6a -o lib/std/getbp.6 lib/std/getbp+plan9-x64.s
+ $pwd/6/6.out -I . -I lib/sys lib/std/errno+plan9.myr
+ $pwd/6/6.out -I . -I lib/sys lib/std/option.myr
+ 6a -o lib/std/memops-impl.6 lib/std/memops-impl+plan9-x64.s
+ $pwd/6/6.out -I . -I lib/sys lib/std/fltbits.myr
+ 6a -o lib/std/sjlj-impl.6 lib/std/sjlj-impl+plan9-x64.s
+ $pwd/6/6.out -I . -I lib/sys lib/std/endian.myr
+ $pwd/6/6.out -I . -I lib/sys lib/std/extremum.myr
+ $pwd/6/6.out -I . -I lib/sys lib/std/sjlj.myr
+ $pwd/6/6.out -I . -I lib/sys lib/std/swap.myr
+ $pwd/6/6.out -I . -I lib/sys lib/std/slfill.myr
+ $pwd/6/6.out -I . -I lib/sys lib/std/clear.myr
+ $pwd/6/6.out -I . -I lib/sys lib/std/result.myr
+ $pwd/6/6.out -I . -I lib/sys lib/std/resolve+plan9.myr
+ 6a -o lib/sys/syscall.6 lib/sys/syscall+plan9-x64.s
+ $pwd/6/6.out lib/sys/ifreq+plan9.myr
+ $pwd/6/6.out lib/sys/systypes.myr
+ $pwd/6/6.out lib/sys/sys+plan9-x64.myr
+ $pwd/muse/6.out -o lib/sys/libsys.use -p sys lib/sys/sys.use lib/sys/systypes.use lib/sys/ifreq.use
+ 6a -o lib/sys/util.6 lib/sys/util+plan9-x64.s
+ ar u lib/sys/libsys.a lib/sys/sys.6 lib/sys/util.6 lib/sys/systypes.6 lib/sys/ifreq.6 lib/sys/syscall.6
+ $pwd/6/6.out -I . -I lib/sys lib/std/types.myr
+ $pwd/6/6.out -I . -I lib/sys lib/std/strfind.myr
+ $pwd/6/6.out -I . -I lib/sys lib/std/memops.myr
+ $pwd/6/6.out -I . -I lib/sys lib/std/sleq.myr
+ $pwd/6/6.out -I . -I lib/sys lib/std/hassuffix.myr
+ $pwd/6/6.out -I . -I lib/sys lib/std/backtrace+x64.myr
+ $pwd/6/6.out -I . -I lib/sys lib/std/units.myr
+ $pwd/6/6.out -I . -I lib/sys lib/std/cstrconv.myr
+ $pwd/6/6.out -I . -I lib/sys lib/std/syswrap-ss+plan9.myr
+ $pwd/6/6.out -I . -I lib/sys lib/std/sleep.myr
+ $pwd/6/6.out -I . -I lib/sys lib/std/syswrap+plan9.myr
+ $pwd/6/6.out -I . -I lib/sys lib/std/mkpath.myr
+ $pwd/6/6.out -I . -I lib/sys lib/std/now.myr
+ $pwd/6/6.out -I . -I lib/sys lib/std/consts.myr
+ $pwd/6/6.out -I . -I lib/sys lib/std/die.myr
+ $pwd/6/6.out -I . -I lib/sys lib/std/slcp.myr
+ $pwd/6/6.out -I . -I lib/sys lib/std/chartype.myr
+ $pwd/6/6.out -I . -I lib/sys lib/std/utf.myr
+ $pwd/6/6.out -I . -I lib/sys lib/std/cmp.myr
+ $pwd/6/6.out -I . -I lib/sys lib/std/sort.myr
+ $pwd/6/6.out -I . -I lib/sys lib/std/search.myr
+ $pwd/6/6.out -I . -I lib/sys lib/std/hasprefix.myr
+ $pwd/6/6.out -I . -I lib/sys lib/std/chomp.myr
+ $pwd/6/6.out -I . -I lib/sys lib/std/striter.myr
+ $pwd/6/6.out -I . -I lib/sys lib/std/intparse.myr
+ $pwd/6/6.out -I . -I lib/sys lib/std/strstrip.myr
+ $pwd/6/6.out -I . -I lib/sys lib/std/introspect.myr
+ $pwd/6/6.out -I . -I lib/sys lib/std/varargs.myr
+ $pwd/6/6.out -I . -I lib/sys lib/std/threadhooks.myr
+ $pwd/6/6.out -I . -I lib/sys lib/std/bytealloc.myr
+ $pwd/6/6.out -I . -I lib/sys lib/std/alloc.myr
+ $pwd/6/6.out -I . -I lib/sys lib/std/slurp.myr
+ $pwd/6/6.out -I . -I lib/sys lib/std/mk.myr
+ $pwd/6/6.out -I . -I lib/sys lib/std/slput.myr
+ $pwd/6/6.out -I . -I lib/sys lib/std/htab.myr
+ $pwd/6/6.out -I . -I lib/sys lib/std/slpush.myr
+ $pwd/6/6.out -I . -I lib/sys lib/std/strsplit.myr
+ $pwd/6/6.out -I . -I lib/sys lib/std/strbuf.myr
+ $pwd/6/6.out -I . -I lib/sys lib/std/sldup.myr
+ $pwd/6/6.out -I . -I lib/sys lib/std/bigint.myr
+ $pwd/6/6.out -I . -I lib/sys lib/std/fltparse.myr
+ $pwd/6/6.out -I . -I lib/sys lib/std/fltfmt.myr
+ $pwd/6/6.out -I . -I lib/sys lib/std/dirname.myr
+ $pwd/6/6.out -I . -I lib/sys lib/std/dir+plan9.myr
+ $pwd/6/6.out -I . -I lib/sys lib/std/diriter.myr
+ $pwd/6/6.out -I . -I lib/sys lib/std/fndup.myr
+ $pwd/6/6.out -I . -I lib/sys lib/std/strjoin.myr
+ $pwd/6/6.out -I . -I lib/sys lib/std/getcwd.myr
+ $pwd/6/6.out -I . -I lib/sys lib/std/slpop.myr
+ $pwd/6/6.out -I . -I lib/sys lib/std/sljoin.myr
+ $pwd/6/6.out -I . -I lib/sys lib/std/getint.myr
+ $pwd/6/6.out -I . -I lib/sys lib/std/hashfuncs.myr
+ $pwd/6/6.out -I . -I lib/sys lib/std/bitset.myr
+ $pwd/6/6.out -I . -I lib/sys lib/std/putint.myr
+ $pwd/6/6.out -I . -I lib/sys lib/std/readall.myr
+ $pwd/6/6.out -I . -I lib/sys lib/std/blat.myr
+ $pwd/6/6.out -I . -I lib/sys lib/std/writeall.myr
+ $pwd/6/6.out -I . -I lib/sys lib/std/fmt.myr
+ $pwd/6/6.out -I . -I lib/sys lib/std/listen+plan9.myr
+ $pwd/6/6.out -I . -I lib/sys lib/std/env+plan9.myr
+ $pwd/6/6.out -I . -I lib/sys lib/std/execvp.myr
+ $pwd/6/6.out -I . -I lib/sys lib/std/assert.myr
+ $pwd/6/6.out -I . -I lib/sys lib/std/rand.myr
+ $pwd/6/6.out -I . -I lib/sys lib/std/wait+plan9.myr
+ $pwd/6/6.out -I . -I lib/sys lib/std/spork.myr
+ $pwd/6/6.out -I . -I lib/sys lib/std/pathjoin.myr
+ $pwd/6/6.out -I . -I lib/sys lib/std/dial+plan9.myr
+ $pwd/6/6.out -I . -I lib/sys lib/std/mktemp.myr
+ $pwd/6/6.out -I . -I lib/sys lib/std/optparse.myr
+ $pwd/6/6.out -I . -I lib/sys lib/std/netaddr.myr
+ $pwd/6/6.out -I . -I lib/sys lib/std/iterutil.myr
+ $pwd/6/6.out -I . -I lib/sys lib/std/ipparse.myr
+ $pwd/6/6.out -I . -I lib/sys lib/std/fmtfuncs.myr
+ $pwd/6/6.out -I . -I lib/sys lib/std/try.myr
+ ar u lib/std/libstd.a lib/std/resolve.6 lib/std/result.6 lib/std/try.6 lib/std/ipparse.6 lib/std/alloc.6 lib/std/iterutil.6 lib/std/putint.6 lib/std/sleq.6 lib/std/sljoin.6 lib/std/slpop.6 lib/std/syswrap.6 lib/std/getint.6 lib/std/strsplit.6 lib/std/slfill.6 lib/std/writeall.6 lib/std/fltfmt.6 lib/std/hasprefix.6 lib/std/swap.6 lib/std/fmt.6 lib/std/netaddr.6 lib/std/varargs.6 lib/std/diriter.6 lib/std/getcwd.6 lib/std/blat.6 lib/std/optparse.6 lib/std/pathjoin.6 lib/std/readall.6 lib/std/strjoin.6 lib/std/threadhooks.6 lib/std/sjlj.6 lib/std/extremum.6 lib/std/endian.6 lib/std/rand.6 lib/std/sldup.6 lib/std/sleep.6 lib/std/wait.6 lib/std/introspect.6 lib/std/fltparse.6 lib/std/fndup.6 lib/std/strbuf.6 lib/std/assert.6 lib/std/spork.6 lib/std/slpush.6 lib/std/strstrip.6 lib/std/htab.6 lib/std/hashfuncs.6 lib/std/slput.6 lib/std/sjlj-impl.6 lib/std/fltbits.6 lib/std/striter.6 lib/std/types.6 lib/std/cstrconv.6 lib/std/units.6 lib/std/backtrace.6 lib/std/syswrap-ss.6 lib/std/die.6 lib/std/mk.6 lib/std/hassuffix.6 lib/std/memops-impl.6 lib/std/utf.6 lib/std/slurp.6 lib/std/bytealloc.6 lib/std/mktemp.6 lib/std/consts.6 lib/std/chomp.6 lib/std/dir.6 lib/std/search.6 lib/std/memops.6 lib/std/fmtfuncs.6 lib/std/strfind.6 lib/std/env.6 lib/std/dirname.6 lib/std/clear.6 lib/std/listen.6 lib/std/sort.6 lib/std/cmp.6 lib/std/now.6 lib/std/intparse.6 lib/std/mkpath.6 lib/std/option.6 lib/std/dial.6 lib/std/errno.6 lib/std/chartype.6 lib/std/bigint.6 lib/std/bitset.6 lib/std/getbp.6 lib/std/slcp.6 lib/std/execvp.6
+ $pwd/muse/6.out -o lib/std/libstd.use -p std lib/std/resolve.use lib/std/result.use lib/std/try.use lib/std/ipparse.use lib/std/alloc.use lib/std/iterutil.use lib/std/putint.use lib/std/sleq.use lib/std/sljoin.use lib/std/slpop.use lib/std/syswrap.use lib/std/getint.use lib/std/strsplit.use lib/std/slfill.use lib/std/writeall.use lib/std/fltfmt.use lib/std/hasprefix.use lib/std/swap.use lib/std/fmt.use lib/std/netaddr.use lib/std/varargs.use lib/std/diriter.use lib/std/getcwd.use lib/std/blat.use lib/std/optparse.use lib/std/pathjoin.use lib/std/readall.use lib/std/strjoin.use lib/std/threadhooks.use lib/std/sjlj.use lib/std/extremum.use lib/std/endian.use lib/std/rand.use lib/std/sldup.use lib/std/sleep.use lib/std/wait.use lib/std/introspect.use lib/std/fltparse.use lib/std/fndup.use lib/std/strbuf.use lib/std/assert.use lib/std/spork.use lib/std/slpush.use lib/std/strstrip.use lib/std/htab.use lib/std/hashfuncs.use lib/std/slput.use lib/std/fltbits.use lib/std/striter.use lib/std/types.use lib/std/cstrconv.use lib/std/units.use lib/std/backtrace.use lib/std/syswrap-ss.use lib/std/die.use lib/std/mk.use lib/std/hassuffix.use lib/std/utf.use lib/std/slurp.use lib/std/bytealloc.use lib/std/mktemp.use lib/std/consts.use lib/std/chomp.use lib/std/dir.use lib/std/search.use lib/std/memops.use lib/std/fmtfuncs.use lib/std/strfind.use lib/std/env.use lib/std/dirname.use lib/std/clear.use lib/std/listen.use lib/std/sort.use lib/std/cmp.use lib/std/now.use lib/std/intparse.use lib/std/mkpath.use lib/std/option.use lib/std/dial.use lib/std/errno.use lib/std/chartype.use lib/std/bigint.use lib/std/bitset.use lib/std/slcp.use lib/std/execvp.use
+ $pwd/6/6.out -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/types.myr
+ $pwd/6/6.out -I lib/sys -I lib/std lib/regex/types.myr
+ $pwd/6/6.out -I lib/sys -I lib/std lib/regex/interp.myr
+ $pwd/6/6.out -I lib/std -I lib/sys lib/bio/bio.myr
+ $pwd/6/6.out -I lib/std -I lib/sys lib/bio/iter.myr
+ $pwd/6/6.out -I lib/std -I lib/sys lib/bio/mem.myr
+ $pwd/6/6.out -I lib/std -I lib/sys lib/bio/geti.myr
+ $pwd/6/6.out -I lib/std -I lib/sys lib/bio/puti.myr
+ ar u lib/bio/libbio.a lib/bio/puti.6 lib/bio/geti.6 lib/bio/mem.6 lib/bio/bio.6 lib/bio/iter.6
+ $pwd/muse/6.out -o lib/bio/libbio.use -p bio lib/bio/puti.use lib/bio/geti.use lib/bio/mem.use lib/bio/bio.use lib/bio/iter.use
+ $pwd/6/6.out -I lib/sys -I lib/std lib/thread/spawn+plan9.myr
+ $pwd/6/6.out -I lib/sys -I lib/std lib/thread/ncpu+plan9.myr
+ $pwd/6/6.out -I lib/sys -I lib/std lib/thread/common.myr
+ $pwd/6/6.out -I lib/sys -I lib/std lib/thread/atomic.myr
+ $pwd/6/6.out -I lib/sys -I lib/std lib/thread/mutex+plan9.myr
+ $pwd/6/6.out -I lib/sys -I lib/std lib/thread/hookstd.myr
+ ar u lib/thread/libthread.a lib/thread/mutex.6 lib/thread/atomic.6 lib/thread/atomic-impl.6 lib/thread/hookstd.6 lib/thread/common.6 lib/thread/ncpu.6 lib/thread/spawn.6
+ $pwd/muse/6.out -o lib/thread/libthread.use -p thread lib/thread/mutex.use lib/thread/atomic.use lib/thread/hookstd.use lib/thread/common.use lib/thread/ncpu.use lib/thread/spawn.use
+ $pwd/6/6.out -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/opts.myr
+ $pwd/6/6.out -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/syssel.myr
+ $pwd/6/6.out -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/libs.myr
+ $pwd/6/6.out -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/util.myr
+ $pwd/6/6.out -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/build.myr
+ $pwd/6/6.out -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/install.myr
+ $pwd/6/6.out -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/parse.myr
+ $pwd/6/6.out -I lib/sys -I lib/std lib/regex/ranges.myr
+ $pwd/6/6.out -I lib/sys -I lib/std lib/regex/compile.myr
+ ar u lib/regex/libregex.a lib/regex/interp.6 lib/regex/ranges.6 lib/regex/types.6 lib/regex/compile.6
+ $pwd/muse/6.out -o lib/regex/libregex.use -p regex lib/regex/interp.use lib/regex/ranges.use lib/regex/types.use lib/regex/compile.use
+ $pwd/6/6.out -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/subtest.myr
+ $pwd/6/6.out -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/test.myr
+ $pwd/6/6.out -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/deps.myr
+ $pwd/6/6.out -I lib/sys -I lib/std -I lib/bio -I lib/regex -I lib/thread mbld/main.myr
+ 6l -lo mbld/mbld $pwd/rt/_myrrt.6 mbld/deps.6 mbld/main.6 mbld/util.6 mbld/libs.6 mbld/syssel.6 mbld/config.6 mbld/opts.6 mbld/subtest.6 mbld/types.6 mbld/test.6 mbld/install.6 mbld/parse.6 mbld/build.6 lib/thread/libthread.a lib/bio/libbio.a lib/regex/libregex.a lib/std/libstd.a lib/sys/libsys.a
true
diff --git a/mkfile b/mkfile
index ed538bd..7352951 100644
--- a/mkfile
+++ b/mkfile
@@ -38,9 +38,12 @@ install:V: $SUB config.h
}
ape/psh mbldwrap.sh install
-bootstrap:V:
+genbootstrap:V:
ape/psh genbootstrap.sh
+bootstrap:V:
+ ape/psh mk/bootstrap/bootstrap+Plan9-amd64.sh
+
uninstall:V: $SUB config.h
for(dir in $SUB)@{
cd $dir
@@ -49,7 +52,7 @@ uninstall:V: $SUB config.h
ape/psh mbldwrap.sh uninstall
check:V: all
- mbld/mbld test
+ obj/mbld/mbld test
config.h:
echo '#define Instroot "/amd64"' > config.h
diff --git a/parse/export.c b/parse/export.c
index 0a777e7..314f880 100644
--- a/parse/export.c
+++ b/parse/export.c
@@ -87,12 +87,19 @@ tagtype(Stab *st, Type *t, int ingeneric, int hidelocal)
tagtype(st, t->udecls[i]->etype, ingeneric, hidelocal);
break;
case Tyname:
+ case Tygeneric:
tagreflect(t);
for (i = 0; i < t->narg; i++)
tagtype(st, t->arg[i], ingeneric, hidelocal);
- case Tygeneric:
for (i = 0; i < t->ngparam; i++)
tagtype(st, t->gparam[i], ingeneric, hidelocal);
+ for (i = 0; i < t->narg; i++)
+ tagtype(st, t->arg[i], ingeneric, hidelocal);
+ break;
+ case Typaram:
+ if (t->trneed)
+ for (i = 0; bsiter(t->trneed, &i); i++)
+ tagtrait(st, traittab[i], ingeneric, hidelocal);
break;
default:
break;
@@ -271,18 +278,14 @@ tagexports(Node *file, int hidelocal)
free(k);
/* tag the impls */
- k = htkeys(st->impl, &n);
- for (i = 0; i < n; i++) {
- s = getimpl(st, k[i]);
+ for (i = 0; i < file->file.nimpl; i++) {
+ s = file->file.impl[i];
if (s->impl.vis != Visexport)
continue;
tagnode(st, s, 0, hidelocal);
tr = s->impl.trait;
tagtrait(st, tr, 0, hidelocal);
for (j = 0; j < tr->naux; j++)
- tr->aux[j]->vis = Visexport;
+ tr->aux[j]->vis = tr->vis;
}
- free(k);
-
}
-
diff --git a/parse/gram.y b/parse/gram.y
index 424538e..08e50a2 100644
--- a/parse/gram.y
+++ b/parse/gram.y
@@ -31,7 +31,6 @@ int yylex(void);
static Op binop(int toktype);
static Node *mkpseudodecl(Srcloc l, Type *t);
static void installucons(Stab *st, Type *t);
-static void addtrait(Type *t, char *str);
static void setattrs(Node *dcl, char **attrs, size_t nattrs);
static void setupinit(Node *n);
@@ -85,7 +84,6 @@ static void setupinit(Node *n);
%token<tok> Ttype /* type */
%token<tok> Tfor /* for */
-%token<tok> Tin /* in */
%token<tok> Twhile /* while */
%token<tok> Tif /* if */
%token<tok> Telse /* else */
@@ -499,13 +497,13 @@ generictype
: Ttyparam {$$ = mktyparam($1->loc, $1->id);}
| Ttyparam Twith name {
$$ = mktyparam($1->loc, $1->id);
- addtrait($$, $3->name.name);
+ lappend(&$$->traits, &$$->ntraits, $3);
}
| Ttyparam Twith Toparen typaramlist Tcparen {
size_t i;
$$ = mktyparam($1->loc, $1->id);
for (i = 0; i < $4.nn; i++)
- addtrait($$, $4.nl[i]->name.name);
+ lappend(&$$->traits, &$$->ntraits, $4.nl[i]);
}
;
@@ -947,8 +945,6 @@ continue : Tcontinue
forstmt : Tfor optexprln loopcond optexprln block
{$$ = mkloopstmt($1->loc, $2, $3, $4, $5);}
- | Tfor expr Tin exprln block
- {$$ = mkiterstmt($1->loc, $2, $4, $5);}
| Tfor expr Tcolon exprln block
{$$ = mkiterstmt($1->loc, $2, $4, $5);}
| Tfor decl Tendln loopcond optexprln block {
@@ -1075,21 +1071,6 @@ static void setupinit(Node *n)
n->decl.name->name.name = strdup(s);
}
-static void addtrait(Type *t, char *str)
-{
- size_t i;
-
- for (i = 0; i < ntraittab; i++) {
- if (!strcmp(namestr(traittab[i]->name), str)) {
- if (!t->trneed)
- t->trneed = mkbs();
- bsput(t->trneed, i);
- return;
- }
- }
- lfatal(t->loc, "Constraint %s does not exist", str);
-}
-
static Node *mkpseudodecl(Srcloc l, Type *t)
{
static int nextpseudoid;
diff --git a/parse/infer.c b/parse/infer.c
index a05dd64..3d84dd1 100644
--- a/parse/infer.c
+++ b/parse/infer.c
@@ -33,7 +33,7 @@ struct Traitmap {
static void infernode(Node **np, Type *ret, int *sawret);
static void inferexpr(Node **np, Type *ret, int *sawret);
static void inferdecl(Node *n);
-static int tryconstrain(Type *ty, Trait *tr);
+static int tryconstrain(Type *ty, Trait *tr, int update);
static Type *tf(Type *t);
@@ -353,6 +353,7 @@ occurs_rec(Type *sub, Bitset *bs)
{
size_t i;
+ sub = tf(sub);
if (bshas(bs, sub->tid))
return 1;
bsput(bs, sub->tid);
@@ -390,8 +391,9 @@ occursin(Type *a, Type *b)
int r;
bs = mkbs();
- bsput(bs, b->tid);
- r = occurs_rec(a, bs);
+ a = tf(a);
+ bsput(bs, a->tid);
+ r = occurs_rec(b, bs);
bsfree(bs);
return r;
}
@@ -413,6 +415,7 @@ needfreshenrec(Type *t, Bitset *visited)
{
size_t i;
+ t = tysearch(t);
if (bshas(visited, t->tid))
return 0;
bsput(visited, t->tid);
@@ -480,10 +483,10 @@ static void
tyresolve(Type *t)
{
size_t i;
+ Trait *tr;
if (t->resolved)
return;
-
/* type resolution should never throw errors about non-generic
* showing up within a generic type, so we push and pop a generic
* around resolution */
@@ -523,6 +526,15 @@ tyresolve(Type *t)
break;
}
+ for (i = 0; i < t->ntraits; i++) {
+ tr = gettrait(curstab(), t->traits[i]);
+ if (!tr)
+ lfatal(t->loc, "trait %s does not exist", ctxstr(t->traits[i]));
+ if (!t->trneed)
+ t->trneed = mkbs();
+ bsput(t->trneed, tr->uid);
+ }
+
for (i = 0; i < t->nsub; i++) {
t->sub[i] = tf(t->sub[i]);
if (t->sub[i] == t) {
@@ -629,8 +641,10 @@ tf(Type *orig)
popenv(orig->env);
} else if (orig->type == Typaram) {
tt = boundtype(t);
- if (tt)
+ if (tt) {
+ tyresolve(tt);
t = tt;
+ }
}
ingeneric -= isgeneric;
return t;
@@ -768,7 +782,7 @@ tymatchrank(Type *pat, Type *to)
if (!pat->trneed)
return 0;
for (i = 0; bsiter(pat->trneed, &i); i++)
- if (!tryconstrain(to, traittab[i]))
+ if (!tryconstrain(to, traittab[i], 0))
return -1;
return 0;
} else if (pat->type == Tyvar) {
@@ -848,7 +862,7 @@ tymatchrank(Type *pat, Type *to)
}
static int
-tryconstrain(Type *base, Trait *tr)
+tryconstrain(Type *base, Trait *tr, int update)
{
Traitmap *tm;
Bitset *bs;
@@ -859,12 +873,14 @@ tryconstrain(Type *base, Trait *tr)
ty = base;
tm = traitmap->sub[ty->type];
while (1) {
- if (ty->type == Typaram && bshas(ty->trneed, tr->uid))
- return 1;
+ if (ty->type == Typaram)
+ if (ty->trneed && bshas(ty->trneed, tr->uid))
+ return 1;
if (ty->type == Tyvar) {
if (!ty->trneed)
ty->trneed = mkbs();
- bsput(ty->trneed, tr->uid);
+ if (update)
+ bsput(ty->trneed, tr->uid);
return 1;
}
if (bshas(tm->traits, tr->uid))
@@ -880,11 +896,12 @@ tryconstrain(Type *base, Trait *tr)
if (tymatchrank(tm->filter[i], ty) >= 0)
return 1;
}
- if (!tm->sub[ty->type])
+ if (!ty->sub || ty->nsub != 1)
break;
- assert(ty->nsub == 1);
- tm = tm->sub[ty->type];
ty = ty->sub[0];
+ tm = tm->sub[ty->type];
+ if (!tm)
+ break;
}
if (base->type != Tyname)
break;
@@ -900,7 +917,7 @@ tryconstrain(Type *base, Trait *tr)
static void
constrain(Node *ctx, Type *base, Trait *tr)
{
- if (!tryconstrain(base, tr))
+ if (!tryconstrain(base, tr, 1))
fatal(ctx, "%s needs trait %s near %s", tystr(base), namestr(tr->name), ctxstr(ctx));
}
@@ -908,6 +925,7 @@ static void
traitsfor(Type *base, Bitset *dst)
{
Traitmap *tm;
+ Bitset *bs;
Type *ty;
size_t i;
@@ -917,7 +935,12 @@ traitsfor(Type *base, Bitset *dst)
while (1) {
if (ty->type == Tyvar)
break;
- bsunion(dst, tm->traits);
+ if (ty->type == Tyname && ty->ngparam == 0)
+ bs = htget(tm->name, ty->name);
+ else
+ bs = tm->traits;
+ if (bs)
+ bsunion(dst, bs);
for (i = 0; i < tm->nfilter; i++) {
if (tymatchrank(tm->filter[i], ty) >= 0)
bsput(dst, tm->filtertr[i]->uid);
@@ -1247,7 +1270,6 @@ unifycall(Node *n)
Type *ft;
ft = type(n->expr.args[0]);
-
if (ft->type == Tyvar) {
/* the first arg is the function itself, so it shouldn't be counted */
ft = mktyfunc(n->loc, &n->expr.args[1], n->expr.nargs - 1, mktyvar(n->loc));
@@ -1643,7 +1665,7 @@ inferexpr(Node **np, Type *ret, int *sawret)
case Odiveq: /* @a /= @a -> @a */
infersub(n, ret, sawret, &isconst);
t = type(args[0]);
- constrain(n, type(args[0]), traittab[Tcnum]);
+ constrain(n, t, traittab[Tcnum]);
isconst = args[0]->expr.isconst;
for (i = 1; i < nargs; i++) {
isconst = isconst && args[i]->expr.isconst;
@@ -1671,8 +1693,8 @@ inferexpr(Node **np, Type *ret, int *sawret)
case Obsreq: /* @a >>= @a -> @a */
infersub(n, ret, sawret, &isconst);
t = type(args[0]);
- constrain(n, type(args[0]), traittab[Tcnum]);
- constrain(n, type(args[0]), traittab[Tcint]);
+ constrain(n, t, traittab[Tcnum]);
+ constrain(n, t, traittab[Tcint]);
isconst = args[0]->expr.isconst;
for (i = 1; i < nargs; i++) {
isconst = isconst && args[i]->expr.isconst;
@@ -1901,19 +1923,21 @@ specializeimpl(Node *n)
Node *dcl, *proto, *name, *sym;
Tysubst *subst;
Type *ty;
- Trait *t;
+ Trait *tr;
size_t i, j;
int generic;
+ char *traitns;
- t = gettrait(curstab(), n->impl.traitname);
- if (!t)
+ tr = gettrait(curstab(), n->impl.traitname);
+ if (!tr)
fatal(n, "no trait %s\n", namestr(n->impl.traitname));
- n->impl.trait = t;
+ n->impl.trait = tr;
+ traitns = tr->name->name.ns;
dcl = NULL;
- if (n->impl.naux != t->naux)
+ if (n->impl.naux != tr->naux)
fatal(n, "%s incompatibly specialized with %zd types instead of %zd types",
- namestr(n->impl.traitname), n->impl.naux, t->naux);
+ namestr(n->impl.traitname), n->impl.naux, tr->naux);
n->impl.type = tf(n->impl.type);
pushenv(n->impl.type->env);
for (i = 0; i < n->impl.naux; i++)
@@ -1931,25 +1955,27 @@ specializeimpl(Node *n)
here.
*/
if (file->file.globls->name)
- setns(dcl->decl.name, file->file.globls->name);
- for (j = 0; j < t->nproto; j++) {
- if (nsnameeq(dcl->decl.name, t->proto[j]->decl.name)) {
- proto = t->proto[j];
+ setns(dcl->decl.name, traitns);
+ for (j = 0; j < tr->nproto; j++) {
+ if (nsnameeq(dcl->decl.name, tr->proto[j]->decl.name)) {
+ proto = tr->proto[j];
break;
}
}
if (!proto)
fatal(n, "declaration %s missing in %s, near %s", namestr(dcl->decl.name),
- namestr(t->name), ctxstr(n));
+ namestr(tr->name), ctxstr(n));
/* infer and unify types */
- verifytraits(n, t->param, n->impl.type);
+ pushenv(proto->decl.env);
+ verifytraits(n, tr->param, n->impl.type);
subst = mksubst();
- substput(subst, t->param, n->impl.type);
- for (j = 0; j < t->naux; j++)
- substput(subst, t->aux[j], n->impl.aux[j]);
+ substput(subst, tr->param, n->impl.type);
+ for (j = 0; j < tr->naux; j++)
+ substput(subst, tr->aux[j], n->impl.aux[j]);
ty = tyspecialize(type(proto), subst, delayed, NULL);
substfree(subst);
+ popenv(proto->decl.env);
generic = hasparams(ty);
if (generic)
@@ -1963,7 +1989,7 @@ specializeimpl(Node *n)
sym = getdcl(file->file.globls, name);
if (sym)
fatal(n, "trait %s already specialized with %s on %s:%d",
- namestr(t->name), tystr(n->impl.type),
+ namestr(tr->name), tystr(n->impl.type),
fname(sym->loc), lnum(sym->loc));
dcl->decl.name = name;
putdcl(file->file.globls, dcl);
@@ -1974,7 +2000,7 @@ specializeimpl(Node *n)
lappend(&proto->decl.gimpl, &proto->decl.ngimpl, dcl);
lappend(&proto->decl.gtype, &proto->decl.ngtype, ty);
}
- dcl->decl.vis = t->vis;
+ dcl->decl.vis = tr->vis;
lappend(&impldecl, &nimpldecl, dcl);
if (generic)
@@ -2792,7 +2818,7 @@ addtraittab(Traitmap *m, Trait *tr, Type *ty)
size_t i;
if (!m->sub[ty->type])
- m = mktraitmap();
+ m->sub[ty->type] = mktraitmap();
mm = m->sub[ty->type];
switch (ty->type) {
case Tygeneric:
diff --git a/parse/node.c b/parse/node.c
index 4a8df7d..d32d4ab 100644
--- a/parse/node.c
+++ b/parse/node.c
@@ -247,6 +247,7 @@ Node *
mkimplstmt(Srcloc loc, Node *name, Type *t, Type **aux, size_t naux, Node **decls, size_t ndecls)
{
Node *n;
+ size_t i;
n = mknode(loc, Nimpl);
n->impl.traitname = name;
@@ -256,6 +257,9 @@ mkimplstmt(Srcloc loc, Node *name, Type *t, Type **aux, size_t naux, Node **decl
n->impl.decls = decls;
n->impl.ndecls = ndecls;
lappend(&impltab, &nimpltab, n);
+ if (name->name.ns)
+ for (i = 0; i < ndecls; i++)
+ setns(decls[i]->decl.name, name->name.ns);
if (hasparams(t)) {
n->impl.env = mkenv();
bindtype(n->impl.env, t);
@@ -550,7 +554,6 @@ void
setns(Node *n, char *ns)
{
assert(!ns || !n->name.ns || !strcmp(n->name.ns, ns));
-
if (!ns)
return;
n->name.ns = strdup(ns);
diff --git a/parse/parse.h b/parse/parse.h
index edb65c6..9c6a658 100644
--- a/parse/parse.h
+++ b/parse/parse.h
@@ -120,11 +120,14 @@ struct Tyenv {
struct Type {
Ty type;
- int tid;
+ uint32_t tid;
Srcloc loc;
Vis vis;
+ Node **traits; /* trait list */
+ size_t ntraits; /* trait list size */
+
Type **gparam; /* Tygeneric: type parameters that match the type args */
size_t ngparam; /* Tygeneric: count of type parameters */
Type **arg; /* Tyname: type arguments instantiated */
@@ -202,6 +205,8 @@ struct Node {
Node **init; /* all __init__ function names of our deps. NB, this
is a Nname, not an Ndecl */
size_t ninit;
+ Node **impl; /* impls defined in this file, across all namespaces */
+ size_t nimpl;
Node *localinit;/* and the local one, if any */
Stab *globls; /* global symtab */
Stab *builtins; /* global symtab */
diff --git a/parse/stab.c b/parse/stab.c
index 7c031f9..49fc776 100644
--- a/parse/stab.c
+++ b/parse/stab.c
@@ -505,12 +505,18 @@ putucon(Stab *st, Ucon *uc)
static int
mergetrait(Trait *old, Trait *new)
{
+ int hidden;
+
+ hidden = old->ishidden && new->ishidden;
if (old->isproto && !new->isproto)
*old = *new;
else if (new->isproto && !old->isproto)
*new = *old;
else if (!new->isimport && !old->isimport)
- return new->vis == Vishidden || old->vis == Vishidden;
+ if (new->vis == Vishidden || old->vis == Vishidden)
+ return 0;
+ new->ishidden = hidden;
+ old->ishidden = hidden;
return 1;
}
@@ -523,9 +529,12 @@ puttrait(Stab *st, Node *n, Trait *c)
st = findstab(st, n);
t = gettrait(st, n);
- if (t && !mergetrait(t, c))
+ if (t) {
+ if (mergetrait(t, c))
+ return;
fatal(n, "trait %s already defined on %s:%d",
namestr(n), fname(t->loc), lnum(t->loc));
+ }
ty = gettype(st, n);
if (ty)
fatal(n, "trait %s defined as a type on %s:%d",
@@ -572,6 +581,9 @@ putimpl(Stab *st, Node *n)
fatal(n, "trait %s already implemented over %s at %s:%d",
namestr(n->impl.traitname), tystr(n->impl.type),
fname(n->loc), lnum(n->loc));
+ /* if this is not a duplicate, record it for later export */
+ if (!impl)
+ lappend(&file->file.impl, &file->file.nimpl, n);
/*
The impl is not defined in this file, so setting the
trait name would be a bug here.
diff --git a/parse/tok.c b/parse/tok.c
index 119d637..eb5ba1c 100644
--- a/parse/tok.c
+++ b/parse/tok.c
@@ -191,7 +191,6 @@ kwd(char *s)
{"goto", Tgoto},
{"if", Tif},
{"impl", Timpl},
- {"in", Tin},
{"match", Tmatch},
{"pkg", Tpkg},
{"pkglocal", Tattr},
diff --git a/parse/type.c b/parse/type.c
index 7eb4146..ddd2cc5 100644
--- a/parse/type.c
+++ b/parse/type.c
@@ -15,6 +15,7 @@
#include "parse.h"
typedef struct Typename Typename;
+typedef struct Typair Typair;
Type **tytab = NULL;
Type **types = NULL;
size_t ntypes;
@@ -22,6 +23,13 @@ Trait **traittab;
size_t ntraittab;
Node **impltab;
size_t nimpltab;
+Htab *eqcache;
+
+struct Typair {
+ uint32_t atid;
+ uint32_t btid;
+};
+
static Htab *tydeduptab;
/* Built in type constraints */
@@ -731,10 +739,48 @@ tyhash(void *ty)
return hash;
}
+static ulong
+typairhash(void *pp)
+{
+ Typair *p;
+
+ p = pp;
+ return inthash(p->atid) ^ inthash(p->btid);
+}
+
+static int
+typaireq(void *a, void *b)
+{
+ Typair *pa, *pb;
+ pa = a;
+ pb = b;
+ return pa->atid == pb->atid && pa->btid == pb->btid;
+}
+
+static void
+equate(int32_t ta, int32_t tb)
+{
+ Typair *pa, *pb;
+
+ /*
+ * unfortunately, we can't negatively cache
+ * here because tyvars may unify down and
+ * eventually make the negative result inaccurate.
+ */
+ pa = zalloc(sizeof(Typair));
+ *pa = (Typair){ta, tb};
+ pb = zalloc(sizeof(Typair));
+ *pb = (Typair){ta, tb};
+
+ htput(eqcache, pa, pa);
+ htput(eqcache, pb, pb);
+}
+
int
tyeq_rec(Type *a, Type *b, Bitset *avisited, Bitset *bvisited, int search)
{
Type *x, *y;
+ Typair p;
size_t i;
int ret;
@@ -752,6 +798,9 @@ tyeq_rec(Type *a, Type *b, Bitset *avisited, Bitset *bvisited, int search)
return 0;
if (a->nmemb != b->nmemb)
return 0;
+ p = (Typair){a->tid, b->tid};
+ if (hthas(eqcache, &p))
+ return 1;
if (a->tid == b->tid)
return 1;
@@ -800,16 +849,22 @@ tyeq_rec(Type *a, Type *b, Bitset *avisited, Bitset *bvisited, int search)
break;
}
break;
+ case Tygeneric:
+ if (!nameeq(a->name, b->name))
+ ret = 0;
+ for (i = 0; i < a->ngparam; i++) {
+ ret = ret && tyeq_rec(a->gparam[i], b->gparam[i], avisited, bvisited, search);
+ if (!ret)
+ break;
+ }
+ break;
case Tyname:
if (!nameeq(a->name, b->name))
ret = 0;
for (i = 0; i < a->narg; i++) {
- x = a->arg[i];
- y = b->arg[i];
- if (!tyeq_rec(x, y, avisited, bvisited, search)) {
- ret = 0;
+ ret = ret && tyeq_rec(a->arg[i], b->arg[i], avisited, bvisited, search);
+ if (!ret)
break;
- }
}
break;
case Tyarray:
@@ -829,6 +884,8 @@ tyeq_rec(Type *a, Type *b, Bitset *avisited, Bitset *bvisited, int search)
}
}
}
+ if (ret)
+ equate(a->tid, b->tid);
bsdel(avisited, a->tid);
bsdel(bvisited, b->tid);
@@ -1042,6 +1099,7 @@ tyinit(Stab *st)
Type *ty;
Trait *tr;
+ eqcache = mkht(typairhash, typaireq);
tydeduptab = mkht(tyhash, tystricteq);
/* this must be done after all the types are created, otherwise we will
* clobber the memoized bunch of types with the type params. */
diff --git a/parse/use.c b/parse/use.c
index 51c0f85..28c48f6 100644
--- a/parse/use.c
+++ b/parse/use.c
@@ -856,7 +856,9 @@ protomap(Trait *tr, Type *ty, Node *dcl)
dclname = declname(dcl);
for (i = 0; i < tr->nproto; i++) {
- proto = tr->proto[i];
+ proto = getdcl(curstab(), tr->proto[i]->decl.name);
+ if (!proto)
+ proto = tr->proto[i];
protoname = declname(proto);
len = strlen(protoname);
p = strstr(dclname, protoname);
@@ -996,12 +998,11 @@ foundextlib:
break;
case 'R':
tr = traitunpickle(f);
- if (!tr->ishidden) {
- tr->vis = vis;
- puttrait(s, tr->name, tr);
- for (i = 0; i < tr->nproto; i++) {
- putdcl(s, tr->proto[i]);
- }
+ tr->vis = vis;
+ puttrait(s, tr->name, tr);
+ for (i = 0; i < tr->nproto; i++) {
+ putdcl(s, tr->proto[i]);
+ tr->proto[i]->decl.ishidden = tr->ishidden;
}
break;
case 'T':
@@ -1031,10 +1032,17 @@ foundextlib:
impl = unpickle(f);
impl->impl.isextern = 1;
impl->impl.vis = vis;
- /* specialized declarations always go into the global stab */
+ /*
+ * Unfortunately, impls can insert their symbols into whatever
+ * namespace the trait comes from. This complicates things a bit.
+ */
for (i = 0; i < impl->impl.ndecls; i++) {
- impl->impl.decls[i]->decl.isglobl = 1;
- putdcl(file->file.globls, impl->impl.decls[i]);
+ dcl = impl->impl.decls[i];
+ dcl->decl.isglobl = 1;
+ ns = file->file.globls;
+ if (dcl->decl.name->name.ns)
+ ns = findstab(s, dcl->decl.name->name.ns);
+ putdcl(ns, dcl);
}
break;
case EOF:
@@ -1043,7 +1051,6 @@ foundextlib:
}
fixtypemappings(s);
fixtraitmappings(s);
- fiximplmappings(s);
htfree(tidmap);
for (i = starttype; i < ntypes; i++) {
ty = types[i];
@@ -1075,6 +1082,7 @@ foundextlib:
bindtype(impl->impl.env, impl->impl.type);
}
}
+ fiximplmappings(s);
popstab();
return 1;
}
@@ -1167,6 +1175,7 @@ writeuse(FILE *f, Node *file)
{
Stab *st;
void **k;
+ Trait *tr;
Node *s, *u;
size_t i, n;
@@ -1211,25 +1220,24 @@ writeuse(FILE *f, Node *file)
}
for (i = 0; i < ntraittab; i++) {
- if (i < Ntraits || i != traittab[i]->uid)
+ tr = traittab[i];
+ if (tr->uid < Ntraits)
continue;
- if (traittab[i]->vis == Visexport || traittab[i]->vis == Vishidden) {
+ if (tr->vis == Visexport || tr->vis == Vishidden) {
wrbyte(f, 'R');
- traitpickle(f, traittab[i]);
+ traitpickle(f, tr);
}
}
- k = htkeys(st->impl, &n);
- for (i = 0; i < n; i++) {
+ for (i = 0; i < nimpltab; i++) {
/* merging during inference should remove all protos */
- s = getimpl(st, k[i]);
+ s = impltab[i];
assert(!s->impl.isproto);
if (s->impl.vis == Visexport || s->impl.vis == Vishidden) {
wrbyte(f, 'I');
pickle(f, s);
}
}
- free(k);
k = htkeys(st->dcl, &n);
for (i = 0; i < n; i++) {
diff --git a/rt/start-openbsd.s b/rt/start-openbsd.s
index ad62bf4..b96e12b 100644
--- a/rt/start-openbsd.s
+++ b/rt/start-openbsd.s
@@ -45,6 +45,12 @@ _start:
call cvt
xorq %rbp,%rbp
+ /* done startup; call kbind */
+ movq $0,%rdi /* param */
+ movq $0,%rsi /* size */
+ movq $0,%rdx /* cookie */
+ movq $86,%rax /* Syskbind */
+ syscall
/* call pre-main initializers */
call __init__
/* enter the main program */
diff --git a/support/dumpleak.myr b/support/dumpleak.myr
index 350298a..dcd6c07 100644
--- a/support/dumpleak.myr
+++ b/support/dumpleak.myr
@@ -50,11 +50,11 @@ const main = {args
const dump = {path, f, stats
while true
match bio.getle64(f)
- | `bio.Ok 0: tracealloc(path, f, stats)
- | `bio.Ok 1: tracefree(path, f, stats)
- | `bio.Eof: break
- | `bio.Ok wat: std.fatal("unknown action type {x}\n", wat)
- | `bio.Err e: std.fatal("failed to read {}: {}\n", path, e)
+ | `std.Err `bio.Eof: break
+ | `std.Ok 0: tracealloc(path, f, stats)
+ | `std.Ok 1: tracefree(path, f, stats)
+ | `std.Ok wat: std.fatal("unknown action type {x}\n", wat)
+ | `std.Err e: std.fatal("failed to read {}: {}\n", path, e)
;;
;;
if !summary
@@ -78,7 +78,7 @@ const tracealloc = {path, f, stats
ptr = get64(path, f)
sz = get64(path, f)
stk = [][:]
- for var i = 0; i < 10; i++
+ for var i = 0; i < 20; i++
std.slpush(&stk, get64(path, f))
;;
stats.allocs++
@@ -116,7 +116,7 @@ const dumptrace = {tab
const get64 = {path, f
match bio.getle64(f)
- | `bio.Ok v: -> v
+ | `std.Ok v: -> v
| res: std.fatal("failed to read {}: {}\n", path, res)
;;
}
diff --git a/support/syscall-gen/gencalls.awk b/support/syscall-gen/gencalls.awk
index ebed585..d625550 100644
--- a/support/syscall-gen/gencalls.awk
+++ b/support/syscall-gen/gencalls.awk
@@ -79,7 +79,7 @@ $Typefield == "STD" || (!masterfmt && $1 == "asmlinkage") {
tabs="\t\t"
else
tabs = "\t"
- num = sprintf("%s%s: scno = %d", numcst, tabs, numbertab[name]);
+ num = sprintf("%s%s: scno = %d", numcst, tabs, $1);
scnums[nnums++] = num
if (nocode)
@@ -107,7 +107,7 @@ $Typefield == "STD" || (!masterfmt && $1 == "asmlinkage") {
sep = ", ";
}
call = call sprintf("\n\t -> (syscall(Sys%s", name)
- for (i = 1; i < argc; i++) {
+ for (i = 0; i < argc; i++) {
call = call sprintf(", a(%s)", argname[i])
}
call = call sprintf(") : %s)\n}", ret)
diff --git a/support/syscall-gen/gensys.sh b/support/syscall-gen/gensys.sh
index 7559be9..c703642 100755
--- a/support/syscall-gen/gensys.sh
+++ b/support/syscall-gen/gensys.sh
@@ -38,6 +38,7 @@ hdrgen() {
}
rm -f have.txt want.txt gentypes+$1-$2.frag
+touch have.txt
if [ `uname` = Linux ]; then
hdrgen $1 $2
diff --git a/support/syscall-gen/gentypes+openbsd:6.2-x64.frag b/support/syscall-gen/gentypes+openbsd:6.2-x64.frag
new file mode 100644
index 0000000..b8a4866
--- /dev/null
+++ b/support/syscall-gen/gentypes+openbsd:6.2-x64.frag
@@ -0,0 +1,120 @@
+type dev = int32
+type uid = uint32
+type gid = uint32
+type fd_mask = uint32
+type uintptr = uint64
+type clockid = int32
+type id = uint32
+type key = int64
+type shmatt = int16
+
+type tfork = struct
+ tcb : void#
+ tid : pid#
+ stack : void#
+
+;;
+
+type msghdr = struct
+ name : void#
+ namelen : int32
+ iov : iovec#
+ iovlen : uint
+ control : void#
+ controllen : int32
+ flags : int
+
+;;
+
+type fsid = struct
+ val : int32[2]
+
+;;
+
+type fid = struct
+ len : uint16
+ reserved : uint16
+ data : byte[16]
+
+;;
+
+type fhandle = struct
+ fsid : fsid
+ fid : fid
+
+;;
+
+type fdset = struct
+ bits : fd_mask[32]
+
+;;
+
+type kevent = struct
+ ident : uintptr
+ filter : int16
+ flags : uint16
+ fflags : uint
+ data : int64
+ udata : void#
+
+;;
+
+type kbind = struct
+ addr : void#
+ size : size
+
+;;
+
+type sembuf = struct
+ num : uint16
+ op : int16
+ flg : int16
+
+;;
+
+type ipc_perm = struct
+ cuid : uid
+ cgid : gid
+ uid : uid
+ gid : gid
+ mode : filemode
+ seq : uint16
+ key : key
+
+;;
+
+type shmid_ds = struct
+ perm : ipc_perm
+ segsz : int
+ lpid : pid
+ cpid : pid
+ nattch : shmatt
+ atime : time
+ atimensec : int64
+ dtime : time
+ dtimensec : int64
+ ctime : time
+ ctimensec : int64
+ internal : void#
+
+;;
+
+type msqid_ds = struct
+ perm : ipc_perm
+ first : msg#
+ last : msg#
+ cbytes : uint64
+ qnum : uint64
+ qbytes : uint64
+ lspid : pid
+ lrpid : pid
+ stime : time
+ pad1 : int64
+ rtime : time
+ pad2 : int64
+ ctime : time
+ pad3 : int64
+ pad4 : int64[4]
+
+;;
+
diff --git a/support/syscall-gen/specials+openbsd:6.1-x64.frag b/support/syscall-gen/specials+openbsd:6.1-x64.frag
index 9a476f5..4cc3843 100644
--- a/support/syscall-gen/specials+openbsd:6.1-x64.frag
+++ b/support/syscall-gen/specials+openbsd:6.1-x64.frag
@@ -154,7 +154,7 @@ const mkdir = {path, mode; -> (syscall(Sysmkdir, cstring(path), a(mode)) : int6
generic ioctl = {fd, req, arg; -> (syscall(Sysioctl, a(fd), a(req), a(arg)) : int64)}
const chdir = {dir; -> syscall(Syschdir, cstring(dir))}
const __getcwd = {buf; -> syscall(Sys__getcwd, a(buf), a(buf.len))}
-const getdents = {fd, buf; -> (syscall(Sysgetdents, a(buf), a(buf.len)) : int64)}
+const getdents = {fd, buf; -> (syscall(Sysgetdents, a(fd), a(buf), a(buf.len)) : int64)}
/* signals */
const sigaction = {sig, act, oact; -> (syscall(Syssigaction, a(sig), a(act), a(oact)) : int)}
diff --git a/support/syscall-gen/specials+openbsd:6.2-x64.frag b/support/syscall-gen/specials+openbsd:6.2-x64.frag
new file mode 100644
index 0000000..4cc3843
--- /dev/null
+++ b/support/syscall-gen/specials+openbsd:6.2-x64.frag
@@ -0,0 +1,286 @@
+/* process control */
+const exit : (status:int -> void)
+const getpid : ( -> pid)
+const kill : (pid:pid, sig:int64 -> int64)
+const fork : (-> pid)
+const wait4 : (pid:pid, loc:int32#, opt : int64, usage:rusage# -> int64)
+const waitpid : (pid:pid, loc:int32#, opt : int64 -> int64)
+const execv : (cmd : byte[:], args : byte[:][:] -> int64)
+const execve : (cmd : byte[:], args : byte[:][:], env : byte[:][:] -> int64)
+/* wrappers to extract wait status */
+const waitstatus : (st : int32 -> waitstatus)
+extern const __tfork_thread : (tfp : tforkparams#, sz : size, fn : void#, arg : void# -> pid)
+
+/* fd manipulation */
+const open : (path:byte[:], opts:fdopt -> fd)
+const openmode : (path:byte[:], opts:fdopt, mode:int64 -> fd)
+const close : (fd:fd -> int64)
+const creat : (path:byte[:], mode:int64 -> fd)
+const unlink : (path:byte[:] -> int)
+const read : (fd:fd, buf:byte[:] -> size)
+const pread : (fd:fd, buf:byte[:], off : off -> size)
+const readv : (fd:fd, iov:iovec[:] -> size)
+const write : (fd:fd, buf:byte[:] -> size)
+const pwrite : (fd:fd, buf:byte[:], off : off -> size)
+const writev : (fd:fd, iov:iovec[:] -> size)
+const lseek : (fd:fd, off : off, whence : whence -> int64)
+const stat : (path:byte[:], sb:statbuf# -> int64)
+const lstat : (path:byte[:], sb:statbuf# -> int64)
+const fstat : (fd:fd, sb:statbuf# -> int64)
+const mkdir : (path : byte[:], mode : int64 -> int64)
+generic ioctl : (fd:fd, req : int64, arg:@a# -> int64)
+const getdents : (fd : fd, buf : byte[:] -> int64)
+const chdir : (p : byte[:] -> int64)
+const __getcwd : (buf : byte[:] -> int64)
+const poll : (pfd : pollfd[:], tm : int -> int)
+
+/* signals */
+const sigaction : (sig : signo, act : sigaction#, oact : sigaction# -> int)
+const sigprocmask : (how : int32, set : sigset#, oset : sigset# -> int)
+
+/* fd stuff */
+const pipe : (fds : fd[2]# -> int64)
+const dup : (fd : fd -> fd)
+const dup2 : (src : fd, dst : fd -> fd)
+/* NB: the C ABI uses '...' for the args. */
+const fcntl : (fd : fd, cmd : fcntlcmd, args : byte# -> int64)
+
+/* networking */
+const socket : (dom : sockfam, stype : socktype, proto : sockproto -> fd)
+const connect : (sock : fd, addr : sockaddr#, len : size -> int)
+const accept : (sock : fd, addr : sockaddr#, len : size# -> fd)
+const listen : (sock : fd, backlog : int -> int)
+const bind : (sock : fd, addr : sockaddr#, len : size -> int)
+const setsockopt : (sock : fd, lev : sockproto, opt : sockopt, val : void#, len : size -> int)
+const getsockopt : (sock : fd, lev : sockproto, opt : sockopt, val : void#, len : size# -> int)
+
+/* memory mapping */
+const munmap : (addr:byte#, len:size -> int64)
+const mmap : (addr:byte#, len:size, prot:mprot, flags:mopt, fd:fd, off:off -> byte#)
+
+/* time - doublecheck if this is right */
+const clock_getres : (clk : clock, ts : timespec# -> int32)
+const clock_gettime : (clk : clock, ts : timespec# -> int32)
+const clock_settime : (clk : clock, ts : timespec# -> int32)
+const sleep : (time : uint64 -> int32)
+const nanosleep : (req : timespec#, rem : timespec# -> int32)
+
+/* system information */
+const uname : (buf : utsname# -> int)
+const sysctl : (mib : int[:], \
+ old : void#, oldsz : size#, \
+ new : void#, newsz : size# \
+ -> int)
+
+/*
+wraps a syscall argument, converting it to 64 bits for the syscall function. This is
+the same as casting, but more concise than writing a cast to uint64
+*/
+generic a = {x : @t; -> (x : uint64)}
+
+extern const cstring : (str : byte[:] -> byte#)
+extern const alloca : (sz : size -> byte#)
+
+extern const __freebsd_pipe : (fds : fd[2]# -> int64)
+
+/* process management */
+const exit = {status; syscall(Sysexit, a(status))}
+const getpid = {; -> (syscall(Sysgetpid, 1) : pid)}
+const kill = {pid, sig; -> syscall(Syskill, pid, sig)}
+const fork = {; -> (syscall(Sysfork) : pid)}
+const wait4 = {pid, loc, opt, usage; -> syscall(Syswait4, pid, loc, opt, usage)}
+const waitpid = {pid, loc, opt;
+ -> wait4(pid, loc, opt, (0 : rusage#))
+}
+
+const execv = {cmd, args
+ var p, cargs, i
+
+ /* of course we fucking have to duplicate this code everywhere,
+ * since we want to stack allocate... */
+ p = alloca((args.len + 1)*sizeof(byte#))
+ cargs = (p : byte##)[:args.len + 1]
+ for i = 0; i < args.len; i++
+ cargs[i] = cstring(args[i])
+ ;;
+ cargs[args.len] = (0 : byte#)
+ -> syscall(Sysexecve, cstring(cmd), a(p), a(__cenvp))
+}
+
+const execve = {cmd, args, env
+ var cargs, cenv, i
+ var p
+
+ /* copy the args */
+ p = alloca((args.len + 1)*sizeof(byte#))
+ cargs = (p : byte##)[:args.len]
+ for i = 0; i < args.len; i++
+ cargs[i] = cstring(args[i])
+ ;;
+ cargs[args.len] = (0 : byte#)
+
+ /*
+ copy the env.
+ of course we fucking have to duplicate this code everywhere,
+ since we want to stack allocate...
+ */
+ p = alloca((env.len + 1)*sizeof(byte#))
+ cenv = (p : byte##)[:env.len]
+ for i = 0; i < env.len; i++
+ cenv[i] = cstring(env[i])
+ ;;
+ cenv[env.len] = (0 : byte#)
+
+ -> syscall(Sysexecve, cstring(cmd), a(p), a(cenv))
+}
+
+/* fd manipulation */
+const open = {path, opts; -> (syscall(Sysopen, cstring(path), a(opts), a(0o777)) : fd)}
+const openmode = {path, opts, mode; -> (syscall(Sysopen, cstring(path), a(opts), a(mode)) : fd)}
+const close = {fd; -> syscall(Sysclose, a(fd))}
+const creat = {path, mode; -> (openmode(path, Ocreat | Otrunc | Owronly, mode) : fd)}
+const unlink = {path; -> (syscall(Sysunlink, cstring(path)) : int)}
+const read = {fd, buf; -> (syscall(Sysread, a(fd), (buf : byte#), a(buf.len)) : size)}
+const pread = {fd, buf, off; -> (syscall(Syspread, a(fd), (buf : byte#), a(buf.len), a(off)) : size)}
+const readv = {fd, vec; -> (syscall(Sysreadv, a(fd), (vec : iovec#), a(vec.len)) : size)}
+const write = {fd, buf; -> (syscall(Syswrite, a(fd), (buf : byte#), a(buf.len)) : size)}
+const pwrite = {fd, buf, off; -> (syscall(Syspwrite, a(fd), (buf : byte#), a(buf.len), a(off)) : size)}
+const writev = {fd, vec; -> (syscall(Syswritev, a(fd), (vec : iovec#), a(vec.len)) : size)}
+const lseek = {fd, off, whence; -> syscall(Syslseek, a(fd), a(off), a(whence))}
+const stat = {path, sb; -> syscall(Sysstat, cstring(path), a(sb))}
+const lstat = {path, sb; -> syscall(Syslstat, cstring(path), a(sb))}
+const fstat = {fd, sb; -> syscall(Sysfstat, a(fd), a(sb))}
+const mkdir = {path, mode; -> (syscall(Sysmkdir, cstring(path), a(mode)) : int64)}
+generic ioctl = {fd, req, arg; -> (syscall(Sysioctl, a(fd), a(req), a(arg)) : int64)}
+const chdir = {dir; -> syscall(Syschdir, cstring(dir))}
+const __getcwd = {buf; -> syscall(Sys__getcwd, a(buf), a(buf.len))}
+const getdents = {fd, buf; -> (syscall(Sysgetdents, a(fd), a(buf), a(buf.len)) : int64)}
+
+/* signals */
+const sigaction = {sig, act, oact; -> (syscall(Syssigaction, a(sig), a(act), a(oact)) : int)}
+const sigprocmask = {sig, act, oact; -> (syscall(Syssigprocmask, a(sig), a(act), a(oact)) : int)}
+
+/* file stuff */
+const pipe = {fds; -> syscall(Syspipe, fds)}
+const dup = {fd; -> (syscall(Sysdup, a(fd)) : fd)}
+const dup2 = {src, dst; -> (syscall(Sysdup2, a(src), a(dst)) : fd)}
+const fcntl = {fd, cmd, args; -> syscall(Sysfcntl, a(fd), a(cmd), a(args))}
+const poll = {pfd, tm; -> (syscall(Syspoll, (pfd : byte#), a(pfd.len), a(tm)) : int)}
+
+/* networking */
+const socket = {dom, stype, proto; -> (syscall(Syssocket, a(dom), a(stype), a(proto)) : fd)}
+const connect = {sock, addr, len; -> (syscall(Sysconnect, a(sock), a(addr), a(len)) : int)}
+const accept = {sock, addr, len; -> (syscall(Sysaccept, a(sock), a(addr), a(len)) : fd)}
+const listen = {sock, backlog; -> (syscall(Syslisten, a(sock), a(backlog)) : int)}
+const bind = {sock, addr, len; -> (syscall(Sysbind, a(sock), a(addr), a(len)) : int)}
+const setsockopt = {sock, lev, opt, val, len; -> (syscall(Syssetsockopt, a(sock), a(lev), a(opt), a(val), a(len)) : int)}
+const getsockopt = {sock, lev, opt, val, len; -> (syscall(Syssetsockopt, a(sock), a(lev), a(opt), a(val), a(len)) : int)}
+
+/* memory management */
+const munmap = {addr, len; -> syscall(Sysmunmap, a(addr), a(len))}
+const mmap = {addr, len, prot, flags, fd, off;
+ /* the actual syscall has padding on the offset arg */
+ -> (syscall(Sysmmap, a(addr), a(len), a(prot), a(flags), a(fd), a(0), a(off)) : byte#)
+}
+
+/* time */
+const clock_getres = {clk, ts; -> (syscall(Sysclock_getres, clockid(clk), a(ts)) : int32)}
+const clock_gettime = {clk, ts; -> (syscall(Sysclock_gettime, clockid(clk), a(ts)) : int32)}
+const clock_settime = {clk, ts; -> (syscall(Sysclock_settime, clockid(clk), a(ts)) : int32)}
+
+const sleep = {time
+ var req, rem
+ req = [.sec = time, .nsec = 0]
+ -> nanosleep(&req, &rem)
+}
+
+const nanosleep = {req, rem; -> (syscall(Sysnanosleep, a(req), a(rem)) : int32)}
+
+
+/* system information */
+const uname = {buf
+ var mib : int[2]
+ var ret
+ var sys, syssz
+ var nod, nodsz
+ var rel, relsz
+ var ver, versz
+ var mach, machsz
+
+ ret = 0
+ mib[0] = 1 /* CTL_KERN */
+ mib[1] = 1 /* KERN_OSTYPE */
+ sys = (buf.system[:] : void#)
+ syssz = buf.system.len
+ ret = sysctl(mib[:], sys, &syssz, (0 : void#), (0 : size#))
+ if ret < 0
+ -> ret
+ ;;
+
+ mib[0] = 1 /* CTL_KERN */
+ mib[1] = 10 /* KERN_HOSTNAME */
+ nod = (buf.node[:] : void#)
+ nodsz = buf.node.len
+ ret = sysctl(mib[:], nod, &nodsz, (0 : void#), (0 : size#))
+ if ret < 0
+ -> ret
+ ;;
+
+ mib[0] = 1 /* CTL_KERN */
+ mib[1] = 2 /* KERN_OSRELEASE */
+ rel = (buf.release[:] : void#)
+ relsz = buf.release.len
+ ret = sysctl(mib[:], rel, &relsz, (0 : void#), (0 : size#))
+ if ret < 0
+ -> ret
+ ;;
+
+ mib[0] = 1 /* CTL_KERN */
+ mib[1] = 27 /* KERN_OSVERSION */
+ ver = (buf.version[:] : void#)
+ versz = buf.version.len
+ ret = sysctl(mib[:], ver, &versz, (0 : void#), (0 : size#))
+ if ret < 0
+ -> ret
+ ;;
+
+ mib[0] = 6 /* CTL_HW */
+ mib[1] = 1 /* HW_MACHINE */
+ mach = (buf.machine[:] : void#)
+ machsz = buf.machine.len
+ ret = sysctl(mib[:], mach, &machsz, (0 : void#), (0 : size#))
+ if ret < 0
+ -> ret
+ ;;
+
+ -> 0
+}
+
+const sysctl = {mib, old, oldsz, new, newsz
+ /* all args already passed through a() or ar ptrs */
+ -> (syscall(Syssysctl, \
+ (mib : int#), a(mib.len), old, oldsz, new, newsz) : int)
+}
+
+const clockid = {clk
+ match clk
+ | `Clockrealtime: -> 0
+ | `Clockproccputime: -> 2
+ | `Clockmonotonic: -> 3
+ | `Clockthreadcputime: -> 4
+ | `Clockuptime: -> 5
+ ;;
+ -> -1
+}
+
+const waitstatus = {st
+ if st < 0
+ -> `Waitfail st
+ ;;
+ match st & 0o177
+ | 0: -> `Waitexit (st >> 8)
+ | 0x7f:-> `Waitstop (st >> 8)
+ | sig: -> `Waitsig sig
+ ;;
+}
+
diff --git a/support/syscall-gen/syscalls+openbsd:6.2.master b/support/syscall-gen/syscalls+openbsd:6.2.master
new file mode 100644
index 0000000..d3ef28a
--- /dev/null
+++ b/support/syscall-gen/syscalls+openbsd:6.2.master
@@ -0,0 +1,571 @@
+; $OpenBSD: syscalls.master,v 1.177 2017/08/12 00:03:10 tedu Exp $
+; $NetBSD: syscalls.master,v 1.32 1996/04/23 10:24:21 mycroft Exp $
+
+; @(#)syscalls.master 8.2 (Berkeley) 1/13/94
+
+; OpenBSD system call name/number "master" file.
+; (See syscalls.conf to see what it is processed into.)
+;
+; Fields: number type [type-dependent ...]
+; number system call number, must be in order
+; type one of the types described below, or one of the
+; compatibility options defined in syscalls.conf
+;
+; types:
+; INDIR included, but don't define the syscall args structure,
+; and allow it to be "really" varargs
+; NOARGS included, but don't define the syscall args structure
+; NODEF included, but don't define the syscall number
+; NOLOCK don't acquire the kernel lock when calling this syscall
+; OBSOL obsolete, not included in system
+; STD always included
+; UNIMPL unimplemented, not included in system
+;
+; The compat options are defined in the syscalls.conf file, and the
+; compat option name is prefixed to the syscall name. Other than
+; that, they're like NODEF (for 'compat' options), or STD (for
+; 'libcompat' options).
+;
+; The type-dependent arguments are as follows:
+; For STD, NODEF, NOARGS, and compat syscalls:
+; { pseudo-proto } [alias]
+; For other syscalls:
+; [comment]
+;
+; #ifdef's, etc. may be included, and are copied to the output files.
+; #include's are copied to the syscall switch definition file only.
+
+#include <sys/param.h>
+#include <sys/systm.h>
+#include <sys/signal.h>
+#include <sys/mount.h>
+#include <sys/syscallargs.h>
+#include <sys/poll.h>
+
+; Reserved/unimplemented system calls in the range 0-150 inclusive
+; are reserved for use in future Berkeley releases.
+; Additional system calls implemented in vendor and other
+; redistributions should be placed in the reserved range at the end
+; of the current calls.
+
+0 INDIR { int sys_syscall(int number, ...); }
+1 STD { void sys_exit(int rval); }
+2 STD { int sys_fork(void); }
+3 STD { ssize_t sys_read(int fd, void *buf, size_t nbyte); }
+4 STD { ssize_t sys_write(int fd, const void *buf, \
+ size_t nbyte); }
+5 STD { int sys_open(const char *path, \
+ int flags, ... mode_t mode); }
+6 STD { int sys_close(int fd); }
+7 STD NOLOCK { int sys_getentropy(void *buf, size_t nbyte); }
+8 STD { int sys___tfork(const struct __tfork *param, \
+ size_t psize); }
+9 STD { int sys_link(const char *path, const char *link); }
+10 STD { int sys_unlink(const char *path); }
+11 STD { pid_t sys_wait4(pid_t pid, int *status, \
+ int options, struct rusage *rusage); }
+12 STD { int sys_chdir(const char *path); }
+13 STD { int sys_fchdir(int fd); }
+14 STD { int sys_mknod(const char *path, mode_t mode, \
+ dev_t dev); }
+15 STD { int sys_chmod(const char *path, mode_t mode); }
+16 STD { int sys_chown(const char *path, uid_t uid, \
+ gid_t gid); }
+17 STD { int sys_obreak(char *nsize); } break
+18 STD NOLOCK { int sys_getdtablecount(void); }
+19 STD { int sys_getrusage(int who, \
+ struct rusage *rusage); }
+20 STD NOLOCK { pid_t sys_getpid(void); }
+21 STD { int sys_mount(const char *type, const char *path, \
+ int flags, void *data); }
+22 STD { int sys_unmount(const char *path, int flags); }
+23 STD { int sys_setuid(uid_t uid); }
+24 STD NOLOCK { uid_t sys_getuid(void); }
+25 STD NOLOCK { uid_t sys_geteuid(void); }
+#ifdef PTRACE
+26 STD { int sys_ptrace(int req, pid_t pid, caddr_t addr, \
+ int data); }
+#else
+26 UNIMPL ptrace
+#endif
+27 STD { ssize_t sys_recvmsg(int s, struct msghdr *msg, \
+ int flags); }
+28 STD { ssize_t sys_sendmsg(int s, \
+ const struct msghdr *msg, int flags); }
+29 STD { ssize_t sys_recvfrom(int s, void *buf, size_t len, \
+ int flags, struct sockaddr *from, \
+ socklen_t *fromlenaddr); }
+30 STD { int sys_accept(int s, struct sockaddr *name, \
+ socklen_t *anamelen); }
+31 STD { int sys_getpeername(int fdes, struct sockaddr *asa, \
+ socklen_t *alen); }
+32 STD { int sys_getsockname(int fdes, struct sockaddr *asa, \
+ socklen_t *alen); }
+33 STD { int sys_access(const char *path, int amode); }
+34 STD { int sys_chflags(const char *path, u_int flags); }
+35 STD { int sys_fchflags(int fd, u_int flags); }
+36 STD { void sys_sync(void); }
+37 OBSOL o58_kill
+38 STD { int sys_stat(const char *path, struct stat *ub); }
+39 STD { pid_t sys_getppid(void); }
+40 STD { int sys_lstat(const char *path, struct stat *ub); }
+41 STD { int sys_dup(int fd); }
+42 STD { int sys_fstatat(int fd, const char *path, \
+ struct stat *buf, int flag); }
+43 STD NOLOCK { gid_t sys_getegid(void); }
+44 STD { int sys_profil(caddr_t samples, size_t size, \
+ u_long offset, u_int scale); }
+#ifdef KTRACE
+45 STD { int sys_ktrace(const char *fname, int ops, \
+ int facs, pid_t pid); }
+#else
+45 UNIMPL ktrace
+#endif
+46 STD { int sys_sigaction(int signum, \
+ const struct sigaction *nsa, \
+ struct sigaction *osa); }
+47 STD NOLOCK { gid_t sys_getgid(void); }
+48 STD NOLOCK { int sys_sigprocmask(int how, sigset_t mask); }
+49 OBSOL ogetlogin
+50 STD { int sys_setlogin(const char *namebuf); }
+#ifdef ACCOUNTING
+51 STD { int sys_acct(const char *path); }
+#else
+51 UNIMPL acct
+#endif
+52 STD { int sys_sigpending(void); }
+53 STD { int sys_fstat(int fd, struct stat *sb); }
+54 STD { int sys_ioctl(int fd, \
+ u_long com, ... void *data); }
+55 STD { int sys_reboot(int opt); }
+56 STD { int sys_revoke(const char *path); }
+57 STD { int sys_symlink(const char *path, \
+ const char *link); }
+58 STD { ssize_t sys_readlink(const char *path, \
+ char *buf, size_t count); }
+59 STD { int sys_execve(const char *path, \
+ char * const *argp, char * const *envp); }
+60 STD { mode_t sys_umask(mode_t newmask); }
+61 STD { int sys_chroot(const char *path); }
+62 STD { int sys_getfsstat(struct statfs *buf, size_t bufsize, \
+ int flags); }
+63 STD { int sys_statfs(const char *path, \
+ struct statfs *buf); }
+64 STD { int sys_fstatfs(int fd, struct statfs *buf); }
+65 STD { int sys_fhstatfs(const fhandle_t *fhp, \
+ struct statfs *buf); }
+66 STD { int sys_vfork(void); }
+67 STD NOLOCK { int sys_gettimeofday(struct timeval *tp, \
+ struct timezone *tzp); }
+68 STD { int sys_settimeofday(const struct timeval *tv, \
+ const struct timezone *tzp); }
+69 STD { int sys_setitimer(int which, \
+ const struct itimerval *itv, \
+ struct itimerval *oitv); }
+70 STD { int sys_getitimer(int which, \
+ struct itimerval *itv); }
+71 STD { int sys_select(int nd, fd_set *in, fd_set *ou, \
+ fd_set *ex, struct timeval *tv); }
+72 STD { int sys_kevent(int fd, \
+ const struct kevent *changelist, int nchanges, \
+ struct kevent *eventlist, int nevents, \
+ const struct timespec *timeout); }
+73 STD { int sys_munmap(void *addr, size_t len); }
+74 STD { int sys_mprotect(void *addr, size_t len, \
+ int prot); }
+75 STD { int sys_madvise(void *addr, size_t len, \
+ int behav); }
+76 STD { int sys_utimes(const char *path, \
+ const struct timeval *tptr); }
+77 STD { int sys_futimes(int fd, \
+ const struct timeval *tptr); }
+78 STD { int sys_mincore(void *addr, size_t len, \
+ char *vec); }
+79 STD NOLOCK { int sys_getgroups(int gidsetsize, \
+ gid_t *gidset); }
+80 STD { int sys_setgroups(int gidsetsize, \
+ const gid_t *gidset); }
+81 STD { int sys_getpgrp(void); }
+82 STD { int sys_setpgid(pid_t pid, pid_t pgid); }
+83 STD NOLOCK { int sys_futex(uint32_t *f, int op, int val, \
+ const struct timespec *timeout, uint32_t *g); }
+84 STD { int sys_utimensat(int fd, const char *path, \
+ const struct timespec *times, int flag); }
+85 STD { int sys_futimens(int fd, \
+ const struct timespec *times); }
+86 STD { int sys_kbind(const struct __kbind *param, \
+ size_t psize, int64_t proc_cookie); }
+87 STD NOLOCK { int sys_clock_gettime(clockid_t clock_id, \
+ struct timespec *tp); }
+88 STD { int sys_clock_settime(clockid_t clock_id, \
+ const struct timespec *tp); }
+89 STD NOLOCK { int sys_clock_getres(clockid_t clock_id, \
+ struct timespec *tp); }
+90 STD { int sys_dup2(int from, int to); }
+91 STD { int sys_nanosleep(const struct timespec *rqtp, \
+ struct timespec *rmtp); }
+92 STD { int sys_fcntl(int fd, int cmd, ... void *arg); }
+93 STD { int sys_accept4(int s, struct sockaddr *name, \
+ socklen_t *anamelen, int flags); }
+94 STD { int sys___thrsleep(const volatile void *ident, \
+ clockid_t clock_id, const struct timespec *tp, \
+ void *lock, const int *abort); }
+95 STD { int sys_fsync(int fd); }
+96 STD { int sys_setpriority(int which, id_t who, int prio); }
+97 STD { int sys_socket(int domain, int type, int protocol); }
+98 STD { int sys_connect(int s, const struct sockaddr *name, \
+ socklen_t namelen); }
+99 STD { int sys_getdents(int fd, void *buf, size_t buflen); }
+100 STD { int sys_getpriority(int which, id_t who); }
+101 STD { int sys_pipe2(int *fdp, int flags); }
+102 STD { int sys_dup3(int from, int to, int flags); }
+103 STD { int sys_sigreturn(struct sigcontext *sigcntxp); }
+104 STD { int sys_bind(int s, const struct sockaddr *name, \
+ socklen_t namelen); }
+105 STD { int sys_setsockopt(int s, int level, int name, \
+ const void *val, socklen_t valsize); }
+106 STD { int sys_listen(int s, int backlog); }
+107 STD { int sys_chflagsat(int fd, const char *path, \
+ u_int flags, int atflags); }
+108 STD { int sys_pledge(const char *request, const char **paths); }
+109 STD { int sys_ppoll(struct pollfd *fds, \
+ u_int nfds, const struct timespec *ts, \
+ const sigset_t *mask); }
+110 STD { int sys_pselect(int nd, fd_set *in, fd_set *ou, \
+ fd_set *ex, const struct timespec *ts, \
+ const sigset_t *mask); }
+111 STD { int sys_sigsuspend(int mask); }
+112 STD { int sys_sendsyslog(const void *buf, size_t nbyte, \
+ int flags); }
+#ifdef KTRACE
+113 STD { int sys_fktrace(int fd, int ops, \
+ int facs, pid_t pid); }
+#else
+113 UNIMPL fktrace
+#endif
+114 OBSOL osendmsg
+115 OBSOL vtrace
+116 OBSOL t32_gettimeofday
+117 OBSOL t32_getrusage
+118 STD { int sys_getsockopt(int s, int level, int name, \
+ void *val, socklen_t *avalsize); }
+119 STD { int sys_thrkill(pid_t tid, int signum, void *tcb); }
+120 STD { ssize_t sys_readv(int fd, \
+ const struct iovec *iovp, int iovcnt); }
+121 STD { ssize_t sys_writev(int fd, \
+ const struct iovec *iovp, int iovcnt); }
+122 STD { int sys_kill(int pid, int signum); }
+123 STD { int sys_fchown(int fd, uid_t uid, gid_t gid); }
+124 STD { int sys_fchmod(int fd, mode_t mode); }
+125 OBSOL orecvfrom
+126 STD { int sys_setreuid(uid_t ruid, uid_t euid); }
+127 STD { int sys_setregid(gid_t rgid, gid_t egid); }
+128 STD { int sys_rename(const char *from, const char *to); }
+129 OBSOL otruncate
+130 OBSOL oftruncate
+131 STD { int sys_flock(int fd, int how); }
+132 STD { int sys_mkfifo(const char *path, mode_t mode); }
+133 STD { ssize_t sys_sendto(int s, const void *buf, \
+ size_t len, int flags, const struct sockaddr *to, \
+ socklen_t tolen); }
+134 STD { int sys_shutdown(int s, int how); }
+135 STD { int sys_socketpair(int domain, int type, \
+ int protocol, int *rsv); }
+136 STD { int sys_mkdir(const char *path, mode_t mode); }
+137 STD { int sys_rmdir(const char *path); }
+138 OBSOL t32_utimes
+139 OBSOL 4.2 sigreturn
+140 STD { int sys_adjtime(const struct timeval *delta, \
+ struct timeval *olddelta); }
+141 STD { int sys_getlogin_r(char *namebuf, u_int namelen); }
+142 OBSOL ogethostid
+143 OBSOL osethostid
+144 OBSOL ogetrlimit
+145 OBSOL osetrlimit
+146 OBSOL okillpg
+147 STD { int sys_setsid(void); }
+148 STD { int sys_quotactl(const char *path, int cmd, \
+ int uid, char *arg); }
+149 OBSOL oquota
+150 OBSOL ogetsockname
+
+; Syscalls 151-180 inclusive are reserved for vendor-specific
+; system calls. (This includes various calls added for compatibility
+; with other Unix variants.)
+; Some of these calls are now supported by BSD...
+151 UNIMPL
+152 UNIMPL
+153 UNIMPL
+154 UNIMPL
+#if defined(NFSCLIENT) || defined(NFSSERVER)
+155 STD { int sys_nfssvc(int flag, void *argp); }
+#else
+155 UNIMPL
+#endif
+156 OBSOL ogetdirentries
+157 OBSOL statfs25
+158 OBSOL fstatfs25
+159 UNIMPL
+160 UNIMPL
+161 STD { int sys_getfh(const char *fname, fhandle_t *fhp); }
+162 OBSOL ogetdomainname
+163 OBSOL osetdomainname
+164 UNIMPL ouname
+165 STD { int sys_sysarch(int op, void *parms); }
+166 UNIMPL
+167 UNIMPL
+168 UNIMPL
+169 OBSOL semsys10
+170 OBSOL msgsys10
+171 OBSOL shmsys10
+172 UNIMPL
+173 STD { ssize_t sys_pread(int fd, void *buf, \
+ size_t nbyte, int pad, off_t offset); }
+174 STD { ssize_t sys_pwrite(int fd, const void *buf, \
+ size_t nbyte, int pad, off_t offset); }
+175 UNIMPL ntp_gettime
+176 UNIMPL ntp_adjtime
+177 UNIMPL
+178 UNIMPL
+179 UNIMPL
+180 UNIMPL
+
+; Syscalls 181-199 are used by/reserved for BSD
+181 STD { int sys_setgid(gid_t gid); }
+182 STD { int sys_setegid(gid_t egid); }
+183 STD { int sys_seteuid(uid_t euid); }
+184 OBSOL lfs_bmapv
+185 OBSOL lfs_markv
+186 OBSOL lfs_segclean
+187 OBSOL lfs_segwait
+188 OBSOL stat35
+189 OBSOL fstat35
+190 OBSOL lstat35
+191 STD { long sys_pathconf(const char *path, int name); }
+192 STD { long sys_fpathconf(int fd, int name); }
+193 STD { int sys_swapctl(int cmd, const void *arg, int misc); }
+194 STD { int sys_getrlimit(int which, \
+ struct rlimit *rlp); }
+195 STD { int sys_setrlimit(int which, \
+ const struct rlimit *rlp); }
+196 OBSOL ogetdirentries48
+197 STD { void *sys_mmap(void *addr, size_t len, int prot, \
+ int flags, int fd, long pad, off_t pos); }
+198 INDIR { quad_t sys___syscall(quad_t num, ...); }
+199 STD { off_t sys_lseek(int fd, int pad, off_t offset, \
+ int whence); }
+200 STD { int sys_truncate(const char *path, int pad, \
+ off_t length); }
+201 STD { int sys_ftruncate(int fd, int pad, off_t length); }
+202 STD { int sys_sysctl(const int *name, u_int namelen, \
+ void *old, size_t *oldlenp, void *new, \
+ size_t newlen); }
+203 STD { int sys_mlock(const void *addr, size_t len); }
+204 STD { int sys_munlock(const void *addr, size_t len); }
+205 UNIMPL sys_undelete
+206 OBSOL t32_futimes
+207 STD { pid_t sys_getpgid(pid_t pid); }
+208 OBSOL nnpfspioctl
+209 STD { int sys_utrace(const char *label, const void *addr, \
+ size_t len); }
+;
+; Syscalls 210-219 were reserved for dynamically loaded syscalls
+;
+210 UNIMPL
+211 UNIMPL
+212 UNIMPL
+213 UNIMPL
+214 UNIMPL
+215 UNIMPL
+216 UNIMPL
+217 UNIMPL
+218 UNIMPL
+219 UNIMPL
+; System calls 220-240 are reserved for use by OpenBSD
+#ifdef SYSVSEM
+220 UNIMPL
+221 STD { int sys_semget(key_t key, int nsems, int semflg); }
+#else
+220 UNIMPL semctl
+221 UNIMPL semget
+#endif
+222 OBSOL semop35
+223 OBSOL semconfig35
+#ifdef SYSVMSG
+224 UNIMPL
+225 STD { int sys_msgget(key_t key, int msgflg); }
+226 STD { int sys_msgsnd(int msqid, const void *msgp, size_t msgsz, \
+ int msgflg); }
+227 STD { int sys_msgrcv(int msqid, void *msgp, size_t msgsz, \
+ long msgtyp, int msgflg); }
+#else
+224 UNIMPL msgctl
+225 UNIMPL msgget
+226 UNIMPL msgsnd
+227 UNIMPL msgrcv
+#endif
+#ifdef SYSVSHM
+228 STD { void *sys_shmat(int shmid, const void *shmaddr, \
+ int shmflg); }
+229 UNIMPL
+230 STD { int sys_shmdt(const void *shmaddr); }
+#else
+228 UNIMPL shmat
+229 UNIMPL shmctl
+230 UNIMPL shmdt
+#endif
+231 OBSOL shmget35
+232 OBSOL t32_clock_gettime
+233 OBSOL t32_clock_settime
+234 OBSOL t32_clock_getres
+235 UNIMPL timer_create
+236 UNIMPL timer_delete
+237 UNIMPL timer_settime
+238 UNIMPL timer_gettime
+239 UNIMPL timer_getoverrun
+;
+; System calls 240-249 are reserved for other IEEE Std1003.1b syscalls
+;
+240 OBSOL t32_nanosleep
+241 UNIMPL
+242 UNIMPL
+243 UNIMPL
+244 UNIMPL
+245 UNIMPL
+246 UNIMPL
+247 UNIMPL
+248 UNIMPL
+249 UNIMPL
+250 STD { int sys_minherit(void *addr, size_t len, \
+ int inherit); }
+251 OBSOL rfork
+252 STD { int sys_poll(struct pollfd *fds, \
+ u_int nfds, int timeout); }
+253 STD NOLOCK { int sys_issetugid(void); }
+254 STD { int sys_lchown(const char *path, uid_t uid, gid_t gid); }
+255 STD { pid_t sys_getsid(pid_t pid); }
+256 STD { int sys_msync(void *addr, size_t len, int flags); }
+257 OBSOL semctl35
+258 OBSOL shmctl35
+259 OBSOL msgctl35
+260 UNIMPL
+261 UNIMPL
+262 UNIMPL
+263 STD { int sys_pipe(int *fdp); }
+264 STD { int sys_fhopen(const fhandle_t *fhp, int flags); }
+265 UNIMPL
+266 UNIMPL
+267 STD { ssize_t sys_preadv(int fd, \
+ const struct iovec *iovp, int iovcnt, \
+ int pad, off_t offset); }
+268 STD { ssize_t sys_pwritev(int fd, \
+ const struct iovec *iovp, int iovcnt, \
+ int pad, off_t offset); }
+269 STD { int sys_kqueue(void); }
+270 OBSOL t32_kevent
+271 STD { int sys_mlockall(int flags); }
+272 STD { int sys_munlockall(void); }
+273 UNIMPL sys_getpeereid
+274 UNIMPL sys_extattrctl
+275 UNIMPL sys_extattr_set_file
+276 UNIMPL sys_extattr_get_file
+277 UNIMPL sys_extattr_delete_file
+278 UNIMPL sys_extattr_set_fd
+279 UNIMPL sys_extattr_get_fd
+280 UNIMPL sys_extattr_delete_fd
+281 STD NOLOCK { int sys_getresuid(uid_t *ruid, uid_t *euid, \
+ uid_t *suid); }
+282 STD { int sys_setresuid(uid_t ruid, uid_t euid, \
+ uid_t suid); }
+283 STD NOLOCK { int sys_getresgid(gid_t *rgid, gid_t *egid, \
+ gid_t *sgid); }
+284 STD { int sys_setresgid(gid_t rgid, gid_t egid, \
+ gid_t sgid); }
+285 OBSOL sys_omquery
+286 STD { void *sys_mquery(void *addr, size_t len, int prot, \
+ int flags, int fd, long pad, off_t pos); }
+287 STD { int sys_closefrom(int fd); }
+288 STD { int sys_sigaltstack(const struct sigaltstack *nss, \
+ struct sigaltstack *oss); }
+#ifdef SYSVSHM
+289 STD { int sys_shmget(key_t key, size_t size, int shmflg); }
+#else
+289 UNIMPL shmget
+#endif
+#ifdef SYSVSEM
+290 STD { int sys_semop(int semid, struct sembuf *sops, \
+ size_t nsops); }
+#else
+290 UNIMPL semop
+#endif
+291 OBSOL t32_stat
+292 OBSOL t32_fstat
+293 OBSOL t32_lstat
+294 STD { int sys_fhstat(const fhandle_t *fhp, \
+ struct stat *sb); }
+#ifdef SYSVSEM
+295 STD { int sys___semctl(int semid, int semnum, int cmd, \
+ union semun *arg); }
+#else
+295 UNIMPL
+#endif
+#ifdef SYSVSHM
+296 STD { int sys_shmctl(int shmid, int cmd, \
+ struct shmid_ds *buf); }
+#else
+296 UNIMPL
+#endif
+#ifdef SYSVMSG
+297 STD { int sys_msgctl(int msqid, int cmd, \
+ struct msqid_ds *buf); }
+#else
+297 UNIMPL
+#endif
+298 STD { int sys_sched_yield(void); }
+299 STD NOLOCK { pid_t sys_getthrid(void); }
+300 OBSOL t32___thrsleep
+301 STD { int sys___thrwakeup(const volatile void *ident, \
+ int n); }
+302 STD { void sys___threxit(pid_t *notdead); }
+303 STD { int sys___thrsigdivert(sigset_t sigmask, \
+ siginfo_t *info, const struct timespec *timeout); }
+304 STD { int sys___getcwd(char *buf, size_t len); }
+305 STD { int sys_adjfreq(const int64_t *freq, \
+ int64_t *oldfreq); }
+306 OBSOL getfsstat53
+307 OBSOL statfs53
+308 OBSOL fstatfs53
+309 OBSOL fhstatfs53
+310 STD { int sys_setrtable(int rtableid); }
+311 STD NOLOCK { int sys_getrtable(void); }
+312 OBSOL t32_getdirentries
+313 STD { int sys_faccessat(int fd, const char *path, \
+ int amode, int flag); }
+314 STD { int sys_fchmodat(int fd, const char *path, \
+ mode_t mode, int flag); }
+315 STD { int sys_fchownat(int fd, const char *path, \
+ uid_t uid, gid_t gid, int flag); }
+316 OBSOL t32_fstatat
+317 STD { int sys_linkat(int fd1, const char *path1, int fd2, \
+ const char *path2, int flag); }
+318 STD { int sys_mkdirat(int fd, const char *path, \
+ mode_t mode); }
+319 STD { int sys_mkfifoat(int fd, const char *path, \
+ mode_t mode); }
+320 STD { int sys_mknodat(int fd, const char *path, \
+ mode_t mode, dev_t dev); }
+321 STD { int sys_openat(int fd, const char *path, int flags, \
+ ... mode_t mode); }
+322 STD { ssize_t sys_readlinkat(int fd, const char *path, \
+ char *buf, size_t count); }
+323 STD { int sys_renameat(int fromfd, const char *from, \
+ int tofd, const char *to); }
+324 STD { int sys_symlinkat(const char *path, int fd, \
+ const char *link); }
+325 STD { int sys_unlinkat(int fd, const char *path, \
+ int flag); }
+326 OBSOL t32_utimensat
+327 OBSOL t32_futimens
+328 OBSOL __tfork51
+329 STD NOLOCK { void sys___set_tcb(void *tcb); }
+330 STD NOLOCK { void *sys___get_tcb(void); }
diff --git a/support/syscall-gen/types+openbsd:6.1-x64.frag b/support/syscall-gen/types+openbsd:6.1-x64.frag
index 4585149..48b8f5b 100644
--- a/support/syscall-gen/types+openbsd:6.1-x64.frag
+++ b/support/syscall-gen/types+openbsd:6.1-x64.frag
@@ -47,7 +47,6 @@ type timeval = struct
usec : uint64
;;
-
type pollfd = struct
fd : fd
events : uint16
diff --git a/support/syscall-gen/types+openbsd:6.2-x64.frag b/support/syscall-gen/types+openbsd:6.2-x64.frag
new file mode 100644
index 0000000..0d28f2e
--- /dev/null
+++ b/support/syscall-gen/types+openbsd:6.2-x64.frag
@@ -0,0 +1,477 @@
+type size = int64 /* spans entire address space */
+type usize = uint64 /* unsigned size */
+type off = int64 /* file offsets */
+type intptr = uint64/* can hold any pointer losslessly */
+type time = int64 /* milliseconds since epoch */
+type pid = int32 /* process id */
+type scno = int64 /*syscall*/
+type fdopt = int64 /* fd options */
+type fd = int32 /* fd */
+type whence = uint64 /* seek from whence */
+type mprot = int64 /* memory protection */
+type mopt = int64 /* memory mapping options */
+type socktype = int64 /* socket type */
+type sockproto = int64 /* socket protocol */
+type sockopt = int32 /* socket option */
+type sockfam = uint8 /* socket family */
+type filemode = uint32
+type filetype = uint8
+type fcntlcmd = int64
+ype signo = int32
+type sigflags = int32
+type sigset = uint32
+type msg = void
+
+const Futexwait : int = 1
+const Futexwake : int = 2
+const Futexrequeue : int = 3
+
+
+type clock = union
+ `Clockrealtime
+ `Clockmonotonic
+ `Clockproccputime
+ `Clockthreadcputime
+ `Clockuptime
+;;
+
+type waitstatus = union
+ `Waitfail int32
+ `Waitexit int32
+ `Waitsig int32
+ `Waitstop int32
+;;
+
+type rlimit = struct
+ cur : uint64 /* current (soft) limit */
+ max : uint64 /* maximum value for rlim_cur */
+;;
+
+type timespec = struct
+ sec : uint64
+ nsec : uint64
+;;
+
+type timeval = struct
+ sec : uint64
+ usec : uint64
+;;
+
+type timezone = struct
+ minwest : int32 /* minutes west of Greenwich */
+ dsttime : int32 /* type of dst correction */
+;;
+
+type pollfd = struct
+ fd : fd
+ events : uint16
+ revents : uint16
+;;
+
+type itimerval = struct
+ interval : timeval /* timer interval */
+ value : timeval /* current value */
+;;
+
+type sigaction = struct
+ handler : byte# /* code pointer */
+ mask : sigset
+ flags : sigflags
+;;
+/*
+ * Information pushed on stack when a signal is delivered.
+ * This is used by the kernel to restore state following
+ * execution of the signal handler. It is also made available
+ * to the handler to allow it to restore state properly if
+ * a non-standard exit is performed.
+ */
+type sigcontext = struct
+ /* plain match trapframe */
+ rdi : int64
+ rsi : int64
+ rdx : int64
+ rcx : int64
+ r8 : int64
+ r9 : int64
+ r10 : int64
+ r11 : int64
+ r12 : int64
+ r13 : int64
+ r14 : int64
+ r15 : int64
+ rbp : int64
+ rbx : int64
+ rax : int64
+ gs : int64
+ fs : int64
+ es : int64
+ ds : int64
+ trapno : int64
+ err : int64
+ rip : int64
+ cs : int64
+ rflags : int64
+ rsp : int64
+ ss : int64
+
+ fpstate : fxsave64#
+ __pad : int32
+ mask : int32
+ cookie : int64
+;;
+
+type sigaltstack = struct
+ sp : void#
+ size : size
+ flags : int32
+;;
+
+type fxsave64 = struct
+ fcw : int16
+ fsw : int16
+ ftw : int8
+ unused1 : int8
+ fop : int16
+ rip : int64
+ rdp : int64
+ mxcsr : int32
+ mxcsrmask : int32
+ st : int64[8][2] /* 8 normal FP regs */
+ xmm : int64[16][2] /* 16 SSE2 registers */
+ unused3 : int8[96]
+;;
+
+const Simaxsz = 128
+const Sipad = (Simaxsz / 4) - 3
+type siginfo = struct
+ signo : int
+ code : int
+ errno : int
+ pad : int[Sipad]
+;;
+
+type rusage = struct
+ utime : timeval /* user time */
+ stime : timeval /* system time */
+ maxrss : uint64 /* max resident set size*/
+ ixrss : uint64 /* shared text size */
+ idrss : uint64 /* unshared data size */
+ isrss : uint64 /* unshared stack size */
+ minflt : uint64 /* page reclaims */
+ majflt : uint64 /* page faults */
+ nswap : uint64 /* swaps */
+ inblock : uint64 /* block input ops */
+ oublock : uint64 /* block output ops */
+ msgsnd : uint64 /* messages sent */
+ msgrcv : uint64 /* messages received */
+ nsignals : uint64 /* signals received */
+ nvcsw : uint64 /* voluntary context switches */
+ nivcsw : uint64 /* involuntary context switches */
+;;
+
+type tforkparams = struct
+ tcb : void#
+ tid : pid#
+ stk : byte#
+;;
+
+type statbuf = struct
+ mode : filemode
+ dev : uint32
+ ino : uint64
+ nlink : uint32
+ uid : uint32
+ gid : uint32
+ rdev : uint32
+ atime : timespec
+ mtime : timespec
+ ctime : timespec
+ size : off
+ blocks : int64
+ blksize : uint32
+ flags : uint32
+ gen : uint32
+ birthtim : timespec
+;;
+
+type semun = struct
+ semarr : void#
+;;
+
+const Mfsnamelen = 16 /* length of fs type name, including nul */
+const Mnamelen = 90 /* length of buffer for returned name */
+
+type statfs = struct
+ flags : uint32 /* copy of mount flags */
+ bsize : uint32 /* file system block size */
+ iosize : uint32 /* optimal transfer block size */
+
+ /* unit is f_bsize */
+ blocks : uint64 /* total data blocks in file system */
+ bfree : uint64 /* free blocks in fs */
+ bavail : int64 /* free blocks avail to non-superuser */
+
+ files : int64 /* total file nodes in file system */
+ ffree : int64 /* free file nodes in fs */
+ favail : int64 /* free file nodes avail to non-root */
+
+ syncwr : int64 /* count of sync writes since mount */
+ syncrd : int64 /* count of sync reads since mount */
+ asyncwr : int64 /* count of async writes since mount */
+ asyncrd : int64 /* count of async reads since mount */
+
+ fsid : fsid /* file system id */
+ namemax : uint32 /* maximum filename length */
+ owner : uid /* user that mounted the file system */
+ ctime : uint64 /* last mount [-u] time */
+
+ fstypename : byte[Mfsnamelen]; /* fs type name */
+ mntonname : byte[Mnamelen]; /* directory on which mounted */
+ mntfromname : byte[Mnamelen]; /* mounted file system */
+ mntfromspec : byte[Mnamelen]; /* special for mount request */
+ ///union mount_info mount_info; /* per-filesystem mount options */
+ __mountinfo : byte[160]; /* storage for 'union mount_info' */
+;;
+
+type utsname = struct
+ system : byte[32]
+ node : byte[32]
+ release : byte[32]
+ version : byte[32]
+ machine : byte[32]
+;;
+
+type sockaddr = struct
+ len : byte
+ fam : sockfam
+ data : byte[14] /* what is the *actual* length? */
+;;
+
+type sockaddr_in = struct
+ len : byte
+ fam : sockfam
+ port : uint16
+ addr : byte[4]
+ zero : byte[8]
+;;
+
+type sockaddr_in6 = struct
+ len : byte
+ fam : sockfam
+ port : uint16
+ flow : uint32
+ addr : byte[16]
+ scope : uint32
+;;
+
+type sockaddr_un = struct
+ len : uint8
+ fam : sockfam
+ path : byte[104]
+;;
+
+type sockaddr_storage = struct
+ len : byte
+ fam : sockfam
+ __pad1 : byte[6]
+ __align : int64
+ __pad2 : byte[240]
+;;
+
+type dirent = struct
+ fileno : uint64
+ off : uint64
+ reclen : uint16
+ ftype : uint8
+ namlen : uint8
+ __pad : byte[4]
+ name : byte[256]
+;;
+
+type iovec = struct
+ base : byte#
+ len : uint64
+;;
+
+/* open options */
+const Ordonly : fdopt = 0x0
+const Owronly : fdopt = 0x1
+const Ordwr : fdopt = 0x2
+const Oappend : fdopt = 0x8
+const Ondelay : fdopt = 0x4
+const Oshlock : fdopt = 0x10 /* open with shared file lock */
+const Oexlock : fdopt = 0x20 /* open with exclusive file lock */