Subject: dupfd hack and clonable devices
To: None <tech-kern@NetBSD.org>
From: None <cube@cubidou.net>
List: tech-kern
Date: 11/16/2004 16:37:12
Hi,

As I was looking for a way to turn ethfoo(4) into some sort of
clonable device, I saw the "dupfd hack", which is more or less
what I want.  If I understand correctly, I have to fill
curlwp->l_dupfd with a complete file descriptor that will be
re-opened by sys_open().

The drawback of this is that it doesn't simply makes a character
device clonable, as I have to provide a fileops structure.  There
are two ways of doing that: providing my own (as systrace and
dmover do), or using vnops (as ptmx does).  The former introduces
a lot of complexity, the latter requires the correct device nodes
to exist in the file-system.

Is my analysis correct?  Is there a simpler way to acheive what
I want to do (which, in case it's not clear, is to have a ethfoo
device that creates an interface for each open)?

-- 
Quentin Garnier - cube@cubidou.net - cube@NetBSD.org
"Commala-come-five! / Even when the shadows rise!
To see the world and walk the world / Makes ya glad to be alive."
Susannah's Song, The Dark Tower VI, Stephen King, 2004.