How to get userID when writing Linux kernel module

后端 未结 4 2090
伪装坚强ぢ
伪装坚强ぢ 2020-12-30 16:13

Here is my function in my kernel module which I insert using insmod command after make at later stages. I am working on goldfish (2.6.29)

4条回答
  •  忘掉有多难
    2020-12-30 17:07

    You need to call current_uid(), defined in linux/cred.h (starting with 2.6, used to be current->uid before). See the kernel doc about credentials

    current is a macro, BTW.

提交回复
热议问题