/*
* 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 (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989 AT&T */
/* All Rights Reserved */
/*
* Copyright (c) 2013, OmniTI Computer Consulting, Inc. All rights reserved.
*/
/*
* Portions of this source code were derived from Berkeley 4.3 BSD
* under license from the Regents of the University of California.
*/
#include <sys/isa_defs.h>
#include <sys/sysmacros.h>
/*
* Common code for openat(). Check permissions, allocate an open
* file structure, and call the device open routine (if any).
*/
static int
{
int error;
char startchar;
/*
* Must be one or the other and neither FREAD nor FWRITE
* Must not be any of FAPPEND FCREAT FTRUNC FXATTR FXATTRDIROPEN
* XXX: Should these just be silently ignored?
*/
}
/*
* Regular open()
*/
} else {
/*
* We're here via openat()
*/
/*
* if startchar is / then startfd is ignored
*/
if (startchar == '/')
else {
}
}
/*
* Handle __openattrdirat() requests
*/
if (filemode & FXATTRDIROPEN) {
}
/*
* Do we need to go into extended attribute space?
*/
/*
* If startchar == '/' then no extended attributes
* are looked up.
*/
if (startchar == '/') {
} else {
mutex_enter(&p->p_lock);
mutex_exit(&p->p_lock);
}
}
/*
* Make sure we have a valid extended attribute request.
* We must either have a real fd or AT_FDCWD and a relative
* pathname.
*/
goto noxattr;
}
}
goto out;
}
/*
* In order to access hidden attribute directory the
* user must be able to stat() the file
*/
goto out;
}
} else {
}
/*
* For __openattrdirat() use "." as filename to open
* as part of vn_openat()
*/
open_filename = ".";
seg = UIO_SYSSPACE;
}
if (error != 0)
goto out;
}
if (error == 0) {
/*
* Last arg is a don't-care term if
* !(filemode & FCREAT).
*/
(int)(createmode & MODEMASK),
if (error == 0) {
/*
* We must now fill in the slot
* falloc reserved.
*/
}
return (fd);
} else {
/*
* Give up the file pointer
* and dup the indicated file descriptor
* (in v_rdev). This is ugly, but I've
* seen worse.
*/
}
}
}
return (fd);
} else {
}
}
} else {
}
out:
}
#ifdef _LP64
#else
#endif
/*
* Open a file.
*/
int
{
}
int
{
}
#if defined(_ILP32) || defined(_SYSCALL32_IMPL)
/*
* Open for large files in 32-bit environment. Sets the FOFFMAX flag.
*/
int
{
}
int
{
}
#endif /* _ILP32 || _SYSCALL32_IMPL */
#ifdef _SYSCALL32_IMPL
/*
* Open for 32-bit compatibility on 64-bit kernel
*/
int
{
}
int
{
}
#endif /* _SYSCALL32_IMPL */