Linux-Development-Sys Digest #11, Volume #8      Tue, 11 Jul 00 12:13:16 EDT

Contents:
  Re: sizeof() in gcc (cLIeNUX user)
  Re: question about /proc file system (Mathias Waack)
  SysV semaphores (Evert Carton)
  Re: linux:Unresolved symbol using 'insmod sg' (Daniel Wagner)
  file descriptor limitation on linux ("S�bastien Le Fustec")
  Re: Ethertap Devices ([EMAIL PROTECTED])
  Re: Why Does Linux Arp All The Time? ([EMAIL PROTECTED])
  nfsd and knfsd problems in 2.2.16 ([EMAIL PROTECTED])
  Re: URGENT: NFS Mount RedHat 6.2 from Solaris ("Barry P. Evans")
  Re: 2.4.0test2 and pppd (Johan Kullstam)
  Re: Raw disk access on Linux ([EMAIL PROTECTED])
  Re: How to port MSVC++ app to Linux? (David Weis)
  Re: SysV semaphores ("Lawrence K. Chen, P.Eng.")
  Re: file descriptor limitation on linux ("Lawrence K. Chen, P.Eng.")

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

From: [EMAIL PROTECTED] (cLIeNUX user)
Crossposted-To: comp.os.linux.development.apps
Subject: Re: sizeof() in gcc
Date: 11 Jul 2000 08:26:27 GMT

[EMAIL PROTECTED] 
>
>Kaz Kylheku <[EMAIL PROTECTED]> wrote in message
>news:[EMAIL PROTECTED]...
>> On Mon, 10 Jul 2000 16:37:15 GMT, Norm Dresner <[EMAIL PROTECTED]> wrote:
>> >I'm getting a "parse error" on the (simplified) line
>> >    #if    ( sizeof(int) ) != 4
>> >
>> >Is this really illegal?
>>
>> Yes. The ANSI C preprocessor expression syntax does not have the sizeof
>> operator.
>>
>> >Is there any other way to do size comparisons in the pre-processor?
>>
>> No. One solution is not to write code which has dependencies on the
>> representation of data types.
>>
>> The other is to simply do the comparison using an ordinary selection
>statement.
>> If the compiler is any good, it will remove the unreachable code.
>>
>
>I truth, in the original -- unsimplified -- file, the sizeof() operator was
>used (in Borland C) to verify that two different data structures would, when
>combined in any order, yield the same memory layout, i.e. that two different
>ways of setting up the FIFOs in a communications channel would ultimately
>take the same space so the memory could be pre-allocated and the user could
>dynamically define the channel's characteristics.
>
>There are obviously many other ways to perform the same check, but we felt
>that doing this at compile-time would make the system the most robust
>against unintentional changes later.  I agree that sizeof() is a C-operator,
>but when the Borland-C implementation had it I thought (obviously
>incorrectly) that I could also use it in the Linux version.
>
>    Norm
>
>

Also of note, the Plan9 C compiler specifically chooses to not support #if
at all. Thompson, Ritchie et al now feel that #if is a mis-feature.

Rick Hohensee
[EMAIL PROTECTED] 

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

From: Mathias Waack <[EMAIL PROTECTED]>
Subject: Re: question about /proc file system
Date: 11 Jul 2000 10:06:14 +0200

"Duke Lee" <[EMAIL PROTECTED]> writes:

> Hello, I am implmenting a device driver that is composed of both user
> process and kernel module.  I have to exchange information between the
> kernel process and the user process.  Someone from this newsgroup
> kindly told me that /proc file system is written out whenever some
> process tries to read from it.  I have implemented the folling polling
> function:
> 
> struct wait_queue * procfs_wait = NULL; static unsigned int
> procfs_poll(struct file *file, poll_table *wait) {
>     poll_wait(file, &procfs_wait, wait);
>     if (data4user == 1)
>         return POLLIN | POLLRDNORM
>     else
>         return 0; }
> 
> but the problem is that my user process is never waken up becuase no
> process tries to read from it.  My question is if it is possible to
> flush the data from the kernel side so that /proc files are written
> out?  Or is there some other solution?  Thank you for your help.

