Linux-Development-Apps Digest #339, Volume #7    Tue, 17 Apr 01 09:13:12 EDT

Contents:
  Qt compiling (sanel)
  What can we put in atexit() exit routine ? (Christopher GAUTIER)
  Kernel <--> User Space ("Cédric Willot")
  Re: What can we put in atexit() exit routine ? (Samuel Hocevar)
  Re: What's it mean if some process's fd is red backgroud color and blinking (Nate 
Eldredge)
  Re: malloc and free calls. (Pete Lewis)
  Re: Tizek.com is in dire need of a development team... (Nix)
  Re: Tizek.com is in dire need of a development team... ([EMAIL PROTECTED])
  Re: Tizek.com is in dire need of a development team... ([EMAIL PROTECTED])
  Fast C++ compiler for LINUX ("Felix E. Klee")
  Re: CodeWarrior Linux and ld error messages (Guy Rouillier)
  Re: What's it mean if some process's fd is red backgroud color and blinking 
("Victor")
  linux c++ problem (Robert Pond)
  Re: Tizek.com is in dire need of a development team... (William Kendrick)
  Passing Parameters to a (library) function (Markus Hoffmann)
  Re: linux c++ problem (Stephen Coursen)
  where am i? ("Wong Ka Chun")
  Re: where am i?
  Re: where am i? ("Wong Ka Chun")
  Re: where am i? (Jan Schaumann)
  Re: where am i? (Lew Pitcher)

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

From: sanel <[EMAIL PROTECTED]>
Subject: Qt compiling
Date: Mon, 16 Apr 2001 15:30:07 -0000

I'm interested, how to compile my own Qt programs under Linux. 
What i need to compile ?

Thanx 

PS: 
Please, if you can, send reply to my mail ([EMAIL PROTECTED])

--
Posted via CNET Help.com
http://www.help.com/

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

From: Christopher GAUTIER <[EMAIL PROTECTED]>
Subject: What can we put in atexit() exit routine ?
Date: Mon, 16 Apr 2001 17:58:15 +0200

Hello,

I discovered than when I put a sleep() in the exit routine (indicated by
atexit() ), I got a SEGF. Because i want to delay my program at its end,
I tried to put a select call, but then I received an error errno=
interrupted system call.  What should I do ?
Thanks,
Christopher GAUTIER


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

From: "Cédric Willot" <[EMAIL PROTECTED]>
Subject: Kernel <--> User Space
Date: Mon, 16 Apr 2001 15:27:52 +0200

If I create a new module with new functions attached to the kernel via
insmod.
How, with a simple C program, can I use the external functions (I can see
them in proc/ksyms) from my module ?

Thanks,

ced.





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

From: [EMAIL PROTECTED] (Samuel Hocevar)
Subject: Re: What can we put in atexit() exit routine ?
Date: 16 Apr 2001 16:26:41 GMT

On Mon, 16 Apr 2001 17:58:15 +0200,
Christopher GAUTIER <[EMAIL PROTECTED]> wrote:

> I discovered than when I put a sleep() in the exit routine (indicated by
> atexit() ), I got a SEGF.

   Are you sure this is caused by sleep() ? It works perfectly here:

--- foo.c ---
void plop(void) { printf("teapot\n"); sleep(1); printf("roulaize\n"); }
int main(void) { atexit(plop); return(0); }
--- foo.c ---

   Maybe your application is linked with a library which registers its
own stuff using atexit (GTK/GDK does this for instance).

   One way to debug this is to LD_PRELOAD a library with an atexit
function which registers stuff for you, and manually call the registered
callbacks before calling exit(). Anyway, having to wait on exit seems
strange to me, why exactly do you need this ?

Sam.
-- 
Samuel Hocevar <[EMAIL PROTECTED]> <http://sam.zoy.org/>
VideoLAN - play DVDs and MPEG on Linux, Unix, BeOS and MacOS X !
                 <http://www.videolan.org/>

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

From: Nate Eldredge <[EMAIL PROTECTED]>
Subject: Re: What's it mean if some process's fd is red backgroud color and blinking
Date: 16 Apr 2001 09:33:53 -0700

"Victor" <[EMAIL PROTECTED]> writes:

