Linux-Development-Sys Digest #695, Volume #7     Wed, 22 Mar 00 11:13:20 EST

Contents:
  Help with user space mmap problem... (Robert Nickel)
  System Commander deluxe ("sjcunn")
  Re: poll()ing TCP sockets - when can I expect a POLLHUP? (Casper H.S. Dik - Network 
Security Engineer)
  how use the LLDK ? (philippe Defert)
  compilation problem  ("Stewart Coomb")
  excepitons in signalhandler ("[EMAIL PROTECTED]")
  interrupts and atomicity in drivers (Alan Donovan)
  pthread library not found (albert)
  Re: excepitons in signalhandler (Mathias Waack)
  Re: Compile error with 2.3.99-Pre2 (Mike Dowling)
  Re: excepitons in signalhandler (Alan Donovan)
  large numbers of open sockets (Chris Green)
  Re: pthread library not found ("Peter T. Breuer")
  Re: pthread library not found ("Peter T. Breuer")
  Re: pthread library not found (Anders Larsen)
  Re: how use the LLDK ? (Anders Larsen)
  Re: large numbers of open sockets (Alan Donovan)
  non-blocked signal handlers and SA_NODEFER flag (Noam Koren)
  2.2.x->2.3.x DKI changes (Bill Waddington)
  UART overrun errors (Mats Byggmastar)
  Re: excepitons in signalhandler (Don Waugaman)
  Re: excepitons in signalhandler (Kaz Kylheku)
  Re: pthread library not found (Patrick E. Hughes)
  Re: pthread library not found (Kaz Kylheku)

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

Subject: Help with user space mmap problem...
From: [EMAIL PROTECTED] (Robert Nickel)
Date: Wed, 22 Mar 2000 08:21:07 GMT

I'm trying to port a user space loader program from dos.

I've got it working, almost.  The problem comes when I try to mmap a chunk of 
memory (0xd0000-0xd7fff) and make changes to it.

The card that I'm trying to write to is supposed to rotate in it's 64k map onto 
this 32k map (or even a 16k map from 0xd0000-0xd3fff).

Here's the code that I'm using.  I haven't had much luck finding an example of 
mmap usage, but I'm guessing that the pointer that is returned is accessible as 
a normal array pointer.

Anyway, on with the code:

int memptr;
unsigned char *cardmem;

if((memptr=open("/dev/mem",O_RDWR))<0) {
  //crash and burn
  exit(1);
}

if((cardmem=(unsigned char *) mmap(0,0x7fff,PROT_READ|PROT_WRITE,MAP_PRIVATE, 
memptr,0xd0000))<0) {
  //choke and sputter
  exit(1);
}

*cardmem=0xf3;

//tell card to switch banks

*cardmem=0x69;

//tell card to switch banks back

if (*cardmem!=0xf3) { //choke and puke!
  exit(1);
}

. 
. 
. 

and so on with an munmap at the end.

Thanks in advance.

--Robert

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

From: "sjcunn" <[EMAIL PROTECTED]>
Subject: System Commander deluxe
Date: Wed, 22 Mar 2000 19:12:43 +1000

Help!

I recently began preparing my system to enable me to install linux, ie
partitioning my hard drive.  however during the resizing of a partition I
lost power to my PC. now I cannot get system commander os wizard to run. I
have uninstalled system commander and reformatted my hard drive and reloaded
win 98 and sys. commander but it still comes up with the same fault.  any
help would be appreciated.



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

From: [EMAIL PROTECTED] (Casper H.S. Dik - Network Security Engineer)
Crossposted-To: comp.unix.programmer
Subject: Re: poll()ing TCP sockets - when can I expect a POLLHUP?
Date: 22 Mar 2000 10:43:22 GMT

