in reply to Problem switching UID + GID under FreeBSD

I'm not sure exactly what platform limitations you're running into, since I don't have a FreeBSD box, but I seem to recall people using something like this to only use setreuid and the like:

($GID,$EGID)=($g,$g); ($UID,$EUID)=($u,$u);

Might be worth a try.