Linux-Development-Sys Digest #768, Volume #7     Thu, 13 Apr 00 21:13:17 EDT

Contents:
  Re: is linux 2.3 available? ("J. C.")
  understand system calls ! ("denis.chmielewski")
  Re: Getting IP address of self in C? ("John Smith")
  Going postal over "lp: no devices found" ("Steven R. Robertson")
  Re: GUS PnP and Linux 2.2+ (Toby Haynes)
  Re: understand system calls ! (Kaz Kylheku)
  Re: Getting IP address of self in C? ([EMAIL PROTECTED])
  Re: Idea !!! (Johan Kullstam)
  Re: Going postal over "lp: no devices found" (Juergen Heinzl)
  Re: SEND_FD ioctl? (Juergen Heinzl)
  Re: Idea !!! ("Larry Ebbitt ")
  Re: Color faxing s/w? (H. Peter Anvin)
  Re: To core or not to core - You tell me (Mark McIntyre)
  Re: Cheap/Free alternatives to Hummingbird eXceed (Victor Wagner)
  Re: To core or not to core - You tell me (Mark McIntyre)
  reliable coredump under Linux? (Haihong Wang)
  Re: reliable coredump under Linux? (Kaz Kylheku)
  Win32 Drivers running under Linux ("David Findlay")
  Re: To core or not to core - You tell me (Kaz Kylheku)

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

From: "J. C." <[EMAIL PROTECTED]>
Subject: Re: is linux 2.3 available?
Date: Thu, 13 Apr 2000 18:37:01 GMT

In article <8d510l$3ou$[EMAIL PROTECTED]>, Yung-Hsiang Lu
<[EMAIL PROTECTED]> wrote:

: I got a (experimental) package and it requires linux kernel 2.3.  I
: have seen some discussion about kernel 2.3 but I could not find it!
: The latest version I found was 2.2.14 from redhat and slackware.  Can
: anybody help me figure out where to find 2.3?  Is it stable enough to


<http://www.kernel.org> has the latest and greatest sources.  It's
currently in version 2.3.99-pre5, just a pubic hair away from being 2.4
--

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

From: "denis.chmielewski" <[EMAIL PROTECTED]>
Subject: understand system calls !
Date: Thu, 13 Apr 2000 20:32:12 +0200

hello everybody,

I am studying the system call mechanism and I don't understand.
To explain my problem, let's take the fopen example :

in the kernel sources, I found a function sys_open(...) in the file
/fs/open.c
from the glibc sources, I found the file fopen.c

I suppose that starting from fopen.c we should arrive to sys_open(..),
probably through an interrupt somewhere to switch into kernel mode.

well, from fopen.c, I found a call to __stdio_open(...) that is in the
file /glibc/sysdeps/generic/sysd-stdio.c

in __stdio_open( ...) there is a call to __open(...) and here is what I
don't understand. I found a few implementation of __open(...) in glibc,
but none of them seem to bring me any further. They contain only few
lines of code, mainly calls to va_list(...), va_arg(...) ...

Can anybody help me please ? and what are va_list(...), ...

thank you !




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

From: "John Smith" <[EMAIL PROTECTED]>
Subject: Re: Getting IP address of self in C?
Date: Thu, 13 Apr 2000 14:16:37 -0500

You can create a socket with INADDR_ANY as adress,
and the machines's IP will be binded .

