In AFS (Andrew File System), separate processes can be put into different PAGs, my question is: How can I get the PAG number of certain process programically? Thanks.
How can I get PAG number in AFS programically?
95 views Asked by wangshuaijie At
1
You can do this in a C program by calling the VIOC_GETPAG pioctl, originally posted by Russ Allbery here:
There is no official interface (yet) for getting a PAG number outside of a C program; say, via running some command. Most of the time you can determine the PAG number by looking at the supplemental group list of the current process, and looking for very high-numbered groups. However, while this mostly "works" for now, there some cases where this information may be incorrect, and it is not guaranteed to work in the future for all platforms. Specifically, on modern Linux, the authoritative location of the PAG number is in a kernel keyring, and supplying the group id is just "best effort" and may go away in the future.