[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: reading /proc/self/mem fails

From: Antonio Diaz Diaz
Subject: Re: reading /proc/self/mem fails
Date: Wed, 01 Mar 2023 16:42:17 +0100
User-agent: Mozilla/5.0 (X11; U; Linux i586; en-US; rv: Gecko/20110420 SeaMonkey/2.0.14

Hi Jan,

Jan Engelhardt wrote:
When using ddrescue to read a section of /proc/self/mem, it appears
ddrescue uses lseek(SEEK_END) in an attempt to determine the file size.
With procfs being special, that unfortunately fails.

$ strace -fe lseek ddrescue -f /proc/self/mem /dev/zero -s $[0x4040]
lseek(3, 0, SEEK_END) = -1 EINVAL (Invalid argument)

procfs is known to be... special. What is your opinion, is it worth
making this work?

Maybe it is worth, but I don't know how to make it work. 'dd' does not work either:
$ dd if=/proc/self/mem of=/dev/zero
dd: error reading '/proc/self/mem': Input/output error
0+0 records in
0+0 records out
0 bytes (0 B) copied, 0.003608 s, 0.0 kB/s

In fact, nothing seems to work with /proc/self/mem:
$ cat /proc/self/mem > /dev/zero
cat: /proc/self/mem: Input/output error

$ wc /proc/self/mem
wc: /proc/self/mem: Input/output error
0 0 0 /proc/self/mem

$ file /proc/self/mem
/proc/self/mem: empty

Best regards,

reply via email to

[Prev in Thread] Current Thread [Next in Thread]