patch: provide "on fork" event for TProcess
Original Reporter info from Mantis: sethdgrover@gmail.com
-
Reporter name: Seth Grover
Original Reporter info from Mantis: sethdgrover@gmail.com
- Reporter name: Seth Grover
Description:
I have attached a simple patch for process.pp and process.inc which allows the programmer to specify a callback procedure which the tprocess will call, in the context of the child process, immediately before the "exec".
This could allow the user to do anything he wants before the actual command is exec'ed but after the process has been created. In my case I'll be using it to enumerate and close inherited file handles, but it could be used for anything, or not used at all, of course.
Since the paradigm for process creation is different in windows (I don't have the ability to execute code in the context of the child after the process has been created) this applies to Unix only.
Additional information:
http://lists.freepascal.org/lists/fpc-devel/2011-January/023665.html
Mantis conversion info:
- Mantis ID: 18617
- OS: UNIX and variants
- OS Build: all
- Platform: all
- Version: 2.5.1
- Fixed in version: 2.6.0
- Fixed in revision: 16822 (#a14b0d02)