---
name: "lpdetach"
section: "2"
platform: "linux"
package: "lam2-dev"
version: "6.3.2-3"
release: "Debian 2.2 (Potato)"
platforms: ["linux"]
url: "https://new.carta.tech/lpattach"
---

# lpdetach(2)

Attach, detach a LAM process from remote process management.

Part of [lpattach(2)](/lpattach/2.md).

## NAME

lpattach, lpdetach - Attach, detach a LAM process from remote process management.

## SYNOPSIS

int lpattach (char \*name);\
 int lpdetach (int pid, int status);

## DESCRIPTION

Remote process management allows a process to be selected by other processes throughout the multicomputer for control or monitoring in such functions as [rpdoom(2)](/rpdoom/2.md), [rpstate(2)](/rpstate/2.md) and [rpspawn(2)](/rpspawn/2.md).

The *name* argument helps identify the process. It is useful to choose the program name, as found in argv\[0\], for this argument. The name will be seen in the output of the [state(1)](/state/1.md) command. *lpattach()* is called by [kenter(2)](/kenter/2.md) and is not typically called directly.

The function *lpdetach()* makes a LAM process inaccessible to remote process management and should be called just prior to process termination. The *status* argument is an exit code. If a parent process is waiting for the calling process to terminate, *lpdetach()* will pass the termination status back to the parent. *lpdetach()* is called by [kexit(2)](/kexit/2.md) and is not typically called directly.

The *pid* argument makes it possible for one process to remove another from remote process management. This is intended as an emergency clean-up measure. The normal value for this argument is 0, which indicates the action is to be taken on the calling process.

## ERRORS

- ENOPDESCRIPTORS

  The remote process descriptor table is full.

- ENOTPROCESS

  The process whose process identifier was passed to *lpdetach()* is not currently being managed.

## SEE ALSO

[rpdoom(2)](/rpdoom/2.md), [rpstate(2)](/rpstate/2.md)
