From owner-freebsd-hackers Sun Jan 18 14:35:41 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id OAA20994 for hackers-outgoing; Sun, 18 Jan 1998 14:35:41 -0800 (PST) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from gvr.gvr.org (root@gvr.gvr.org [194.151.74.97]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id OAA20924 for ; Sun, 18 Jan 1998 14:34:48 -0800 (PST) (envelope-from guido@gvr.org) Received: (from guido@localhost) by gvr.gvr.org (8.8.6/8.8.5) id XAA24903; Sun, 18 Jan 1998 23:34:25 +0100 (MET) From: Guido van Rooij Message-Id: <199801182234.XAA24903@gvr.gvr.org> Subject: Re: socket ops In-Reply-To: From guido at "Jan 18, 98 11:28:12 pm" To: guido@gvr.gvr.org (guido) Date: Sun, 18 Jan 1998 23:34:25 +0100 (MET) Cc: tlambert@primenet.com, FreeBSD-hackers@FreeBSD.ORG X-Mailer: ELM [version 2.4ME+ PL32 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk guido wrote: > Terry Lambert wrote: > > > I just found out that I cannot fchmod unix domain sockets. > > > > > > This is because fchmod() calls getvnode() which fails if the vnode > > > passed is not of type vnode or type fifo. > > > Is there a reason for this rationale? > > > > Look for "struct fileops" in /sys/kern/*.c, and all will be revealed. > > > > The mode is referenced via VOP_GETATTR/VOP_SETATTR off of a vnode > > to get the FS specific method of getting/setting mode bits. If you > > do not have a backing object, you do not have mode bits. > > ?? There *is* a backing object. I am talking about UNIX domain > sockets here. The problem here is that the struct file underneath the file descriptor is of type DTYPE_SOCKET. However, there *is* a backing vnode if the socket happens to be in the unix domain. Indeed there is no simpe way (I think) to find that out runtime. But that was not the question. I still think it is a bit strange we cannot use f*() functions on files in the unix name space. -Guido