Linux-Development-Sys Digest #982, Volume #7     Thu, 29 Jun 00 01:13:10 EDT

Contents:
  Re: nonblocking gethostbyname? (Damir Cosic)
  SO_BINDTODEVICE on 2.2.14 (Damir Cosic)
  Re: Checking socket status (c/c++) (Kaz Kylheku)
  Re: read(2) error EINTR (H. Peter Anvin)
  Problem sending file descriptor using sendmsg/recvmsg ([EMAIL PROTECTED])
  Re: Confirm this bug: CodeWarrior does not support spaces in paths? (Dima Maziuk)
  Linker errors (Timothy Sorrentino)
  copy_to_user Linux-2.2.12 (Richard Bonomo)
  Kernel 2.2.16 "kernel panic, no init found", kernel 2.2.12, no problem (Peter 
Mardahl)
  Re: read(2) error EINTR ([EMAIL PROTECTED])
  Re: running remote untrusted code (jepler epler)
  Re: Confirm this bug: CodeWarrior does not support spaces in paths? (Roger Shawl)
  Re: Linker errors (David Weis)
  Re: Good Basic compiler for linux? ("cdaniel")
  a better process kill ([EMAIL PROTECTED])
  Re: Problem sending file descriptor using sendmsg/recvmsg (Mario Klebsch)
  Developing Device Drivers ("Martin Klingensmith")
  Re: Kernel 2.2.16 "kernel panic, no init found", kernel 2.2.12, no problem 
([EMAIL PROTECTED])

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

From: Damir Cosic <[EMAIL PROTECTED]>
Subject: Re: nonblocking gethostbyname?
Date: Wed, 28 Jun 2000 12:18:47 -0600


I received following response on my email
address, so in case anybody else has
similar problems:


> You are looking for a name resolving library (DNS). 
> Try the adns library from GNU (www.gnu.org)
>
> Basile STARYNKEVITCH

Thanks everybody for help.

Damir

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

From: Damir Cosic <[EMAIL PROTECTED]>
Subject: SO_BINDTODEVICE on 2.2.14
Date: Wed, 28 Jun 2000 12:27:40 -0600


I really need functionality that this option
provides, but I found out it's not supported
after kernel 2.1. Do you know if there is
replacement and what is it?

Damir

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

From: [EMAIL PROTECTED] (Kaz Kylheku)
Crossposted-To: comp.os.linux.development
Subject: Re: Checking socket status (c/c++)
Reply-To: [EMAIL PROTECTED]
Date: Wed, 28 Jun 2000 18:39:56 GMT

On Wed, 28 Jun 2000 10:36:00 -0700, Bhavin Shah <[EMAIL PROTECTED]> wrote:
[ Please don't mail me replies that you also post to Usenet without including a
  notice that this is being done. ]
>Thanks, but one more thing.  If the send is within a thread, I'm 
>assuming that the thread can switch in the middle of the send w/o
>locks or anything.

The send takes place in the kernel which has proper locking mechanisms to
ensure the safety of concurrent operations on the same socket descriptor.

> My question is when the thread switches back to
>where it left off in the send and the connection got broken in between 
>the switching, will the send(upon switching back to the thread) still
>catch the broken connection?

You'd have to read the kernel code to see the details. Either the send
will return the number of bytes it was able to queue before the connection
broke, or it will return an error.

-- 
#exclude <windows.h>

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

From: H. Peter Anvin <[EMAIL PROTECTED]>
Subject: Re: read(2) error EINTR
Date: 28 Jun 2000 11:10:54 -0700

Followup to:  <kwf45.293$[EMAIL PROTECTED]>
By author:    [EMAIL PROTECTED]
In newsgroup: comp.os.linux.development.system
> 
> The SunOS thing is annoying. However, Linux, *BSD, and possibly others
> default to restarting system calls if you use signal() rather than
> sigaction(). I think the confusion about my statement of system calls
> being restarted by default on most modern implementation is that I was
> refering only to signal() and not sigaction().
> 

Linux doesn't, unless you compile with __BSD_SOURCE.

        -hpa
-- 
<[EMAIL PROTECTED]> at work, <[EMAIL PROTECTED]> in private!
"Unix gives you enough rope to shoot yourself in the foot."
http://www.zytor.com/~hpa/puzzle.txt

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

From: [EMAIL PROTECTED]
Subject: Problem sending file descriptor using sendmsg/recvmsg
Date: Wed, 28 Jun 2000 19:44:36 GMT

