Ah, you're right. The Squeak VM gets the file size via stat and does not just read the contents from the file. So for squeak the file looks just empty.
That's a shame because /proc/self/environ would be an easy way to access the environment variables from within the image without any need to add a specific primitive to the VM or use FFI.
Alex
2011/2/21 Tony Garnock-Jones
<[hidden email]>
On 2011-02-21 4:35 PM, Alexander Lazarević wrote:
Does anybody know why the linux vm can't read files from the /proc
filesystem? The VM is able to open the files but the size is 0!? A
simple less or cat on these files just works fine ...
Is it just the sizes that are zero, or does actually reading from them fail too? A stat() (or for that matter an ls -l) will return a zero size, but a read() in C will return data.
Regards,
Tony