File: popen3.h

package info (click to toggle)
nsd 4.14.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 5,260 kB
  • sloc: ansic: 64,435; sh: 4,351; python: 2,085; yacc: 1,344; makefile: 688
file content (27 lines) | stat: -rw-r--r-- 737 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
/*
 * popen3.h -- execute a command and connect stdin, stdout and stderr
 *
 * Copyright (c) 2019, NLnet Labs. All rights reserved.
 *
 * See LICENSE for the license.
 *
 */
#ifndef POPEN3_H
#define POPEN3_H

#include <stdio.h>
#include <sys/types.h>

/*
 * Execute a command and connect stdin, stdout and stderr of the process to
 * respectively finptr, foutptr and ferrptr if non-NULL. The process
 * identifier of the new process is returned on success and the pointers to
 * the FILE handles will have been set. On failure, -1 is returned and none
 * of the pointers will have been set.
 */
pid_t popen3(char *const *command,
             int *fdinptr,
             int *fdoutptr,
             int *fderrptr);

#endif /* POPEN3_H */