









Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!










z^
z^
z^
z^
typedef struct {
char *name;int opCode;int numRegisters;int usesMem; } opInfo;
static opInfo opTable[] = {
{ "Load",
{ "Move",
{ "Store", 3, 1, 1 },{ "Add",
{ "Halt",
{ "Negate", 6, 1, 0 },{ "Branch", 7, 2, 1 },{ "Bnn",
{ "Input", 10, 1, 0 },{ "Output", 11, 1, 0 },{ "Data",
z^
setenv FOO_CONFIG ~/foo
FOO_CONFIG=~/foo
z^
z^
returns twice
the "child" (new) process
0
the "parent" (original) process
the "parent", but not child was created (error case)
z^
z^
z^
z^
z^
z^
z^
z^
z^
dup2(0, pipefd[0]);close(pipefd[1]);ret = execvp("ls", args);…. else if (pid > 0) {
dup2(1, pipefd[1]);close(pipefd[0]); } else {….}