I'm afraid I don't understand your problem. Which event toggles your 
data4user switch? The code looks good and should work. 

Mathias

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

From: Evert Carton <[EMAIL PROTECTED]>
Subject: SysV semaphores
Date: Tue, 11 Jul 2000 08:40:35 GMT

Hi All,

I'm having these troubles on SysV semaphores under Linux, kernel 2.2.15
(standard RedHat build).on a genuine Intel PIII ( if the latter really
matters ...)
>From what I read about the implementation of Posix semaphores, I guess I
won't even try those.

Since nothing seemed to work, I tried the most simple program

#include <unistd.h>
#include <stdlib.h>
#include <stdio.h>
#include <sys/types.h>
#include <sys/ipc.h>
#include <sys/sem.h>

int main() {

int semid;

semid=semget((key_t)1234,1,0660 | IPC_CREAT);

printf ("Semaphore identifier : %d\n",semid)

return();
}

Cannot be simpler than this, I presume.
Unfortunately, the identifier returned is 0 (zero).
I guess thats where things screw up.

perror gives "Success.".

Running exactly the same code on a HP-UX-box runs fine. I get a valid
identifier.
But I really need the code running on the Linux box.

What am I doing wrong here ? Or does it mean that my kernel does not
fully support semaphores ?
How can I find out ?

Regards,

Please help.

Evert Carton
Development/System Engineer
[EMAIL PROTECTED]


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

Crossposted-To: 
comp.os.linux.advocacy,comp.os.linux.development.apps,comp.os.linux.hardware
Subject: Re: linux:Unresolved symbol using 'insmod sg'
From: Daniel Wagner <[EMAIL PROTECTED]>
Date: 11 Jul 2000 12:49:23 +0200

Carlos Villegas <[EMAIL PROTECTED]> writes:

> My goal is to have the 'sg module' load automatically.
> 
> As root I typed:  'insmod sg'
> And I got this:
> Using /lib/modules/2.2.14/scsi/sg.o
> /lib/modules/2.2.14/scsi/sg.o: unresolved symbol
> is_reg_chrdev
> 
> How can I get the sg module to load automatically given the above
> obsticle?

It's better when you use 'modprobe <module>' instead of insmod,
because modprobe loads all the modules on which the the module to load
depends.

If you want to load modules automatically you should edit your
/etc/modules.conf.

hth, Daniel
-- 
The mome rath isn't born that could outgrabe me.
                -- Nicol Williamson

@icq: 41472160 (kwaxi)                      @counter.li: #65688
@www: http://www.pfeilheim.sth.ac.at/members/d.wagner/
@gpg: http://www.pfeilheim.sth.ac.at/members/d.wagner/kwaxi.asc
      C63A 06F0 3E2A A039 E830  83A0 C1DA 3479 803F 078F

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

From: "S�bastien Le Fustec" <[EMAIL PROTECTED]>
Subject: file descriptor limitation on linux
Date: Tue, 11 Jul 2000 12:17:48 +0200

We are developping a socket application using the select directive.
On Red Hat Linux , Anyone knows the max number of file descriptor we can
open simultaneously.

it is possible to increase this number ?

Sincerely,
S�bastien Le Fustec



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

From: [EMAIL PROTECTED]
Crossposted-To: 
comp.os.linux.networking,comp.os.linux.development.apps,comp.os.linux.misc
Subject: Re: Ethertap Devices
Date: Tue, 11 Jul 2000 11:05:17 GMT

In comp.os.linux.development.system Tim Godfrey <[EMAIL PROTECTED]> wrote:
|> Do you have this option compiled into your kernel?
|> 
|> Kernel/User netlink socket (CONFIG_NETLINK) [Y/n/?] ?
|> 
|
| Yes indeed I do...

Are you loading anything by module?  Or have you compiled everything into
the kernel directly like I do?  If you compile everything in, could you
maybe send me a copy of your kernel .config file?  I could see exactly
what is different between yours and mine and see if any differences
suggest to me something that could be a problem.


| I have also tried opening /dev/tap0 as O_RDWR.
|
| Really stumped....

Has me stumped, too ... except that when I get stumped on my own machines
I'm usually trying a whole lot of things quite rapidly to see if anything
even sheds clues.

