jsoftware / jsource

J engine source mirror
Other
657 stars 90 forks source link

Reading files in /proc/ produces empty string #139

Closed hacxman closed 2 years ago

hacxman commented 2 years ago

I've tried to open some files in /proc, namely /proc/meminfo. It simply returns no content, it does not matter if I used 1!:1 or freads, I have no content. Any ideas what might be wrong? I'm using J903. Thanks

moon-chilled commented 2 years ago

Interesting. This seems to be an issue with linux; stat returns a size of 0, and though S_ISREG is true, lseek fails (and glibc fseek doesn't propagate the error, which is another issue). I'll see about working around it, likely by bypassing libc to eat the lseek error directly.

moon-chilled commented 2 years ago

I think this is now fixed by commit 19d5087ea3b3f78e9b048e2016a55ecc38f149f8