You may find it easier to get the information you want by opening and reading the "file" /proc/self/status
You can get a sample of the format and some of the available information by typing
head -n 25 /proc/self/status
That, of course, gives the information about the process running head. If your own program opens and reads that file, it will get the information about itself.
The Linux kernel creates the information in that format as you read /proc/self/status
. It is not like an ordinary file with the information sitting around waiting to be read.