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