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
0
votes
0 answers

It is possible to grab process memory using ftrace?

I have two applications one writing requests to and reading responses from stdin/stdout of another. I should not modify the applications, but I have root permission. I need to intercept requests, and responses and measure time when some messages…
user2616346
  • 465
  • 1
  • 5
  • 12
0
votes
1 answer

How to get jobid from procfs in Linux

I would like to get the jobid from procfs in Linux. I see only Pid , Ppid in the /proc//status files. But I needed jobid too. Please let me know if there is a way to get the info. Thanks !
Vin
  • 717
  • 1
  • 12
  • 26
0
votes
1 answer

Linux Proc kernel hello world program

make -C /lib/modules/5.13.0-37-generic/build M=/home/a1085551/osc10e/ch2 modules make[1]: Entering directory '/usr/src/linux-headers-5.13.0-37-generic' CC [M] /home/a1085551/osc10e/ch2/hello.o /home/a1085551/osc10e/ch2/hello.c: In function…
Hasta
  • 3
  • 1
0
votes
1 answer

How to parse /proc/pid/stat?

I'm writing a program to parse data from /proc/pid/stat, but don't know how to parse those fields using idiomatic rust. The second field can contain anything, including space and parenthesis. /proc/pid/stat look like this: 802359 (cat) R 728674…
William Taylor
  • 549
  • 3
  • 22
0
votes
1 answer

reading and writing from a file in linux kernel

I'm writing a patch for VFS FAT implmentation on kernel 3.0 I want to add posix attributes to FAT files that are created in linux. to achive that, I must save a file that contains all the relevant information on the mounted drive. I know that…
stdcall
  • 27,613
  • 18
  • 81
  • 125
0
votes
2 answers

/proc/interrupts - Read in c shows no IPIs

When I cat /proc/interrupts, I can also see system internal interrupts (as described in the doc), e.g. all the IPIs occurring on the cores. However, when I read the content of /proc/interrupts in C, these additional lines are not there. E.g. this…
0
votes
1 answer

monitoring proc mounts using poll or select

I am trying to come up with a script that will monitor /proc/mounts and notify back when it detects a read only file system. In python, one way is to store the value of /proc/mounts in a list and keep doing a cat /proc/mounts in a loop and check for…
user9763248
  • 35
  • 1
  • 5
0
votes
2 answers

How to check if /tmp and /proc filesysystems are mounted in a chrooted environment?

I have already tried mounting the filesystems without checking like this: sudo -- mount -t proc /proc $chroot_dir/proc sudo -- mount --bind /tmp $chroot_dir/tmp However, this would corrupt the parent OS session if already mounted, and I would have…
Samy
  • 629
  • 8
  • 22
0
votes
1 answer

How to disable reading or writing functionality on a proc file?

I am creating a proc file (/proc/key) that a user can write his decryption_key to it and then this key will be used to decrypt the contents of a buffer stored inside a kernel module. Also, I have another proc entry (/proc/decrypted) that will be…
Mina Ashraf
  • 353
  • 1
  • 12
0
votes
0 answers

Is there a way to know there is any kind of page move or swap happend in Linux?

Virtual address to physical page mapping can be changed during application runtime by swapping or physical page reallocation for memory defragmentation or etc. What if I want to cache physical page numbers (PPNs) of some virtual address range from…
0
votes
0 answers

linux process TEXT segment expansion

I am working with processes and i need to replace function in text segment, but if function will be larger then old it could overwrite something. So i wont to paste new function somwhere in virtual memory and then change pointers from old function.…
ipolit__
  • 23
  • 4
0
votes
0 answers

How can I check whether my child process is ended in Linux?

I am new to multi-processing in C. I am using fork to create a child process. Now I want to check if my child has ended(So I can continue to the next step). I tried to check whether /proc/${my child pid}/ exsits, but I realise that not until I call…
szdytom
  • 76
  • 5
0
votes
1 answer

When the column values for UID and GID fields in /proc//status file will differ

Here is the output of a sample /proc/pid/status file. From the procfs(5) Man page, found that those are Real, Effective, Saved and FileSystem UIDs Uid: 998 998 998 998 Gid: 996 996 996 996 Here all are showing same…
0
votes
1 answer

Avoid related processes in process listing

How can I generate a process listing, that does not include the current process, its shell and any related processes in the process group, and the SSHD process generated to handle the session? Does ps(1) actually have an option that does this? Is…
Matt Joiner
  • 112,946
  • 110
  • 377
  • 526
0
votes
0 answers

Read a file in /proc using an absolute path?

EDIT: The problem has been solved. I'm trying to read a file that is located in proc/PID/environ which is 5 folder higher in the tree of folder than my current program. I can do it when I write the following file name…
JavaDumbell
  • 215
  • 2
  • 11