ref: 4868e3b769c7b0d4c77c715df641219010be835b
parent: 15127e35827c55fcb3310e8b71351bd4420b2b0d
author: Ori Bernstein <ori@eigenstate.org>
date: Fri Apr 29 13:02:13 EDT 2016
mbld sort of works.
--- a/lib/std/bld.sub
+++ b/lib/std/bld.sub
@@ -84,6 +84,7 @@
dialparse+posixy.myr
dir+freebsd.myr
dir+linux.myr
+ dir+openbsd.myr
dir+osx.myr
dir+plan9.myr
env+plan9.myr
@@ -101,6 +102,7 @@
# system-specific syscall wrappers
syswrap-ss+linux.myr
+ syswrap-ss+openbsd.myr
syswrap-ss+osx.myr
syswrap-ss+plan9.myr
syswrap-ss+freebsd.myr
--- a/lib/std/syswrap-ss+openbsd.myr
+++ b/lib/std/syswrap-ss+openbsd.myr
@@ -12,5 +12,5 @@
const exit = {status; sys.exit(status)}
const bgetcwd = {buf
- -> sys.__getcwd(buf) castto(errno)
+ -> (sys.__getcwd(buf) - 1) castto(errno)
}
--- a/lib/sys/bld.sub
+++ b/lib/sys/bld.sub
@@ -14,6 +14,7 @@
ifreq+freebsd.myr
ifreq+linux.myr
ifreq+osx.myr
+ ifreq+openbsd.myr
ifreq+plan9.myr
ifreq.myr # dummy file: plan9 doesn't have ifreq
util+plan9-x64.s
--- a/lib/sys/sys+openbsd-x64.myr
+++ b/lib/sys/sys+openbsd-x64.myr
@@ -1,7 +1,7 @@
use "systypes.use"
pkg sys =
- type pid = int /* process id */
+ type pid = int32 /* process id */
type scno = int64 /*syscall*/
type fdopt = int64 /* fd options */
type fd = int32 /* fd */
@@ -11,7 +11,7 @@
type socktype = int64 /* socket type */
type sockproto = int64 /* socket protocol */
type sockfam = uint8 /* socket family */
- type filemode = uint16
+ type filemode = uint32
type filetype = uint8
type fcntlcmd = int64
type umtxop = int32
@@ -68,9 +68,9 @@
;;
type statbuf = struct
+ mode : filemode
dev : uint32
ino : uint64
- mode : filemode
nlink : uint32
uid : uint32
gid : uint32
@@ -78,12 +78,11 @@
atime : timespec
mtime : timespec
ctime : timespec
- size : int64
+ size : off
blocks : int64
blksize : uint32
flags : uint32
gen : uint32
- lspare : int32
birthtim : timespec
;;
--- a/mbld/install.myr
+++ b/mbld/install.myr
@@ -83,7 +83,6 @@
if !std.blat(path, buf, perm)
std.put("Could not write {}\n", file)
;;
- std.slfree(buf)
;;
;;
std.slfree(path)