I am trying to pass a file descriptor between two processes. I am using
the UNIX domain stream connection client and server code in the 4.4BSD
IPC Tutorial (pages 20-21) and Richard Stevens read_fd/write_fd
functions from Unix Network Programming 2nd Ed. Vol. 1 (Chap. 14).

My sendmsg appears to work, but I get an EINVAL (Invalid Argument)
error returned by recvmsg.

I've tried sending dummy data using the iov and no file descriptor, but
I get the same error.

I'm using RedHat 6.2 and the GNUPro Dev Kit (2.9).

I can include code if needed, but it really is just the two examples
shown above.

Any suggestions?

Thanks

Chris Bechtol
[EMAIL PROTECTED]



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

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

From: Dima Maziuk <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.development.apps
Subject: Re: Confirm this bug: CodeWarrior does not support spaces in paths?
Date: Wed, 28 Jun 2000 14:41:29 -0500

Roger Shawl wrote:
> 
... snip ...
> To then imply that it is fundamentally ignorant or stupid to expect tools to handle
> legal OS filenames suggests a different origin for the ignorance: that of the
> user-hostile (i.e. "you're a goofball") community of programmers perpetuating the
> assumption that no "reasonable" user - and, again, I *AM* a *USER* in this context
> - would ever use the full range of OS legal filenames available to them. I'm sorry,
> but expecting users to behave "reasonably" is not "reasonable."

Evidently you never used VB5 on NT. When you pass it a legal path,
eg. "c:\Program Files\foo" on command line (note the double-quotes are
part of the argument) it's split into 2 arguments: ``"c:\Program'' &
``Fies\foo"''. Expecting your development tool to behave "reasonably" 
is not "reasonable". Sad, eh? 
...user-hostile community of programmers with headquarters in Redmond...

my $.02

Dima
--
I'm not crazy. I've just been in a very bad mood for 30 years.
==============================================================
Prickle-Prickle, 33 Confusion 3166, 155:2:4 (1)

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

From: Timothy Sorrentino <[EMAIL PROTECTED]>
Subject: Linker errors
Date: Wed, 28 Jun 2000 19:50:22 GMT

Sorry for asking such a newbie question but I'm still new to Linux and
driver development.  Here's my problem, I've gotten my driver to compile
successfully, but I get a whole bunch of errors from the linker:

gcc -o tmdriver.o tmdriver.c -D__KERNEL__ -O2

