It might be easier to just `getprogname(3)` here? That should be more portable.