Linux-Development-Sys Digest #264, Volume #8      Wed, 8 Nov 00 11:13:15 EST

Contents:
  syslog() in kernel module ([EMAIL PROTECTED])
  Re: non-portable port (John Hasler)
  how to get the number of online cpu ? (Nicolas Morant)
  Re: /proc i need help (Perego Paolo)
  catching smurf attack... (Perego Paolo)
  Re: how to get the number of online cpu ? (Josef Moellers)
  Software RAID ("U. Siegel")
  Re: Software RAID ("David Sisk")
  linux doesn't detect my LNE100TX ethernet card (Sudhindra Suresh Bengeri)
  doesn't recognize sound card (Sudhindra Suresh Bengeri)
  Files on NFS ("Ildar Gabdullin")
  Re: Software RAID (moonie;))
  Re: Linux engineers wanted (Ron Grigg)
  Re: Software RAID (Lee Allen)
  ipc - key_t ... ("Geoff Winkless")
  Re: non-portable port (Grant Edwards)
  Re: harddisk and partitions (MESMEUR Philippe)
  How to catch stdout of an application ? (denis martinez)
  Re: How to catch stdout of an application ? (denis martinez)
  Runtime file size modifying (patrick)
  Re: How to catch stdout of an application ? (Josef Moellers)
  Re: Runtime file size modifying ("Z")

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

From: [EMAIL PROTECTED]
Subject: syslog() in kernel module
Date: Wed, 08 Nov 2000 11:02:31 GMT

How can I use syslog in the kernel module?

The followinng piece of code: syslog(3,message,strlen(message));
seems to has no effect... What's wrong?

Thanks


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

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

From: John Hasler <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.development.apps
Subject: Re: non-portable port
Date: Wed, 8 Nov 2000 05:19:34 GMT

derlehrer writes:
> Are there any viable approaches (other than give it up:~) and stuff like
> curses?

Depending on what you need to do you might find newt or slang useful.
-- 
John Hasler
[EMAIL PROTECTED]
Dancing Horse Hill
Elmwood, Wisconsin

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

From: Nicolas Morant <[EMAIL PROTECTED]>
Subject: how to get the number of online cpu ?
Date: Wed, 08 Nov 2000 12:22:20 +0100
Reply-To: [EMAIL PROTECTED]

hello

in solaris and tru64 I use sysconf :
    #include <unistd.h>
    int n = sysconf(_SC_NPROCESSORS_ONLN); /* the number of online cpu */

in linux 2.2.14 sysconf is in /usr/src/linux/ibcs/iBCSemul/sysconf.c
    it does not support _SC_NPROCESSORS_ONLN, it returns EINVAL

in 2.2.17 (seen with lxr.linux.no)
   sysconf is in arch/sparc/kernel/sys_sunos.c
                 arch/mips/kernel/sysirix.c
                 etc ...
        and it does not support _SC_NPROCESSORS_ONLN, either.


I have to use linux/smp.h
but it is a #define smp_num_cpus 1 if it is compiled in a uniprocessor machine
and a variable otherwise
since my code is compiled on a uniprocessor machine and if it is put in a smp machine
it will always give only one processor

is there a system call to retrieve the online cpu number (for any architecture) ?

thanks a lot

Nico

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

From: Perego Paolo <[EMAIL PROTECTED]>
Subject: Re: /proc i need help
Date: 8 Nov 2000 12:15:21 GMT

Keith <[EMAIL PROTECTED]> wrote:
> I am trying to register data with the /proc filesystem. The code I'm using
> is the below:

> The problems are being caused by the proc_register(&proc_root,
> &Our_Proc_File) line.

> The error I get is this:  proc_entry_R02343 undefined

> If anyone has experience registering to the proc system, please HELPPPPP.
[snip snip]
I've ripped off a lot of code from "linux Kernel Module Programming 
Guide" by O. Pomerantz I suppose! :) I'm reading that book!

Are you using a 2.4.0-prexx series kernel? If so, take a look on 
proc_fs.h file because something has changed.

If you are using a 2.2.xx kernel series that code have to work! :)
Ciao
-- 
$>cd /pub
$>more beer

Perego Paolo <[EMAIL PROTECTED]>
Tutor at D.S.I. - University of Milan
I'm Linux zion 2.4.0-test9 #2 Fri Oct 27 10:51:12 CEST 2000 i586 unknown

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

