/*
* 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
*/
/*
* Use is subject to license terms.
*/
#include <sys/sysmacros.h>
#include <unistd.h>
#include <stdlib.h>
#include <stdio.h>
#include <fcntl.h>
#include <strings.h>
#include "libmicro.h"
typedef volatile char vchar_t;
typedef struct {
int ts_once;
} tsd_t;
static long long optl = 0;
static long long optp = 0;
static int optr = 0;
static int opts = 0;
static int optw = 0;
static int anon = 0;
static long long def_optl;
static long long def_optp;
int
{
lm_tsdsize = sizeof (tsd_t);
int i;
#ifdef __sun
/* determine available page sizes before parsing options */
if (npagesizes <= 0) {
return (-1);
}
#endif
return (-1);
}
#ifdef __sun
return (-1);
}
#endif
/* pick a default for mapping length and page size */
/* set mapping length so we map at least 2 pages */
" [-f file-to-map (default %s)]\n"
" [-l mapping-length (default %lld)]\n"
" [-p page-size (default %lld)]\n"
" [-r] (read a byte from each page)\n"
" [-w] (write a byte on each page)\n"
" [-s] (use MAP_SHARED)\n"
"notes: measures mmap()\n",
return (0);
}
int
{
switch (opt) {
case 'f':
break;
case 'l':
break;
case 'p':
break;
case 'r':
optr = 1;
break;
case 's':
opts = 1;
break;
case 'w':
optw = 1;
break;
default:
return (-1);
}
return (0);
}
int
{
int i;
/*
* If optp or optl were set by caller, make sure that they point to a
* valid pagesize. If not, return an error.
*/
for (i = 0; i < npagesizes; i++) {
break;
}
}
if (i == npagesizes) {
exit(1);
}
}
/*
* If the benchmark is running 32-bit, return an error if a page
* size >= 1G is selected.
*/
printf("Page sizes >= 1G not supported on 32-bit\n");
exit(1);
}
printf("map length %lld must be aligned to page size %lld\n",
exit(1);
}
if (!anon)
return (0);
}
int
{
int errors = 0;
errors++;
}
}
return (errors);
}
int
{
int i;
unsigned long j;
#ifdef __sun
#endif
for (i = 0; i < lm_optB; i++) {
if (anon) {
-1, 0L);
} else {
fd, 0L);
}
continue;
}
#ifdef __sun
continue;
}
#endif
if (optr) {
}
}
if (optw) {
}
}
}
return (0);
}
int
{
int i;
for (i = 0; i < lm_optB; i++) {
}
return (0);
}
char *
{
flags[4] = 0;
return (result);
}