> 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.
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 ?
> 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
> 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.
> 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:
> 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.
> 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
> 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.
> Hi Bruce, > > thank you
)
> 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
Hi Bruce, > [1] what Linux
)
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
> Hi Bruce, > > > [1] what
)
> 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
> I suggest you contact the
)
> 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
Hi Bruce, > I suggest you
)
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 \
> Hi Bruce, > > > I suggest
)
> 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
Hallo Bruce, > Yes.
)
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
> Hallo Bruce, > > > Yes.
)
> 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