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

Using /proc/x/fd/y to open a pipe

Firstly I shall note, my program needs only work on Linux, built with a modern version of GCC so portability concerns are not terribly relevant here (the software is already using highly platform specific features for low level hardware…
Vality
  • 6,577
  • 3
  • 27
  • 48
0
votes
2 answers

Implementing my own ps command

I'm trying to implement my own ps command, called psmod. I can use linux system call and all utilities of the /proc directory. I discovered that all directory in /proc directory with a number as their name are the processes in the system. My…
Michael
  • 876
  • 9
  • 29
0
votes
0 answers

SysInfo and Proc MemInfo missing important fields

I am trying to access High Memory and High Free Memory so that i can pick up what are the available percentage of user memory space. When i try the sysinfo API, i get accurate information for the total RAM and total free RAM.…
Desert Ice
  • 4,461
  • 5
  • 31
  • 58
0
votes
2 answers

reading the timestamp from kernel using procfs - where is it stored after reading from kernel?

when the interrupt occurs in the kernel and If I am reading a timestamp in the kernel. I am reading the timestamp from kernel to the user via procfs. where that interrupt time value will be stored ?? how should the user read that value from the user…
user3458454
  • 291
  • 1
  • 4
  • 20
0
votes
1 answer

how to receive the data by the user space application from the kernel space?

I am calculating a interrupt time in dev.c kernel source code as below : extern double InterruptTime; InterruptTime = ktime_get_real(); //timestamp I am writing a data from kernel space to user space using procfs and using the below api in kernel…
user3458454
  • 291
  • 1
  • 4
  • 20
0
votes
0 answers

how to solve the warning in proc read function?

about /proc read and write functions I used the code from the above link and I am getting the same warning as shown in that link. I am just using a read function to read from the kernel to the user space. I look at the solution given by the other…
user3458454
  • 291
  • 1
  • 4
  • 20
0
votes
1 answer

How to send the kernel data to the user the space using procfs?

I am calculating a timestamp in the kernel and later I want to transfer the timestamp from kernel to the user space. So I am using procfs for communication between kernel and user. I am using the procfile_read function for sending the data from…
0
votes
1 answer

Efficient file checking in a Linux daemon

I'm looking for a more efficient method of monitoring a file from my daemon. I wrote a script which loops to watch a couple of files (/proc/btn_sw1 and /proc/btn_sw2)... I knew looping was a bad idea, I didn't realize how bad it would be. My daemon…
Mike
  • 47,263
  • 29
  • 113
  • 177
0
votes
1 answer

workqueue and timer module crashes when reading

I'm making a module which counts with three parts. I'm working in Debian 6. The first one is a timer that is triggered every 125 ticks. Its function is picking the system jiffies, masking them and including them into a circular buffer with 10…
Kaostias
  • 321
  • 4
  • 24
0
votes
2 answers

Check /proc file from C kernel module

I'd like to share a variable between kernel and user space and I've found that it's possible with procfs. The kernel module must act in certain way if given value is set. The user space program is responsible for changing this value, but the kernel…
2rdv1
  • 25
  • 4
0
votes
2 answers

Listing all shared memory segments used by a process on AIX5.3+

I would like to find all shared memory segments used by a given process. I am especially interested in figuring out the shmid so i can use it in calls to shmctl(). On Solaris i would just read /proc/$PID/map to figure out that information (field…
Frank Meerkötter
  • 2,778
  • 2
  • 20
  • 26
0
votes
1 answer

Strange error during debugging program with threads: Unable open /proc file

During debugging a program with threads, I have a strange error: (gdb) info threads warning: unable to open /proc file '/proc/3663/status' warning: Can't attach LWP 3663: No child processes Cannot find new threads: debugger service failed I get no…
Igor Chubin
  • 61,765
  • 13
  • 122
  • 144
0
votes
1 answer

/proc/partitions major and minor numbers to detect physical disk and partitions

$ cat /proc/partitions major minor #blocks name 8 0 976762584 sda 8 1 99998720 sda1 8 2 1 sda2 8 3 103561216 sda3 8 4 291514368 sda4 8 5 1998848 sda5 8 16 …
Neel Basu
  • 12,638
  • 12
  • 82
  • 146
0
votes
2 answers

Revert some commands/configurations to their default

I am trying to setup Squid proxy server on my Ubuntu 12.04. There are lot of tutorials on that and I am following them one by one till I get success. In each tutorial, they have asked to issue commands like below: modprobe ip_gre ip tunnel add wccp0…
Akshay J
  • 5,362
  • 13
  • 68
  • 105
0
votes
1 answer

Creating a proc entry under an existing entry

My kernel module would create an entry under an existing proc entry, e.g /proc/sys, So the ordinary call to proc_create fails. Then I try to see if there's a function to obtain the right parent node, by checking proc_fs.h, but to no avail. What…
daisy
  • 22,498
  • 29
  • 129
  • 265
1 2 3
15
16