You mean like libsystemd, which looks in /run to see whether systemd
is in use, talks to it if it is, and returns some suitable error code
(-ENOSYS?) if it isn't? :-)
Here's interesting for you. (-:
Here's libsystemd and Arturo Borrero Gonzalez's code that calls it.
Please point to the line that checks in /run for systemd running.