ATTACH(3R)

NAME
attach - connect process to host

SYNOPSIS
int attach (host)
int host;

DESCRIPTION
A process that is already local may connect itself to a host by calling the function attach. It takes a single argument indicating the host to be connected to. There are currently only two valid values, 0 and 1, that refer to logical Host 1 and Host 2, respectively. When a process is successfully attached, the border for the window of that process becomes solid.

The resources owned by the process remain unchanged except for the addition of a host connection. The attach function operates correctly independent of whether the host is already in layers mode or not.

The function can fail if the host has not been configured in the set-up options; if there are not any available connections for the specified host; if the process is already connected; or if the host argument is invalid. A failure is indicated to the calling process by a return value of zero.

EXAMPLE
This example shows how the attach function may be used in a process that wishes to be connected to the logical Host 2.

    #include <dmd.h>
    switchhost ()
    {
    	if (local())
    		attach(1);

    }

SEE ALSO
local(3R), peel(3R).

WARNING
The host values may change in meaning and/or be expanded in the future.