> >create a socket, and read ip from socket structure
>
> >[EMAIL PROTECTED] wrote in message ...
> >>> How can I get my IP address from C?
>
> Have you tried this, top-poster? You'd have to bind the socket to an
> address first; the machine may have several interfaces with different
> IP addresses. When you bind the socket to an address the local address
> becomes bound to the IP address of the interface through which the
> packets will travel (it's probably more complicated inside, but
> that's the principle anyway).
>
> Nick.
> --
> Pacific Internet                  SP4   Fax: +61-2-9233-6545 Voice:
9253-5762
> G.P.O. Box 3400, Sydney NSW 1043        http://www.zeta.org.au/



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

From: "Steven R. Robertson" <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux
Subject: Going postal over "lp: no devices found"
Date: Thu, 13 Apr 2000 12:12:58 -0700

I'm trying to get my printer recognized by a Linux system I'm building
from scratch.
I keep getting "lp: no devices found" I've compiled parallel port
support into the 
kernel (2.2.14). I've also tried appending parport=0x378, parport=auto
and lp=parport0 and lp=auto and various combinations thereof to my Lilo
configuration and still no luck
 When  I reboot the same machine back to my SuSe system the printer
works fine.
I've read parport text in the kernel source docs but I must be missing
something.
Any one have any ideas before I go postal?

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

From: Toby Haynes <[EMAIL PROTECTED]>
Subject: Re: GUS PnP and Linux 2.2+
Date: 13 Apr 2000 15:32:30 -0400

!! "Steve" ==   <[EMAIL PROTECTED]> writes:

  Steve> I am having a problem getting the kernel to recognize my GUS
  Steve> PnP.  Under kernal 2.0.38 using isapnp it worked fine. Also,
  Steve> using the commercial OSS driver it does work, but not all
  Steve> that well.  For example, the mixer won't control the mic
  Steve> input volume.

  Steve> Specifically, following the
  Steve> linux/Documentation/sound/ultrasound documentation I get the
  Steve> following error:

  Steve> /lib/modules/2.2.14/misc/gus.o: init_module: Device or
  Steve> resource busy

  Steve> when I try to load the sound module.

This is a long shot, since I don't have a GUS card, but is your PnP OS
enabled in your BIOS? If it is, boot your machine into it's BIOS
configuration utility (check your machine manual for how to do this)
and turn it off. Then try again - it's possible you are ending up with
some device contention. I've seen this sort of error message when
trying to set up my Aureal card under Linux and the PnP OS had to be
off before it went away.

Cheers,
Toby Haynes

-- 

Toby Haynes
The views and opinions expressed in this message are my own, and do
not necessarily reflect those of IBM Canada.

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

From: [EMAIL PROTECTED] (Kaz Kylheku)
Subject: Re: understand system calls !
Reply-To: [EMAIL PROTECTED]
Date: Thu, 13 Apr 2000 19:51:59 GMT

On Thu, 13 Apr 2000 20:32:12 +0200, denis.chmielewski <[EMAIL PROTECTED]>
wrote:
>
>in __stdio_open( ...) there is a call to __open(...) and here is what I
>don't understand. I found a few implementation of __open(...) in glibc,
>but none of them seem to bring me any further. They contain only few
>lines of code, mainly calls to va_list(...), va_arg(...) ...

This is a glibc question rather than a kernel question. ;)

The system call stubs in glibc are machine generated, so you are wasting
your time looking for hand written source code.

Probably the easiest way to look at them is to just diassemble your libc with
objdump -d. They are assembly language anyway, so little meaning is lost by
looking at them this way.

-- 
#exclude <windows.h>

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

From: [EMAIL PROTECTED]
Subject: Re: Getting IP address of self in C?
Date: Thu, 13 Apr 2000 20:09:39 GMT

On Fri, 31 Mar 2000 04:22:53 GMT Kaz Kylheku <[EMAIL PROTECTED]> wrote:
| On Fri, 31 Mar 2000 01:27:56 GMT, Pete Cavender <[EMAIL PROTECTED]> wrote:
|>Hi-
|>
|>How can I get my IP address from C?  I used to use gethostid() but with
|>newer kernels that doesn't seem to work...I can run ifconfig and dig
|>through the text and look for it, bu there has to be a C way...  Thanks!
|
| You might not be aware of this, but it's possible for a machine to have many IP
| addresses. This is true even if it only has one network adapter, thanks to IP
| aliasing. So you may have to rethink your problem.

What what _is_ the official way for a C program to get all the addresses
of all the interfaces?

