1
.\" Copyright (c) Kristaps Dzonsons <kristaps@bsd.lv>
3
.\" Permission to use, copy, modify, and distribute this software for any
4
.\" purpose with or without fee is hereby granted, provided that the above
5
.\" copyright notice and this permission notice appear in all copies.
7
.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
8
.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
9
.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
10
.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
11
.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
12
.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
13
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
20
.Nd get the FastCGI control socket
30
.Fa "const struct kfcgi *fcgi"
33
Get the control socket used for handling FastCGI processes.
36
be used for polling purposes in asynchronous applications.
37
If the returned socket descriptor is manipulated in any other way, the results
40
The returned descriptor is only valid after
43
.Xr khttp_fcgi_free 3 .
45
The following example starts an application in FastCGI or regular CGI
46
mode depending upon the environment.
47
.Bd -literal -offset indent
57
er = khttp_fcgi_init(&fcgi, NULL, 0, NULL, 0, 0);
59
errx(1, "khttp_fcgi_init: %s", kcgi_strerror(er));
62
pfd.fd = khttp_fcgi_getfd(fcgi);
64
/* Poll on other sockets here... */
65
while ((rc = poll(&pfd, 1, INFTIM)) != -1) {
66
er = khttp_fcgi_parse(fcgi, &req);
68
err(1, "khttp_fcgi_parse: %s", kcgi_strerror(er));
69
if (KCGI_EXIT == er) {
76
khttp_fcgi_free(fcgi);
86
.An Kristaps Dzonsons Aq Mt kristaps@bsd.lv .