Linux-Development-Sys Digest #674, Volume #8     Sat, 28 Apr 01 17:13:10 EDT

Contents:
  how to get good cpu time from running processes on Linux ("Alex Ho")
  Re: 2.2.19 freezes during strong gcc usage
  scripting questions ("PPP")
  Re: Realtek 8139b NIC ("Cameron Kerr")
  ifconfig command (Sachio)
  Re: ifconfig command ("Cameron Kerr")
  Re: ifconfig command ("Peter T. Breuer")
  Re: scripting questions (Trevor Hemsley)
  kernel number meaning ("stefano")
  How to find out whether the device(floppy drivers,zip drives) is removable on linux 
("Luiz Rafael Culik Guimaraes")
  Re: How to find out whether the device(floppy drivers,zip drives) is removable on 
linux ("Peter T. Breuer")
  Re: glibc 2.1.1 to 2.1.3 : Check ERROR (Andreas Jaeger)
  sockets ("Darren")
  Startup service ("Darren")
  Re: sockets (Rene Herman)

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

From: "Alex Ho" <[EMAIL PROTECTED]>
Subject: how to get good cpu time from running processes on Linux
Date: 27 Apr 2001 21:32:16 GMT

Over the last few days, I have been searching for a solution that could
accurately total up cpu usage from threads on Linux.  You know that pthread
on Linux forks off a process for each thread created. This architecture
presents a problem when collecting cpu usage (using clock() or getruage())
from a set of threads.  The same code on Linux is totalling up numbers
different from other platforms.

Say, on a single processor machine, a program creates 2 child threads.  Each
child thread actively doing something (not sleeping) while the main thread
sleeps and wakes up at 1 second-interval to report total cpu usage (using
clock() or getrusage()) of the entire program.  On Linux, the main thread is
reporting times of only itself because it is in a separate process while on
other platforms (like Solaris), the times reported include those from the
child threads because they all running in the same process.

I would like Linux to report total times of the main and the 2 child
threads.  I guess in general, the question is how to collect cpu times from
a set of running processes.

Thanks in advance for any help.

Best Regards,
Alex Ho







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

From: <[EMAIL PROTECTED]>
Subject: Re: 2.2.19 freezes during strong gcc usage
Date: Fri, 27 Apr 2001 15:37:06 -0700

Uh, Phil, whats a furby??


> Well, we all know about smp and threads on the 2.2.X kernels, right?
>
> Just try and figure out which CPU the thread is on... and which
> thread was that anyway?
>
> If he tries things with smp disabled I'll bet the problem goes away.
>
> But I still think gcc-3 can replace your kernel with a furby.
> Unless you are developing gcc I would stay a mile away from it.
>



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

From: "PPP" <[EMAIL PROTECTED]>
Subject: scripting questions
Date: Sat, 28 Apr 2001 01:06:57 GMT

I am trying to get proficient in scripting. I have a few questions.

 $SETSID $PPPD pty "$PPPOE_CMD" \
     $PPP_STD_OPTIONS \
     $DEMAND \
     $PPPD_SYNC &
 echo "$!" > $PPPD_PIDFILE
    fi
    wait

Now when a program returns a value the calling script usually uses $? to
represent the returned value. What does the term $! represent (why was $?
not used)?

What does the wait command do? Would not the script wait for $PPPD to return
anyway? If this is the case then why is wait used?



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

From: "Cameron Kerr" <[EMAIL PROTECTED]>
Subject: Re: Realtek 8139b NIC
Crossposted-To: alt.os.linux,comp.os.linux.misc
Date: Sat, 28 Apr 2001 15:03:51 +1200

Have you disabled the mouse port int the BIOS then, in
that case.

-- 
Cameron Kerr -- cameron.kerr @ paradise.net.nz
Praise Slackware, our baud and saviour!
--

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

From: Sachio <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.development.apps
Subject: ifconfig command
Date: Sat, 28 Apr 2001 06:05:07 GMT

When you execute 'ifconfig' with no other arguments, where does the
utility retrieve the information from?  I have one network adapter that
is dhcp, and I'm wanting to find out where ifconfig retrieves the
assigned ip from.

Also, which directory/file contains the source code for the ifconfig utility?

Please, echo to my e-mail, just in case!

Thanks in advance!

Sachio




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

From: "Cameron Kerr" <[EMAIL PROTECTED]>
Subject: Re: ifconfig command
Crossposted-To: comp.os.linux.development.apps
Date: Sat, 28 Apr 2001 18:52:21 +1200

Mostly from /proc/net

-- 
Cameron Kerr -- cameron.kerr @ paradise.net.nz
Praise Slackware, our baud and saviour!
--

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

From: "Peter T. Breuer" <[EMAIL PROTECTED]>
Subject: Re: ifconfig command
Crossposted-To: comp.os.linux.development.apps
Date: Sat, 28 Apr 2001 08:39:17 GMT

In comp.os.linux.development.apps Sachio <[EMAIL PROTECTED]> wrote:
> When you execute 'ifconfig' with no other arguments, where does the
> utility retrieve the information from?  I have one network adapter that

>From the kernel. It reports all "up" interfaces.

> is dhcp, and I'm wanting to find out where ifconfig retrieves the
> assigned ip from.

It makes ioctls on a socket to get the information about each interface
in turn.

> Also, which directory/file contains the source code for the ifconfig utility?

The one called ifconfig.c (and more). Download the source code for your
ifconfig and you will see.

Peter

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

From: [EMAIL PROTECTED] (Trevor Hemsley)
Subject: Re: scripting questions
Date: 28 Apr 2001 10:35:50 GMT

