bind -a '#C' / /cmd/clone /cmd/n/ctl /cmd/n/data /cmd/n/status
exec oscmd args...Prior to launching the command cmd prints at the console a line (128 bytes, maximum) of the format:
devcmd: 'oscmd args...' pid pidThe string between the single quotes matches the command written to /cmd/n/ctl and pid is the number (in decimal format) of the process running the emulator. Each field is separated by a single blank.
File offset is ignored for both reading and writing.
Writing to /cmd/n/data sends the data into the command's standard input.
Reading /cmd/n/status provides a status line (maximum128 bytes) of the format:
cmd/n refcnt state cmd args...where each field separator is a single blank. The meaning of each field is:
A cmd directory n can be in the following states
Open
|
Allocated for use but not yet running a command.
|
Execute
|
Running a command
|
Close
|
Command completed. Available for reallocation via /cmd/clone.
|
Directory Management
Once closed, a directory n created by cmd persists and is reused by cmd in response to later openings of /cmd/clone. The cmd device only creates a new directory when all others (if any) are in use. Command Execution
Unix-Hosted Systems
The command is run via the /bin/sh program as follows
/bin/sh -c 'cmd args...'Emulator run by root:
If available, the emulator runs the command with a host user ID (uid) and host group ID (gid) corresponding to Inferno's representation for the user's identity. If not available, the emulator runs the command with uidnobody and gidnobody.
Emulator not run by root:
Commands are run on the host with the same host identity as the emulator
The command is always run with the same host identity as the emulator.
emu
|
Overview of the emulator
|
os
|
Inferno command interface to the cmd device
|