> Hi, all
> 
> There are some errors occur of my program recently. When I use ls look at
> the system's directory(/proc/<PID>/fd/), I found all the fd is blinking with
> red background color. What does this mean?

Blinking red often means "broken link"; that is, a symlink pointing to
a file that doesn't exist.  However, the files in /proc/pid/fd are
sometimes "linked" to bogus names like socket:[451];  They will still
work, though.  It could also point to a file that's been deleted, but
you can still open the link, because the file isn't actually deleted
until closed.

Basically, without more information, you don't know what it means.

-- 

Nate Eldredge
[EMAIL PROTECTED]

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

From: Pete Lewis <[EMAIL PROTECTED]>
Subject: Re: malloc and free calls.
Date: Mon, 16 Apr 2001 17:36:20 +0000

On Sunday 15 April 2001 22:11, Tristan Wibberley spouted forth:

> 
> "Pete Lewis" <[EMAIL PROTECTED]> wrote in message
> news:nCkC6.5994$[EMAIL PROTECTED]...
>> On Sunday 15 April 2001 16:50, Eric P. McCoy spouted forth:
>>
>> > [EMAIL PROTECTED] (Byron A Jeff) writes:
>> >
>> >> -I know I really shouldn't be asking this... but:
>> >
>> >> Why not?
>> >
>> > Probably because it seems like lazy programming.
>> >
>> > But since even DOS was pretty reliable about this (where it could be),
>> > I'd say this is more or less standard procedure by now.
>> >
>>
>> Thanks a lot everyone.
>>
>> The reason I thought it might be a bad question to ask is because it's a
>> bit lazy and not that "scientific", seeing as I've spent 3 years on a
>> computer science course!
>>
>> Now my tutor shouldn't have cause to have a go at me for not writing a
>> cleanup routine!
> 
> Yes they should. In a CS course, your code may never be reused; but in
> real life it will. You effectively have a cleanup routine in your code,
> and it's called exit (). Much better to give it a more descriptive name
> and tailor it to the situation - providing an optimised version when the
> heap is reclaimed automatically.
> 
> If you rely on exit () to cleanup, then you can't easily take your code
> and plug it into another program which doesn't exit when the mallocs need
> to be freed. You would have to provide an isolated environment for the
> re-used code and that's a right bugger.
> 
> --
> Tristan Wibberley
> 
> 
> 


Hmmm. I take the points expressed.

I think I might write that cleanup routine after all.

Thanks.

-Pete.

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

