2

For my intro to operating systems class we were introduced to the /proc directory and many of the features that can be used to access data stored in the process ID's that are available in /proc.

When I was trying out some commands learned (and a few I looked up) on the UNIX server hosted by my school I noticed that some sub directories that were present in a process, that I created, were a file type called "TeX font metric data" or a .tfm file. I figured that was the file type that was used when my professor showed us how to get data from the directories like status and map.

When I entered the command cat /proc/(PID)/status to look into the status file I got a random assortment of characters and white space. When I tried the same command on a process I created in my schools Linux server I was shown the information I expected to see in the status and map files.

My question is:

Why did the Unix server produce the random characters from my process's /proc/(PID)/status file while the Linux server gave me the data I would expect from the same command? Also Is there a way to access the Unix /proc data by accessing the /proc directory?

Chen Li
  • 4,824
  • 3
  • 28
  • 55
JoshZ
  • 21
  • 1

1 Answers1

3

The Linux procfs you are familiar with, aka /proc/ is not a POSIX thing. It's OS-specific and multiple OSes just happen to implement similar things also called /proc.

Because no formal standard covers it, it's allowed to be / going to be different on any *nix-like system that implements it.

My guess with /proc/(PID)/status is that your UNIX is dumping the process status in a binary form instead of easy to read plain text.

See also: Knowing the process status using procf/<pid>/status

If you can determine WHAT Unix you're on (odds are, Solaris since there's a free variant) you should be able to find a more specific answer.

Community
  • 1
  • 1
Brian McFarland
  • 9,052
  • 6
  • 38
  • 56