lkml.org 
[lkml]   [1998]   [Aug]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: Thread implementations...
From
Date
>    A possible solution could be extending of the SIGIO concept in the
> following way:
>
> - SIGIO handler gets an extra parameter containing the FD
> in being reported.
>
> - FASYNC gets split to read and write part

I received this reply from Johnny Eriksson <bygg@swip.net>:

Implement a new set of signals, one for each possible file. Access
this with a macro, SIGFILE(), making the user code something like:

{
FILE * myfile;

/* ... */

signal(SIGFILE(myfile), myhandler);

}

The macro SIGFILE should be defined like:

#define SIGFILE(fp) (-1 - (fileno(fp)))

In the kernel, a table (one entry per file) is needed, and the code
that normally generates the SIGIO signal should first check if there
is a file-specific handler in that table, and if so use that handler,
if not generate a normal SIGIO. This makes SIGIO a catch-all handler
for all files that does not have a SIGFILE handler.

-- End reply from Johnny Eriksson --

/Magnus
map@stacken.kth.se

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.altern.org/andrebalsa/doc/lkml-faq.html

\
 
 \ /
  Last update: 2005-03-22 13:44    [W:0.042 / U:0.068 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site