Focusing on the fact that your message says a resource is busy, I would
wonder if something opened the /dev/tap0 device.  I can see that on my
own machine:

root@izar:/root 483> lsof -n | fgrep tap
readpacke 21835 root    3u   CHR      36,16                8213 /dev/tap0
root@izar:/root 484>

You probably already looked around for anything like that, even though most
likely you have nothing that could have opened it.

I might look around deeper in the netlink device handling code to see what
kinds of things it could be testing for busy conditions and checking to see
if those conditions might exist.  In the mean time, you might want to give
a shot at seeing if my little readpacket program will by some chance make
a difference.  You can grab it at:  http://phil.ipal.org/readpacket.tar.gz
It was something I used to do some testing of ethertap to see what I get
out, and I got stuff like:

root@izar:/root 517> ifconfig tap0
tap0      Link encap:Ethernet  HWaddr FE:FD:00:00:00:00
          inet addr:10.1.1.1  Bcast:10.1.255.255  Mask:255.255.0.0
          UP BROADCAST RUNNING NOARP MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:36 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0


root@izar:/root 518> route add -host 10.2.3.4 gw 10.1.1.1
root@izar:/root 519> ( ( sleep 4 ; date | sock -u 10.2.3.4 4660 ) & )
root@izar:/root 520> /root/readpacket
======================================== 73 bytes
01000000 00000000 fefd0000 00000800 45000039 9e840000 4011c428 0a010101
0a020304 04011234 00252e4f 54756520 4a756c20 31312030 353a3539 3a333920
43445420 32303030 0a

root@izar:/root 521>

-- 
| Phil Howard - KA9WGN | My current websites: linuxhomepage.com, ham.org
| phil  (at)  ipal.net +----------------------------------------------------
| Dallas - Texas - USA | [EMAIL PROTECTED]

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

From: [EMAIL PROTECTED]
Subject: Re: Why Does Linux Arp All The Time?
Date: Tue, 11 Jul 2000 11:17:39 GMT

On Tue, 11 Jul 2000 06:50:05 GMT Kaz Kylheku <[EMAIL PROTECTED]> wrote:

| On Mon, 10 Jul 2000 22:35:22 -0700, David Highley
| <[EMAIL PROTECTED]> wrote:
|>Snooping the net has shown that Linux seems to be a noisy network
|>neighbor ARPing all the time.   Is there a way to disable this?  Kind
|>of reminds me of Windows behavior.
|
| You have to substantiate your finding a little more; do you know that
| these requests are not necessary?  ARP is needed to discover the MAC adress of
| a peer. The results of an ARP query are cached for some time to prevent too
| much ``arping''. I believe the expiry is 30 seconds?

I would prefer the ARP logic work a little differently.  Maybe if I get up
enough motive I might go hack the change.  The way I might try changing it
would be:

1.  Record an expiration flag in each ARP entry.
2.  After 60 seconds of inactivity mark the entry expired.
3.  After 5 minutes of activity mark the entry expired.
4.  When an ARP lookup gets an expired entry, broadcast the ARP request,
    but go ahead and use the expired entry for now.
5.  If the ARP response is received, replace the ARP table entry, and
    clear the expired flag.
6.  If the expired entry is still expired after 20 seconds remove it from
    the ARP table.

-- 
| Phil Howard - KA9WGN | My current websites: linuxhomepage.com, ham.org
| phil  (at)  ipal.net +----------------------------------------------------
| Dallas - Texas - USA | [EMAIL PROTECTED]

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

From: [EMAIL PROTECTED]
Subject: nfsd and knfsd problems in 2.2.16
Date: 11 Jul 2000 00:17:03 GMT

Does anyone know what is going on with knfsd in recent 2.2 kernels?  I'll be darned if 
I can get nfsd
working with 2.2.16; any attempt to start it gets me an error with "nfssvc".  I use a 
copy of 2.2.12
source and compiled it and that version seems to run nfsd fine...

Hugh

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

From: "Barry P. Evans" <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.networking,alt.linux,linux.redhat
Subject: Re: URGENT: NFS Mount RedHat 6.2 from Solaris
Date: Tue, 11 Jul 2000 07:48:22 -0400

