The appropriate order of function calls is posix_setgid() first, posix_setuid() last.

The appropriate order of function calls is posix_setgid() first,
posix_setuid() last.