Linux-Development-Sys Digest #79, Volume #8      Tue, 15 Aug 00 03:13:12 EDT

Contents:
  about mips-linux simulator ("Alpha")
  Re: insmod with new kernel: unresolved symbols (Thomas Berkefeld)
  Re: What is the difference between soft link and hard link? (Lew Pitcher)
  Regarding glibc, optimized functions. (Terje Stoeback)
  Re: Adding a system call dynamically (Tom Roberts)
  Re: Asus A7V + Duron700 (pinson cedric)
  intercepting open/read/close calls (Bernhard Mogens Ege)
  LinuxThreads and waitpid ("Halfdan Ingvarss")
  Re: LinuxThreads and waitpid (Kaz Kylheku)
  EACCES on bind (Bhavin Shah)
  Re: What is the difference between soft link and hard link? (Nix)
  Re: semaphore function semop fails with error EINTR ("charity")

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

From: "Alpha" <[EMAIL PROTECTED]>
Subject: about mips-linux simulator
Date: Mon, 14 Aug 2000 15:31:18 +0800

Hi
    Have any mips-linux simulator can execuse mips-linux binary file?





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

From: [EMAIL PROTECTED] (Thomas Berkefeld)
Subject: Re: insmod with new kernel: unresolved symbols
Date: Mon, 14 Aug 2000 11:18:30 +0200

yes, symbol versioning was on (chosen in menuconfig of the kernel build).

Thomas

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

From: [EMAIL PROTECTED] (Lew Pitcher)
Subject: Re: What is the difference between soft link and hard link?
Reply-To: [EMAIL PROTECTED]
Date: Mon, 14 Aug 2000 12:17:46 GMT

On Sun, 13 Aug 2000 19:13:19 GMT, Kevin Lacquement
<[EMAIL PROTECTED]> wrote:

