Linux-Development-Apps Digest #447, Volume #6    Tue, 21 Mar 00 14:13:15 EST

Contents:
  Re: Casting argv? (Starchaser)
  Re: Casting argv? ("Brendan Murray")
  [Embedded Linux] Where to get the embedded linux? ("tasi")
  Re: Casting argv? ("Daniel Beer")
  Re: searching for an environment.... (Ralf Nolden)
  CD-ROM API (Steffen Sobiech)
  Re: Casting argv? (Ken Sodemann)
  Re: Linux leaks ([EMAIL PROTECTED])
  Re: Howto link to libc5 when in libc6 ? ([EMAIL PROTECTED])
  Re: Redirecting stderr to a new xterm: how to find /dev/pts/XX ? (Curly++)
  AM_INIT_AUTOMAKE/AM_PATH_GTK problems (John Miskinis)
  Problem: Visual Age for Java 3.0 for Linux ("Edmund C. Greene")
  Re: Problem with sendmsg () (Andi Kleen)
  linux pthreads problem on dual processor machine (Michael Tanenblatt)
  Re: AM_INIT_AUTOMAKE/AM_PATH_GTK problems (Tom Tromey)
  Re: linux pthreads problem on dual processor machine (Kaz Kylheku)
  Re: shared library as a new API ("Markus")

----------------------------------------------------------------------------

From: Starchaser <[EMAIL PROTECTED]>
Crossposted-To: linux.dev.c-programming
Subject: Re: Casting argv?
Date: Tue, 21 Mar 2000 16:27:49 +1200

Jack Kelly Dobson wrote:
> 
> Hello,
> 
> Just curious... why does:
> 
> int main(int argc, char **argv)
> {
>         if ((string)argv[1] == "Test") {
>         }
> }
> 
> Cause a segmentation fault.
> 
> When:
>
> "Providing technology solutions, whether you want them or not!"
As far as I know it shoud not work at all in both cases
should be

int main(int argc, char *argv[]) {
        if(strcmp(argv[1],"Test")) {
        do_some_stuff();
        }
}

-- 

Cheetor HTTP://cantua.canterbury.ac.nz/~gdb48

------------------------------

Reply-To: "Brendan Murray" <[EMAIL PROTECTED]>
From: "Brendan Murray" <[EMAIL PROTECTED]>
Crossposted-To: linux.dev.c-programming
Subject: Re: Casting argv?
Date: Tue, 21 Mar 2000 04:38:42 GMT

"Jack Kelly Dobson" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]...
> Hello,
>
> Just curious... why does:
>
> int main(int argc, char **argv)
> {
> if ((string)argv[1] == "Test") {
> }
> }
>
> Cause a segmentation fault.

Try this slight modification (which you actually have in your next example):
if (argv[1] != NULL && (string)argv[1] == "Test") {
}



> if (argv[1] != NULL) teststring = argv[1];

> Is this due to something strange with argv or that the string
> class does not know how to cast a pointer?
>

Or perhaps because you're not testing for NULL?

B=



------------------------------

From: "tasi" <[EMAIL PROTECTED]>
Subject: [Embedded Linux] Where to get the embedded linux?
Date: 21 Mar 2000 05:34:39 GMT

Dear All

I look for a embedded linux base on x86 or ARM target.
Could somebody tell me the success story about
(1) what target(Evaluate board) does you use? price? how to get the
information?
(2) where to get the embedded linux ?
Thanks!!

mail to [EMAIL PROTECTED]





------------------------------

Crossposted-To: linux.dev.c-programming
Subject: Re: Casting argv?
From: "Daniel Beer" <[EMAIL PROTECTED]>
Reply-To: "Daniel Beer" <[EMAIL PROTECTED]>
Date: Tue, 21 Mar 2000 18:15:18 +1300