From: Perego Paolo <[EMAIL PROTECTED]>
Subject: catching smurf attack...
Date: 8 Nov 2000 12:18:29 GMT

Hi guys, I'm writing a module for my computer science thesis work.
I've to catch the smurf attack using netfilter firewalling scheme 
( so we are in 2.4.0 kernel series ).
How is filled the broadcast field in the sock structure, and when?

Thanxs

-- 
$>cd /pub
$>more beer

Perego Paolo <[EMAIL PROTECTED]>
Tutor at D.S.I. - University of Milan
I'm Linux zion 2.4.0-test9 #2 Fri Oct 27 10:51:12 CEST 2000 i586 unknown

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

From: Josef Moellers <[EMAIL PROTECTED]>
Subject: Re: how to get the number of online cpu ?
Date: Wed, 08 Nov 2000 13:40:29 +0100

Nicolas Morant wrote:
> =

> hello
> =

> in solaris and tru64 I use sysconf :
>     #include <unistd.h>
>     int n =3D sysconf(_SC_NPROCESSORS_ONLN); /* the number of online cp=
u */
> =

> in linux 2.2.14 sysconf is in /usr/src/linux/ibcs/iBCSemul/sysconf.c
>     it does not support _SC_NPROCESSORS_ONLN, it returns EINVAL
> =

> in 2.2.17 (seen with lxr.linux.no)
>    sysconf is in arch/sparc/kernel/sys_sunos.c
>                  arch/mips/kernel/sysirix.c
>                  etc ...
>         and it does not support _SC_NPROCESSORS_ONLN, either.
> =

> I have to use linux/smp.h
> but it is a #define smp_num_cpus 1 if it is compiled in a uniprocessor =
machine
> and a variable otherwise
> since my code is compiled on a uniprocessor machine and if it is put in=
 a smp machine
> it will always give only one processor
> =

> is there a system call to retrieve the online cpu number (for any archi=
tecture) ?

Not necessarily a system call (if you don't count open/read/close as
system calls B-{):
open /proc/cpuinfo
read lines and count those that have "processor\t:" as the first
characters.
close file

Voila: the number of CPUs.

-- =

Josef M=F6llers (Pinguinpfleger bei FSC)
        If failure had no penalty success would not be a prize (T.  Pratchett)

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

From: "U. Siegel" <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.hardware,alt.linux,comp.os.linux.misc
Subject: Software RAID
Date: Wed, 08 Nov 2000 13:34:06 +0100

Hi folks,
anybody out there having experience with Software-RAID?


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

From: "David Sisk" <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.hardware,alt.linux,comp.os.linux.misc
Subject: Re: Software RAID
Date: Wed, 08 Nov 2000 13:03:30 GMT

Setup no, operation yes.  I'd suggest that you only use RAID0 as the O/S
level, do anything else (RAID1, RAID5, RAID10) at the hardware level.  If
the box is doing any heavy work, RAID1, 5, or 10 will suck up lots of CPU
and saturate the bus if you do it at the O/S level.  Do it at the hardware
level instead.

There's an hardware adapter from 3ware.com that supports RAID0, RAID1, and
RAID10 for IDE drives, is certified to work with Linux, and only costs about
$150 for the 2-channel model.  There's also an IDE RAID adapter from ABIT
(www.abit-usa.com) that's only about $50 for a 4 channel (!!!), their site
states that it is supported by Linux, but the manual doesn't mention it.
Anyone familiar with this?

Regards,
Dave

U. Siegel <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]...
> Hi folks,
> anybody out there having experience with Software-RAID?
>



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

From: Sudhindra Suresh Bengeri <[EMAIL PROTECTED]>
Subject: linux doesn't detect my LNE100TX ethernet card
Date: Tue, 7 Nov 2000 10:08:25 -0500

Hi,

I just isntalled kernel 2.2.17 hoping that it would have support for my
LinkSys LNE100TX Fast Ethernet Adapter. But is didn't.

I tried 2 things:
1. I found the code for the linksys pci cards in 
/usr/src/linux/drivers/net/tulip.c, it was also compiled during make. I
copied the tulip.o to the /lib/modules/2.2.17/net

But /sbin/depmod -a <- did not find it, I tried to force it to look for in
that dir by including the following in /etc/modules.conf
path[net]=/lib/modules/2.2.17/net

