(CFACT-59) Add id and gid facts

Also, I think the re-entrant ones might not set errno, which is why they return it instead.