From 0fd708b8f1ffd099d092c02af28c79101ca58524 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Mon, 11 Jul 2016 14:58:50 +0200 Subject: Place in background unless -f MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/util.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/util.h') diff --git a/src/util.h b/src/util.h index c44164b..25c1a71 100644 --- a/src/util.h +++ b/src/util.h @@ -40,3 +40,15 @@ void* memdup(const void* src, size_t n); */ void* nread(int fd, size_t* n); + +/** + * Duplicate a file descriptor an make sure + * the new file descriptor's index as a + * specified minimum value + * + * @param fd The file descriptor + * @param atleast The least acceptable new file descriptor + * @return The new file descriptor, -1 on error + */ +int dup2atleast(int fd, int atleast); + -- cgit v1.2.3-70-g09d2