FCGI_STARTFILTERDATA(3)
π FCGI_StartFilterData β the fcgi_stdio compatibility library glow-up π
okay bestie, sit down, hydrate, because we're talking about FCGI_StartFilterData(3) from the fcgi_stdio compatibility library. it's giving "let me read my filter input from stdin, finally" energy, and honestly? iconic.
β¨ SYNOPSIS β¨
#include "fcgi_stdio.h"
int
FCGI_StartFilterData(void);
that's it. that's the whole vibe. one function, zero arguments, maximum main character energy π«Ά
πΈ DESCRIPTION πΈ
so like, this is the function that lets a FastCGI Filter application start reading its filter input data from stdin. that's the whole job. she's a simple girl. π
but β and this is the important part, no cap β before you can call FCGI_StartFilterData, two things have to be true:
- your FastCGI application needs to have been invoked in the Filter role, like literally
getenv("FCGI_ROLE") == "FILTER" - you should have read
stdinall the way to EOF, consuming the entireFCGI_STDINdata stream π
if you did all that, then the call to FCGI_StartFilterData positions stdin at the start of FCGI_DATA. slay. that's the dream. β¨
β οΈ but if the preconditions are NOT met (e.g. your app has not readstdinto EOF),FCGI_StartFilterDatareturns a negative result, and your application will get EOF on attempts to read fromstdin. that's the cursed timeline. we don't want that. π
okay so how do you even know how many bytes you've got coming? the application can determine the number of bytes available on FCGI_DATA by doing this lil thing:
atoi(getenv("FCGI_DATA_LENGTH"))
and listen β if fewer than that many bytes get delivered on stdin after calling FCGI_StartFilterData, your application should perform an application-specific error response. and if your application normally makes an update? most likely it should abort the update. do not proceed. do not pass go. π«
also!! you can find out the last modification time of the filter input data by doing:
getenv("FCGI_DATA_LAST_MOD")
which means your application can do caching based on last modification time. obsessed with a queen who caches. π§
π RETURN VALUES π
0β for a successful call, periodt π< 0β for error, and we do not perceive it π
π¦ SEE ALSO π¦
π HISTORY π
Copyright (c) 1996 Open Market, Inc.
See the file "LICENSE" for information on usage and redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES.
and that's the whole page bestie β brought to you by the $Id: FCGI_StartFilterData.3,v 1.1.1.1 1997/09/16 15:36:26 stanleyg Exp $ era, so yeah, she's vintage, she's a classic, she's lowkey older than everyone in the group chat and still ate π go read your stdin to EOF and live your truth β¨π
π¦ where this page comes from
- alpine 3.22: fcgi-doc 2.4.6-r0 Β· OML
- alpine 3.23: fcgi-doc 2.4.6-r0 Β· OML
- alpine 3.24: fcgi-doc 2.4.6-r0 Β· OML
- arch rolling: fcgi 2.4.7-1 Β· custom
- debian trixie: libfcgi-dev 2.4.5-0.1 Β· FASTCGI
- epel 10: fcgi-devel 2.4.7-1.el10_2 Β· OML
- epel 9: fcgi-devel 2.4.7-1.el9 Β· OML
- fedora 43: fcgi-devel 2.4.6-2.fc43 Β· OML
- fedora 43: fcgi-devel 2.4.6-2.fc43 Β· OML
- fedora 43: fcgi-devel 2.4.7-1.fc43 Β· OML
- fedora 43: fcgi-devel 2.4.7-1.fc43 Β· OML
- fedora 44: fcgi-devel 2.4.7-2.fc44 Β· OML
- fedora 44: fcgi-devel 2.4.7-2.fc44 Β· OML
- nixos 26.05: fcgi 2.4.7
- nixpkgs unstable: fcgi 2.4.7
- opensuse-leap 16.0: FastCGI-devel 2.4.6-160000.2.2 Β· OML
- opensuse-leap 16.0: FastCGI-devel 2.4.6-160000.2.2 Β· OML
- opensuse-leap 16.0: FastCGI-devel 2.4.6-160000.2.2 Β· OML
- opensuse-leap 16.0: FastCGI-devel 2.4.6-160000.2.2 Β· OML
- ubuntu questing: libfcgi-dev 2.4.5-0.1build1
- ubuntu resolute: libfcgi-dev 2.4.5-0.1build2 Β· FASTCGI
- ubuntu stonking: libfcgi-dev 2.4.5-0.1build2 Β· FASTCGI
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms