is there a function like access() but for a specific user id?

view story

http://stackoverflow.com – The Linux function access() allows me to check file permissions for the current user. Is there a similar function that gives me the same information - but instead of checking the current user it checks the permissions of any given system user? Something like int access_for(const char *pathname, uid_t uid, int mode); or whatever I can't use seteuid() as I need this for a multithreaded process (POSIX threads) which would affect all threads at the same time. That's why I need to check file permissions myself. Edit: The process itself is known/assumed to have at least the privileges of the re (HowTos)