summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorforsyth <forsyth@vitanuova.com>2009-07-28 17:44:25 +0100
committerforsyth <forsyth@vitanuova.com>2009-07-28 17:44:25 +0100
commitc25d3f6db1487efc983a3301dadc677d4b1fdca2 (patch)
treeef40576da56637db6d2ac299565a4d537af7804e
parent560dc2e2a37e7e04e86569d3c540dc02d73e59a9 (diff)
20090728-1744
-rw-r--r--CHANGES4
-rw-r--r--appl/lib/bufio.b6
-rw-r--r--dis/lib/bufio.disbin4630 -> 4607 bytes
-rw-r--r--emu/port/main.c7
-rw-r--r--include/version.h2
-rw-r--r--man/1/emu47
6 files changed, 61 insertions, 5 deletions
diff --git a/CHANGES b/CHANGES
index c4160903..25f0208d 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,7 @@
+20090728
+ emu/port/main.c: put host's working directory name as emuwdir
+ document initial environment variables in emu(1)
+ appl/lib/bufio.b dis/lib/bufio.dis [issue 199] don't lose track of actual file seek offset (following second suggestion of mjl)
20090719
correct order of operands to memset(!), eg in ipif [mjl]
20090718
diff --git a/appl/lib/bufio.b b/appl/lib/bufio.b
index ab884649..e2ad8bae 100644
--- a/appl/lib/bufio.b
+++ b/appl/lib/bufio.b
@@ -171,12 +171,10 @@ Iobuf.seek(b: self ref Iobuf, off: big, start: int): big
return big ERROR;
b.size = 0;
b.index = 0;
- if ((s := sys->seek(b.fd, off, start)) < big 0) {
- b.filpos = b.bufpos = big 0;
+ if ((s := sys->seek(b.fd, off, start)) < big 0)
return big ERROR;
- }
b.bufpos = b.filpos = s;
- return b.bufpos = b.filpos = s;
+ return s;
}
Iobuf.offset(b: self ref Iobuf): big
diff --git a/dis/lib/bufio.dis b/dis/lib/bufio.dis
index 17f118f4..dccad0fc 100644
--- a/dis/lib/bufio.dis
+++ b/dis/lib/bufio.dis
Binary files differ
diff --git a/emu/port/main.c b/emu/port/main.c
index 2409916d..66ebb6a9 100644
--- a/emu/port/main.c
+++ b/emu/port/main.c
@@ -263,6 +263,7 @@ void
emuinit(void *imod)
{
Osenv *e;
+ char *wdir;
e = up->env;
e->pgrp = newpgrp();
@@ -312,6 +313,12 @@ emuinit(void *imod)
putenvqv("emuargs", rebootargv, rebootargc, 1);
putenvq("emuroot", rootdir, 1);
ksetenv("emuhost", hosttype, 1);
+ wdir = malloc(1024);
+ if(wdir != nil){
+ if(getwd(wdir, 1024) != nil)
+ putenvq("emuwdir", wdir, 1);
+ free(wdir);
+ }
kproc("main", disinit, imod, KPDUPFDG|KPDUPPG|KPDUPENVG);
diff --git a/include/version.h b/include/version.h
index c5377249..e72f45a6 100644
--- a/include/version.h
+++ b/include/version.h
@@ -1 +1 @@
-#define VERSION "Fourth Edition (20090725)"
+#define VERSION "Fourth Edition (20090728)"
diff --git a/man/1/emu b/man/1/emu
index 5c4b91e3..868f5d86 100644
--- a/man/1/emu
+++ b/man/1/emu
@@ -208,6 +208,53 @@ set by a
option to the
.I emu
command itself.
+.PP
+.I Emu
+sets several Inferno environment variables:
+.TF emuwdirxxx
+.PD
+.TP
+.B cputype
+host processor architecture:
+.B 386
+(for any x86),
+.BR arm ,
+.BR mips ,
+.B power
+(any Power or PowerPC),
+.BR sparc ,
+and
+.BR spim
+(little-endian MIPS).
+.TP
+.B emuargs
+arguments with which
+.I emu
+was invoked
+.TP
+.B emuhost
+host operating system type, such as:
+.BR FreeBSD ,
+.BR Irix ,
+.BR Linux ,
+.BR MacOSX ,
+.BR NetBSD ,
+.BR Nt
+(used for Windows generally),
+.BR OpenBSD ,
+.BR Plan9 ,
+.B Solaris
+and
+.BR Unixware .
+.TP
+.B emuroot
+name of directory in host file system that acts as Inferno's root directory
+.TP
+.B emuwdir
+name in host file system of directory where
+.I emu
+was invoked
+.PD
.SH EXAMPLE
To start
.B wm/logon