Skip to content

Instantly share code, notes, and snippets.

@mike-bourgeous
mike-bourgeous / popen3_2007.c
Last active May 13, 2022 06:35 — forked from nitrogenlogic/00_popen3_moved.md
Two implementations of a popen3() function in POSIX/C providing stdin, stdout, and stderr (http://blog.mikebourgeous.com/2011/06/12/programmatic-process-control-in-c-popen3/)
/*
* This implementation of popen3() was created in 2007 for an experimental
* mpg123 frontend and is based on a popen2() snippet found online. This
* implementation may behave in unexpected ways if stdin/stdout/stderr have
* been closed or modified. No warranty of its correctness, security, or
* usability is given. My modifications are released into the public domain,
* but if used in an open source application, attribution would be appreciated.
*
* Mike Bourgeous
* https://github.com/mike-bourgeous