THANKS TO ALL THAT REPLIED, THIS ISSUE HAS BEEN RESOLVED.

Well we got it working!

We applied some patches (actually VA Linux did that for us) and then
we added the following options to the sun boxen in /etc/exports file:
   (rw,insecure,insecure_locks)
and now the Sun boxes mount our Linux nfs drives!

Once again, all is peaceful and good in the world.

BTW: we had a great time playing with mounting the drives via Samba.  We
actually got it to work fairly well, but it didn't maintain the individual

users rights - though we were hot on the heels of a scheme that might have

actually made that work as well (we just figured we better get back to
work
on the real problem!)

Now for some fine tuning of the speed parameters.  I'm told that using
rsize=8192,wsize=8129 in our mount options may lead to some spectacular
increases in speed...  We'll soon see!

Barry Evans wrote:

> We recently upgraded from Red Hat 4.2 to VA/Red Hat 6.2 (kernel
> 2.2.14?) and can no longer NFS mount the linux drive from our other
> UNIX (Solaris, AIX & HPUX) boxes.   It appears that the new kernel NFS
> daemon does not work with anything other than other Linux boxes.
>
> Has anyone found a workaround to this issue or alternate means of
> exporting file systems between other UNIX* and linux?  Smbmount is not
> an option. (Filesystem must be read+writeable by users)
>
> Thanks,
> BP


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

From: Johan Kullstam <[EMAIL PROTECTED]>
Subject: Re: 2.4.0test2 and pppd
Date: 11 Jul 2000 09:51:20 -0400

"[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes:

> No need to act haughty. I keep that in my email fields because some
> sites steal the info from your browser and it pisses me off.

what does a browser have to do with usenet? ;-)

no need to insult the world.  just get junkbuster.

<URL:http://www.junkbusters.com>

run browser of your choice through junkbuster proxy (works in unix,
linux *and* windows).  have it strip outgoing info to protect your
privacy.  have it strip incomming ads to protect your sanity.

-- 
johan kullstam l72t00052

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

From: [EMAIL PROTECTED]
Subject: Re: Raw disk access on Linux
Date: Tue, 11 Jul 2000 16:17:20 +0200

Marc SCHAEFER wrote:
> 
> Christopher Browne <[EMAIL PROTECTED]> wrote:
> : Stephen Tweedy apparently has a patch to allow creating accesses for
> : block devices that _don't_ cache.  You may want to look at one of the
> 
> I think this is now standard in 2.2.x (and if not, in 2.4.x). You need
> a special program to create instances of raw devices (a bit like
> loop devices for the file system mount).
> 
> E.g.
> 
>    make_it_appear_raw /dev/raw0 /dev/hda

It's e.g. already include in RedHat 6.2 and probably also
in other distributions. On RedHat 6.2 e.g. you can use
the command

    /usr/bin/raw /dev/raw/raw1 /dev/hdc1

to setup the raw device "/dev/raw/raw1" for the
associated block device "/dev/hdc1".

Gerhard

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

From: David Weis <[EMAIL PROTECTED]>
Subject: Re: How to port MSVC++ app to Linux?
Date: Tue, 11 Jul 2000 10:06:24 -0500