-- 
| Phil Howard - KA9WGN | My current boycotts: Amazon.Com, DVDs, Mattel, Sony
| [EMAIL PROTECTED] +----------------------------------------------------
| Dallas - Texas - USA | My current websites: linuxhomepage.com, ham.org

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

From: Johan Kullstam <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.hardware
Subject: Re: Idea !!!
Date: 13 Apr 2000 16:12:27 -0400

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

> On Tue, 11 Apr 2000 12:44:32 -0500, Akbar Avliyaev wrote:
> 
> >I'm thinking about making a way to use windows drivers in Linux.
> >Have anyone thought about it?
> >Is it reasonable/possible?
> 
> The programming interfaces are quite different.  They would have
> to be rewritten.  If the hardware manufacturer will give you specs,
> that's quite reasonable, if not, you would have to reverse-
> engineer them and that is probably not legal.

reverse-engineering of hardware certainly *is* legal.

-- 
johan kullstam l72t00052

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

From: [EMAIL PROTECTED] (Juergen Heinzl)
Crossposted-To: comp.os.linux
Subject: Re: Going postal over "lp: no devices found"
Date: Thu, 13 Apr 2000 20:29:35 GMT

In article <[EMAIL PROTECTED]>, Steven R. Robertson wrote:
>I'm trying to get my printer recognized by a Linux system I'm building
>from scratch.
>I keep getting "lp: no devices found" I've compiled parallel port
>support into the 
>kernel (2.2.14). I've also tried appending parport=0x378, parport=auto
>and lp=parport0 and lp=auto and various combinations thereof to my Lilo
>configuration and still no luck
> When  I reboot the same machine back to my SuSe system the printer
>works fine.
>I've read parport text in the kernel source docs but I must be missing
>something.
>Any one have any ideas before I go postal?
[...]

You did not tell us the output of dmesg, so I shall start with that
one ...
parport0: PC-style at 0x378 (0x778), irq 7 [SPP,ECP,ECPPS2]
... or something similar ought to show up.

You might see /usr/src/linux/.config too, it is the one generated
for the last kernel compilation. Just presuming it is an Intel
PC ...
CONFIG_PARPORT=y
CONFIG_PARPORT_PC=y
CONFIG_PARIDE_PARPORT=y
... and on this machine I disabled Plug & Pray support.

My lilo entry for the parallel port is ...
        append = "parport=0x378,7"
... say 08/15 values, not using interrupts 7 and 5 for additional,
serial interfaces or something similar. All just to possibly exclude
problems with the lower level configuration.

Ta',
Juergen

-- 
\ Real name     : J�rgen Heinzl                 \       no flames      /
 \ EMail Private : [EMAIL PROTECTED] \ send money instead /

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

From: [EMAIL PROTECTED] (Juergen Heinzl)
Subject: Re: SEND_FD ioctl?
Date: Thu, 13 Apr 2000 20:29:36 GMT

In article <[EMAIL PROTECTED]>, Konstantinos Agouros wrote:
>Hi,
>
>I recently came across the need to pass a fd from one process to another.
>"Advanced programming in the Unix environment" gave me an answer with an
>ioctl called sendfd. I searched /usr/include and /usr/src/linux and didn't
>find it. Does this thing exist in Linux or how do I emulate this behaviour?
[...]

ioctl()'s are `somewhat' system dependent and using sendmsg() / recvmsg()
is a more common method. It depends on the current kernel and libc versions
though and might not be possible at all.

See "UNIX Network Programming I", W. Richard Stevens for an exhaustive
example a./o. get the example code from http://www.kohala.com/start/

Get the book even so, volume II too.

Cheers,
Juergen

-- 
\ Real name     : J�rgen Heinzl                 \       no flames      /
 \ EMail Private : [EMAIL PROTECTED] \ send money instead /

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

