Linux-Development-Sys Digest #725, Volume #8 Wed, 16 May 01 16:13:16 EDT
Contents:
Re: STLport 4.0 & g++ 2.96 (John Beardmore)
Re: SIGSEGV is not blocking
Re: Newbie programmer (Friedrich Dominicus)
Re: Free OS ? (Joe Pfeiffer)
Raid A0 patch with Kernel 2.2.17 and ReiserFS ("Cristov")
Re: Path to kernel include directory? (Grant Edwards)
Re: Will Linux recognize >4GB RAM on Pentium-III Xeon? ("Steve Wolfe")
Meaning of kernel: NET: 3 messages suppressed (Grant Edwards)
Re: STLport 4.0 & g++ 2.96 (David Konerding)
Re: Meaning of kernel: NET: 3 messages suppressed (Frank Sweetser)
Re: malloc returns NULL! ("Karl Heyes")
Re: Meaning of kernel: NET: 3 messages suppressed (Grant Edwards)
Execve and execvp ("override")
----------------------------------------------------------------------------
From: John Beardmore <[EMAIL PROTECTED]>
Subject: Re: STLport 4.0 & g++ 2.96
Date: Wed, 16 May 2001 17:16:54 +0100
In message <[EMAIL PROTECTED]>, David Konerding
<[EMAIL PROTECTED]> writes
>On Sat, 12 May 2001 17:02:01 +0100, John Beardmore
><[EMAIL PROTECTED]> wrote:
>> In message <[EMAIL PROTECTED]>, David Konerding
>><[EMAIL PROTECTED]> writes
>>>On 9 May 2001 11:14:19 +0100, Philip Armstrong <[EMAIL PROTECTED]> wrote:
>>>You don't want to link using g++ because that links with libstdc++,
>>>and you don't want that if you're linking against STLport-- it's
>>>redundant, although possibly harmless.
>>
>> OK, I'm still confused...
>>
>> First I tried linking with gcc as suggested, but there were a bunch of
>> things it couldn't resolve:
>>
>> log sqrt cosh cos sin
>> atan2 sinh log10 exp hypot
>>
>> so there's a problem there.
>
>Those are all math functions. Add "-lm" to teh end of your link line.
>
>>
>> Taking the hint that g++ is more promiscuous in the libraries it will
>> search, I tried linking with that and it linked clean.
>
>Actually, it just adds -lm for you probably. You can see exactly
>what it is doing using "gcc -v" or "g++ -v". Both compilers just
>run the "collect2" application which does the linking for you.
>g++ normally links against libstdc++ and libm for good measure since
>libstdc++ needs symbols from the math library. If you just do "gcc"
>it won't do the libm library by default-- but you can add it.
OK. Is there a file where a particular front end to a compiler has its
default settings configured ?
>> On running ./RetSim however, it fell over saying:
>>
>> "Error in loading shared libraries: libstlport_gcc.so: cannot open
>> shared
>> object file: No such file or directory.
>>
>> I've got /home2/STLport-4.0/STLport-4.0/lib in $PATH now, and
>> libstlport_gcc.so is in that directory, but it still doesn't find it at
>> runtime.
>
>/home2/STLport-4.0/STLport-4.0/lib should b in LD_LIBRARY_PATH, not PATH.
>THen the dynamic linker will find that library and load it.
Thanks ! I got it going by linking to the .a static library in the end
and it all seems to go !
It's probably better to use dynamic libs though ? I might use more than
one app built with this compiler at a time I guess.
Come to think of it, might I run into version problems if the dynamic
libs for both compilers and stlport all end up in the same
LD_LIBRARY_PATH ? If this might cause instability, I guess I might be
better sticking to static linking ?
Can the old and the new compiles be configured to use separate
LD_LIBRARY_PATH and include path settings ?
Cheers, J/.
--
John Beardmore
------------------------------
From: [EMAIL PROTECTED] ()
Crossposted-To: comp.os.linux.development.apps,comp.programming.threads
Subject: Re: SIGSEGV is not blocking
Date: Wed, 16 May 2001 16:20:46 -0000
In article <[EMAIL PROTECTED]>,
Vishnu Vardhan C K <[EMAIL PROTECTED]> wrote:
>> Where is your program going to go after a seg fault? That's why the
>> results are undefined.
>I am not sure i am talking sense here, but would it make sense
>to do a longjump from the signal handler ?
>
>I don't know just guessing..
A longjump from the handler would probably be ok but we're talking
about blocking or delay the signal. Being able to just continue on
with the next instruction could get very strange. I doubt it would
be too useful.
--
http://www.spinics.net/linux
------------------------------
From: Friedrich Dominicus <[EMAIL PROTECTED]>
Crossposted-To: alt.os.linux.mandrake,comp.os.linux.development.apps
Subject: Re: Newbie programmer
Date: 16 May 2001 18:31:02 +0200
"Paul Jones" <[EMAIL PROTECTED]> writes:
> I was wondering if anyone could point me in the direction of some help for
> people moving from windows to Linux development. I can't seem to find
> anything on the subject. I'm ok at windows programming, but I'm assuming
> that linux has totally different libraries and stuff. Also I'm still
> learning Linux which makes it a bit hard :)
What are you doing at the moment? What are you expecting? We were in
you shoes let's say 1 and a half year ago, we ported Windows
Application to Linux (it is a C-IDE) we too ported a windows compiler
to Linux too.
FYI the port of the C-IDE was done with GTK+ and took quite a while..
Regards
Friedrich
------------------------------
From: Joe Pfeiffer <[EMAIL PROTECTED]>
Subject: Re: Free OS ?
Date: 16 May 2001 10:26:15 -0600
Kasper Dupont <[EMAIL PROTECTED]> writes:
> Joe Pfeiffer wrote:
> > I'm not privy to Linux's original intent, but if he wanted something
> > else he shouldn't have used the GNU Public License for the system.
> > Since I haven't seen any quotes in which he complains about it, I
> > assume he has no objections.
>
> If you want to know the legal details read the GPL:
> <URL:http://www.gnu.org/copyleft/gpl.html#SEC1>
I have -- I was respondibg to the poster's comment in which he said
he'd heard that for-sale distributions of Linux weren't what Linus had
in mind.
--
Joseph J. Pfeiffer, Jr., Ph.D. Phone -- (505) 646-1605
Department of Computer Science FAX -- (505) 646-1002
New Mexico State University http://www.cs.nmsu.edu/~pfeiffer
SWNMRSEF: http://www.nmsu.edu/~scifair
------------------------------
From: "Cristov" <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.setup
Subject: Raid A0 patch with Kernel 2.2.17 and ReiserFS
Date: Wed, 16 May 2001 09:39:11 -0700
Does the Raid A0 patch for the 2.2.17 kernel fix whether or not ReiserFS
will work with Raid5?
Chris
------------------------------
From: [EMAIL PROTECTED] (Grant Edwards)
Subject: Re: Path to kernel include directory?
Date: Wed, 16 May 2001 16:57:28 GMT
In article <9du5l8$hk7$[EMAIL PROTECTED]>, Rene Herman wrote:
>Grant Edwards wrote:
>
>> I'm not using glibc in my driver module.
>
>Obviously you're not, as I said, you *should* not. But you were asking
>why net and scsi aren't symlinks into the kernel tree, and that's the
>question I answered. If you didn't want it answered, why bother asking?
Sorry, I misunderstood your answer. What you said makes sense.
>> That is my requirement -- whether it's the way you'd do it or not.
>
>Good luck!
I'm going to add /usr/src/linux and /usr/src/linux-<version> to
the include path for my driver module. That works for all of
the systems to which I have access. I'm a bit dissapointed
that RH stopped installing a /usr/src/linux symlink as part of
the kernel-soruces RPM.
--
Grant Edwards grante Yow! Hello. Just walk
at along and try NOT to think
visi.com about your INTESTINES being
almost FORTY YARDS LONG!!
------------------------------
From: "Steve Wolfe" <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.hardware
Subject: Re: Will Linux recognize >4GB RAM on Pentium-III Xeon?
Date: Wed, 16 May 2001 11:32:03 -0600
> you seem willing to part with large coin since you are considering the
> intel wallet vaccuum -- maybe equipment from, e.g., sun would be
> competitive in price/performance?
Our $12,000 quad Xeon handily beats a $25,000 Alpha machine at database
work. The Compaq rep that loaned us the Alpha for a week was pretty sad
to hear that. : )
steve
------------------------------
From: [EMAIL PROTECTED] (Grant Edwards)
Subject: Meaning of kernel: NET: 3 messages suppressed
Date: Wed, 16 May 2001 18:51:23 GMT
I've searched Usenet and the web and found dozens of people
asking the question, but the only answer I find is from people
who think it's syslog eliminating duplicate messages. It's
not, that message reads something like "last message repeated 4
times".
What causes the following messages:
May 16 12:17:29 grante kernel: NET: 3 messages suppressed.
May 16 12:17:33 grante kernel: NET: 189 messages suppressed.
May 16 12:17:38 grante kernel: NET: 313 messages suppressed.
May 16 12:17:43 grante kernel: NET: 337 messages suppressed.
May 16 12:17:48 grante kernel: NET: 322 messages suppressed.
May 16 12:18:21 grante kernel: NET: 193 messages suppressed.
They only seem to occur when a particular driver is running.
That driver handles a particular Ethernet protocol number using
dev_add_pack().
I've asked in comp.os.linux.networking, but either nobody
knows, or they don't want to answer. :(
--
Grant Edwards grante Yow! Vote for ME
at -- I'm well-tapered,
visi.com half-cocked, ill-conceived
and TAX-DEFERRED!
------------------------------
From: [EMAIL PROTECTED] (David Konerding)
Subject: Re: STLport 4.0 & g++ 2.96
Date: 16 May 2001 18:16:30 GMT
Reply-To: [EMAIL PROTECTED]
On Wed, 16 May 2001 17:16:54 +0100, John Beardmore <[EMAIL PROTECTED]> wrote:
> In message <[EMAIL PROTECTED]>, David Konerding
><[EMAIL PROTECTED]> writes
>>On Sat, 12 May 2001 17:02:01 +0100, John Beardmore
>><[EMAIL PROTECTED]> wrote:
>>> In message <[EMAIL PROTECTED]>, David Konerding
>>><[EMAIL PROTECTED]> writes
>>>>On 9 May 2001 11:14:19 +0100, Philip Armstrong <[EMAIL PROTECTED]> wrote:
>>>>You don't want to link using g++ because that links with libstdc++,
>>>>and you don't want that if you're linking against STLport-- it's
>>>>redundant, although possibly harmless.
>>>
>>> OK, I'm still confused...
>>>
>>> First I tried linking with gcc as suggested, but there were a bunch of
>>> things it couldn't resolve:
>>>
>>> log sqrt cosh cos sin
>>> atan2 sinh log10 exp hypot
>>>
>>> so there's a problem there.
>>
>>Those are all math functions. Add "-lm" to teh end of your link line.
>>
>>>
>>> Taking the hint that g++ is more promiscuous in the libraries it will
>>> search, I tried linking with that and it linked clean.
>>
>>Actually, it just adds -lm for you probably. You can see exactly
>>what it is doing using "gcc -v" or "g++ -v". Both compilers just
>>run the "collect2" application which does the linking for you.
>>g++ normally links against libstdc++ and libm for good measure since
>>libstdc++ needs symbols from the math library. If you just do "gcc"
>>it won't do the libm library by default-- but you can add it.
>
> OK. Is there a file where a particular front end to a compiler has its
> default settings configured ?
Yes, but you probably don't want to play with that. It's much easier to
maintain your own makefiles and have them change the defaults of the compiler
than it is to modify the spec file. THe reason is that if you ever distribute
your code to be compiled by others, then can just build it out of the box
rather than having to edit the spec file (They may still have to compile
and install the compiler :-( ...
>
>
>>> On running ./RetSim however, it fell over saying:
>>>
>>> "Error in loading shared libraries: libstlport_gcc.so: cannot open
>>> shared
>>> object file: No such file or directory.
>>>
>>> I've got /home2/STLport-4.0/STLport-4.0/lib in $PATH now, and
>>> libstlport_gcc.so is in that directory, but it still doesn't find it at
>>> runtime.
>>
>>/home2/STLport-4.0/STLport-4.0/lib should b in LD_LIBRARY_PATH, not PATH.
>>THen the dynamic linker will find that library and load it.
>
> Thanks ! I got it going by linking to the .a static library in the end
> and it all seems to go !
>
> It's probably better to use dynamic libs though ? I might use more than
> one app built with this compiler at a time I guess.
Um, whether it's better to use dynamic libraries depends on the situation.
I definitely prefer dynamic libraries for a lot of things, but in
some cases static is more appropriate. A case where static is important is
Motif- you may be delivering your binary to a user who does not have
Motif, in which case you would statically link Motif into your app.
Then you can distribute it and the user can run a Motif program without
needing to own motif. On the other hand, with OpenGL, the user probably
has a specific OpenGL library which supports their graphics card. If you
linked in Mesa/OpenGL statically, they wouldn't be able to use their hardware
OpenGL (they'd be stuck with your static Mesa/OpenGL).
>
> Come to think of it, might I run into version problems if the dynamic
> libs for both compilers and stlport all end up in the same
> LD_LIBRARY_PATH ? If this might cause instability, I guess I might be
> better sticking to static linking ?
Not sure. If your app is linked against libstlport_gcc.so then it will try to load
that file even if libstdc++.so is in the same directory. You can run 'ldd' on your
executable to see which one is linked in.
Linking STLport statically should be OK if you're just distributing a stand-alone app.
But if you're writing a program which dlopen()'s other .so's and they are also linked
against STLport, you need to use dynamic libraries because otherwise the dlopen'd
library will have its own seperate copy of the STLport symbols, and chaos will ensue.
>
> Can the old and the new compiles be configured to use separate
> LD_LIBRARY_PATH and include path settings ?
LD_LIBRARY_PATH is a run-time thing, not a compile-time thing. like I said above,
all the compiler defaults can be modified using -L and -I, and that is the preferred
mechanism
over manipulating the installed compiler defaults.
------------------------------
From: [EMAIL PROTECTED] (Frank Sweetser)
Subject: Re: Meaning of kernel: NET: 3 messages suppressed
Date: 16 May 2001 19:16:00 GMT
Grant Edwards <[EMAIL PROTECTED]> wrote:
>I've searched Usenet and the web and found dozens of people
>asking the question, but the only answer I find is from people
>who think it's syslog eliminating duplicate messages. It's
>not, that message reads something like "last message repeated 4
>times".
>
>What causes the following messages:
>
>May 16 12:17:29 grante kernel: NET: 3 messages suppressed.
>May 16 12:17:33 grante kernel: NET: 189 messages suppressed.
>May 16 12:17:38 grante kernel: NET: 313 messages suppressed.
>May 16 12:17:43 grante kernel: NET: 337 messages suppressed.
>May 16 12:17:48 grante kernel: NET: 322 messages suppressed.
>May 16 12:18:21 grante kernel: NET: 193 messages suppressed.
>
>They only seem to occur when a particular driver is running.
>That driver handles a particular Ethernet protocol number using
>dev_add_pack().
>
>I've asked in comp.os.linux.networking, but either nobody
>knows, or they don't want to answer. :(
This is the kernel suppressing duplicate messages. Can't really
do anything with the messages, though, since all you have here is
the supression messages - we'd need the actual message itself.
--
Frank Sweetser fs at wpi.edu, fs at suave.net | $ x 15
Full-time WPI Network Tech, Part time Linux/Perl guy |
I wasn't recommending that we make the links for them, only provide them
with the tools to do so if they want to take the gamble (or the gambol).
-- Larry Wall in <[EMAIL PROTECTED]>
------------------------------
From: "Karl Heyes" <[EMAIL PROTECTED]>
Subject: Re: malloc returns NULL!
Date: Wed, 16 May 2001 20:42:41 +0100
In article <[EMAIL PROTECTED]>, "Wolfram Gloger"
<[EMAIL PROTECTED]> wrote:
> "Karl Heyes" <[EMAIL PROTECTED]> writes:
>> I don't know what the implementation of glibc malloc is like
> I do :-)
>
>> but if two
>> pointers are used and 10 bytes requested then that a minimum of 18 bytes
>> for each allocation (not counting alignment, size field and chunk usage).
> The pointers are used by the malloc implementation _only_ when the chunk is
> `not in use', therefore they don't contribute to `overhead' but just to the
> minimum chunk size of 16bytes. Only the 4byte `size' field is truly
> overhead. This is one of the good features of glibc's malloc.
> This is all on 32bit architectures only, though, I forgot that in my
> previous post.
nice! I'm assuming the size of 16 bytes was determined due to cache line
size.
karl.
------------------------------
From: [EMAIL PROTECTED] (Grant Edwards)
Subject: Re: Meaning of kernel: NET: 3 messages suppressed
Date: Wed, 16 May 2001 19:47:45 GMT
In article <[EMAIL PROTECTED]>, Frank Sweetser wrote:
>Grant Edwards <[EMAIL PROTECTED]> wrote:
>>I've searched Usenet and the web and found dozens of people
>>asking the question, but the only answer I find is from people
>>who think it's syslog eliminating duplicate messages. It's
>>not, that message reads something like "last message repeated 4
>>times".
>>
>>What causes the following messages:
>>
>>May 16 12:17:29 grante kernel: NET: 3 messages suppressed.
>>May 16 12:17:33 grante kernel: NET: 189 messages suppressed.
>>May 16 12:17:38 grante kernel: NET: 313 messages suppressed.
>>May 16 12:17:43 grante kernel: NET: 337 messages suppressed.
>>May 16 12:17:48 grante kernel: NET: 322 messages suppressed.
>>May 16 12:18:21 grante kernel: NET: 193 messages suppressed.
>>
>>They only seem to occur when a particular driver is running.
>>That driver handles a particular Ethernet protocol number using
>>dev_add_pack().
>>
>>I've asked in comp.os.linux.networking, but either nobody
>>knows, or they don't want to answer. :(
>
>This is the kernel suppressing duplicate messages.
If you're talking about syslog supressing duplicate messages,
then no, that isn't what it is.
The routine in the kernel that generates those messages
(net_ratelimit) doesn't suppress messages based on whether they
are duplicates or not. All it controls is how many get printed
per second.
>Can't really do anything with the messages, though, since all
>you have here is the supression messages - we'd need the actual
>message itself.
What message?
Here's a chunk of my syslog file starting a few lines above first
"NET: %d messages suppressed":
May 16 12:16:20 grante kernel: NS-Link driver, version 2.16 (15-May-2001)
May 16 12:16:20 grante nslinkd[2670]: Starting NS-Link daemon, version 2.16
(15-May-2001)
May 16 12:16:20 grante nslinkd[2673]: ID response from 00:c0:4e:10:ff:f4 flags=00,
Model=5002030 Arch=2 NumPorts=2 ProgId=0 BoardRev=255
May 16 12:16:20 grante nslinkd[2674]: ID response from 00:c0:4e:0b:ff:f9 flags=00,
Model=5002120 Arch=3 NumPorts=16 ProgId=0 BoardRev=1
May 16 12:16:51 grante kernel: NET: 1 messages suppressed.
May 16 12:16:53 grante kernel: NET: 111 messages suppressed.
May 16 12:16:58 grante kernel: NET: 334 messages suppressed.
May 16 12:17:03 grante kernel: NET: 304 messages suppressed.
May 16 12:17:03 grante nslinkd[2671]: Exiting
May 16 12:17:08 grante kernel: NET: 242 messages suppressed.
May 16 12:17:12 grante dhcpd: DHCPINFORM from 192.168.0.2
May 16 12:17:20 grante dhcpd: DHCPINFORM from 192.168.0.2
Why did 1 message get suppressed when it it had been 31 seconds
since the previous printk()?
--
Grant Edwards grante Yow! All of life is a blur
at of Republicans and meat!
visi.com
------------------------------
From: "override" <[EMAIL PROTECTED]>
Subject: Execve and execvp
Date: Wed, 16 May 2001 20:05:11 GMT
Hi! I'm programming a Linux shell; i need to convert the following
execvp() syscall to an execve() syscall... i've been trying to do
this many ways, but it didn' work... can you please help me?
Thanks
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <sys/param.h>
char *get_current_dir_name(void);
char *getcwd(char *buf, size_t size);
char *getwd(char *buf);
char *getenv(const char *name);
int main (int argc, char **argv)
{
char *my_argv[64];
char *s;
int my_argc;
int pid;
int status;
char buf[8192];
char c;
int x;
int flag;
const char spazio[]=" \n";
while (1) //get command and parameters
{
printf("Prompt$ ");
gets(buf);
s=strtok (buf, spazio);
my_argc = 0;
while (s != 0) {
my_argv [my_argc++] = s;
s = strtok (NULL, spazio);
}
// ..............
if (flag==0) //if not a built-in command
{
my_argv[my_argc] = 0;
for (x = 0; x < argc; x++)
pid = fork();
if (0 == pid)
{
execvp(myargv[], my_argv);
printf("Comando o parametro sconosciuto\n");
return 0;
}
else
{
wait(&status);
}
// .............
}
}
}
------------------------------
** FOR YOUR REFERENCE **
The service address, to which questions about the list itself and requests
to be added to or deleted from it should be directed, is:
Internet: [EMAIL PROTECTED]
You can send mail to the entire list by posting to the
comp.os.linux.development.system newsgroup.
Linux may be obtained via one of these FTP sites:
ftp.funet.fi pub/Linux
tsx-11.mit.edu pub/linux
sunsite.unc.edu pub/Linux
End of Linux-Development-System Digest
******************************