Hi folks,

Can I ask if there's any way to get ucred/xucred of a process in user space?
As I'm trying to port glustertfs and it's a userland filesystem, I need to
get secondary groups of a process.

AFAIK, Linux gets them in /proc and NetBSD gets them in this way:
        int name[] = { CTL_KERN, KERN_PROC, KERN_PROC_PID, frame->root->pid
};
        size_t namelen = sizeof name / sizeof name[0];
        struct kinfo_proc kp;
        size_t kplen = sizeof(kp);
int i, ngroups;
        if (sysctl(name, namelen, &kp, &kplen, NULL, 0) != 0)
                return;
        ngroups = MIN(kp.kp_eproc.e_ucred.cr_ngroups, GF_REQUEST_MAXGROUPS);

I realized none of them would work in FreeBSD.
I'm wondering if there's any alternative way to get group information?

-- 
Cheers,
Mike
_______________________________________________
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "freebsd-hackers-unsubscr...@freebsd.org"

Reply via email to