On Sat, 28 Apr 2001 01:06:57, "PPP" <[EMAIL PROTECTED]> wrote:

> 
> Now when a program returns a value the calling script usually uses $? to
> represent the returned value. What does the term $! represent (why was $?
> not used)?

man bash

/Special Parameters

       !      Expands to the process ID of the most recently exe
              cuted background (asynchronous) command.           

-- 
Trevor Hemsley, Brighton, UK.
[EMAIL PROTECTED]

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

From: "stefano" <[EMAIL PROTECTED]>
Subject: kernel number meaning
Date: Sat, 28 Apr 2001 16:02:37 +0100

Hi everybody,
uname -a  informs me I'm using kernel 2.2.12-20 on my machine.
But I can't figure out what does 12-20 mean?
If I want to use a newer kernel from which patch should I start upgrading ?
Thankyou for any help.


Stefano




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

From: "Luiz Rafael Culik Guimaraes" <[EMAIL PROTECTED]>
Crossposted-To: linux.act.gcc,linux.dev.c-programming
Subject: How to find out whether the device(floppy drivers,zip drives) is removable on 
linux
Date: Sat, 28 Apr 2001 12:19:27 -0300


Dear Friends

As subject

also I need help on this:
How  to retreive the free space on a device pointed by the filepath.

Regards

Luiz Rafael Culik




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

From: "Peter T. Breuer" <[EMAIL PROTECTED]>
Crossposted-To: linux.act.gcc,linux.dev.c-programming
Subject: Re: How to find out whether the device(floppy drivers,zip drives) is 
removable on linux
Date: Sat, 28 Apr 2001 18:11:42 +0200

In comp.os.linux.development.system Luiz Rafael Culik Guimaraes 
<[EMAIL PROTECTED]> wrote:
> How  to retreive the free space on a device pointed by the filepath.

man df

Peter

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

From: Andreas Jaeger <[EMAIL PROTECTED]>
Subject: Re: glibc 2.1.1 to 2.1.3 : Check ERROR
Date: 28 Apr 2001 18:31:28 +0200

Olivier Gaquiere <[EMAIL PROTECTED]> writes:

> Hello,
> 
> I have to upgrade my libc 2.1.1 to 2.1.3 (jdk 1.3 needs this upgrade).

2.1.3 is quite old...

> I work with Suse 6.2 and my system's components are :
>     Make 3.79
>     Gcc 2.95.2
>     Binutils 2.9.1.0.25
>     Bash 2.03
> 
> Sources of glibc 2.1.3 are in /opt/progs/glibc-2.1.3 and i created a

Can you write in that directory or is it read-only?  If it's
read-only, then you've encountered a bug in test-canon that has been
fixed some time ago.

> distinct directory
> for building (/usr/local/glibc-build).
> 
> I ran configure with LinuxThreads and Crypt Add-ons, and with
> --prefix=/usr
> Configure runs OK
> Make runs OK
> 
> My problem is :
> 
> "Make check" exits with an error on
> /usr/local/glibc-build/stdlib/test-canon
> (i included the file "test-canon.out")
> 
> I run "make check" again and the other tests seem to pass with success.
> (i say "seem" because interpretation of some .out files is not obvious
> and some
> .out files are empty)

We create out files for each test, empty .out files are ok.  So it
seems that only test-canon is broken.  If you have a read-only source
directory, then go ahead.

Andreas
-- 
 Andreas Jaeger
  SuSE Labs [EMAIL PROTECTED]
   private [EMAIL PROTECTED]
    http://www.suse.de/~aj

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

From: "Darren" <[EMAIL PROTECTED]>
Crossposted-To: 
comp.os.linux.development.apps,linux.redhat.devel,linux.redhat.development
Subject: sockets
Date: Sat, 28 Apr 2001 19:09:28 +0100

Hello. I am looking for some info on socket programming for Linux. I assume
from the man pages it is similar to Winsock programming. Can anyone direct
me to a decent document on the subject as I find the man pages lacking

Thank you

Darren




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

From: "Darren" <[EMAIL PROTECTED]>
Subject: Startup service
Date: Sat, 28 Apr 2001 19:06:01 +0100

Hello all I am writing a small app that I want to run as a Linux service
when it starts up. Can anyone tell me if I need any special consideration
when writing a Linux tsr? also does one know which file it stores the info
on startup apps in?

Thank you

Darren



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

From: Rene Herman <[EMAIL PROTECTED]>
Crossposted-To: 
comp.os.linux.development.apps,linux.redhat.devel,linux.redhat.development
Subject: Re: sockets
Date: Sat, 28 Apr 2001 21:35:58 +0200

Darren wrote:

[ Followup-To set ]

> Hello. I am looking for some info on socket programming for Linux.

The most frequently mentioned book on the subject is "UNIX Network 
Programming" by W. Richard Stevens. It's ridiculously expensive.

> I assume from the man pages it is similar to Winsock programming.

Since Windows Sockets were modelled after (ie, copied from) regular BSD 
UNIX sockets, this is true. Sockets originated in BSD and found their 
way into the other unices and many other systems, including Windows.

> Can anyone direct me to a decent document on the subject as I find
> the man pages lacking

The single best thing you can do is study existing socket source code. 
Fortunately, with Linux being as open source as it is, there are many 
good examples available. The next thing you'll want to do is subscribe 
to comp.unix.programmer and check out their socket faq at:

http://www.lcg.org/sock-faq/

Posting questions to c.u.p is likely to yield many good answers. Many 
good TCP/IP programmers (of which I am not one) hang out there...

Hope this helps,
Rene Herman

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


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

Reply via email to