procfs Questions

3

Solved

/proc/net/tcp gives me a local address, port, and inode number for a socket (0.0.0.0:5432 and 9289, for example). I'd like to find the PID for a specific process, given the above information. It'...
Recalcitrate asked 2/2, 2013 at 22:30

11

Solved

How can I obtain the (IPv4) addresses for all network interfaces using only proc? After some extensive investigation I've discovered the following: ifconfig makes use of SIOCGIFADDR, which requir...
Unlock asked 12/3, 2011 at 7:42

1

Is it possible to get relevant information from /proc/pid/environ file if process modified its environment? My tests show that setenv/putenv/clearenv don't update environ file. However, in bash its...
Nostradamus asked 3/4, 2013 at 6:0

2

Solved

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 fil...
Borst asked 24/1, 2011 at 23:36

3

Solved

I'm trying to extract the parameter with which an app was called by using the data inside cmdline. If I start an application instance like this: myapp 1 2 and then cat the cmdline of myapp I ...
Fritter asked 10/9, 2009 at 17:32

3

Solved

I'm trying to create a proc entry. My init_module function is as below int init_module() { printk(KERN_INFO "proc2:Module Loaded\n"); proc_entry=proc_create_data(proc_name,0644,NULL,&fops,NULL...
Mentally asked 4/9, 2013 at 6:50

9

Solved

I would like to get a list of open files in a process on os x (10.9.1). In Linux I was able to get this from /proc/PID/fd. However I'm not sure how to get the same on OS X. I found that the procfs ...
Erective asked 7/1, 2014 at 14:40

8

I want to use the /proc to find the resource usage of a particular process every second. The resources include cputime, disk usage and network usage. I looked at /proc/pid/stat , but I am not sure ...
Exaggerated asked 8/7, 2011 at 3:46

1

I am trying to parse the PSS value from /proc/<pid>/smaps of a process in my C++ binary. According to this SO answer, naively reading the /proc/<pid>/smaps file for example with ifstre...
Roybal asked 14/1, 2020 at 16:26

5

Solved

I'm currently trying to create a kernel module that will produce data based on kernel events and push them to a file. After reading that this is bad (and I agree), I decided it would make more sens...
Kela asked 24/11, 2008 at 3:23

2

Solved

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...
Data asked 7/4, 2014 at 13:59

9

Solved

I'm looking for an equivalent to sscanf() in Python. I want to parse /proc/net/* files, in C I could do something like this: int matches = sscanf( buffer, "%*d: %64[0-9A-Fa-f]:%X %64[0-9A-Fa-f]:...
Whiffet asked 1/2, 2010 at 6:38

3

I need to fetch the RTT for TCP flow. I have looked into the proc file system but not able to get the RTT value of TCP .If any one having any idea regarding it that, in which file RTT would be stor...
Hallucinogen asked 26/4, 2013 at 8:7

1

Solved

I'd expect echo foo | tee /proc/self/fd/{3..6} 3>&1 to fail with errors like /proc/self/fd/4: No such file or directory etc., but to my surprise, it outputs foo foo foo foo foo It's li...
Vinasse asked 2/11, 2019 at 11:52

2

Solved

I've been doing stuff with the proc filesystem on linux, and I've come across some behavior I'd like to have clarified. Each process in /proc has a symlink to it's executable file, /proc/{pid}/exe...
Osmen asked 4/6, 2014 at 14:4

5

Solved

I'm looking for the value of the time slice (or quantum) of my Linux kernel. Specific Questions: Is there a /proc file which expose such an information ? (Or) Is it well-defined in the Linux he...
Abscise asked 6/5, 2013 at 14:48

0

I'd like add the number of mapped memory regions to the status report of my daemon. There's a number of reasons why you may want this: There's a limit for that (vm.max_map_count) so it's good t...
Crematorium asked 18/10, 2018 at 9:21

2

Solved

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 kern...
Aquaplane asked 24/5, 2014 at 2:22

4

Solved

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 wo...
Russell asked 21/2, 2011 at 20:16

3

Solved

I parse data from /proc/[pid]/statm to get a clue about memory usage of a certain process. man proc states that resident set size(measured in 'pages') is the same as VmRSS (KB??) in /proc/[pid]/sta...
Airspace asked 1/5, 2012 at 16:22

2

I read /proc/<pid>/status this way: std::ifstream file(filename); std::string line; int numberOfLinesToRead = 4; int linesRead = 0; while (std::getline(file, line)) { // do stuff if (numb...
Debbradebby asked 11/8, 2016 at 8:11

3

I want to create a file under a /proc/driver directory. I would like to use a macro like proc_root_driver (or something else provided) rather than use "driver/MODULE_NAME" explicitly. I use create_...
Polychaete asked 26/2, 2009 at 2:21

1

Solved

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...
Mcgehee asked 11/6, 2015 at 15:25

3

Solved

It seems (from looking at the Linux kernel source) that the Swap: metric in /proc/pid/smaps is the total swap accessible by the given pid. In the case where there is shared memory involved, this s...
Scum asked 2/12, 2014 at 11:16

2

Solved

I read proc/<pid>/io to measure the IO-activity of SQL-queries, where <pid> is the PID of the database server. I read the values before and after each query to compute the difference an...
Presbyopia asked 17/5, 2012 at 14:7

© 2022 - 2025 — McMap. All rights reserved.