Unified · Split
| @@ -1,3 +1,7 @@ | ||
| 1 | +20090728 | |
| 2 | + emu/port/main.c: put host's working directory name as emuwdir | |
| 3 | + document initial environment variables in emu(1) | |
| 4 | + appl/lib/bufio.b dis/lib/bufio.dis [issue 199] don't lose track of actual file seek offset (following second suggestion of mjl) | |
| 1 | 5 | 20090719 |
| 2 | 6 | correct order of operands to memset(!), eg in ipif [mjl] |
| 3 | 7 | 20090718 |
| @@ -171,12 +171,10 @@ Iobuf.seek(b: self ref Iobuf, off: big, start: int): big · 170 unmodified lines | ||
| 171 | 171 | return big ERROR; |
| 172 | 172 | b.size = 0; |
| 173 | 173 | b.index = 0; |
| 174 | − if ((s := sys->seek(b.fd, off, start)) < big 0) { | |
| 175 | − b.filpos = b.bufpos = big 0; | |
| 174 | + if ((s := sys->seek(b.fd, off, start)) < big 0) | |
| 176 | 175 | return big ERROR; |
| 177 | − } | |
| 178 | 176 | b.bufpos = b.filpos = s; |
| 179 | − return b.bufpos = b.filpos = s; | |
| 177 | + return s; | |
| 180 | 178 | } |
| 181 | 179 | |
| 182 | 180 | Iobuf.offset(b: self ref Iobuf): big |
Binary file not shown.
| @@ -263,6 +263,7 @@ void · 262 unmodified lines | ||
| 263 | 263 | emuinit(void *imod) |
| 264 | 264 | { |
| 265 | 265 | Osenv *e; |
| 266 | + char *wdir; | |
| 266 | 267 | |
| 267 | 268 | e = up->env; |
| 268 | 269 | e->pgrp = newpgrp(); |
| @@ -312,6 +313,12 @@ emuinit(void *imod) · 43 unmodified lines | ||
| 312 | 313 | putenvqv("emuargs", rebootargv, rebootargc, 1); |
| 313 | 314 | putenvq("emuroot", rootdir, 1); |
| 314 | 315 | ksetenv("emuhost", hosttype, 1); |
| 316 | + wdir = malloc(1024); | |
| 317 | + if(wdir != nil){ | |
| 318 | + if(getwd(wdir, 1024) != nil) | |
| 319 | + putenvq("emuwdir", wdir, 1); | |
| 320 | + free(wdir); | |
| 321 | + } | |
| 315 | 322 | |
| 316 | 323 | kproc("main", disinit, imod, KPDUPFDG|KPDUPPG|KPDUPENVG); |
| 317 | 324 | |
| @@ -1 +1 @@ | ||
| 1 | −#define VERSION "Fourth Edition (20090725)" | |
| 1 | +#define VERSION "Fourth Edition (20090728)" | |
| @@ -208,6 +208,53 @@ set by a · 207 unmodified lines | ||
| 208 | 208 | option to the |
| 209 | 209 | .I emu |
| 210 | 210 | command itself. |
| 211 | +.PP | |
| 212 | +.I Emu | |
| 213 | +sets several Inferno environment variables: | |
| 214 | +.TF emuwdirxxx | |
| 215 | +.PD | |
| 216 | +.TP | |
| 217 | +.B cputype | |
| 218 | +host processor architecture: | |
| 219 | +.B 386 | |
| 220 | +(for any x86), | |
| 221 | +.BR arm , | |
| 222 | +.BR mips , | |
| 223 | +.B power | |
| 224 | +(any Power or PowerPC), | |
| 225 | +.BR sparc , | |
| 226 | +and | |
| 227 | +.BR spim | |
| 228 | +(little-endian MIPS). | |
| 229 | +.TP | |
| 230 | +.B emuargs | |
| 231 | +arguments with which | |
| 232 | +.I emu | |
| 233 | +was invoked | |
| 234 | +.TP | |
| 235 | +.B emuhost | |
| 236 | +host operating system type, such as: | |
| 237 | +.BR FreeBSD , | |
| 238 | +.BR Irix , | |
| 239 | +.BR Linux , | |
| 240 | +.BR MacOSX , | |
| 241 | +.BR NetBSD , | |
| 242 | +.BR Nt | |
| 243 | +(used for Windows generally), | |
| 244 | +.BR OpenBSD , | |
| 245 | +.BR Plan9 , | |
| 246 | +.B Solaris | |
| 247 | +and | |
| 248 | +.BR Unixware . | |
| 249 | +.TP | |
| 250 | +.B emuroot | |
| 251 | +name of directory in host file system that acts as Inferno's root directory | |
| 252 | +.TP | |
| 253 | +.B emuwdir | |
| 254 | +name in host file system of directory where | |
| 255 | +.I emu | |
| 256 | +was invoked | |
| 257 | +.PD | |
| 211 | 258 | .SH EXAMPLE |
| 212 | 259 | To start |
| 213 | 260 | .B wm/logon |