---
name: "set-tcp-env"
section: "1"
platform: "linux"
package: "twoftpd"
version: "1.14-1"
release: "Debian 3.0 (Woody)"
platforms: ["linux"]
url: "https://new.carta.tech/set-tcp-env"
---

# set-tcp-env(1)

set up mandatory TCP-related environment variables

## NAME

set-tcp-env - set up mandatory TCP-related environment variables

## SYNOPSIS

**set-tcp-env** *prog*

## DESCRIPTION

**set-tcp-env** is heavily based on [**tcp-env**(1)](/tcp-env/1.md) from qmail-1.03. It uses C libraries from djb he put into the Public domain.

*prog* consist of one or more arguments.

The input for **set-tcp-env** must be a TCP connection. **set-tcp-env** finds out information about that connection, and sets PROTO, TCPLOCALIP, TCPLOCALPORT, TCPREMOTEIP, TCPREMOTEPORT respectively. It unsets TCPLOCALHOST, TCPREMOTEHOST and TCPREMOTEINFO. These environment variables are described in [**tcp-environ**(5)](/tcp-environ/5.md).

**set-tcp-env** then runs *prog* with the given arguments.

## EXIT CODES

**set-tcp-env** returns 111 on error, it replaces itself with *prog* in all other cases.

## SEE ALSO

[tcp-env(1)](/tcp-env/1.md), [tcp-environ(5)](/tcp-environ/5.md), [inetd(8)](/inetd/8.md)