even this did not work.

2. I downloaded tulip.c/kern_compat.h as directed by the driver disk that
came along with the ethernet card. This could not be compiled. From the
error messages it looked like the code with accessing non existant members
of a struct or some like that.

Pls. lemme know what should I do next??

TIA.

Regards,
Sudhin.

****************** Sudhindra Suresh Bengeri ********************
Graduate Research Assistant   | Home:                          |
to Dr. George N. Rouskas      | 2110, Gorman St.,              |
Dept. of Computer Science,    | Raleigh, NC - 27606            |
NCSU, Raleigh, NC 27606       | Ph. (919) 852-1961             |
My web projection: http://www4.ncsu.edu/~ssbenger



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

From: Sudhindra Suresh Bengeri <[EMAIL PROTECTED]>
Subject: doesn't recognize sound card
Date: Tue, 7 Nov 2000 10:10:15 -0500

Hi,

I have a MSI694D motherboard (VIA chipset) with a on-board sound card: 
Sound blaster/Direct Sound AC97 Audio.

I am running redhat version 7.0, kernel 2.2.17
While configuring the kernel (make xconfig) I had enabled the 
OSS/Audio and the Sound blaster options. The kernel did include the 
ac97.c. However it does not recognize the card.

Any suggestions??

TIA.

Regards,
Sudhin.

****************** Sudhindra Suresh Bengeri ********************
Graduate Research Assistant   | Home:                          |
to Dr. George N. Rouskas      | 2110, Gorman St.,              |
Dept. of Computer Science,    | Raleigh, NC - 27606            |
NCSU, Raleigh, NC 27606       | Ph. (919) 852-1961             |
My web projection: http://www4.ncsu.edu/~ssbenger


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

From: "Ildar Gabdullin" <[EMAIL PROTECTED]>
Subject: Files on NFS
Date: Wed, 8 Nov 2000 16:24:51 +0300

Hello, all.

How I can determine whether the file reside on NFS or not ?

Any help very appreciated.

Ildar.




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

From: moonie;) <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.hardware,alt.linux,comp.os.linux.misc
Subject: Re: Software RAID
Date: Wed, 8 Nov 2000 08:46:44 -0500

On Wed, 08 Nov 2000, U. Siegel wrote:
>Hi folks,
>anybody out there having experience with Software-RAID?

I do.  I have RAID 0 striped set up across 2 drives.  First drive reports
19.5mb/s and second reports 23mb/s under hdparm.  My RAID arrays report 38mb/s.
 I am impressed with the speed increase, netscape opens in 3 seconds!
--
moonie ;)

Registered Linux User #175104
   http://counter.li.org

KDE2
Kernel 2.4.0-test5
XFree86 4.0 Nvidia .94 drivers
RAID 0 Striped
Test-Pilots-R-Us ;)


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

From: Ron Grigg <[EMAIL PROTECTED]>
Crossposted-To: 
comp.os.linux,comp.os.linux.development,comp.os.linux.development.apps,comp.os.linux.portable
Subject: Re: Linux engineers wanted
Date: Wed, 08 Nov 2000 07:54:44 -0600


If you're just looking for "locally based" why are you broadcasting your post to
the
world?  You'll probably catch a lot of heat over this...

-Ron Grigg

HR wrote:

> First of all, our apology if these type of postings are not allowed here..
>
> Stream2Go, Inc. (www.stream2go.com), a startup company based in Orange
> County, California offers total mobile wireless intranet solutions for the
> corporate enterprise customers.  We develop advanced mobile wireless
> applications based on embedded Linux OS as a mobile platform.  We were
> founded by former AT&T Wireless & IBM engineers.
>
> We're currently looking for locally based (LA, OC, & San Diego) Linux / Unix
> engineers in all levels & skill sets -
>
> Positions - Directors, Managers, & Engineers (entry, mid, senior)
> Salary & Benefits - industry competitive benefits & salary, including
> relocation
> Skills - Linux / Unix / C / C++, Wireless (HW and/or SW), TCP/IP, WAN/LAN
> Design, software development, applications development, Embedded systems
>
> We offer generous stock options and fun working environment.  If you're
> interested please send your resume via email to [EMAIL PROTECTED]
>
> Stream2Go, Inc.
> 1 Centerpointe Dr.
> Suite 320
> La Palma, CA 90623
> 714-736-1760 main
> 714-736-1769 fax


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