>Nix wrote:
>> 
>> Kevin Lacquement <[EMAIL PROTECTED]> writes:
>> 
>> > Nix wrote:
>> > >
>> > > No, but .. in / points to / (it is its own parent).
>> > >
>> >
>> > Ahh...the Unix filesystem....where your sister's your cousin and your
>> > father's....yourself.
>> 
>> Heinlein, `All You Zombies'.
>
>You mean that was in a book...I didn't make it up??

One of Heinlein's classic time-travel tales. This one's a first-person
narrative that starts something like "I am an unwed mother" and goes
on from there. As good as "By His Bootstraps", with a twist.


Lew Pitcher
Information Technology Consultant
Toronto Dominion Bank Financial Group

([EMAIL PROTECTED])


(Opinions expressed are my own, not my employer's.)

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

From: Terje Stoeback <[EMAIL PROTECTED]>
Subject: Regarding glibc, optimized functions.
Date: Mon, 14 Aug 2000 14:40:50 +0200
Reply-To: [EMAIL PROTECTED]

Hi,

 I have a simple question regarding glibc. 
 I suspect that the library I am using (came with RH6.2) was compiled
 for i386. If it was, does GCC set pointers to optimized functions for
the  
 architecture upon compilation, or am I stuck with the i386 functions
until 
 I decide to recompile glibc?

--
Terje Stoeback
SW Developer
Screen Media A/S
http://www.screenmedia.no/

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

From: Tom Roberts <[EMAIL PROTECTED]>
Subject: Re: Adding a system call dynamically
Date: Mon, 14 Aug 2000 11:02:44 -0500

James Avery wrote:
> I have a kernel module that installs an interrupt handler which maintains
> some state. Now, I want to communicate this state to userland through a
> system call in this module, [...]
> So the question is: How does one add a system call -- in a module?

I don't think that is very easy. The "usual" way is to provide a simple
interface to a new file in /proc. Your user program then uses 
open/read/close. If you make your file ASCII, it's easy to debug using
cat /proc/myfile.


Tom Roberts     [EMAIL PROTECTED]

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

From: pinson cedric <[EMAIL PROTECTED]>
Subject: Re: Asus A7V + Duron700
Date: Mon, 14 Aug 2000 18:51:44 +0200
Reply-To: [EMAIL PROTECTED]

The Black Goeroe a �crit :

> Hi,
>
> Any1 here have linux running using these two?
> I use kernel 2.2.14 as distributed by RedHat.
> I just tried to install a RH6.2 on it and all went ok,
> but only until I got to reboot to start from it self without the CD that is.
> It didn't want to and gave a general page fault at kernel load, right after
> the message that it was going to disable CPU_ID I believe.
>
> Is there some things I can to do for it to work?
> (Like newer kernel wich recognizes the duron ok, or some compilation
> config?)
>
> Thx

for info i have Asus 7V with duron 600and it work fine with redhat 6.2 ...
search another way the hardware aren't responsable ...

bye


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

Subject: intercepting open/read/close calls
From: Bernhard Mogens Ege <[EMAIL PROTECTED]>
Date: Mon, 14 Aug 2000 17:40:21 GMT

Having a lot of programs reading images that compresses very well, but 
the programs themself do not support compression/decompression and
often also cannot have the image be fed through a pipe, I am seeking
another way to add file deccompression to these programs.

I have toyed a little with the --wrap option for ld, and it is sort of 
working. The problem is that I have to implement a lot of function
calls, such as fgets, fscanf and fread, which is rather a large job
(especially fscanf).

Having used strace (on RedHat i386) on some of my programs, I see that 
open and read are the actual function calls used to read the
images. This reduces my problem to about 3 function calls that I have
to intercept. Fairly simple ones, too.

The problem is that I cannot intercept open/read using the --wrap
option for the linker.

Seeing that strace can display what it can, it must be possible to
create a wrapper that can either be linked to the programs or a tool
like strace that can take the program as it is and extend the
open/read functions calls.

Any idea on what would be possible/easiest?

regards,

Bernhard Ege

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

From: "Halfdan Ingvarss" <[EMAIL PROTECTED]>
Subject: LinuxThreads and waitpid
Date: Mon, 14 Aug 2000 13:39:20 -0400

I'm probably barking up the wrong tree here but here goes anyway:

I'm using pthreads (on top of LinuxThreads) to enable three threads to chat
to each other via pipes. The main process then watches over these three
threads to see whether any of them has died. Now LinuxThreads give me a new
PID for each thread started so I reasoned that I could use
waitpid(..,..,WNOHANG) to check what their status is.
It always returns -1 with the error 'No child process'.

Is there a clean way of checking whether a thread is still alive or is a
massive /proc hack required?




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

From: [EMAIL PROTECTED] (Kaz Kylheku)
Subject: Re: LinuxThreads and waitpid
Reply-To: [EMAIL PROTECTED]
Date: Mon, 14 Aug 2000 19:20:29 GMT

On Mon, 14 Aug 2000 13:39:20 -0400, Halfdan Ingvarss <[EMAIL PROTECTED]>
wrote:
>I'm probably barking up the wrong tree here but here goes anyway:
>
>I'm using pthreads (on top of LinuxThreads) to enable three threads to chat
>to each other via pipes.

Since the threads are in one address space, you can have them communicate
through shared memory in your address space instead of going through kernel
mechanisms like pipes.

>The main process then watches over these three
>threads to see whether any of them has died. Now LinuxThreads give me a new
>PID for each thread started so I reasoned that I could use
>waitpid(..,..,WNOHANG) to check what their status is.
>It always returns -1 with the error 'No child process'.

You are trying to use a non-portable technique that will probably not work on
any POSIX platform. Threads are not entities that can be subject to a waitpid()
call. 

[ In Linux, kernel threads are a actually processes, but the usual UNIX
rules apply: you can only wait on child processes.  The threads created by
LinuxThreads are not children of the main thread, but rather its grandchildren.
There is an intermediate task called the tread manager which actually creates
the children. It listens on requests coming from a shared pipe and performs the
action of creating a thread, and other things. ]

You should use pthread_join() to collect threads that terminated.  The
pthread_join() function does not have any non-blocking mode, nor does it have a
way to wait for any child. If you need to collect terminated threads in roughly
the order in which they die, then you need to have them communicate with the
collector. E.g. just before it terminates, each dying thread could append
an obituary message to a queue. The collector dequeues these obituaries from
the queue and performs a pthread_join() on each one in turn.

>Is there a clean way of checking whether a thread is still alive or is a
>massive /proc hack required?

There is no clean way of checking whether a thread is a live. It's a hack at
the platform-independent conceptual level.   Consider that the answer to the
question ``is this thread alive'' is obsolete as soon as it is obtained.  In

POSIX threads you can check whether a thread is alive by doing a pthread_kill)
on it with signal 0. This has the effect of performing error checking only
without delivering any signal.  The error checking can tell you that no thread
corresponds to the thread ID. Of course, by the time you obtain this
information, the thread ID might have already been recycled, so even finding
out that the thread does *not* exist is not reliable.

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

From: Bhavin Shah <[EMAIL PROTECTED]>
Subject: EACCES on bind
Date: Mon, 14 Aug 2000 12:46:19 -0700

Hi,

I'm trying to bind a socket to an address, but
am getting an EACCES errno, which states that 
the address is protected and the user isn't a
super user.  I'm running the program as a user 
other than root, and gave him all priv's.
In linuxconf, I granted super-user equilvalence,
but I can only bind w/ root.  How would I allow
this other user to bind?  Thanks.

Bhavin 



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

From: Nix <$}xinix{[email protected]>
Subject: Re: What is the difference between soft link and hard link?
Date: 14 Aug 2000 07:44:58 +0100

Kevin Lacquement <[EMAIL PROTECTED]> writes:

> Nix wrote:
> > 
> > Kevin Lacquement <[EMAIL PROTECTED]> writes:
> > 
> > > Nix wrote:
> > > >
> > > > No, but .. in / points to / (it is its own parent).
> > >
> > > Ahh...the Unix filesystem....where your sister's your cousin and your
> > > father's....yourself.
> > 
> > Heinlein, `All You Zombies'.
> 
> You mean that was in a book...I didn't make it up??