On Mon, 20 Mar 2000 16:19:38 -0600, Jack Kelly Dobson <[EMAIL PROTECTED]>
wrote:
>Hello,
>
>Just curious... why does:
>
>int main(int argc, char **argv)
>{
>       if ((string)argv[1] == "Test") {
>       }
>}
>
>Cause a segmentation fault.
>
>When:
>
>int main(int argc, char **argv)
>{
>       string teststring;
>
>       if (argv[1] != NULL) teststring = argv[1];
>       if (teststring == "Test") {
>       }
>}
>
>Does not?
>
>Is this due to something strange with argv or that the string
>class does not know how to cast a pointer?
>
>(I'm just starting out with C++ so this my not be worded as well
>as it could be)
>
>-- 
>Jack Kelly Dobson        "Everything I say is factual,
>Aggressive Media            unless, of course, I'm wrong,
>                               or lying."
>
>"Providing technology solutions, whether you want them or not!"
>

In the first example, you are trying to use a real string (i.e. a
pointer to a collection of characters) as a "string" class, which it is
not (I'm assuming here that the == operator has been overloaded, when
used with the "string" class).

In the second example, you are creating a string class based on the
information pointed to by argv[1] (I also assume that the = operator has
been overloaded to do this).

--
   _     _
 o' \,=./ `o   Daniel Beer <[EMAIL PROTECTED]>
    (o o)      dlbeer.freeshell.org
ooO--(_)--Ooo-


------------------------------

From: Ralf Nolden <[EMAIL PROTECTED]>
Subject: Re: searching for an environment....
Date: Tue, 21 Mar 2000 11:12:41 +0100

Yaniv Ben-Arie wrote:
> =

> Hi,
> I am quite new in linux business, does anyone can tell me if there is a=

> good developing environment (C/C++) for linux - something like the
> visual studio in windows????
> I realy need help on that.
> =

> 10x
> Yaniv
Use KDevelop ;-)

http://www.kdevelop.org
-- =

**********************************
Ralf Nolden

Ardennenstr. 41 =

52355 D=FCren

Tel. 02421/502758

The KDevelop Project
http://www.kdevelop.org

Email: [EMAIL PROTECTED]
**********************************

------------------------------

From: Steffen Sobiech <[EMAIL PROTECTED]>
Subject: CD-ROM API
Date: Tue, 21 Mar 2000 13:21:15 +0100

Hi there!

Is there any way to find out the tray position
of my IDE-CDROM?
I am using Kernel 2.2.12 .
Using CDROM_DRIVE_STATUS correctly return that
a disc is inserted, but it does not distinguish
between TRAY_OPEN and NO_DISC. It always returns
TRAY_OPEN even if it is closed (but with no disc).

Any suggestions?

------------------------------

From: [EMAIL PROTECTED] (Ken Sodemann)
Subject: Re: Casting argv?
Reply-To: [EMAIL PROTECTED]
Date: Tue, 21 Mar 2000 07:06:15 -0600

On Tue, 21 Mar 2000 16:27:49 +1200, Starchaser <[EMAIL PROTECTED]> 
wrote:
>Jack Kelly Dobson wrote:
>> 
>> Hello,
>> 
>> Just curious... why does:
>> 
>> int main(int argc, char **argv)
>> {
>>         if ((string)argv[1] == "Test") {
>>         }
>> }

Test argv[1] for NULL before casting it to 'string' and doing the compare.

>As far as I know it shoud not work at all in both cases
>should be
>
>int main(int argc, char *argv[]) {
>       if(strcmp(argv[1],"Test")) {
>       do_some_stuff();
>        }
>}

That was my first thought too, until I realized that despite the old/ugly
C style cast, he was actally writting C++ code, so as long as the '==' 
operator is properly overloaded, it should work (after adding a test for
a NULL argv[1]).

BTW - Your code won't work exactly as intened either.  You need a '!' or 
'== 0' in your 'if ()'...  :)

-- 
Ken Sodemann 
[EMAIL PROTECTED]
http://www.execpc.com/~stuffle
NASCAR fan, Packer fan | Go #20, #23, #24 (BGN #27) | Go Pack!!

------------------------------

From: [EMAIL PROTECTED]
Subject: Re: Linux leaks
Date: Tue, 21 Mar 2000 14:03:21 GMT

In article <[EMAIL PROTECTED]>,
[EMAIL PROTECTED] (Peter Mortensen) wrote:
>
> What is a good way to detect leaks of different kinds in a
> program under Linux, apart from memory leaks? E.g. a server
> program that opens a file for each request but does not
> close it again will soon (or maybe not so soon) run out of
> file resources/descriptors - open returns -1.
>
> Are there some built-in tools that will detect different
> kinds of leaks or is it necessary to go commercial?

