-0 MB memory

Bruce Allen
Bruce Allen
Moderator
Joined: 15 Oct 04
Posts: 1,119
Credit: 172,127,663
RAC: 0

> Hi Bruce, > > thank you

Message 5529 in response to message 5527

> Hi Bruce,
>
> thank you very much for the smalll program. Compilation is Ok, with a little
> warning:memory.c:27:2: warning: no newline at end of file.
> The results of running the programm are:
> quote
> -------
> bash-2.05b$ ./memory
> size = 4096 number = -1 bytes=-4096
> bash-2.05b$
>> And I am dealing with the box ID 48907.

Edgar,

No need for header files, thanks!

[1] what Linux distribution are you using?

[2] Please do:
man sysconf
and see if it documents _SC_PHYS_PAGES

If it does, then you need to file a bug report with the distribution, saying that memory is being reported incorrectly and that sysconf doesn't work as advertised. You can send them memory.c as an example.

Bruce

Director, Einstein@Home

Edgar Alwers
Edgar Alwers
Joined: 23 Feb 05
Posts: 8
Credit: 0
RAC: 0

Hi Bruce, > [1] what Linux

Message 5530 in response to message 5529

Hi Bruce,

> [1] what Linux distribution are you using?

Linux from the Scratch, Version 5.1.1 with Kernel 2.4.26. It is not a distribution but a self compiled system "from the scratch", taylormade. Please have a look in http://www.tldp.org/LDP/lfs/html/ or in http://www.linuxfromscratch.org/lfs/news.html
>
> [2] Please do:
> man sysconf
> and see if it documents _SC_PHYS_PAGES
>
quote ( extract )
-----------
These values also exist, but may not be standard.

- _SC_PHYS_PAGES
The number of pages of physical memory. Note that it is possi-
ble for the product of this value and the value of _SC_PAGE_SIZE
to overflow.
------------
unquote

> If it does, then you need to file a bug report with the distribution, saying
> that memory is being reported incorrectly and that sysconf doesn't work as
> advertised. You can send them memory.c as an example.

Mhmm, the components from Linux from the scratch are the original ones downloaded eg. from Sourceforge or so. So this kind of bug should also be found in distributions. I will try to find out, if a bug was reported on sysconf or a patch given. Will we remain in contact ?

Regards and thanks you for your help.

Edgar

Bruce Allen
Bruce Allen
Moderator
Joined: 15 Oct 04
Posts: 1,119
Credit: 172,127,663
RAC: 0

> Hi Bruce, > > > [1] what

Message 5531 in response to message 5530

> Hi Bruce,
>
> > [1] what Linux distribution are you using?
>
> Linux from the Scratch, Version 5.1.1 with Kernel 2.4.26. It is not a
> distribution but a self compiled system "from the scratch", taylormade. Please
> have a look in http://www.tldp.org/LDP/lfs/html/ or in
> http://www.linuxfromscratch.org/lfs/news.html

OK. This is almost certainly a problem with how the distribution is building glibc.

> > [2] Please do:
> > man sysconf
> > and see if it documents _SC_PHYS_PAGES
> >
> quote ( extract )
> -----------
> These values also exist, but may not be standard.
>
> - _SC_PHYS_PAGES
> The number of pages of physical memory. Note that it is
> possi-
> ble for the product of this value and the value of
> _SC_PAGE_SIZE
> to overflow.
> ------------
> unquote

Good enough. What's happening is that your glibc library is complaining that _SC_PHYS_PAGES is not defined or available to sysconf.

> > If it does, then you need to file a bug report with the distribution,
> saying
> > that memory is being reported incorrectly and that sysconf doesn't work
> as
> > advertised. You can send them memory.c as an example.
>
> Mhmm, the components from Linux from the scratch are the original ones
> downloaded eg. from Sourceforge or so. So this kind of bug should also be
> found in distributions.

Not in (for example) Fedora Core 3, RH9, or Debian (I have tested on all three).

> I will try to find out, if a bug was reported on
> sysconf or a patch given. Will we remain in contact ?