[[ PLEASE DON'T SEND ME EMAIL COPIES OF POSTINGS ]]

[EMAIL PROTECTED] (Steven Eker) writes:

>Suppose one of my connections is closed from the other end.
>If I set POLLIN in events I expect to see it set in revents so that I
>can get 0 bytes from read() and realize what has happened. Whether
>POLLHUP should be set seems unclear.

POLLHUP can usually never be set on a TCP STREAM; POLLHUP is not a unilateral
shutdown (i.e., EOF) but a complete end of two-way communication (as in
a modem that drops a connection).

>Having experimented I see:

>Linux 2.2.5 fails to set POLLIN but sets POLLHUP.

Bug.

>FreeBSD 3.3 & SunOS 5.7 set POLLIN but not POLLUP (this seems to me to
>be the most sensible behaviour).

Correct behaviour.

>DEC OSF1 V4.0 set both POLLIN and POLLHUP whether or not there are
>still bytes to be read.

POLLHUP can only be generated if the other end has send a RST in
response to a write and perhaps if a shutdown of the write side was
done; POLLHUP when write is still possible is not correct.

Here's what the UNIX98 definition says:

POLLHUP
            The device has been disconnected. This event and POLLOUT
            are mutually exclusive; a stream can never be writable if a
                                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
            hangup has occurred. However, this event and POLLIN,
            POLLRDNORM, POLLRDBAND or POLLPRI are not mutually
            exclusive. This flag is only valid in the revents bitmask;
            it is ignored in the events member.


>My questions:
>(1) what _should_ poll() be doing?

If it sets POLLHUP on a TCP stream, it should only do so if it
has half-closed its end (w/ shutdown) or if a RST was received
after a write.

Casper
--
Expressed in this posting are my opinions.  They are in no way related
to opinions held by my employer, Sun Microsystems.
Statements on Sun products included here are not gospel and may
be fiction rather than truth.

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

From: philippe Defert <[EMAIL PROTECTED]>
Subject: how use the LLDK ?
Date: Wed, 22 Mar 2000 13:12:50 +0100
Reply-To: [EMAIL PROTECTED]

i want use The Linux Drivers Developpemnt Kit of Linux Lab Project
but  it don't work under kernel 2.2.14.
the compilation made some lot of error with all  files from
<linux/....h>


can you help me , please

Philippe Defert
www.vi-services.com


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

From: "Stewart Coomb" <[EMAIL PROTECTED]>
Subject: compilation problem 
Date: Wed, 22 Mar 2000 11:15:29 -0000

undefined reference to `pcibios_present'

could anyone tell me how to solve this error message i'm getting from gcc,
thanks

stewart



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

From: "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
Subject: excepitons in signalhandler
Date: Wed, 22 Mar 2000 12:59:47 +0100


Hi all ! 
I got a problem when i throw an exception in a signalhandler. When i
force a SIGFPE signal the
exception in the signalhandler causes an SIGABRT. When i call the
Signalhandler manuell
everything works fine. The little testprogramm shows my problem. I hope
someone cauld give
me a little hint.  

pls cc your replies to [EMAIL PROTECTED] 
Thx 

#ifdef HAVE_CONFIG_H 
#include <config.h> 
#endif 

#include <iostream.h> 
#include <stdlib.h> 
#include <signal.h> 
  

void ErrorFunc(int Error); 
void SignalHandler(int signo); 

main() 
{   
    signal( SIGFPE,    &SignalHandler ); 
    ErrorFunc(0); 
    ErrorFunc(1); 
} 

void ErrorFunc(int Error) 
{ 
    try 
    { 
        cout << "Error code is " << Error << endl; 

        // force a SIGFPE Signal --> excepition fails 
        int i = 10/0; 

        // manual call of SignalHandler --> excepition works fine 
        //SignalHandler(1); 

        if (Error > 0 ) 
        { 
            throw(Error);        // This statement causes control to
jump 
                                 // to the 'catch' statement 
        } 
        cout << "No Error occoured" << endl; 

    } 
    catch(int n) 
    { 
        cout << "Error number is " << n << endl;; 
    } 
} 

void SignalHandler(int signo) 
{ 
        cout << "In SignalHandler before throw" << endl; 
        throw(99); 
        cout << "In SignalHandler after throw" << endl; 
        exit(1); 
}

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

From: Alan Donovan <[EMAIL PROTECTED]>
Subject: interrupts and atomicity in drivers
Date: Wed, 22 Mar 2000 12:40:14 +0000


Hi, can anyone advise me what the rules are for when I need to disable
interrupts in my modular device driver?  I have some datastructures
shared between top-level driver methods, the interrupt handler and the
bottom half.

I understand that the interrupt handler can access them freely so long
as the interruptible code (top-level methods, bottom half) use
cli()/sti() pairs around access to interrupt-volatile data.

However, I moved most of the work of the interrupt handler into a bottom
half to reduce the amount of time the machine spends with interrupts
disabled, only to find that I must now introduce cli()/sti() around the
whole body of my bottom half, removing any advantage in having a bottom
half at all.

It is true that the bottom half routine does a fairly small amount of
calculation and makes no major calls to the kernel (just printk, I
think), so it should be quick (and perhaps it could all be moved back
into the interrupt handler).

However I may need to introduce a call to schedule() in my BH to do a
long wait. Is it sufficient just to call sti()/cli() around schedule()?

alan

-- 
========================================================================
  Alan Donovan     [EMAIL PROTECTED]    http://www.imerge.co.uk
  Imerge Ltd.      +44 1223 875265

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

From: albert <[EMAIL PROTECTED]>
Subject: pthread library not found
Date: Wed, 22 Mar 2000 07:47:27 -0500

Hi ,
I wrote a small program that uses threads. i included the pthread.h and
when i wanted to compile i used this :
    gcc hello_world.c -o hello_world    -lpthreads

but i got : could not find or open (i don't remember the exact message)
lpthreads

i searched all the disk , no signs of this library. so how can i install
it ? where could i find it? is it on the CD ? i have the Redhat 6.0

thanks in advance .

albert


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

From: Mathias Waack <[EMAIL PROTECTED]>
Subject: Re: excepitons in signalhandler
Date: Wed, 22 Mar 2000 13:49:05 +0100

"[EMAIL PROTECTED]" wrote:
> I got a problem when i throw an exception in a signalhandler. 

You shouldn't do that. Throwing an exception creates a new instance of 
a class and so allocates memory. This is forbidden in a signalhandler. 

A signalhandler is allowed to call only reentrant functions. 

Please consider what happens if your program does a malloc when it receives 
a signal and the signal handler itself tries to malloc some memory...

HTH
        Mathias

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

From: [EMAIL PROTECTED] (Mike Dowling)
Subject: Re: Compile error with 2.3.99-Pre2
Date: 22 Mar 2000 12:51:24 GMT

On 21 Mar 2000 10:30:38 -0500, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>#include <linux/module.h>

That  did the job, but....

ld -m elf_i386 -T /usr/src/linux/arch/i386/vmlinux.lds -e stext
arch/i386/kernel/head.o arch/i386/kernel/init_task.o init/main.o
init/version.o \
        --start-group \
        arch/i386/kernel/kernel.o arch/i386/mm/mm.o kernel/kernel.o
        mm/mm.o fs/fs.o ipc/ipc.o \
        drivers/block/block.a drivers/char/char.o drivers/misc/misc.o
        drivers/net/net.o drivers/parport/parport.a
        drivers/char/drm/drm.o drivers/scsi/scsi.a drivers/cdrom/cdrom.a
        drivers/sound/sounddrivers.o drivers/pci/pci.a drivers/pnp/pnp.o
        drivers/video/video.o \
        net/network.a \
        /usr/src/linux/arch/i386/lib/lib.a /usr/src/linux/lib/lib.a
        /usr/src/linux/arch/i386/lib/lib.a \
        --end-group \
        -o vmlinux
fs/fs.o: In function `msdos_partition':
fs/fs.o(.text+0x1f6c5): undefined reference to `ide_xlate_1024'
fs/fs.o(.text+0x1f6f5): undefined reference to `ide_xlate_1024'
fs/fs.o(.text+0x1f77e): undefined reference to `ide_xlate_1024'
drivers/sound/sounddrivers.o: In function `sb_dsp_unload':
drivers/sound/sounddrivers.o(.text+0x1535): undefined reference to
`sbmixnum'
make: *** [vmlinux] Error 1

Cheers,
Mike

-- 
My email address [EMAIL PROTECTED] above is a valid email address.
It is, in fact, a sendmail alias; the digit 'N' is incremented regularly.
Spammed aliases will be deleted.  Currently, mike[21,22]
are valid.  If email to mikeN bounces, try mikeN+1.

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

From: Alan Donovan <[EMAIL PROTECTED]>
Subject: Re: excepitons in signalhandler
Date: Wed, 22 Mar 2000 12:56:37 +0000

"[EMAIL PROTECTED]" wrote:

> I got a problem when i throw an exception in a signalhandler. When i
> force a SIGFPE signal the [...]

Signals are a bit of a pain in UNIX. You can consider signals to be
running in another thread from your main application: they represent
events truly asynchronous to your process. 

As a result, you cannot guarantee that your program was in a sane state
when the signal occurred. Therefore the number of things you are allowed
to do within a signal handler is very restricted. You are only allowed
to invoke a subset of system calls. You may not allocate memory.

For this reason many experienced programmers advise that the only thing
you do in a signal handler is to set an integer variable of type
sig_atomic_t and then return. The rest of your application must poll
this variable and act accordingly. If you like, use a separate thread to
poll these flags.

alan



-- 
========================================================================
  Alan Donovan     [EMAIL PROTECTED]    http://www.imerge.co.uk
  Imerge Ltd.      +44 1223 875265

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

Subject: large numbers of open sockets
From: Chris Green <[EMAIL PROTECTED]>
Date: 22 Mar 2000 08:59:01 -0500



        Are there going to be any problems with an application
(running on a large linux system w/ lots of ram and processor amd
internet connection bandwidth) that might have something like 50K
simultaneous open stream sockets? Traffic through each socket will be
fairly low, and intermittent. The app would use poll() to wait for
requests, and then dispatch the requests to different threads. I know
I could use some multiplexing scheme w/ udp to get around the huge #
of connections, but there are good reasons to do it with stream
sockets, if practical.

        Posted to this group, because I'm worried about kernel limits,
or severe performance problems.

-- 
Chris Green

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

From: "Peter T. Breuer" <[EMAIL PROTECTED]>
Subject: Re: pthread library not found
Date: 22 Mar 2000 14:08:58 GMT

albert <[EMAIL PROTECTED]> wrote:
: Hi ,
: I wrote a small program that uses threads. i included the pthread.h and
: when i wanted to compile i used this :
:     gcc hello_world.c -o hello_world    -lpthreads

: but i got : could not find or open (i don't remember the exact message)
: lpthreads

: i searched all the disk , no signs of this library. so how can i install
: it ? where could i find it? is it on the CD ? i have the Redhat 6.0

It's libpthreads. Man gcc, for %&&% sake.

  oboe:/usr/oboe/ptb% locate libpthreads
  /usr/lib/old/libpthreads.so
  /usr/lib/old/libpthreads.so.1
  /usr/lib/old/libpthreads.so.1.60.4
  /var/log/packages/libpthreads-1.60.4-1Ada

(hem, well, I don't use them very often :)

And throw away redhat and get something fit for decent company.  Try
corel linux (and then upgrade to debian by choosing every one of the
additional packages by hand :-).


Peter

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

From: "Peter T. Breuer" <[EMAIL PROTECTED]>
Subject: Re: pthread library not found
Date: 22 Mar 2000 14:10:12 GMT

albert <[EMAIL PROTECTED]> wrote:
: Hi ,
: I wrote a small program that uses threads. i included the pthread.h and
: when i wanted to compile i used this :
:     gcc hello_world.c -o hello_world    -lpthreads

: but i got : could not find or open (i don't remember the exact message)
: lpthreads

Actually, now I notice it. you probably meant "-lpthread", no trailing
"s". Or a more recent threads library.

Peter

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

From: Anders Larsen <[EMAIL PROTECTED]>
Subject: Re: pthread library not found
Date: Wed, 22 Mar 2000 15:14:13 +0100

albert wrote:
> 
> I wrote a small program that uses threads. i included the pthread.h and
> when i wanted to compile i used this :
>     gcc hello_world.c -o hello_world    -lpthreads
> 
> but i got : could not find or open (i don't remember the exact message)
> lpthreads

"/usr/bin/ld: cannot open -lpthreads: No such file or directory" ?

> i searched all the disk , no signs of this library. so how can i install
> it ? where could i find it? is it on the CD ? i have the Redhat 6.0

Its called "pthread", not "pthreads", and is installed with the glibc-devel
package (which you probably already have installed).
The actual name on disc is /usr/lib/libpthread.a resp. /usr/lib/libpthread.so

"gcc -ohello_world -lpthread hello_world.c" will do the job.

--
Anders Larsen

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

From: Anders Larsen <[EMAIL PROTECTED]>
Subject: Re: how use the LLDK ?
Date: Wed, 22 Mar 2000 15:17:29 +0100

Philippe Defert wrote:
> 
> i want use The Linux Drivers Developpemnt Kit of Linux Lab Project
> but  it don't work under kernel 2.2.14.
> the compilation made some lot of error with all  files from
> <linux/....h>
> 
> can you help me , please

Sounds as if some kernel headers are not installed
(in /usr/src/linux/include/linux/)

--
Anders Larsen

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

From: Alan Donovan <[EMAIL PROTECTED]>
Subject: Re: large numbers of open sockets
Date: Wed, 22 Mar 2000 14:24:38 +0000

Chris Green wrote:

>  Are there going to be any problems with an application
> (running on a large linux system w/ lots of ram and processor amd
> internet connection bandwidth) that might have something like 50K
> simultaneous open stream sockets? Traffic through each socket will be
> fairly low, and intermittent. The app would use poll() to wait for
> requests, and then dispatch the requests to different threads. I know
> I could use some multiplexing scheme w/ udp to get around the huge #
> of connections, but there are good reasons to do it with stream
> sockets, if practical.


Let me preface what I say with "I'm not an expert, but".  I would be
slightly surprised if it even let you open as many as 50K sockets.
Certainly, poll becomes very inefficient as the number of fds grows,
because it has to do linear array searching, and it ends up hogging the
CPU.  I believe this is the subject of some current kernel-redesign
thinking (e.g. to use completion ports or something); I saw an article
about it recently on the web. Try searching the web.


HTH

alan


-- 
========================================================================
  Alan Donovan     [EMAIL PROTECTED]    http://www.imerge.co.uk
  Imerge Ltd.      +44 1223 875265

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

From: Noam Koren <[EMAIL PROTECTED]>
Subject: non-blocked signal handlers and SA_NODEFER flag
Date: Wed, 22 Mar 2000 16:24:53 +0200

Hi,

I need to write a signal handler which could be called again
while running. I plan to this by not blocking the signal using the
sigaction SA_NODEFER flag.

If anyone used this flag, or has written a non-blocking signal handler I
would like to hear about potential problems with such a handler, and
with using the SA_NODEFER flag.

Also, if you know were I could get more information about this subject
(other than man sigaction and info libc...) please let me know.

Thanks,
Noam

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

From: Bill Waddington <[EMAIL PROTECTED]>
Subject: 2.2.x->2.3.x DKI changes
Date: Wed, 22 Mar 2000 15:31:02 GMT

Hello,

I there somewhere a list of driver/kernel interface changes between 2.2
& 2.3?  I think someone is working on Rubini II, but for now it would be
 sufficient to just have a list of the names of kernel functions and
driver-related structures that have changed.

I am trying to port a 2.2 chaining DMA driver to 2.3.51 and get it
running before adding the kiobuf stuff.  So far I have tripped over
pci_dev and notice that something has changed w/wait queues, but I
suspect that there is more.

Thanks to all,
Bill


--
Bill Waddington
[EMAIL PROTECTED]
[EMAIL PROTECTED]


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

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

From: Mats Byggmastar <[EMAIL PROTECTED]>
Subject: UART overrun errors
Date: Wed, 22 Mar 2000 16:36:30 +0100

Hello,

I'm working with some serial port code and (again) run into problems. 
I open a port (/dev/ttyS0) at 115200 bps. Data is sent/received over
the port at a steady 64 kbit/s. I've also tried using lower speeds. 
However, the port don't seem to be very reliable. As soon as there is 
some disk activity, I immediately receive errors in my data stream. 
Either bytes are lost or random bytes are inserted into the received data 
stream. Checking in /proc/tty/driver/serial I see that a 16550A UART is 
used. I can also see that the errors are registered as overrrun errors.

Does this mean that the interrupt that the 16550A issues isn't served by 
the driver in time and the FIFO gets overwritten?

To eliminate the possibility that I could be picking up external noise
on the null-modem cable I tested the port in loopback, TX pin connected 
to RX pin, with a very short wire. The problem was still there.

Anyone has some ideas what is going on?

I am using Red Hat 6.1


Mats




===========================================
Mats Byggmastar, B.Sc., SW Design Engineer
GSM/GPRS/D-AMPS cellular data testequipment
Moesarc Technology AS, Oslo Norway 
[EMAIL PROTECTED], tel: (+47)22516974

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

From: [EMAIL PROTECTED] (Don Waugaman)
Subject: Re: excepitons in signalhandler
Date: 22 Mar 2000 08:42:46 -0700

In article <[EMAIL PROTECTED]>,
Mathias Waack  <[EMAIL PROTECTED]> wrote:
>"[EMAIL PROTECTED]" wrote:
>> I got a problem when i throw an exception in a signalhandler. 
>
>You shouldn't do that. Throwing an exception creates a new instance of 
>a class and so allocates memory. This is forbidden in a signalhandler. 

The creation of a new class instance in throw need not allocate dynamic
memory.  The compiler/linker may reserve a static section of memory to
hold objects thrown.  This memory must be as large as the largest object
that will be thrown.  A compiler can annote each object file with the
size of the largest object it throws, and then a linker can take the maximum
of the sizes given as the size of the static memory area.  As long as the
object itself does not allocate dynamic memory (virtually a requirement for
an exception object, IMHO) there will be no allocation associated with a
throw().

>A signalhandler is allowed to call only reentrant functions. 
>
>Please consider what happens if your program does a malloc when it receives 
>a signal and the signal handler itself tries to malloc some memory...

Also consider what the program stack looks like while a signal handler is
executing, and how well the stack unwinding code would work on such a stack.
(Not like a normal stack, and not very well.)
-- 
    - Don Waugaman ([EMAIL PROTECTED])    O-             _|_  Will pun
Web Page: http://www.cs.arizona.edu/people/dpw/            |   for food
In the Sonoran Desert, where we say: "It's a dry heat..."  |     <><
Gosh that takes me back... or is it forward?  That's the trouble with
time travel, you never can tell."    -- Doctor Who "Androids of Tara"

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

From: [EMAIL PROTECTED] (Kaz Kylheku)
Subject: Re: excepitons in signalhandler
Reply-To: [EMAIL PROTECTED]
Date: Wed, 22 Mar 2000 15:49:07 GMT

On Wed, 22 Mar 2000 12:59:47 +0100, [EMAIL PROTECTED] <[EMAIL PROTECTED]>
wrote:
>
>Hi all ! 
>I got a problem when i throw an exception in a signalhandler.

Indeed you do. You must not throw C++ exceptions in signal handlers.

>When i
>force a SIGFPE signal the
>exception in the signalhandler causes an SIGABRT. When i call the
>Signalhandler manuell

My guess would be that the exception is unable to scale the slippery surface of
the signal stack, and calls unhandled(). Anything can happen, since the
behavior is not well defined.

C++ exceptions are synchronous. Signals are asynchronous.

Try this:

Use the ANSI C longjmp function to jump out of the signal
handler. (That is not exactly well defined either, but it works on POSIX
systems; POSIX even defines siglongjmp and sigsetjmp specifically for use with
signal handlers---these two are capable of saving and restoring the signal
mask).

Once you catch the longjmp, throw your C++ exception.

-- 
#exclude <windows.h>

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

From: Patrick E. Hughes <[EMAIL PROTECTED]>
Subject: Re: pthread library not found
Date: Wed, 22 Mar 2000 15:59:53 GMT

>I wrote a small program that uses threads. i included the pthread.h and
>when i wanted to compile i used this :
>    gcc hello_world.c -o hello_world    -lpthreads
>
>but i got : could not find or open (i don't remember the exact message)
>lpthreads

Ummm, try -lpthread with no (s).  I believe that it comes with glibc
which you've probably got installed, but couldn't find because you
were hunting the wrong name.



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

From: [EMAIL PROTECTED] (Kaz Kylheku)
Subject: Re: pthread library not found
Reply-To: [EMAIL PROTECTED]
Date: Wed, 22 Mar 2000 16:05:34 GMT

On Wed, 22 Mar 2000 15:59:53 GMT, Patrick E. Hughes <[EMAIL PROTECTED]>
wrote:
>>I wrote a small program that uses threads. i included the pthread.h and
>>when i wanted to compile i used this :
>>    gcc hello_world.c -o hello_world    -lpthreads
>>
>>but i got : could not find or open (i don't remember the exact message)
>>lpthreads
>
>Ummm, try -lpthread with no (s).  I believe that it comes with glibc
>which you've probably got installed, but couldn't find because you
>were hunting the wrong name.

If you are using a recent gcc, just try the -pthread option.  This option sets
up the correct compiler options for making a threaded program. 

That is to say, it adds -D_REENTRANT as well as -lpthread . If you are curious,
you can see the effect if you also specify -v .

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