/usr/lib/crt1.o(.text+0x18): undefined reference to `main'
/tmp/ccerSq4o.o: In function `remap_pci_mem':
/tmp/ccerSq4o.o(.text+0x1f): undefined reference to `__ioremap'
/tmp/ccerSq4o.o(.text+0x34): undefined reference to `printk'
/tmp/ccerSq4o.o: In function `unmap_pci_mem':
/tmp/ccerSq4o.o(.text+0x60): undefined reference to `iounmap'
/tmp/ccerSq4o.o(.text+0x6e): undefined reference to `printk'
/tmp/ccerSq4o.o: In function `register_PCI':
/tmp/ccerSq4o.o(.text+0x92): undefined reference to
`pci_read_config_dword'....

You get the idea.  If I just compile the driver with the same command
with a -c added and then try to insmod,
insmod simply says 'Segmentation Fault'.
Any ideas on how to finish the driver?  Is it a problem with not
including a library or is there still an error in my code?

TIA,
Tim


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

From: Richard Bonomo <[EMAIL PROTECTED]>
Subject: copy_to_user Linux-2.2.12
Date: Wed, 28 Jun 2000 15:01:38 -0500


Hello!
I am writing a device driver, and have not
yet been able to fathom how the system
call copy_to_user is supposed to be called.

Is it copy_to_user(pointer to kernel buffer,
pointer to user buffer, # of bytes) or is
it something else.

Sad to say, I have not been able to divine
this from examining the code in uaccess.h.
I am afraid I am not sufficiently familiar
with Intel assembler...

Thanks!

(please address a reply to [EMAIL PROTECTED])

Rich

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

From: [EMAIL PROTECTED] (Peter Mardahl)
Subject: Kernel 2.2.16 "kernel panic, no init found", kernel 2.2.12, no problem
Date: 28 Jun 2000 21:04:25 GMT

Kernel 2.2.12-20smp will boot up fine as will other 2.2.12smp kernels
I have compiled for my RedHat 6.1 box.

However, on trying to compile my own new 2.2.16smp kernel,
I get this error:
Kernel panic: No init found, Try passing init=option to kernel

 I've also tried booting with
init=/sbin/init root=/dev/sda1

My new 2.2.16smp kernel has ext2 support, SCSI support both for hard disks
and for the Adaptec controller, and boot messages indicate that these
devices are recognized OK and that the partitions are seen(sda1 sda2 sda3
sda4)

Here is lilo.conf:  "linuxold" and "linux-up" boot, "linux" won't.

boot=/dev/sda
map=/boot/map
install=/boot/boot.b
prompt
timeout=50
default=linux
linear

image=/vmlinuz
    label=linux
    APPEND="ether=0,0,0x30,eth0"
    root=/dev/sda1
    read-only
image=/boot/vmlinuz-2.2.12-20smp
    label=linuxold
    initrd=/boot/initrd-2.2.12-20smp.img
    read-only
    APPEND="ether=0,0,0x30,eth0"
    root=/dev/sda1
image=/boot/vmlinuz-2.2.12-20
    label=linux-up
    initrd=/boot/initrd-2.2.12-20.img
    read-only
    root=/dev/sda1

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

From: [EMAIL PROTECTED]
Subject: Re: read(2) error EINTR
Date: Wed, 28 Jun 2000 22:04:56 GMT

H. Peter Anvin <[EMAIL PROTECTED]> wrote:
>> The SunOS thing is annoying. However, Linux, *BSD, and possibly others
>> default to restarting system calls if you use signal() rather than
>> sigaction(). I think the confusion about my statement of system calls
>> being restarted by default on most modern implementation is that I was
>> refering only to signal() and not sigaction().

> Linux doesn't, unless you compile with __BSD_SOURCE.

I suspect either this is incorrect, or __BSD_SOURCE is incorrectly
turned on in the header files in some cases. I'd have to make time and
peruse the source to be sure, but the original poster _did_ note the
above behavior. Wether or not he defined __BSD_SOURCE himself, I have
no idea.

-- 
Matt Gauthier <[EMAIL PROTECTED]>

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

From: [EMAIL PROTECTED] (jepler epler)
Subject: Re: running remote untrusted code
Date: Wed, 28 Jun 2000 22:34:49 GMT

On Mon, 26 Jun 2000 23:02:40 -0700, Brennan Cheung
 <[EMAIL PROTECTED]> wrote:
>I have have been thinking about what the requirements of this system
>are and they are really pretty high.  Due to the number of processes
>running concurrently there music be a really low context switch for
>task swapping.  The large number of processes also demands that each
>process run as fast as it possibly can.  I am currently looking under
>different opearting systems to see if any other operating systems out
>there meet this requirement.  So far I haven't really found anything
>too promising.  I am thinking that a new operating system will have to
>be build in order to solve this problem.  I'm probably going to start
>playing around with the OSKit again sometime soon.

While it's nothing like as fast as native machine code, Stackless Python
with coroutines have a comparatively fast switch time compared to the switch
time of the traditional Python VM.

And, unlike native machine code, you have a protection model.

Jeff

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

From: Roger Shawl <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.development.apps
Subject: Re: Confirm this bug: CodeWarrior does not support spaces in paths?
Date: Wed, 28 Jun 2000 14:51:35 -0700
Reply-To: [EMAIL PROTECTED]

On Wed, 28 Jun 2000 14:41:29 -0500, Dima Maziuk <[EMAIL PROTECTED]> wrote:

>Roger Shawl wrote:
>> 
>... snip ...
>> To then imply that it is fundamentally ignorant or stupid to expect tools to handle
>> legal OS filenames suggests a different origin for the ignorance: that of the
>> user-hostile (i.e. "you're a goofball") community of programmers perpetuating the
>> assumption that no "reasonable" user - and, again, I *AM* a *USER* in this context
>> - would ever use the full range of OS legal filenames available to them. I'm sorry,
>> but expecting users to behave "reasonably" is not "reasonable."
>
>Evidently you never used VB5 on NT. When you pass it a legal path,
>eg. "c:\Program Files\foo" on command line (note the double-quotes are
>part of the argument) it's split into 2 arguments: ``"c:\Program'' &
>``Fies\foo"''. Expecting your development tool to behave "reasonably" 
>is not "reasonable". Sad, eh? 
>...user-hostile community of programmers with headquarters in Redmond...

I haven't used VB5 on NT, that's true. But I don't believe I ever 
suggested that Windows programmers were immune to this type of behavior
- that's an assumption on your part. I've seen it in many places, this
CW bug just the latest. (How many Win32 programs have I seen that do a
weak job with Win32 server/share syntax, for example?)

So let me be clear: treating the user as if they are stupid and ignorant
(i.e. worthy of being beaten in the parking lot) is arrogance of the
highest order. We should not do this, no matter what platform we are
writing for. Programs should be prepared to accept a wide array of bad
input and handle it appropriately, with error messages that are as helpful
and friendly as we can make them.

Ok, I'm done. I don't want this to get political. Have a nice day all. (and
thanks to those who answered the original question!)

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

From: David Weis <[EMAIL PROTECTED]>
Subject: Re: Linker errors
Date: Wed, 28 Jun 2000 19:08:11 -0500


On Wed, 28 Jun 2000, Timothy Sorrentino wrote:

> Sorry for asking such a newbie question but I'm still new to Linux and
> driver development.  Here's my problem, I've gotten my driver to compile
> successfully, but I get a whole bunch of errors from the linker:
> 
> gcc -o tmdriver.o tmdriver.c -D__KERNEL__ -O2

Try using a command line like
gcc -c -D__KERNEL__ -O2 -o tmdriver.o tmdriver.c

You need the -c because you only want to compile, not link with the C
library.
david

> 
> /usr/lib/crt1.o(.text+0x18): undefined reference to `main'
> /tmp/ccerSq4o.o: In function `remap_pci_mem':
> /tmp/ccerSq4o.o(.text+0x1f): undefined reference to `__ioremap'
> /tmp/ccerSq4o.o(.text+0x34): undefined reference to `printk'
> /tmp/ccerSq4o.o: In function `unmap_pci_mem':
> /tmp/ccerSq4o.o(.text+0x60): undefined reference to `iounmap'
> /tmp/ccerSq4o.o(.text+0x6e): undefined reference to `printk'
> /tmp/ccerSq4o.o: In function `register_PCI':
> /tmp/ccerSq4o.o(.text+0x92): undefined reference to
> `pci_read_config_dword'....
> 
> You get the idea.  If I just compile the driver with the same command
> with a -c added and then try to insmod,
> insmod simply says 'Segmentation Fault'.
> Any ideas on how to finish the driver?  Is it a problem with not
> including a library or is there still an error in my code?
> 
> TIA,
> Tim
> 
> 
> 