I suggest you contact the linuxfromstcratch maintainers and complain that memory.c does not compile and run as expected, and as it does under other distributions. We can use this thread to stay in touch about it.

I'll try and add something to the scheduler in the next few days so that if the memory is reported as

Director, Einstein@Home

Seti-Cruncher
Seti-Cruncher
Joined: 9 Feb 05
Posts: 70
Credit: 7,114
RAC: 0

> I suggest you contact the

Message 5532 in response to message 5531

> I suggest you contact the linuxfromstcratch maintainers and complain that
> memory.c does not compile and run as expected, and as it does under other
> distributions.

Linuxfromscratch is not a distro, Bruce. There are no maintainers. It's a book (and website) that gives instructions for creating a Linux system entirely from source code.

It would appear that something is wrong with Edgar's build. Maybe a buggy source package.

Be lucky,

Neil

Edgar Alwers
Edgar Alwers
Joined: 23 Feb 05
Posts: 8
Credit: 0
RAC: 0

Hi Bruce, > I suggest you

Message 5533 in response to message 5531

Hi Bruce,

> I suggest you contact the linuxfromstcratch maintainers and complain that
> memory.c does not compile and run as expected, and as it does under other
> distributions. We can use this thread to stay in touch about it.
>
Here five answers to my posting in the "Beyond Linux From Scratch"-List:
Quote
----------
Does this have to be a c program? This is what I use in my bash scripts:

# Test for memory size
MEM=$(free |grep Mem:)
count=1
for grep in $MEM
do
echo $grep
export grep$count=$grep
let count=count+1
done
echo "Memory size is $grep2"

------
cat /proc/meminfo | grep MemTotal
------
Correct, but you end up with this:

MemTotal: 385064 kB

I would still have to get rid of MemTotal:, the space after it, and
the kb for it to be of any use. The reason for the loop, is to strip
that information off. With mine I parse $grep2 to whatever might
need it inside a script. IE:

if [[ $grep2 \

Bruce Allen
Bruce Allen
Moderator
Joined: 15 Oct 04
Posts: 1,119
Credit: 172,127,663
RAC: 0

> Hi Bruce, > > > I suggest

Message 5534 in response to message 5533

> Hi Bruce,
>
> > I suggest you contact the linuxfromstcratch maintainers and complain
> that
> > memory.c does not compile and run as expected, and as it does under
> other
> > distributions. We can use this thread to stay in touch about it.
> >
> Here five answers to my posting in the "Beyond Linux From Scratch"-List:
> Quote
> ----------
> Does this have to be a c program?

Yes. Linuxfromscratch needs to fix sysconf() so that it behaves as documented.

Bruce

Director, Einstein@Home

Edgar Alwers
Edgar Alwers
Joined: 23 Feb 05
Posts: 8
Credit: 0
RAC: 0

Hallo Bruce, > Yes.

Message 5535 in response to message 5534

Hallo Bruce,

> Yes. Linuxfromscratch needs to fix sysconf() so that it behaves as
> documented.

The problem is _my_ Scratch 5.1.1 installation on this machine. I booted some hours ago with the old version 3 I still have installed on this box, and sysconf was reporting the correct amount on memory. Also my friend's box with 5.1.1 is working correct. It is my problem, and I have to try to find out what is happening. I will come back.
Edgar

Bruce Allen
Bruce Allen
Moderator
Joined: 15 Oct 04
Posts: 1,119
Credit: 172,127,663
RAC: 0

> Hallo Bruce, > > > Yes.

Message 5536 in response to message 5535

> Hallo Bruce,
>
> > Yes. Linuxfromscratch needs to fix sysconf() so that it behaves as
> > documented.
>
> The problem is _my_ Scratch 5.1.1 installation on this machine. I booted some
> hours ago with the old version 3 I still have installed on this box, and
> sysconf was reporting the correct amount on memory. Also my friend's box with
> 5.1.1 is working correct. It is my problem, and I have to try to find out what
> is happening. I will come back.

Something is probably wrong with your glibc installation or with your header file installation.

Bruce

Director, Einstein@Home

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.