Plan B User's Manual


Name

make ­ Makes a box.

Synopsis

#include <ulib.h>

void make(char* sel, char* l, Stat *i)
void maken(char* sel)

Description

Make creates a new box named and constrained by sel. Usually, only sel has to be specified and the constraint carries just the type for the box being created. maken is supplied as a convenience and is equivalent to
make(sel, nil, nil) .

If the parameter l is supplied, it identifies a box whose constraint is like the one to be made. It is intended to allow the creation of a box with a constraint matching the one of a given box.

The Stat structure can be supplied to set initial information for the box created.

If both s and l carry constraints, they must

match as said in intro(1).

Example

maken("/b/mem/x");
make("/b/mem/x", nil, &st);
make("/b/mem/x!text", nil, &st);
make("/b/proc/x!bin!%", "/bin/x", nil);

The first one creates /b/mem/x with default type, constraint and other information (as decided by default mem(4) values ). The second one, supplies an Stat structure to set up initial permissions. The third one requests the box to be of type text. The last one creates /b/proc/x such that its type would be

bin and its architecture would match that of a box named /bin/x.

Source

/src/b/port/box.c

See also

intro(2), and mk(1).


Plan B User's Manual. First edition.