To be positive that something is a leak, you might have to wait until a
programm finishes. Before that you can just assume a manner as
suspicious.

As you are asking for any way to monitore the number of open file
descriptors by process using linux, have a look at:

/proc/<pid>/fd

hope it helps


Sent via Deja.com http://www.deja.com/
Before you buy.

------------------------------

From: [EMAIL PROTECTED]
Subject: Re: Howto link to libc5 when in libc6 ?
Date: Tue, 21 Mar 2000 14:06:50 GMT

In article <[EMAIL PROTECTED]>,
Eric GAUDET <[EMAIL PROTECTED]> wrote:
> Hi,
> I'm running a mixed RH6.1/mandrake 7.0 (glibc2.1), but I'm trying to
> hack CCLinux, which is a nice 1-floppy distri, based on libc5.
> I have some sources (say "less", for example) that I want to compile
> against libc5 (I have the devels). How can one do that ? (gcc seems to
> look at my local ldconfig)

Read the FAQs to the glibc.
I know it was there, but I can't find it now quickly.

hope it helps


Sent via Deja.com http://www.deja.com/
Before you buy.

------------------------------

From: [EMAIL PROTECTED] (Curly++)
Subject: Re: Redirecting stderr to a new xterm: how to find /dev/pts/XX ?
Reply-To: [EMAIL PROTECTED]
Date: Tue, 21 Mar 2000 09:38:58 -0500

In comp.os.linux.development.apps, Larry Zimmerman proclaimed:
> In article <[EMAIL PROTECTED]>,
>       [EMAIL PROTECTED] (Curly++) writes:
> > In comp.os.linux.development.apps, Alex Farber proclaimed:
> >> Hi,
> >> 
> >> Jack Joergensen wrote:
> >> > what about a pipe?
> >> > Not sure if it can be used for xterms..
> >> 
> >> thanks for this idea! I have tried using the "xterm -e tail -f ... --pid=..." 
> >> but the xterm shows the entered lines only after I enter CTRL-D on the parent 
> > 
> > `tail` must find EOF before it knows where to start.
> 
> I think I've used it this way and had no problem using unbuffered output.
> setbuf(stdout,NULL);

You probably added "+1" to tail's command line, telling it to 
count from the top and display everything.  That removes the need
for it to seek to EOF.  But in that case, you are asking `tail` 
to emulate the behaviour of a program half it's size.  Why not 
use the smaller, simpler tool? 
 
In any case, using tail this way is no longer a portable solution. 
The GNU tail (probably the most common these days) fails if "-f" 
is added with any other option, including "+1".  At least, any 
option I've tried to mix it with.
 
You can test this on the command line with a shell pipe.  This 
is screen-scraped from RedHat 6.0:

$ ( echo 1;sleep 1;echo 2;sleep 1;echo 3 )|tail +1 -f
tail: -f: No such file or directory
Broken pipe
$ ( echo 1;sleep 1;echo 2;sleep 1;echo 3 )|tail -f +1
tail: +1: No such file or directory
Broken pipe
$ ( echo 1;sleep 1;echo 2;sleep 1;echo 3 )|cat
1
2
3
$ 


-- 
Oisin "telling the tail of a bug" Curtin     [EMAIL PROTECTED]
Surface Liaison, Minetown Digger                    Send no SPAM.
                                http://pages.infinit.net/curlypp/

------------------------------

From: John Miskinis <[EMAIL PROTECTED]>
Subject: AM_INIT_AUTOMAKE/AM_PATH_GTK problems
Date: Tue, 21 Mar 2000 09:51:40 -0500
Reply-To: [EMAIL PROTECTED]

Hello,

I recently installed automake 1.4 and autoconf 2.13 from
tarballs, to get glade 5.5 up and running.  I've been hunting
on the web for a solution, but haven't found one.  There seem
to be mention of bugs that were discovered after the 1.4
release of automake, but I don't know if this is one...

./configure: line 524: syntax error near unexpected token
`AM_INIT_AUTOMAKE(test2,'
./configure: line 524: `AM_INIT_AUTOMAKE(test2, 0.1)'

It does not seem to recognize the AM_INIT_AUTOMAKE macro
at all!  Also, I'm not sure if the following is related:

