/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#include <sys/sysmacros.h>
#include <sys/vfs_opreg.h>
#include <sys/socketvar.h>
/*
* Generic vnode ops
*/
caller_context_t *);
struct cred *, caller_context_t *);
struct cred *, caller_context_t *);
struct cred *, caller_context_t *);
caller_context_t *);
struct cred *, caller_context_t *);
struct cred *, caller_context_t *);
caller_context_t *);
caller_context_t *);
caller_context_t *);
caller_context_t *);
caller_context_t *);
static int socket_vop_poll(struct vnode *, short, int, short *,
struct pollhead **, caller_context_t *);
};
/*
* generic vnode ops
*/
/*ARGSUSED*/
static int
{
return (0);
}
/*ARGSUSED*/
static int
{
int error = 0;
if (count > 1) {
return (0);
}
/*
* Initiate connection shutdown.
*/
} else {
}
return (error);
}
/*ARGSUSED2*/
static int
{
}
/*ARGSUSED2*/
static int
{
/*
* If the socket is not byte stream set MSG_EOR
*/
}
}
/*ARGSUSED4*/
static int
{
}
/*
* Allow any flags. Record FNDELAY and FNONBLOCK so that they can be inherited
* from listener to acceptor.
*/
/* ARGSUSED */
static int
{
int error = 0;
else
else
/*
* of the FASYNC flag passed to fcntl(F_SETFL).
* This exists solely for BSD fcntl() FASYNC compatibility.
*/
/*
* SS_ASYNC bit, but for TPI it is more involved. For that
* reason we delegate the job to the protocol's ioctl handler.
*/
}
return (error);
}
/*
* Get the made up attributes for the vnode.
* 4.3BSD returns the current time for all the timestamps.
* 4.4BSD returns 0 for all the timestamps.
* Here we use the access and modified times recorded in the sonode.
*
* Just like in BSD there is not effect on the underlying file system node
* bound to an AF_UNIX pathname.
*
* When sockmod has been popped this will act just like a stream. Since
* a socket is always a clone there is no need to inspect the attributes
* of the "realvp".
*/
/* ARGSUSED */
int
{
static int sonode_shift = 0;
/*
* Calculate the amount of bitshift to a sonode pointer which will
* still keep it unique. See below.
*/
if (sonode_shift == 0)
ASSERT(sonode_shift > 0);
/*
* The imaginary "sockmod" has been popped - act
* as a stream
*/
} else {
}
/*
* If the va_nodeid is > MAX_USHORT, then i386 stats might fail.
* So we shift down the sonode pointer to try and get the most
* uniqueness into 16-bits.
*/
/*
* We need to zero out the va_rdev to avoid some fstats getting
* EOVERFLOW. This also mimics SunOS 4.x and BSD behavior.
*/
if (!SOCK_IS_NONSTR(so)) {
} else {
}
return (0);
}
/*
* Set attributes.
* Just like in BSD there is not effect on the underlying file system node
* bound to an AF_UNIX pathname.
*
* When sockmod has been popped this will act just like a stream. Since
* a socket is always a clone there is no need to modify the attributes
* of the "realvp".
*/
/* ARGSUSED */
int
{
/*
* If times were changed, and we have a STREAMS socket, then update
* the sonode.
*/
if (!SOCK_IS_NONSTR(so)) {
}
}
return (0);
}
/*
* Check if user is allowed to access vp. For non-STREAMS based sockets,
* there might not be a device attached to the file system. So for those
* types of sockets there are no permissions to check.
*
* XXX Should there be some other mechanism to check access rights?
*/
/*ARGSUSED*/
int
{
if (!SOCK_IS_NONSTR(so)) {
}
return (0);
}
/*
* 4.3BSD and 4.4BSD fail a fsync on a socket with EINVAL.
* This code does the same to be compatible and also to not give an
* application the impression that the data has actually been "synced"
* to the other end of the connection.
*/
/* ARGSUSED */
int
{
return (EINVAL);
}
/*ARGSUSED*/
static void
{
/*
* If no one has reclaimed the vnode, remove from the
* cache now.
*/
/*
* Drop the temporary hold by vn_rele now
*/
return;
}
/* socket specfic clean-up */
}
/* ARGSUSED */
int
{
return (EINVAL);
}
/*
* Sockets are not seekable.
* (and there is a bug to fix STREAMS to make them fail this as well).
*/
/*ARGSUSED*/
int
{
return (ESPIPE);
}
/*ARGSUSED*/
static int
{
}