Crossposted-To: comp.os.linux.hardware
From: "Larry Ebbitt " <[EMAIL PROTECTED]>
Date: Thu, 13 Apr 2000 17:34:20 -0400 (EDT)
Reply-To: "Larry Ebbitt" <[EMAIL PROTECTED]>
Subject: Re: Idea !!!

On 13 Apr 2000 16:12:27 -0400, Johan Kullstam wrote:

>
>reverse-engineering of hardware certainly *is* legal.

Perhaps, but disassembly usually is in violation of
code licenses.  Windos drivers are often so buggy as
to make it a waste of time, anyway.


Larry - Atlanta - IBM Global Services



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

From: [EMAIL PROTECTED] (H. Peter Anvin)
Crossposted-To: comp.os.linux.development.apps
Subject: Re: Color faxing s/w?
Reply-To: [EMAIL PROTECTED] (H. Peter Anvin)
Date: 13 Apr 2000 14:58:18 -0700

Followup to:  <upJI4.59641$[EMAIL PROTECTED]>
By author:    "Spehro Pefhany" <[EMAIL PROTECTED]>
In newsgroup: comp.os.linux.development.system
< 
> The Japanese have had color faxes for some time, and I'm vaguely aware of
> an extension to the fax standard that allows Postscript faxes to be sent
> in the native format, provided both ends agree on the feasibility after
> the connection is made, but I think mailing the file as an attachment is
> the best way these days (or just put it on an ftp site for the recipient
> to pull it down from). 
> 

PDF via email is definitely the way to go for high-quality portable
image sending.  It's trivial to turn this into a "fax machine" by
having a specific email address to send to.

(You don't want high-resolution images sent via modem, which is what
fax machines are: scanner, modem, printer.)

        -hpa
-- 
<[EMAIL PROTECTED]> at work, <[EMAIL PROTECTED]> in private!
"Unix gives you enough rope to shoot yourself in the foot."

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

From: Mark McIntyre <[EMAIL PROTECTED]>
Crossposted-To: comp.lang.c,comp.unix.solaris,comp.lang.c++,comp.unix.programmer
Subject: Re: To core or not to core - You tell me
Date: Fri, 14 Apr 2000 00:05:54 +0100
Reply-To: [EMAIL PROTECTED]

On 12 Apr 2000 17:59:12 -0400, [EMAIL PROTECTED] (Paul D. Smith)
wrote:

>%% Mark McIntyre <[EMAIL PROTECTED]> writes:
>
>  mm>  "An integer constant expression with  the  value  0,  or
>  mm>        such  an  expression  cast  to type void *, is called a null
>  mm>        pointer constant."
>
>  mm> This says that either its (int)0
>
>Since we're picking nits, (int)0 is not an integer constant.  You mean
>just 0 (or 0L or 0U or 0UL).

The problem is, when trying to define whether NULL is zero or not, its
not helpful to define it in terms of integers, since its not one
(necessarily). By saying (int)0 I was using shorthand for "an integer
constant with value 0" whereas (void*)(int)0 meant "such an experssoin
cast to type void*". 