~/work_gtk/test2# aclocal
aclocal: configure.in: 12: macro `AM_PATH_GTK' not found in library

I suspect that something is broken on my system, but I do not know
enought to know where to start looking.  I'm hoping it is something
simple to fix.

I'm using the files generated from GLADE, without any edits...

Any clues/advise is welcome,

John


------------------------------

From: "Edmund C. Greene" <[EMAIL PROTECTED]>
Subject: Problem: Visual Age for Java 3.0 for Linux
Date: Tue, 21 Mar 2000 09:51:52 -0500

I am trying to install Visual Age for Java 3.0 for Linux.

The instructions are just untar the archive to a directory and run the
program.  However, when I try to start the application I get the
following error:

Primitive failed in:
PlatformFunction>>#callWith:with:with:with:with:with: due to General
protection fault

It sounds like a MSWindows error, but I am not running Windows.
I am running RedHat Linux 6.1 with all the updates.  I have all the
compat libraries installed.  I have never heard of an error like this.

-- 
Edmund C. Greene            | email: [EMAIL PROTECTED]
Web Engineer                | web  : http://www2.bc.edu/~ed
Internet Business Services  | phone: (617) 552-8633
Boston College              | FAX  : (617) 552-2836
============================+================================
  Life is too short and too important to take seriously.

------------------------------

From: Andi Kleen <[EMAIL PROTECTED]>
Subject: Re: Problem with sendmsg ()
Date: 21 Mar 2000 17:01:36 +0100

Bernd Draxler <[EMAIL PROTECTED]> writes:

> Hi,
> is there any restriction in the number of msg_iov used to buffer the
> message for sendmsg ?
> 
> My problem is that works correctly up to approx. 13, but when i try to
> use more of them (e.g. 
> 21), i always get an errno=EINVAL.

On newer Linux kernels (2.2+) UIO_MAXIOV is 1024. On some older version
it is limited to 16, but you can increase it (in include/linux/uio.h) 
and recompile the kernel. 

-Andi

------------------------------

From: Michael Tanenblatt <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.development.system
Subject: linux pthreads problem on dual processor machine
Date: Tue, 21 Mar 2000 11:55:25 -0500
Reply-To: [EMAIL PROTECTED]


==============6FA799EDBADDEB90424E0D85
Content-Type: text/plain; charset=us-ascii; x-mac-type="54455854"; 
x-mac-creator="4D4F5353"
Content-Transfer-Encoding: 7bit


I am having trouble with a large program multithreaded program when I
run it on my linux box, though the same code runs perfectly on a
multiprocessor Solaris box. In both cases, I compiled the program using
g++ 2.95.2 and the symbol
_REENTRANT was defined at compile time. When I try to figure out why it
is crashing, I attach gdb to the process and it always crashes in the
function __pthread_mutex_unlock(), as called from __funlockfile() with
the mutex (passed via stream->_lock) having an invalid value. Does
anoyone have have ideas as to what might cause this failure on an
SMP linux box yet not on Solaris?

In the file glibc-2.1/linuxthreads/lockfile.c:


void

__funlockfile (FILE *stream)

{

#ifdef USE_IN_LIBIO

  __pthread_mutex_unlock (stream->_lock);

#else

#endif

}





--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Michael Tanenblatt                  Language Modeling Research
Department
Bell Laboratories                   Tel +1 908 582-6456 / Fax +1 908
582-3306
600 Mountain Avenue, Rm 2D-435      Email:
[EMAIL PROTECTED]
Murray Hill NJ 07974 USA
http://www.bell-labs.com/project/tts/


==============6FA799EDBADDEB90424E0D85
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit

<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
&nbsp;
<br>I am having trouble with a large program multithreaded program when
I run it on my linux box, though the same code runs perfectly on a multiprocessor
Solaris box. In both cases, I compiled the program using g++ 2.95.2 and
the symbol
<br>_REENTRANT was defined at compile time. When I try to figure out why
it is crashing, I attach gdb to the process and it always crashes in the
function __pthread_mutex_unlock(), as called from __funlockfile() with
the mutex (passed via stream->_lock) having an invalid value. Does anoyone
have have ideas as to what might cause this failure on an
<br>SMP linux box yet not on Solaris?
<p>In the file glibc-2.1/linuxthreads/lockfile.c:
<br>&nbsp;
<pre>void</pre>

<pre>__funlockfile (FILE *stream)</pre>

<pre>{</pre>

<pre>#ifdef USE_IN_LIBIO</pre>

<pre>&nbsp; __pthread_mutex_unlock (stream->_lock);</pre>

<pre>#else</pre>

<pre>#endif</pre>

<pre>}</pre>
&nbsp;
<p>&nbsp;
<p>--
<br>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<br>Michael 
Tanenblatt&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
Language Modeling Research Department
<br>Bell 
Laboratories&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
Tel +1 908 582-6456 / Fax +1 908 582-3306
<br>600 Mountain Avenue, Rm 2D-435&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Email:
[EMAIL PROTECTED]
<br>Murray Hill NJ 07974 
USA&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<A 
HREF="http://www.bell-labs.com/project/tts/">http://www.bell-labs.com/project/tts/</A>
<br>&nbsp;</html>

==============6FA799EDBADDEB90424E0D85==


------------------------------

From: Tom Tromey <[EMAIL PROTECTED]>
Subject: Re: AM_INIT_AUTOMAKE/AM_PATH_GTK problems
Date: 21 Mar 2000 10:21:16 -0700
Reply-To: [EMAIL PROTECTED]

>>>>> "John" == John Miskinis <[EMAIL PROTECTED]> writes:

John> ./configure: line 524: syntax error near unexpected token
John> `AM_INIT_AUTOMAKE(test2,'
John> ./configure: line 524: `AM_INIT_AUTOMAKE(test2, 0.1)'

John> It does not seem to recognize the AM_INIT_AUTOMAKE macro at all!

You need to successfully run aclocal before running autoconf.

John> ~/work_gtk/test2# aclocal
John> aclocal: configure.in: 12: macro `AM_PATH_GTK' not found in library

If aclocal can't find a macro it dies and does not generate
aclocal.m4.  This is your problem.  You need to tell aclocal where to
find AM_PATH_GTK.

Tom

------------------------------

From: [EMAIL PROTECTED] (Kaz Kylheku)
Crossposted-To: comp.os.linux.development.system
Subject: Re: linux pthreads problem on dual processor machine
Reply-To: [EMAIL PROTECTED]
Date: Tue, 21 Mar 2000 18:01:44 GMT

On Tue, 21 Mar 2000 11:55:25 -0500, Michael Tanenblatt
<[EMAIL PROTECTED]> wrote:
>I am having trouble with a large program multithreaded program when I
>run it on my linux box, though the same code runs perfectly on a
>multiprocessor Solaris box. In both cases, I compiled the program using

You may be bitten by bugs in LinuxThreads. Please upgrade to the latest release
(glibc-2.1.3) and see whether you can reproduce the crash.  If so, you can then
submit a bug report via glibcbug.

------------------------------

From: "Markus" <[EMAIL PROTECTED]>
Subject: Re: shared library as a new API
Date: Tue, 21 Mar 2000 18:33:17 +0100

I have exported LIBRARY_PATH and LD_LIBRARY_PATH with the right directory
within /etc/profile. In addition I have included this directory in
/etc/ld.conf and executed ldconfig -v.

But the result was the same error message :-(

Some more hints?


>The problem is that /opt/com/lib is in neither your LIBRARY_PATH (used
>during compilation) nor your LD_LIBRARY_PATH (used at runtime).
>
>Either in a shell or your .profile:
>
>export LIBRARY_PATH=/opt/com/lib:$LIBRARY_PATH  (*)
>export LD_LIBRARY_PATH=/opt/com/lib:$LD_LIBRARY_PATH
>
>(*) or you can put this in your Makefile.
>
>HTH,
>--ag
>--
>Artie Gold, Austin, TX  (finger the cs.utexas.edu account for more info)
>mailto:[EMAIL PROTECTED] or mailto:[EMAIL PROTECTED]
>--
>A: Look for a lawyer who speaks Aramaic...about trademark infringement.



------------------------------


** 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 (and comp.os.linux.development.apps) via:

    Internet: [EMAIL PROTECTED]

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-Apps Digest
******************************

Reply via email to