From: [EMAIL PROTECTED] (Lee Allen)
Crossposted-To: comp.os.linux.hardware,alt.linux,comp.os.linux.misc
Subject: Re: Software RAID
Reply-To: [EMAIL PROTECTED]
Date: Wed, 08 Nov 2000 14:12:52 GMT

On Wed, 08 Nov 2000 13:34:06 +0100, "U. Siegel"
<[EMAIL PROTECTED]> wrote:

>Hi folks,
>anybody out there having experience with Software-RAID?
>

I have been configuring & testing software RAID for a couple weeks
now.  Using RAID-1 (mirroring), performance and recoverability are
excellent.  Using RAID-5 (though not for the /boot or / filesystems) I
am having a problem, if drive 0 is removed the system won't mount the
RAID-5 filesystem.  Working on that with RedHat at the moment.

Someone advised not to use software RAID.  As CPU speeds increase,
this advice is less and less valid.  With a fast CPU, the performance
penalty of software RAID can sink below zero.  Because the CPU may be
faster than the processor on a [hardware RAID] RAID controller, the
RAID controller's processor could actually become the system
bottleneck.

Two bits of advice:
1. After installing RAID, test it, by disconnecting drives ONE AT A
TIME, while the system is powered off.
2. You will notice that after a drive is removed and replaced, the
system does not immediately put it online.  You must (a) partition the
drive identically to the drive that was replaced (obviously you don't
have to do this if you have just disconnected and reconnected the
drive as a test) and then (b) use 'raidhotadd' to add the drive back
into the RAID array.

-Lee Allen

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

From: "Geoff Winkless" <[EMAIL PROTECTED]>
Subject: ipc - key_t ...
Date: Wed, 8 Nov 2000 14:20:18 -0000

Can someone shed some light on what's happening?

key_t is defined as int in posix_types.h and types.h

My understanding of ansi is that "int" implies a signed int

My C code calls msgget(0xffe0ffe0), which for some reason appears to work -
ipcs returns a queue with that key.

Should the msgget call not fail?

When I use perl and do the same msgget() call it fails. If I modify perl's
doio.c to cast within perl to an unsigned int the msgget call succeeds. This
would imply that the kernel is actually handling keys as unsigned ints...

What gives???

Any input appreciated, I'm way out of my depth here.

Cheers

Geoff



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

From: [EMAIL PROTECTED] (Grant Edwards)
Crossposted-To: comp.os.linux.development.apps
Subject: Re: non-portable port
Date: Wed, 08 Nov 2000 14:56:54 GMT

In article <IL4O5.134328$[EMAIL PROTECTED]>, [EMAIL PROTECTED] wrote:

>I do remember there being some _appallingly_ slow rendering of text on
>Sun 2's when running in console mode; that was, of course, when Sun
>2's were considered reasonably powerful :-).

Sun 3's and 4's also had text console code that displayed at
about 300 buad.  When you booted Linux on a Sun4 the Linux
console mode was about 100X faster than the Sun ROM console
mode.  I've heard that there were ROM updates available with
a faster console mode, but nobody really cared.

-- 
Grant Edwards                   grante             Yow!  Yow! And then we
                                  at               could sit on the hoods of
                               visi.com            cars at stop lights!

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

From: MESMEUR Philippe <[EMAIL PROTECTED]>
Subject: Re: harddisk and partitions
Date: Wed, 08 Nov 2000 16:09:17 +0100



Josef Moellers wrote:
> 
> MESMEUR Philippe wrote:
> >
> > Philip Armstrong wrote:
> > >
> > > In article <[EMAIL PROTECTED]>, Tux  <[EMAIL PROTECTED]> wrote:
> > > >MESMEUR Philippe wrote:
> > > >> Hello, I'm looking for a way to get the list of the hard-drives an the
> > > >> list for all the partitions in each hard-disk. I think the is a system
> > > >> call to to this.
> > > >What about "fdisk -l" ?
> > >
> > > Or cat /proc/partitions ?
> >
> > yes but I would like a function to do this (if there isn't, I
> > will code it)
> 
> ??? You want to write a function to retrieve information which is
> already there ???
> Hey, this is Linux, not any other OS!
>

