diff options
| author | forsyth <forsyth@vitanuova.com> | 2009-07-28 17:44:25 +0100 |
|---|---|---|
| committer | forsyth <forsyth@vitanuova.com> | 2009-07-28 17:44:25 +0100 |
| commit | c25d3f6db1487efc983a3301dadc677d4b1fdca2 (patch) | |
| tree | ef40576da56637db6d2ac299565a4d537af7804e | |
| parent | 560dc2e2a37e7e04e86569d3c540dc02d73e59a9 (diff) | |
20090728-1744
| -rw-r--r-- | CHANGES | 4 | ||||
| -rw-r--r-- | appl/lib/bufio.b | 6 | ||||
| -rw-r--r-- | dis/lib/bufio.dis | bin | 4630 -> 4607 bytes | |||
| -rw-r--r-- | emu/port/main.c | 7 | ||||
| -rw-r--r-- | include/version.h | 2 | ||||
| -rw-r--r-- | man/1/emu | 47 |
6 files changed, 61 insertions, 5 deletions
@@ -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 Binary files differindex 17f118f4..dccad0fc 100644 --- a/dis/lib/bufio.dis +++ b/dis/lib/bufio.dis 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)" @@ -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 |
