fd_copy(3)

fd_copy3

Duplicate a descriptor

Usage

#include <fd.h>

int fd_copy(to,from);

int to;
int from;

Overview

fd_copy copies descriptor from to descriptor to. If to was already open, fd_copy closes it. fd_copy always leaves from intact; if to and from are the same number, fd_copy does nothing.

fd_copy returns 0 on success, -1 on error. fd_copy does not guarantee that to will remain open, if it was open, in case of error.

Releases

Unchanged in 4 releases since Debian 7 (Wheezy).

  1. 7–10

From qmail 1.06-6.2~deb10u1 in Debian 10 (Buster). Parsed by carta from the page's man source.