Attached is are some simple examples (in C) that collectively does most of what you are trying to do.

You have some args wrong in your call. See slave_spawn.c for how to use info_keys.

HTH
Ralph