From: Nix <$}xinix{$@esperi.demon.co.uk>
Crossposted-To: comp.os.linux.development.system,comp.os.linux.misc
Subject: Re: Tizek.com is in dire need of a development team...
Date: 16 Apr 2001 19:04:20 +0100

On Mon, 16 Apr 2001, [EMAIL PROTECTED] stipulated:
> If the need is _SO_ desperate, and the destiny for greatness so
> certain, it would seem senseless NOT to spend some of the venture
> capital paying for competent programmers.

The need is *so* desperate that they are engaging in a massive
alphaspam.

> Any venture that plans to altogether defer paying would-be employees
> seems more than a mite shifty to me...

Very so.

-- 
`... and it's not true that I'm closely related to the three-toed
 sloth.' --- Kieran

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

From: [EMAIL PROTECTED]
Crossposted-To: comp.os.linux.development.system,comp.os.linux.misc
Subject: Re: Tizek.com is in dire need of a development team...
Date: Mon, 16 Apr 2001 19:22:30 -0000

In comp.os.linux.development.system [EMAIL PROTECTED] wrote:
| [EMAIL PROTECTED] writes:
|> There is no pay (yet) but once we get going income will be generated
|> through advertisements on the site and various other services which
|> we will offer, and there will surely be enough to go around.
|
|> Brief Overview:
|
|> TizEK.com is destined to be THE premiere Internet portal for techies
|> and geeks alike. We currently need graphic developers, HTML authors,
|> PHP, CGI/PERL authors, and creative minds. To apply, mail us at
|> [EMAIL PROTECTED]
|
| If the need is _SO_ desperate, and the destiny for greatness so
| certain, it would seem senseless NOT to spend some of the venture
| capital paying for competent programmers.
|
| Any venture that plans to altogether defer paying would-be employees
| seems more than a mite shifty to me...

Seems that way to me, too, especially considering their authority
DNS servers don't even know what "tizek.com" is.

And this is the Nth site to claim this, where N is significantly
larger than the number of portal sites that will ever see the light
of visiting users, much less actual ad revenue.

s/is destined/has a wild dream/

Besides, I'm too busy building my own premiere Internet portal for
techies and geeks alike.  At least my DNS works.  At least I have
an MX record.

-- 
=================================================================
| Phil Howard - KA9WGN |   Dallas   | http://linuxhomepage.com/ |
| [EMAIL PROTECTED] | Texas, USA | http://phil.ipal.org/     |
=================================================================

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

From: [EMAIL PROTECTED]
Subject: Re: Tizek.com is in dire need of a development team...
Crossposted-To: comp.os.linux.development.system,comp.os.linux.misc
Date: Mon, 16 Apr 2001 20:32:47 GMT

Nix <$}xinix{$@esperi.demon.co.uk> writes:
> On Mon, 16 Apr 2001, [EMAIL PROTECTED] stipulated:
> > If the need is _SO_ desperate, and the destiny for greatness so
> > certain, it would seem senseless NOT to spend some of the venture
> > capital paying for competent programmers.

> The need is *so* desperate that they are engaging in a massive
> alphaspam.

I see, from other newsgroups, that it is so.

Unfortunately, such vast levels of desperation are suggestive that
it's a "sinking ship" long before it ever gets launched.  

Sort of like a fellow I once knew called Bruno; he'd meet a girl that
somewhat interested him, and almost instantaneously launch into trying
to "offer her a ring."  I don't particularly _like_ calling people
"losers," but anyone that uses the term would feel it hit the mark
with Bruno...
-- 
(reverse (concatenate 'string "gro.mca@" "enworbbc"))
http://vip.hex.net/~cbbrowne/resume.html
Academics denigrating "Popularizers"

"During the rise of the merchant class, the landed aristocracy
understood the value of creating food, but didn't appreciate that food
isn't valuable unless it reaches hungry mouths.

New ideas aren't valuable unless they reach hungry minds. "
-- Mark Miller

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

From: "Felix E. Klee" <[EMAIL PROTECTED]>
Subject: Fast C++ compiler for LINUX
Date: Mon, 16 Apr 2001 23:48:12 +0200

Hi,

I am looking for a C++ compiler (preferably an incremental one) that runs
under i*86-Linux and has short compilation times. I am asking this because
g++ gets very slow when compiling code that interfaces with large template
libraries (eg. Blitz++). Does such a thing exist (doesn't need to be free)?

TIA,

Felix

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

From: [EMAIL PROTECTED] (Guy Rouillier)
Subject: Re: CodeWarrior Linux and ld error messages
Date: Tue, 17 Apr 2001 13:55:44 GMT

The sentinals are defined only for a single compilation unit.  So if
you compile a.c that #include "model.h" and then compile b.c that does
the same, model.h will get included in both because the sentinal only
becomes defined for the duration of a single compilation unit. a.c and
b.c are different compilation units.

Peter Mantell <[EMAIL PROTECTED]> wrote:

>
>> That is your problem.  You presumably include model.h in several
>> different source files, so your variable ends up being defined in each
>> of these.
>
>Yeah, I did have it included several times, but I thought that wrapping
>the entire .h file in
>
>#ifndef MODEL_H
>#define MODEL_H
>
>...
>
>#endif
>
>
>would cater for that problem.
>
>
>>  The definition SHOULD be in a .c file so that it only ends
>> up in the final program once.  The header should contain only a
>> declaration.  Example:
>> 
>> model.h:
>> extern sometype lightdirection;
>> 
>> model.c:
>> sometype lightdirection = INITIAL_VALUE;
>
>
>But that makes much more sense. Thanks Nate.

=============================
Guy Rouillier

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

From: "Victor" <[EMAIL PROTECTED]>
Subject: Re: What's it mean if some process's fd is red backgroud color and blinking
Date: Tue, 17 Apr 2001 10:32:06 +0800
Reply-To: "Victor" <[EMAIL PROTECTED]>

Yes, all the fd blinking is refer to sokets. Do you mean they could still
work even if they are blinking(broken link)?
I think this really match with what happened to me. Where could I find
detail description about this?

Thanks a lot!

--

E-mail: [EMAIL PROTECTED]
==============================================
http://www.baidu.com
"Behind Your e-Success!"

"Nate Eldredge" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]...
> "Victor" <[EMAIL PROTECTED]> writes:
>
> > Hi, all
> >
> > There are some errors occur of my program recently. When I use ls look
at
> > the system's directory(/proc/<PID>/fd/), I found all the fd is blinking
with
> > red background color. What does this mean?
>
> Blinking red often means "broken link"; that is, a symlink pointing to
> a file that doesn't exist.  However, the files in /proc/pid/fd are
> sometimes "linked" to bogus names like socket:[451];  They will still
> work, though.  It could also point to a file that's been deleted, but
> you can still open the link, because the file isn't actually deleted
> until closed.
>
> Basically, without more information, you don't know what it means.
>
> --
>
> Nate Eldredge
> [EMAIL PROTECTED]



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

From: Robert Pond <[EMAIL PROTECTED]>
Subject: linux c++ problem
Date: Tue, 17 Apr 2001 02:48:28 -0400
Reply-To: [EMAIL PROTECTED]





linux c++

From:

Robert Pond <[EMAIL PROTECTED]>

Reply-To:

[EMAIL PROTECTED]

Date:

Tuesday 17 April 2001 02:46:47

Groups:

alt.os.linux



no references



Does anybody know why this snippet only creates one child process?

void main()
 {
                string direction[2] = {"north", "south"};
                int num_cars = 10;
                int status;
                int pid = 0;
                int dir = 0;
                pid = fork();
                char out[15];
                for(int id = 0; id < num_cars; id++)
                {
                        if(pid == 0)
                        {
                                dir = rand() % 2;
                                sprintf(out,"%d",id);

                                execlp("./car", "car", out, 
direction[dir].c_str(), NULL);

                        }
                        wait(&status);
                }
        }



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

From: William Kendrick <[EMAIL PROTECTED]>
Subject: Re: Tizek.com is in dire need of a development team...
Crossposted-To: comp.os.linux.development.system,comp.os.linux.misc
Date: Tue, 17 Apr 2001 07:11:19 GMT

In comp.os.linux.misc [EMAIL PROTECTED] wrote:

: If the need is _SO_ desperate, and the destiny for greatness so
: certain, it would seem senseless NOT to spend some of the venture
: capital paying for competent programmers.

Speaking of alphaspamming.  I saw this spam (at least, the title) on
one of the slower _classic_Atari_ newsgroups I subscribe to.

Daahhhhhhhh okay!?

-bill!
[EMAIL PROTECTED]
http://www.lugod.org/
Linux Users' Group of Davis

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

From: Markus Hoffmann <[EMAIL PROTECTED]>
Subject: Passing Parameters to a (library) function
Date: Tue, 17 Apr 2001 10:03:42 +0200

Hi, I want to pass an unknown number of Parameters to a function.
(using the gcc c compiler)
The Problem is, the Number of Parameters is not known at compile time.
I am only interested in the function call. The subroutine is a
shared-Library function.

This is how I can execute a Function without parameters.

void *a();       Adress of Function

a=dl_sym("NAME");

a();

=================

But how can I give Arguments?

regards
Markus



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

From: [EMAIL PROTECTED] (Stephen Coursen)
Subject: Re: linux c++ problem
Date: Tue, 17 Apr 2001 10:12:17 GMT

On Tue, 17 Apr 2001 02:48:28 -0400, Robert Pond <[EMAIL PROTECTED]> wrote:
>
>Does anybody know why this snippet only creates one child process?
>
>void main()
> {
>                string direction[2] = {"north", "south"};
>                int num_cars = 10;
>                int status;
>                int pid = 0;
>                int dir = 0;
>                pid = fork();

At this point, you've spawned your first and only child process.

>                char out[15];
>                for(int id = 0; id < num_cars; id++)
>                {
>                        if(pid == 0)
>                        {
>                                dir = rand() % 2;
>                                sprintf(out,"%d",id);
>
>                                execlp("./car", "car", out, 
>direction[dir].c_str(), NULL);
>

Right here, you've overlaid your process space with a new process.  This
stops the for loop from ever continuing.

Hope this helps,
Steve

>                        }
>                        wait(&status);
>                }
>        }
>
>


-- 
--
Stephen Coursen                      [EMAIL PROTECTED]
I waste him with my crossbow!
One Ring to rule them all, One Ring to find them,
One Ring to bring them all and in the darkness bind them

Mix a little foolishness with your serious plans; it's lovely to be silly
at the right moment.
                -- Horace

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

From: "Wong Ka Chun" <[EMAIL PROTECTED]>
Subject: where am i?
Date: Tue, 17 Apr 2001 19:33:21 +0800

Hello,

  I have a C program that wants to know where itself is located in the file
system. Is there any system call can do it?

TIA.

- Wong



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

From:  <[EMAIL PROTECTED]>
Subject: Re: where am i?
Date: Tue, 17 Apr 2001 12:00:07 GMT

If you use the argv, argc parameters in the main function you can see the
complete path to the program.

/ Juman

On Tue, 17 Apr 2001, Wong Ka Chun wrote:

> Hello,
> 
>   I have a C program that wants to know where itself is located in the file
> system. Is there any system call can do it?
> 
> TIA.
> 
> - Wong
> 
> 
> 


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

From: "Wong Ka Chun" <[EMAIL PROTECTED]>
Subject: Re: where am i?
Date: Tue, 17 Apr 2001 20:13:36 +0800

Hello,

  I tried, but if I run the program say "./abc", argv[0] just gives me
./abc, rather than full path of the program location.

- Wong

<[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]...
: If you use the argv, argc parameters in the main function you can see the
: complete path to the program.
:
: / Juman
:
: On Tue, 17 Apr 2001, Wong Ka Chun wrote:
:
: > Hello,
: >
: >   I have a C program that wants to know where itself is located in the
file
: > system. Is there any system call can do it?
: >
: > TIA.
: >
: > - Wong
: >
: >
: >
:



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

From: [EMAIL PROTECTED] (Jan Schaumann)
Subject: Re: where am i?
Date: Tue, 17 Apr 2001 12:56:14 -0000

* Wong Ka Chun wrote:
> Hello,
> 
>   I have a C program that wants to know where itself is located in the file
> system. Is there any system call can do it?

man getcwd

-Jan

-- 
Jan Schaumann <http://www.netmeister.org>

We'll pivot at warp 2 and bring all tubes to bear, Mr. Sulu!

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

From: [EMAIL PROTECTED] (Lew Pitcher)
Subject: Re: where am i?
Reply-To: [EMAIL PROTECTED]
Date: Tue, 17 Apr 2001 13:05:54 GMT

On Tue, 17 Apr 2001 20:13:36 +0800, "Wong Ka Chun"
<[EMAIL PROTECTED]> wrote:

>Hello,
>
>  I tried, but if I run the program say "./abc", argv[0] just gives me
>./abc, rather than full path of the program location.

To get the full path to the program, you have to read the /proc entry
for your program (specifically, resolve the symbolic link
/proc/self/exe). There is no other 'generic' way to get the path to
the executable from within the running executable. BTW: this is not
portable outside of Linux; it's not a Unix-generic method.

Anyway, just think about it. If I make a hard link to a program in
another directory, and start the program through that hardlink, where
is the program? (Hint, it's in two places at once.)

If I delete the executable once I've started it
  (./a.out & rm ./a.out)
what would the executable use as a path?

What happens if I start a program outside of the PATH?
What happens if I start a program from the PATH?

><[EMAIL PROTECTED]> wrote in message
>news:[EMAIL PROTECTED]...
>: If you use the argv, argc parameters in the main function you can see the
>: complete path to the program.
>:
>: / Juman
>:
>: On Tue, 17 Apr 2001, Wong Ka Chun wrote:
>:
>: > Hello,
>: >
>: >   I have a C program that wants to know where itself is located in the
>file
>: > system. Is there any system call can do it?
>: >
>: > TIA.
>: >
>: > - Wong
>: >
>: >
>: >
>:
>
>


Lew Pitcher, Information Technology Consultant, Toronto Dominion Bank Financial Group
([EMAIL PROTECTED])

(Opinions expressed are my own, not my employer's.)

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


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

Reply via email to