user7718036
user7718036

Reputation: 35

How to get uid in bionic libc?

I am trying to get the uid of the process calling dns files in bionic libc. I know using current->cred->uid.val is used to get the uid in android/linux kernel, but how to get the uid in bionic libc. I don't think the same will work. Can you please suggest me a way to get uid in bionic libc and what headers to use?

Upvotes: 1

Views: 231

Answers (1)

Florian Weimer
Florian Weimer

Reputation: 33717

The header is <unistd.h>, the functions are getuid, geteuid, getresuid and so on, depending on which kind of UID you need.

Upvotes: 1

Related Questions