Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 3 Mar 1998 03:25:15 +0000 (GMT)
From:      Terry Lambert <tlambert@primenet.com>
To:        avalon@coombs.anu.edu.au (Darren Reed)
Cc:        hackers@FreeBSD.ORG
Subject:   Re: vnodes for sockets.
Message-ID:  <199803030325.UAA11963@usr06.primenet.com>
In-Reply-To: <199803022353.PAA21947@hub.freebsd.org> from "Darren Reed" at Mar 3, 98 10:53:52 am

next in thread | previous in thread | raw e-mail | index | archive | help
> Is it possible to associate a vnode with a socket ?

Yes, this happens.

> if so, (or just for unix domain sockets), do the various VOP functions
> such as VOP_WRITE work properly with them ?

No, this is not currently possible.  The vp is subverted out of the
VFS architecture using a struct fileops pointer specific to the
sockets.  The pipe code and the IPC code use the same approach.

If you look at the standard system calls, (like read, in sys_generic.c),
you will see the indirection through the struct fileops.

The code is an artifact at the system call level.  This means that
the kernel internal vn_* calls will not work against the code.

You will need to indirect the same way (ie: use struct file and
dereference out the f_ops ops member, and call the function from
the struct, directly).


We hope to clean this up in the future (struct fileops must die).
PTY's are unusable from the kernel because of them being implemented
as a device; perhaps you can use a pty, instead.


					Terry Lambert
					terry@lambert.org
---
Any opinions in this posting are my own and not those of my present
or previous employers.

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199803030325.UAA11963>