A much faster popen() and system() implementation for Linux
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
misc
performance_tests
README
README.md
popen_noshell.c
popen_noshell.h
popen_noshell_examples.c
popen_noshell_tests.c
popen_noshell_tests.cpp

README.md

Our tests show that fork() calls on 2.6.x Linux get slower as the parent process uses more memory. So do popen() and system().

This project is a much faster and more secure re-implementation of the Libc popen() and system() calls for Linux. The functions of this library can be used in currently existing source code which uses the standard popen() and system() functions. Small code modifications are required.

For more detailed information and benchmarks, please review the following blog pages:

Documentation, examples, unit tests and a performance benchmark tool are included in the source code.

A few caveats, as described in issue #11:

  • If you use any signal handlers in the parent process, you may need to temporarily block them before executing popen_noshell().
  • Multi-threaded applications must be extra careful, especially with setuid() calls and its friends.

Any comments, positive or negative, are welcome. Send them directly to my Gmail address, or use the "Issues" tracker here.