Click to See Complete Forum and Search --> : Strange numbers from 'more'


MuffinRemnant
06-27-2003, 10:05 AM
Why when I enter 'more /proc/pci' at the command prompt do I get the info (-2147483648% of 0 bytes) instead of the expected (25% of 1024 bytes) or whatever. Looks like some overflow problem - is it something I've done or some sort of corruption in the file itself? 'more' seems to work ok on every other file.

Sorry if it's a lame question but as a total newbie it's bugging me!

chrism01
06-27-2003, 12:35 PM
The /proc filesystem does not actually exist. Its a 'window' into the kernel internals, so don't F*** with it unless you know what you are doing.
As for the pci 'sub-dir' , I couldn't say. On my Redhat 7.3, kernel 2.4.20-18.7, both more and cat (on /proc/pci) work fine for me....

HTH

MuffinRemnant
06-27-2003, 12:40 PM
Thanks for that Chris :)

Explains why viewing a couple of other files in /proc caused the system to lock up - had to use another console to kill the process.

Still it didn't bring the whole thing down, unlike the sort of thing that happens on some OS's I can think of.

Hayl
06-27-2003, 12:42 PM
Originally posted by MuffinRemnant
Explains why viewing a couple of other files in /proc caused the system to lock up - had to use another console to kill the process.

lol

mdwatts
06-27-2003, 12:47 PM
It is usually safe to use 'cat' in the /proc directory, but 'more' or 'less' will keep the file open and prevent system internals from writing to those 'files'.

MuffinRemnant
06-27-2003, 01:21 PM
@hayl: Don't laugh I'm a total newbie :)

@mdwatts: My notebook entry for /proc has been condensed to one word - Dangerous!

Incidentally, what is the reason then for making /proc 's contents accessible to users?

camelrider
06-27-2003, 01:47 PM
Processes ownede by users may need to read files in the /proc filesystem in order to function properly.

MuffinRemnant
06-27-2003, 02:19 PM
I see. Thanks.

chrism01
06-28-2003, 07:38 AM
The reference i've seen most often is to set various values to '1' when setting up ipchains/iptables ie firewalls.
I've used them myself, but only when specified by eg HOWTOs from www.tldp.org (The Linux Doc Proj).

Otherwise, just avoid until you've done a bit more research :)

MuffinRemnant
06-28-2003, 07:49 AM
Cheers Chris but I think I'll make that "a LOT more research!" :)