I would like to get uid pid. Note that the uid I want to get does NOT apply to the current process. Please let me know if you have an idea. Maybe I can get it by reusing the / proc / [pid] / function to read the state in the kernel? // Bruce
A handle to the search process ( struct task_struct) with the given pid.
struct task_struct
Use task->cred->uid.
task->cred->uid
Struct is struct task_structdefined in include/linux/sched.h. Struct is struct creddefined in include/linux/cred.h.
include/linux/sched.h
struct cred
include/linux/cred.h
Note that iteration through the processes and credentials of the read process must be performed in the RCU-critical section.
Source: https://habr.com/ru/post/1652389/More articles:Перенаправить print() в файл в python 2.4 - pythonPHP scope inside wordpress page - phpVerify that the UID / GID system call check is performed in the critical RCU section - cCompile libstdC ++ with the SYSV hash style - c ++need to improve accuracy in fsolve to find multiple roots - pythonWeight and offset from processed metagraph - pythonTelerik Reporting produces pdf files locally, but not Azure - c #Is there a standard defacto exception or the best way to pass "invalid input" information on an exception? - c ++graphically constructed diagram does not display negative values - rResize Image Using AlamofireImage - iosAll Articles