If you [refer, I can say (const int)0 and (void*)(const int)0


Mark McIntyre

C- FAQ: http://www.eskimo.com/~scs/C-faq/top.html

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

From: [EMAIL PROTECTED] (Victor Wagner)
Crossposted-To: comp.os.linux.development,comp.os.linux.misc
Subject: Re: Cheap/Free alternatives to Hummingbird eXceed
Date: 13 Apr 2000 08:56:49 +0400

In comp.os.linux.misc Gast Primus <[EMAIL PROTECTED]> wrote:
: Hi

: I have been testing an evaluation copy of exceed but my boss says it's too
: expensive and telnet sessions are next to useless for what we want to do.
: Does anybody know of a cheap / free alternative to exceed bearing in mind I
: really only want xterms.

Try TeraTerm or Putty. 
Both are free telnet/ssh clients.
Putty emulates xterm type of terminal.
Teraterm either emulates vt220 or lets you install special terminfo
entry, but it also supports tektronics graphics, i.e. programs like
gnuplot or dvigt would be able to show something graphical.

Of course, colors, proper box drawing, mouse support etc,etc.



-- 
� ������ ������ ������������ ������ ������ ��-������.
                                --- �.�. ���

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

From: Mark McIntyre <[EMAIL PROTECTED]>
Crossposted-To: comp.lang.c,comp.unix.solaris,comp.lang.c++,comp.unix.programmer
Subject: Re: To core or not to core - You tell me
Date: Fri, 14 Apr 2000 00:08:23 +0100
Reply-To: [EMAIL PROTECTED]

On Wed, 12 Apr 2000 15:33:17 -0700, Erik Max Francis <[EMAIL PROTECTED]>
wrote:

>Mark McIntyre wrote:
>
>> Agreed. I'm talking about NULL, the macro which 6.3.2.3 and 7.17 in
>> the ANSI/ISO C standard defines as the null pointer constant.
>
>But you said "the bit pattern of NULL," which doesn't make sense,
>because NULL is a macro.  Macros don't have bit patterns.  

But the macro preprocesses out to a value. And that value is either an
integer 0 or such an expression cast to a void*. This value is
represented in memory by some bitpattern.

>What you mean
>is the bit pattern representation of the _null pointer_, which is
>specified by a null pointer constant -- either 0 in a pointer context or
>(void *) 0 -- and which, incidentally, the NULL _macro_ is defined as. 
>But NULL itself doesn't have a bit pattern.

Nit picking a la creme!

>The reason people are replying to correct you is not that you are
>totally wrong, it's just that you're using sloppy terminology.  All the
>people who are presently participating in this thread are saying
>precisely the same thing, we're just at the nitpick level now.

Yup. Its healthy if you're a chimp though, so why not for us? Consider
it a form of complimentary grooming...
Mark McIntyre

C- FAQ: http://www.eskimo.com/~scs/C-faq/top.html

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

From: Haihong Wang <[EMAIL PROTECTED]>
Subject: reliable coredump under Linux?
Date: Thu, 13 Apr 2000 16:23:07 -0700

Hi, I am currently annoyed by the coredump behavior for multithread
(standard pthread lib) program under Linux. Sometime, when the program
crashes, it does not produce any core file. Sometimes, it coredumps -
but the core file is not what I want. Apparently the core contains
thread context that is not the culprit. And the core file does not have
information of all threads that are running at the time of crash.
The running environment is just fine for coredump - no core file limit,
not setpid/setgid problem, no access right problem... In other words,
the programs coredumps fine if it is a single threaded program.
What is the problem involved? Is there a limitation in Linux that
prohibits reliable coredumps for pthread program? Or is there a trick
that I should do to overcome that?
Thanks.

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

From: [EMAIL PROTECTED] (Kaz Kylheku)
Subject: Re: reliable coredump under Linux?
Reply-To: [EMAIL PROTECTED]
Date: Fri, 14 Apr 2000 00:54:57 GMT

On Thu, 13 Apr 2000 16:23:07 -0700, Haihong Wang <[EMAIL PROTECTED]> wrote:
>Hi, I am currently annoyed by the coredump behavior for multithread
>(standard pthread lib) program under Linux. Sometime, when the program
>crashes, it does not produce any core file. Sometimes, it coredumps -
>but the core file is not what I want. Apparently the core contains
>thread context that is not the culprit. And the core file does not have
>information of all threads that are running at the time of crash.

There was a discussion about this in the libc-alpha mailing list earlier
this month. In one of the postings, I offer an explanation what is going on.
A developer by the name of George T. Talbot follows up by doing some
experimental tweaking in the kernel, with some success.

Here is what I wrote. You can dig out the rest of the discussion
at http://sourceware.cygnus.com/glibc/  . There are links to HTML-ized
mailing list archives.

#>To: "George T. Talbot" <george at moberg dot com>
#>Subject: Re: Coredumps and pthreads on Linux w/glibc?
#>From: Kaz Kylheku <kaz at ashi dot footprints dot net>
#>Date: Tue, 4 Apr 2000 14:58:06 -0700 (PDT)
#>cc: libc-alpha at sourceware dot cygnus dot com
#>
#>On Tue, 4 Apr 2000, George T. Talbot wrote:
#>
#> Date: Tue, 04 Apr 2000 14:45:40 -0400
#> From: George T. Talbot <[EMAIL PROTECTED]>
#> To: [EMAIL PROTECTED]
#> Subject: Coredumps and pthreads on Linux w/glibc?
#>
#> I'm running glibc 2.1.3 on x86 Linux (Kernel 2.2.14 SMP).  Can anyone tell me
#> why this program will not dump core when it segfaults?  I've set ulimit -c
#> unlimited, and if I comment-out pthread_create(), the program will dump core.
#
#
#The ELF coredump logic in the kernel prevents this. What happens is that
#the kernel checks the reference count on the memory map of the thread.
#It only generates a core dump if the reference count is 1.
#
#Thus in order to get a core dump from a LinuxThreads application, a thread
#which received the core-generating signal must pass through the core dump
#function after all other threads have released their memory maps.
#
#So basically, whether you get a core dump or not is the result of a lottery.
#
#You can patch your kernel to defeat this check.

-- 
#exclude <windows.h>

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

From: "David Findlay" <[EMAIL PROTECTED]>
Subject: Win32 Drivers running under Linux
Date: Fri, 14 Apr 2000 11:06:24 +1000

Seeing that there are virtually no drivers for linux by manufacturers, would
it be possible to use Wine to run Win32 drivers under Linux. It might not be
the best thing to do, but it would avoid hardware non-compatablility issues.

David Findaly



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

From: [EMAIL PROTECTED] (Kaz Kylheku)
Crossposted-To: comp.lang.c,comp.unix.solaris,comp.lang.c++,comp.unix.programmer
Subject: Re: To core or not to core - You tell me
Reply-To: [EMAIL PROTECTED]
Date: Fri, 14 Apr 2000 01:02:17 GMT

On Fri, 14 Apr 2000 00:08:23 +0100, Mark McIntyre <[EMAIL PROTECTED]>
wrote:
>On Wed, 12 Apr 2000 15:33:17 -0700, Erik Max Francis <[EMAIL PROTECTED]>
>wrote:
>
>>Mark McIntyre wrote:
>>
>>> Agreed. I'm talking about NULL, the macro which 6.3.2.3 and 7.17 in
>>> the ANSI/ISO C standard defines as the null pointer constant.
>>
>>But you said "the bit pattern of NULL," which doesn't make sense,
>>because NULL is a macro.  Macros don't have bit patterns.  
>
>But the macro preprocesses out to a value. And that value is either an
>integer 0 or such an expression cast to a void*. This value is
>represented in memory by some bitpattern.

Read my other posting about this. The value of an expression is not
necessarily represented in memory.

That is why an expression like:

    &3

is invalid. An expression that is not an l-value doesn't refer to an object.
In the abstract semantics of C, it is a data object which has a representation.
Something that is not a data object doesn't have a representation.

Many compilers generate code which manipulates values in a form that is
quite different from their representation in memory. For example, it's
not atypical for an 8 bit signed char value to be sign extended and 
loaded into a 32 bit register. But this internal form is not visible
to the programmer.

A null pointer constant may be assigned to a pointer object. When that happens,
that object acquires a null pointer value which is characteristic of the
machine architecture and perhaps the pointer's type.

Not all expressions involving null pointer constants even require an explicit
value to be generated! For example, a given compiler for a given architecture
may take a selection test like:

    if (ptr == 0) ...

and turn it into some machine sequence that *implicitly* tests for zero: for
example, load the value into a register and then perform a branch based on the
state of a processor flag which indicates that a zero value was loaded.   You
can look in vain for a representation of the zero constant in such a machine
sequence.

-- 
#exclude <windows.h>

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


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