2N/A * The contents of this file are subject to the terms of the 2N/A * Common Development and Distribution License (the "License"). 2N/A * You may not use this file except in compliance with the License. 2N/A * See the License for the specific language governing permissions 2N/A * and limitations under the License. 2N/A * When distributing Covered Code, include this CDDL HEADER in each 2N/A * If applicable, add the following below this CDDL HEADER, with the 2N/A * fields enclosed by brackets "[]" replaced with your own identifying 2N/A * information: Portions Copyright [yyyy] [name of copyright owner] 2N/A * Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved. 2N/Aextern int gmatch(
const char *s,
const char *p);
2N/A/* environment variables */ 2N/A * avoid malloc which causes certain applications to crash 2N/A * These need to correspond to the order of the MADV_ flags in mman.h 2N/A * since the position infers the value for the flag. 2N/A "willneed_NOT_SUPPORTED!",
2N/A "dontneed_NOT_SUPPORTED!",
2N/A "free_NOT_SUPPORTED!",
2N/A * Return the pointer to the fully-resolved path name of the process's 2N/A * executable file obtained from the AT_SUN_EXECNAME aux vector entry. 2N/A * The first time through, read the initial aux vector that was 2N/A * passed to the process at exec(2). Only do this once. 2N/A * Return the process's current brk base and size. 2N/A * Check if exec name matches cfgname found in madv cfg file. 2N/A /* cfgname should not have a '/' unless it begins with one */ 2N/A * if execname does not begin with a '/', prepend the 2N/A * current directory. 2N/A }
else {
/* simple cfg name */ 2N/A /* execname is a path name - get the base name */ 2N/A * Check if string matches any of exec arguments. 2N/A while ((c = *
str) ==
'\n' || c ==
' ' || c ==
'\t')
2N/A "%s: invalid advice option (%s)" 2N/A " for %s - cfgfile: %s, line: %d\n"),
2N/A "%s: option missing advice" 2N/A " for %s - cfgfile: %s, line: %d\n"),
2N/A "%s: invalid advice specified (%s)" 2N/A " for %s - cfgfile: %s, line: %d\n"),
2N/A "%s: duplicate advice specified " 2N/A "(%s) for %s - cfgfile: %s, line: %d\n"),
2N/A "%s: duplicate advice specified " 2N/A "(%s) for %s - cfgfile: %s, line: %d\n"),
2N/A "%s: duplicate advice specified " 2N/A "(%s) for %s - cfgfile: %s, line: %d\n"),
2N/A "%s: duplicate advice specified " 2N/A "(%s) for %s - cfgfile: %s, line: %d\n"),
2N/A "%s: duplicate advice specified " 2N/A "(%s) for %s - cfgfile: %s, line: %d\n"),
2N/A "%s: duplicate advice specified " 2N/A "(%s) for %s - cfgfile: %s, line: %d\n"),
2N/A "%s: duplicate advice specified " 2N/A "(%s) for %s - cfgfile: %s, line: %d\n"),
2N/A "%s: duplicate advice specified " 2N/A "(%s) for %s - cfgfile: %s, line: %d\n"),
2N/A "%s: invalid advice option (%s)" 2N/A " for %s - cfgfile: %s, line: %d\n"),
2N/A * If a private error file is indicated then set the locale 2N/A * for error messages for the duration of this routine. 2N/A * Error messages destined for syslog should not be translated 2N/A * and thus come from the default C locale. 2N/A "%s: cannot open error file: %s [%s]\n"),
2N/A "%s: invalid advice specified: MADV=%s\n"),
2N/A * Open specified cfg file or default one. 2N/A "%s: cannot open configuration file: %s [%s]\n"),
2N/A * Make sure line wasn't truncated. 2N/A "%s: invalid entry, " 2N/A "line too long - cfgfile:" 2N/A * Get advice options. 2N/A * Parse right to left in case delimiter is in name. 2N/A "%s: no delimiter specified - cfgfile:" 2N/A * Remove newline from end of advice options. 2N/A * Get optional argument string. 2N/A * Compare exec name. 2N/A * Compare arguments if argument string specified. 2N/A * Parse advice options. 2N/A * If empty, any advice from ENV_MADV is reset. 2N/A * Pagesize needed for proper aligning by brk interpose. 2N/A * Apply global advice if set. 2N/A * Specific options in the cfgfile take precedence. 2N/A * If heap advice is specified, apply it to the existing heap. 2N/A * As the heap grows the kernel applies the advice automatically 2N/A * to new portions of the heap. 2N/A * Align start address for memcntl and apply advice 2N/A * on full pages of heap. Create a page of heap if 2N/A * it does not already exist. 2N/A "%s: sbrk failed [%s]\n"),
2N/A "%s: memcntl() failed [%s]: heap advice\n"),
2N/A /* close log file: no-op if nothing logged to syslog */ 2N/A * Options ism, dism take precedence over option shm. 2N/A * Apply advice if specified and shmat succeeded. 2N/A /* First determine segment size */ 2N/A "shmat advice: 0x%x 0x%x %d, rc %d errno %d\n",
2N/A * Option mapanon has highest precedence while option map 2N/A * has lowest precedence. 2N/A * Apply advice if specified and mmap succeeded. 2N/A "mmap advice: 0x%x 0x%x %d, rc %d errno %d\n",
2N/A * Option mapanon has highest precedence while option map 2N/A * has lowest precedence. 2N/A * Apply advice if specified and mmap succeeded. 2N/A "mmap64 advice: 0x%x 0x%x %d, rc %d errno %d\n",