-- 
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: "cdaniel" <[EMAIL PROTECTED]>
Subject: Re: Good Basic compiler for linux?
Date: Thu, 29 Jun 2000 04:15:18 GMT

What ever happened to Business Basic, we used to build some nice databases
for the old Fortune *NIX boxes.



"Brian J Luczkiewicz" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]...
> If Basic were a worthwhile enough language that it were actually used for
> linux application development then there would be hundreds of these
> programs...Instead, we have extensively flexible and completely wonderful
> tools for linux such as egcs/gcc,binutils,gdb,etc...and if you really need
an
> interface builder use glade....it's not so bad either....I gave up basic
at 11
> for Assembler and shortly after, C....I tried visual basic and decided
that if
> you an't have source to the compiler, it's not worth using....
>
> Brian
>
>
> dave wrote:
>
> > I manage a small team of VB programmers and I am looking for a Basic
> > Compiler and IDE for Linux. I have seen Xbasic and some others but they
are
> > quite the quality I am looking for. I need a complete commercial package
> > with available support. Anyone know of such a product?
> >
> > thanks
> > [EMAIL PROTECTED]
>



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

From: [EMAIL PROTECTED]
Subject: a better process kill
Date: Thu, 29 Jun 2000 04:26:57 GMT

Having had a hardware failure that led to a hung process, I started to
think again about better ways to handle process kills.  The hardware
was a tape drive that lost an interrupt due to a loose SCSI cable.

There are 2 things I think could be improved:

1.  When a process is kiled with -KILL, this should be so terminal that
    it has no hope of ever running again (should the lost interrupt
    somehow mysteriously re-appear).  What I'd like for -KILL to also
    do to a process is to forcibly close all it's open file descriptors
    that are not actually the blocking ones, including disassociating
    the process with any current directory (e.g. I should be able to
    umount its current directory), and unmapping its program space (so
    I can umount the filesystem it ran from).  Short of the list I/O
    being on a filesystem mounted device, I should be able to get a clean
    unmount and shutdown done.

2.  If a process gets hung while it is in the background, it is still in
    the background.  If it gets hung in the foreground, it is still in
    the foreground.  Even if a process is hung or even -KILL'd, I would
    like to see kill -STOP push it from foreground to background in order
    to release the session it is hung in for other things.  Even ^Z should
    do this if it wasn't specifically trapped for by the process (and the
    -KILL should clear all traps so that would not be the case then anyway).
    This it would cause a process to go from "hung dead foreground" state
    to "hung dead background" state.