I want to write a C-Program that needs to know all hard-disk on the
current system and all partitions in each hard-disk;
I can write a function that reads /proc/partitions or maybe, if it
exists, I can use a function that does the same.

Sorry if it was not clear.
thanks to answer me

> --
> Josef M�llers (Pinguinpfleger bei FSC)
>         If failure had no penalty success would not be a prize (T.  Pratchett)

-- 

========================================================
                Oce-Industries SA
                1, rue Jean Lemoine
                94015 Creteil cedex France                
                phone: 33-1-48988000  fax: 33-1-48985450
========================================================

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

From: denis martinez <[EMAIL PROTECTED]>
Subject: How to catch stdout of an application ?
Date: Wed, 08 Nov 2000 16:29:20 +0100

Hi all,

I have an application wich display messages warning/status using stdout.
This application is lunched in background when i start up my linux
system, so the messages are not visible for me when i log in a new
cession.
I there any way , to "catch/get" all this messages from a new cession ?.
I know of course the process id of my application, and i use only stdout
to print my messages.

Any help or suggestion will welcome.

Thank's in advance
Denis.

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

From: denis martinez <[EMAIL PROTECTED]>
Subject: Re: How to catch stdout of an application ?
Date: Wed, 08 Nov 2000 16:35:30 +0100

denis martinez a �crit :
> 
> Hi all,
> 
> I have an application wich display messages warning/status using stdout.
> This application is lunched in background when i start up my linux

is "launched" of course !! (excuse my bad english)

> system, so the messages are not visible for me when i log in a new
> cession.
> I there any way , to "catch/get" all this messages from a new cession ?.
> I know of course the process id of my application, and i use only stdout
> to print my messages.
> 
> Any help or suggestion will welcome.
> 
> Thank's in advance
> Denis.

-- 
Denis MARTINEZ <[EMAIL PROTECTED]>
R&D Engineer at Sofrel Telecontrol
Phone +33(0)4 92 08 43 24  Fax +33(0)4 92 08 43 19

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

From: patrick <[EMAIL PROTECTED]>
Subject: Runtime file size modifying
Date: Wed, 08 Nov 2000 16:41:00 +0100
Reply-To: [EMAIL PROTECTED]

Hello every body,
   Do you know how to reduce the size of a growing file?
Does the C function "truncate" work correctly for such
opened file?
   Pat



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

From: Josef Moellers <[EMAIL PROTECTED]>
Subject: Re: How to catch stdout of an application ?
Date: Wed, 08 Nov 2000 16:45:46 +0100

denis martinez wrote:
> =

> Hi all,
> =

> I have an application wich display messages warning/status using stdout=
=2E
> This application is lunched in background when i start up my linux
> system, so the messages are not visible for me when i log in a new
> cession.
> I there any way , to "catch/get" all this messages from a new cession ?=
=2E
> I know of course the process id of my application, and i use only stdou=
t
> to print my messages.

The only means is to redirect the output into a file when the program is
launched.
Then, after lunch (yes, I read your f'up), you can digest the output.

-- =

Josef M=F6llers (Pinguinpfleger bei FSC)
        If failure had no penalty success would not be a prize (T.  Pratchett)

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

From: "Z" <[EMAIL PROTECTED]>
Subject: Re: Runtime file size modifying
Date: Wed, 08 Nov 2000 16:53:23 +0100

Once upon a while "patrick" <[EMAIL PROTECTED]> wrote:

> Hello every body,
>    Do you know how to reduce the size of a growing file?
> Does the C function "truncate" work correctly for such opened file?
>    Pat
> 
> 

Hello Pat,

It depends on how you want to reduce the size of the file.
If you simply want to cut of the back from a file like 
hte head unix command does, you can simply use truncate().
But since it is a growing file (I assume some log file)
it is likly that you want to tail the file. Which means
you want to keep the newest entries in the file but throw
away the oldest.
There is no simple way to do this with just one function
in C, so you have to open the old file lseek to the
location up to where you want to cut of and than start
copying lines to a temporary file up to the end of the
old file. When you finish copying you close both files
and use rename() to move the temporary file over the old
one. That should be the job.

        Z



-- 
LISP is worth learning for the profound enlightenment experience you 
will have when you finally get it; that experience will make you a 
better programmer for the rest of your days.         Eric S. Raymond

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


** 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.system) 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-System Digest
******************************

Reply via email to