File: popen_nosh.3

package info (click to toggle)
libexecs 1.4-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 168 kB
  • sloc: ansic: 486; makefile: 16
file content (59 lines) | stat: -rw-r--r-- 2,662 bytes parent folder | download | duplicates (4)
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
.\"* popen_nosh: system replacement not using any shell
.\" Copyright (C) 2014 Renzo Davoli. University of Bologna. <renzo@cs.unibo.it>
.\" 
.\" This library is free software; you can redistribute it and/or
.\" modify it under the terms of the GNU Lesser General Public
.\" License as published by the Free Software Foundation; either
.\" version 2.1 of the License, or (at your option) any later version.
.\" 
.\" This library is distributed in the hope that it will be useful,
.\" but WITHOUT ANY WARRANTY; without even the implied warranty of
.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
.\" Lesser General Public License for more details.
.\" 
.\" You should have received a copy of the GNU Lesser General Public
.\" License along with this library; if not, write to the Free Software
.\" Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
.TH popen_nosh 3 2014-05-27 "VirtualSquare" "Linux Programmer's Manual"
.SH NAME

popen_nosh, pclose_nosh, popen_execs, pclose_execs, \- pipe stream to or from a process without using a shell
.SH SYNOPSIS
.B #include <stdio.h>
.br
.B #include <execs.h>
.sp
.BI "FILE *popen_nosh(const char *" command ", const char *" type ");"
.br
.BI "int pclose_nosh(FILE *" stream ");"
.sp
.BI "FILE *popen_execsp(const char *" command ", const char *" type ");"
.br
.BI "int pclose_execsp(FILE *" stream ");"
.sp
.BI "FILE *popen_execs(const char *" path ",const char *" command ", const char *" type ");"
.br
.BI "int pclose_execs(FILE *" stream ");"
.sp
These functions are provided by libexecs. Link with \fI-lexecs\fR.
.SH DESCRIPTION
\fBpopen_nosh\fR, \fBpopen_execsp\fR and \fBpclose_nosh\fR are almost drop in replacement for \fBpopen\fR(3) and \fBpclose\fR(3)
provided by the libc. \fBpopen_nosh\fR and \fBpopen_execsp\fR are synonyms: they parse the command string
and run the command directly, without using a shell.
.br
Command arguments in \fIargs\fR are delimited by space characters (blank, tabs
or new lines).
Single or double quotes can be used to delimitate command arguments including
spaces and a non quoted backslash (\fB\e\fP)
is the escape character to protect the next char. The executable file
is sought using the PATH environment variable as explained for \fBexeclp\fR(3).
.br
\fBpclose_nosh\fR closes a stream opened by \fBpopen_nosh\fR.
.br
\fBpopen_execs\fR requires the path of the executable to be specified
as its first parameter so it does not use the PATH environment variable.
\fBpclose_execs\fR closes a stream opened by \fBpopen_execs\fR.

.SH RETURN VALUE
These functions have the same return values of \fBpopen\fR(3) and \fBpclose\fR(3).