Plan B User's Manual


Name

copy ­ Copies one box to another.

Synopsis

#include <ulib.h>

void copy(char* s, char* d)

Description

Copy copies the box with name and constraint s to the box named and constrained by d.

Both constraints must match as said in intro(1).

This system call is also used instead of the more traditional system calls "read" and "write" (not available on Plan B) to copy from/to user memory. See vm(4) and vmboxaddr(3) for a description of how to do it.

Example

copy("/b/fs/a", "/b/fs/b");
copy("/b/fs/a!%", "/b/fs/b");
copy("/b/fs/a!*!%", "/b/fs/b");
copy("/b/fs/a!*!wave", "/b/fs/b"");

The first one copies /b/fs/a to /b/fs/b. The second does the same but requests both boxes to be of the same architecture. The third requests both boxes to be attached to the same network. The last one requests both boxes to be attached to the network named wave.

Source

/src/b/port/box.c

See also

intro(2) and cp(1).


Plan B User's Manual. First edition.