Questions tagged [procfs]

The proc filesystem is a virtual filesystem through which kernels of Unix-like operating systems, including Linux, expose process and kernel information. It is commonly mounted at /proc and implements a view of the system process table inside the file system. It provides a two-level view of process space.

Procfs, also known as the proc filesystem, is a virtual filesystem normally mounted at /proc. The details vary between unix variants, but on most, /proc/PID is a file or a directory that exposes information about the running process whose id is PID.

In addition, /proc can expose information about other aspects on the system. Linux, in particular, exposes information about mounted filesystems, network status, connected devices and more. This use is partly phased out in favor of the newer .

234 questions
15
votes
1 answer

How to interpret the contents of /proc/bus/pci/devices?

The first few fields of 'cat /proc/bus/pci/devices' are understandable. Field 1 - BusDevFunc Field 2 - Vendor Id + Device Id Field 3 - Interrupt Line Field 4 - BAR 0 and the rest of the BAR registers (0 - 5) after that. After the BAR registers…
vivekian2
  • 3,795
  • 9
  • 35
  • 41
15
votes
1 answer

What is alternative of create_proc_entry()

As create_proc_entry function is deprecated, what is its replacement? I was trying to create a simple proc entry using create_proc_entry but got the this error: error: implicit declaration of function ‘create_proc_entry’ I grepped…
Kumar Gaurav
  • 1,287
  • 3
  • 19
  • 47
11
votes
3 answers

Is there anything like /proc for windows

I'm Curious about 2 things, What is the closest equivalent to /proc that ships with windows Are there any products which add a proc like filesystem to windows?
Roman A. Taycher
  • 18,619
  • 19
  • 86
  • 141
11
votes
4 answers

Monitoring mount point changes via /proc/mounts

According proc manual, one can monitor for mount point changes in linux system by opening "/proc/mounts", and adding the file descriptor to read fd_set in select() call. Following piece of code works on Ubuntu 9.04, and not in Ubuntu 10.04 (with…
shoban
  • 650
  • 1
  • 9
  • 14
11
votes
3 answers

Linux c++: apis vs /proc files?

Im working on an app to collect and send various bits of system info (partition space/free, laptop battery info, etc). Im not having much success getting this information in the form of direct c++ api.. though its all available via files in /proc…
ethrbunny
  • 10,379
  • 9
  • 69
  • 131
11
votes
2 answers

some uid's in /proc/pid/loginuid are strange

i'm analysing the procfs in unix/linux and some loginuid of processes are really strange. Some pid's have as loginuid a big number: 4294967295. Are they daemons or system events or whats the matter? # cat /proc/11071/loginuid 4294967295
Oni1
  • 1,445
  • 2
  • 19
  • 39
10
votes
1 answer

How is a Linux kernel task's stack pointer determined for each thread?

I'm working on a tool that sometimes hijacks application execution, including working in a different stack. I'm trying to get the kernel to always see the application stack when performing certain system calls, so that it will print the [stack]…
nitzanms
  • 1,786
  • 12
  • 35
10
votes
1 answer

What is the maximum allowed limit on the length of a process name?

What is the maximum length allowed for a process name? I am reading the process name from /proc/[pid]/stat file and i would like to know the maximum buffer that i would need. I am pretty sure there is a limit which is configurable but just can't…
Desert Ice
  • 4,461
  • 5
  • 31
  • 58
9
votes
3 answers

How to parse large amount of data passed to kernel module through /proc file?

Edit: I have found seq_file that eases writing a lot of data from kernel to user-space. What I am looking for is the opposite; an API that facilitates reading a lot of data (more than one page) from user-space. Edit 2: I am implementing a port of…
Shahbaz
  • 46,337
  • 19
  • 116
  • 182
9
votes
2 answers

Calculating user, nice, sys, idle, iowait, irq and sirq from /proc/stat

/proc/stat shows ticks for user, nice, sys, idle, iowait, irq and sirq like this: cpu 6214713 286 1216407 121074379 260283 253506 197368 0 0 0 How can I calculate the individual utilizations (in %) for user, nice etc with these values? Like the…
jgr
  • 3,914
  • 2
  • 24
  • 28
9
votes
2 answers

Is it safe to use lseek() when reading from Proc-FS files second time

Is it safe to use lseek(fd,0) and then read(fd,buf) for /proc/stat file instead of reopening it to get updated contents of this file next time? And what does the mmap() call after opening this file really do (see below)? The problem I am…
user389238
  • 1,656
  • 3
  • 19
  • 40
7
votes
2 answers

Shared library load address under Linux

I have a major doubt regarding the shared library. What I studied is that the virtual address of a library that will be shared by different processes will be same for all these processes. But I tried to look into the same using the proc filesystem…
pradeepchhetri
  • 2,899
  • 6
  • 28
  • 50
7
votes
1 answer

Unable to access contents of a [vvar] memory region in GDB?

I'm live-debugging a process in GDB under Linux and I find it impossible to read the contents of the memory region defined in /proc/${PID}/maps as: 3aaef123000-3aaef125000 r--p 00000000 00:00 0 [vvar] Clearly, the r flag…
jotik
  • 17,044
  • 13
  • 58
  • 123
7
votes
2 answers

Correct way of reading /proc/pid/status

I read /proc//status this way: std::ifstream file(filename); std::string line; int numberOfLinesToRead = 4; int linesRead = 0; while (std::getline(file, line)) { // do stuff if (numberOfLinesToRead == ++linesRead) { break; …
lstipakov
  • 3,138
  • 5
  • 31
  • 46
7
votes
2 answers

How to remount the /proc filesystem in a docker as a r/w system?

I have installed docker 0.11.1 over Ubuntu 12.04. I am trying to change the shmmax from its fixed value (32 M) to something bigger (1G) from within the docker when I run the command: sysctl -w kernel.shmmax=1073741824 error: "Read-only file system"…
upendra
  • 103
  • 1
  • 1
  • 5
1
2
3
15 16