This is another case of a fairly straightforward action, but it seems that the internet is only filled with documenting how to do slight variations of this.

I want to call a program (which you'd normally use exec for) but redirect stdin and stdout to a fifo's that I've created in my program. I know how to do pipes on the command line, but how can you do this programmatically in C?

I would've thought that the execve family of functions would allow you to specify FILE pointers in the function call for this, but I don't see that anywhere. The other method I can think of is assigning my FILE pointers to stdin and stdout, and then exec'ing. Does that work? It's a tad tricky to test in a small example...