Why can't kill -KILL not just flag a process for cleanup, but also take
the process and clear all its relationships that can be cleared so that
even if it can't be removed from the process table (there's that linger
lost interrupt again) yet, it should be "reported dead and gone" to other
processes anyway.

I think things like this would help in areas like being able to put off
a scheduled reboot to clear problems instead of being forced to do them
really soon.  That would allow more cases of letting other long running
programs to finish, getting a clean shutdown of huge databases, doing a
clean unmount of large filesystems (journaling is a good alternative for
this, too), waiting until users have left for the day, etc.

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

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

From: [EMAIL PROTECTED] (Mario Klebsch)
Subject: Re: Problem sending file descriptor using sendmsg/recvmsg
Date: Wed, 28 Jun 2000 22:13:06 +0200

[EMAIL PROTECTED] writes:

>I am trying to pass a file descriptor between two processes. I am using
>the UNIX domain stream connection client and server code in the 4.4BSD
>IPC Tutorial (pages 20-21) and Richard Stevens read_fd/write_fd
>functions from Unix Network Programming 2nd Ed. Vol. 1 (Chap. 14).

>My sendmsg appears to work, but I get an EINVAL (Invalid Argument)
>error returned by recvmsg.

When I have tried descriptor passing on Linux the last time, I found,
that I can use it on unix domain DGRAM sockets, but i was not able to
get my programs to work using unix domain STREAM sockets. :-(

73, Mario
-- 
Mario Klebsch                                           [EMAIL PROTECTED]
PGP-Key available at http://www.klebsch.de/public.key
Fingerprint DSS: EE7C DBCC D9C8 5DC1 D4DB  1483 30CE 9FB2 A047 9CE0
 Diffie-Hellman: D447 4ED6 8A10 2C65 C5E5  8B98 9464 53FF 9382 F518

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

From: "Martin Klingensmith" <[EMAIL PROTECTED]>
Subject: Developing Device Drivers
Date: Thu, 29 Jun 2000 04:46:24 GMT

Hello everyone, I am interested in developing device drivers for linux, the
only reference I have found is the O'Reilley book, is there any
comprehensive online source for figuring out how to interface hardware to
the kernel? Yes, I can browse the source with various online 'navigator'
deals but I am looking for actual information on the subject.
Thanks for any leads

Martin Klingensmith
NNyTech www.nnytech.net



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

From: [EMAIL PROTECTED]
Subject: Re: Kernel 2.2.16 "kernel panic, no init found", kernel 2.2.12, no problem
Date: Thu, 29 Jun 2000 05:01:45 GMT

There aren't very many possible causes remaining as you have apparently
taken the correct steps.  Among the potential causes that remain are:

1.  The ext2 support somehow didn't get compiled into the kernel.
2.  /dev/sda1 is some other filesystem type that isn't compiled in.

I'm sure you'll know how to check if those causes could be involved.


On 28 Jun 2000 21:04:25 GMT Peter Mardahl <[EMAIL PROTECTED]> wrote:

| Kernel 2.2.12-20smp will boot up fine as will other 2.2.12smp kernels
| I have compiled for my RedHat 6.1 box.
|
| However, on trying to compile my own new 2.2.16smp kernel,
| I get this error:
| Kernel panic: No init found, Try passing init=option to kernel
|
|  I've also tried booting with
| init=/sbin/init root=/dev/sda1
|
| My new 2.2.16smp kernel has ext2 support, SCSI support both for hard disks
| and for the Adaptec controller, and boot messages indicate that these
| devices are recognized OK and that the partitions are seen(sda1 sda2 sda3
| sda4)
|
| Here is lilo.conf:  "linuxold" and "linux-up" boot, "linux" won't.
|
| boot=/dev/sda
| map=/boot/map
| install=/boot/boot.b
| prompt
| timeout=50
| default=linux
| linear
|
| image=/vmlinuz
|     label=linux
|     APPEND="ether=0,0,0x30,eth0"
|     root=/dev/sda1
|     read-only
| image=/boot/vmlinuz-2.2.12-20smp
|     label=linuxold
|     initrd=/boot/initrd-2.2.12-20smp.img
|     read-only
|     APPEND="ether=0,0,0x30,eth0"
|     root=/dev/sda1
| image=/boot/vmlinuz-2.2.12-20
|     label=linux-up
|     initrd=/boot/initrd-2.2.12-20.img
|     read-only
|     root=/dev/sda1

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

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


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