On Tue, 11 Jul 2000, Pjtg0707 wrote:
> On Mon, 10 Jul 2000 17:56:41 -0500, Dima Maziuk <[EMAIL PROTECTED]> wrote:
> >Gene Montgomery <[EMAIL PROTECTED]> wrote:
> >>       I would appreciate hearing any tips regarding porting MS-dependent code
> >> to the Linux/GNU world, or a steer to a web site with such information.
> >If it's a gooey app I'm afraid you should consider rolling your own.
> >MSVC++ tends to put app logic code into UI; MFC was not designed with
> >portability in mind (IMO when they designed MFC the mind wasn't there 
> >at all). You may well spend the rest of your life just trying to find
> >model, view & controller in MSVC/MFC app. Then you'll need to re-write
> >the view (UI) part and port model & controller parts. Writing a new 
> >program will probably take much less time and effort. :(
> >YMMV, of course.
> 
> Can't that be said of pretty much of OOP in general? Unless you have
> the classes on the platforms you intend to port to, the OOP advantage
> just isn't there anymore. Perhaps Microsoft may one day decide to 
> port MFC 
> to Linux; we will then have all the Microsoft apps we can handle!
                              ************************************

I have that now, it's 0.

david

-- 
David Weis                | 10520 New York Ave, Des Moines, IA 50322
[EMAIL PROTECTED]      | Voice 515-278-0133 Ext 231
                          | http://www.perfectionlearning.com/
When they took the Fourth Amendment, I was quiet because I didn't deal drugs.
When they took the Fifth Amendment, I was quiet because I was innocent.
When they took the Second Amendment, I was quiet because I didn't own a gun.
Now they've taken the First Amendment and I can't say anything.


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

From: "Lawrence K. Chen, P.Eng." <[EMAIL PROTECTED]>
Subject: Re: SysV semaphores
Date: Tue, 11 Jul 2000 11:10:19 -0400

Why is 0 a problem?  It just happens that some system process on an HP already
created a semaphore set with an ID of 0, so you can't have that ID.  But,
there are no preexisting semaphores on a Linux box.  And the initial value for
sem_seq is 0, so the first time you get a semaphore on a fresh system....it'll
have an ID of 0.

Evert Carton wrote:
> 
> Hi All,
> 
> I'm having these troubles on SysV semaphores under Linux, kernel 2.2.15
> (standard RedHat build).on a genuine Intel PIII ( if the latter really
> matters ...)
> From what I read about the implementation of Posix semaphores, I guess I
> won't even try those.
> 
> Since nothing seemed to work, I tried the most simple program
> 
> #include <unistd.h>
> #include <stdlib.h>
> #include <stdio.h>
> #include <sys/types.h>
> #include <sys/ipc.h>
> #include <sys/sem.h>
> 
> int main() {
> 
> int semid;
> 
> semid=semget((key_t)1234,1,0660 | IPC_CREAT);
> 
> printf ("Semaphore identifier : %d\n",semid)
> 
> return();
> }
> 
> Cannot be simpler than this, I presume.
> Unfortunately, the identifier returned is 0 (zero).
> I guess thats where things screw up.
> 
> perror gives "Success.".
> 
> Running exactly the same code on a HP-UX-box runs fine. I get a valid
> identifier.
> But I really need the code running on the Linux box.
> 
> What am I doing wrong here ? Or does it mean that my kernel does not
> fully support semaphores ?
> How can I find out ?
> 
> Regards,
> 
> Please help.
> 
> Evert Carton
> Development/System Engineer
> [EMAIL PROTECTED]

-- 
    Who: Lawrence Chen, P.Eng.          Email: [EMAIL PROTECTED]
   What: Software Developer               URL: http://www.opentext.com/basis
  Where: Open Text, BASIS Division      Phone: 614-761-7449
         5080 Tuttle Crossing Blvd.       Fax: 614-761-7269
         M/S 7&8
         Dublin, OH  43016                ICQ: 12129673
  DISCLAIMER: All opinions expressed are mine and *NOT* my employers

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

From: "Lawrence K. Chen, P.Eng." <[EMAIL PROTECTED]>
Subject: Re: file descriptor limitation on linux
Date: Tue, 11 Jul 2000 11:12:13 -0400

If memory serves...the limit is 1024.  And, I haven't found a way to get over
this yet....I've been trying (including fiddling with kernel builds and
such).  Since I have an application that I'm porting to Linux that wants up to
2048 open files.

"S�bastien Le Fustec" wrote:
> 
> We are developping a socket application using the select directive.
> On Red Hat Linux , Anyone knows the max number of file descriptor we can
> open simultaneously.
> 
> it is possible to increase this number ?
> 
> Sincerely,
> S�bastien Le Fustec

-- 
    Who: Lawrence Chen, P.Eng.          Email: [EMAIL PROTECTED]
   What: Software Developer               URL: http://www.opentext.com/basis
  Where: Open Text, BASIS Division      Phone: 614-761-7449
         5080 Tuttle Crossing Blvd.       Fax: 614-761-7269
         M/S 7&8
         Dublin, OH  43016                ICQ: 12129673
  DISCLAIMER: All opinions expressed are mine and *NOT* my employers

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


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