Roughly, yes ;) (Well, no. In _All You Zombies_ the protagonist managed
to be his own father and mother through time-travel trickery. Since
directories only have one parent this is kind of difficult for them.)

-- 
`I am of the belief that catnip arrived on the planet in the same spaceship
 that delivered cats. It is the only thing they have from their home
 planet. Tuna, chicken, sparrow-brains, etc., these are all things of our
 world that they like, but catnip is crack from home.' --- Bill Cole

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

From: "charity" <[EMAIL PROTECTED]>
Subject: Re: semaphore function semop fails with error EINTR
Date: Mon, 14 Aug 2000 16:21:37 +0800

should be signals,you should ignore some signals that should be sending to
your threads
<[EMAIL PROTECTED]> wrote in message news:8msdm1$7gs$[EMAIL PROTECTED]...
> Hi ,
>  I have run into a problem where the semop function fails in my user
> code.
>  Here's the full scenario,
>  I writing a driver and its support application.
>  the driver uses wait queue for back halves but doesnot use any
> blocking mode for communication between app and driver.
>
>  the application has 3 threads
>   the first sends in a sequence of commands to the hardware
>   second polls driver for events, when found puts them in a list
>   third thread processes the events in the above said thread.
>
> the second and third thread share a semaphore.
> In the third thread I find that the semop operation at times(when thei
> r multiple events coming in) fails. error code : 4 (EINTR)
>
> If i send in only 1 command to the hardware, then wait and process the
> event, everything works fine. But the problem occurs when sending
> multiple commands.
>
> Can someone please tell me what this error is and how to solve it.
>
> please help
>
> regards
> jeseem
>
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.



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


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