/*
* 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
*/
/*
*/
#include <sys/sysmacros.h>
int
{
int shift = 0;
/*
* Check access based on owner, group and
* public permissions in tmpnode.
*/
}
}
/*
* Decide whether it is okay to remove within a sticky directory.
* Two conditions need to be met: write access to the directory
* is needed. In sticky directories, write access is not sufficient;
* you can remove entries from a directory only if you own the directory,
* if you are privileged, if you own the entry or if they entry is
* a plain file and you have write access to that file.
* Function returns 0 if remove access is granted.
*/
int
{
return (secpolicy_vnode_remove(cr));
return (0);
}
/*
* Allocate zeroed memory if tmpfs_maxkmem has not been exceeded
* or the 'musthave' flag is set. 'musthave' allocations should
* always be subordinate to normal allocations so that tmpfs_maxkmem
* can't be exceeded by more than a few KB. Example: when creating
* a new directory, the tmpnode is a normal allocation; if that
* succeeds, the dirents for "." and ".." are 'musthave' allocations.
*/
void *
{
now = gethrestime_sec();
if (last_warning != now) {
last_warning = now;
}
return (NULL);
}
void
{
}
/*
* Convert a string containing a number (number of bytes) to a pgcnt_t,
* containing the corresponding number of pages. On 32-bit kernels, the
* maximum value encoded in 'str' is PAGESIZE * ULONG_MAX, while the value
* returned in 'maxpg' is at most ULONG_MAX.
*
* If the number is followed by a "k" or "K", the value is converted from
* kilobytes to bytes. If it is followed by an "m" or "M" it is converted
* from megabytes to bytes. If it is not followed by a character it is
* assumed to be in bytes. Multiple letter options are allowed, so for instance
* '2mk' is interpreted as 2gb.
*
* Parse and overflow errors are detected and a non-zero number returned on
* error.
*/
int
{
#ifdef _LP64
#else
#endif
char *c;
return (EINVAL);
c = str;
/*
* Convert str to number
*/
while ((*c >= '0') && (*c <= '9')) {
return (EINVAL);
}
/*
* Terminate on null
*/
while (*c != '\0') {
switch (*c++) {
/*
* convert from kilobytes
*/
case 'k':
case 'K':
return (EINVAL);
num *= 1024;
break;
/*
* convert from megabytes
*/
case 'm':
case 'M':
return (EINVAL);
break;
default:
return (EINVAL);
}
}
/*
* Since btopr() rounds up to page granularity, this round-up can
* cause an overflow only if 'num' is between (max_bytes - PAGESIZE)
* and (max_bytes). In this case the resulting number is zero, which
* is what we check for below.
*/
return (EINVAL);
return (0);
}