[fpc-pascal] modifying system.pp's InstallSignals

Seth Grover sethdgrover at gmail.com
Tue Mar 31 15:41:02 CEST 2009

I'm working on a project in Linux where I've got some special signal
handling requirements. I need to modify system.pp's InstallSignals to
dynamically load an .so, look up a function by name, and make some
calls into that library instead of doing what it normally does.

The dynlibs unit has the code I need to call SafeLoadLibrary and
GetProcedureAddress, but my problem is that obviously I can't just put
"uses dynlibs" in system since, well, it's system, and there would be
circular dependencies since system is pretty much first on the
dependency list.

My thought is that basically I'll just have to pull the code from
dynlibs.pas, dynlibs.inc, and dl.pp into my own .inc file and include
it rather than trying to have anything in a uses section. I'm aware
that doing this will decrease the portability of my code and make me
dependent on libc, but these changes I'm making to the rtl are for a
very specific purpose, and I won't be using them to compile anything
else. :)

Does that seem like the right way for me to get the functionality of
those calls available to me in InstallSignals? Or is there something
easier I'm missing?



This email is fiction. Any resemblance to actual events
or persons living or dead is purely coincidental.

Seth Grover

More information about the fpc-pascal mailing list