summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2016-04-29 17:02:13 +1200
committerOri Bernstein <ori@eigenstate.org>2016-05-08 17:20:44 +1200
commit4868e3b769c7b0d4c77c715df641219010be835b (patch)
treebe02b5a33be35484cbe222e2ae2afea8a96b5502 /lib
parent15127e35827c55fcb3310e8b71351bd4420b2b0d (diff)
downloadmc-4868e3b769c7b0d4c77c715df641219010be835b.tar.gz
mbld sort of works.
Diffstat (limited to 'lib')
-rw-r--r--lib/std/bld.sub2
-rw-r--r--lib/std/syswrap-ss+openbsd.myr2
-rw-r--r--lib/sys/bld.sub1
-rw-r--r--lib/sys/sys+openbsd-x64.myr9
4 files changed, 8 insertions, 6 deletions
diff --git a/lib/std/bld.sub b/lib/std/bld.sub
index 638860d..33a9fbe 100644
--- a/lib/std/bld.sub
+++ b/lib/std/bld.sub
@@ -84,6 +84,7 @@ lib std {inc=.} =
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 @@ lib std {inc=.} =
# system-specific syscall wrappers
syswrap-ss+linux.myr
+ syswrap-ss+openbsd.myr
syswrap-ss+osx.myr
syswrap-ss+plan9.myr
syswrap-ss+freebsd.myr
diff --git a/lib/std/syswrap-ss+openbsd.myr b/lib/std/syswrap-ss+openbsd.myr
index 0d6e3fb..cc3ea08 100644
--- a/lib/std/syswrap-ss+openbsd.myr
+++ b/lib/std/syswrap-ss+openbsd.myr
@@ -12,5 +12,5 @@ pkg std =
const exit = {status; sys.exit(status)}
const bgetcwd = {buf
- -> sys.__getcwd(buf) castto(errno)
+ -> (sys.__getcwd(buf) - 1) castto(errno)
}
diff --git a/lib/sys/bld.sub b/lib/sys/bld.sub
index 44152d2..866152d 100644
--- a/lib/sys/bld.sub
+++ b/lib/sys/bld.sub
@@ -14,6 +14,7 @@ lib sys =
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
diff --git a/lib/sys/sys+openbsd-x64.myr b/lib/sys/sys+openbsd-x64.myr
index 72269bc..018c1d5 100644
--- 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 @@ pkg sys =
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 @@ pkg sys =
;;
type statbuf = struct
+ mode : filemode
dev : uint32
ino : uint64
- mode : filemode
nlink : uint32
uid : uint32
gid : uint32
@@ -78,12 +78,11 @@ pkg sys =
atime : timespec
mtime : timespec
ctime : timespec
- size : int64
+ size : off
blocks : int64
blksize : uint32
flags : uint32
gen : uint32
- lspare : int32
birthtim : timespec
;;