/*
* 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.
*/
/*
* Copyright (c) 2013, Joyent, Inc. All rights reserved.
*/
#include <fcntl.h>
#include <libproc.h>
#include <limits.h>
#include <stdio.h>
#include <strings.h>
#include "pmap_common.h"
/*
* We compare the high memory addresses since stacks are faulted in from
* high memory addresses to low memory addresses, and our prmap_t
* structures identify only the range of addresses that have been faulted
* in so far.
*/
int
{
if (a < b)
return (1);
if (a > b)
return (-1);
return (0);
}
/*
* Create labels for non-anon, non-heap mappings
*/
char *
{
int len;
return (buf);
} else {
/* Verify that the path exists */
return (buf);
}
}
}
return (NULL);
/* first see if we can find a path via /proc */
if (len >= 0) {
return (buf);
}
/* fall back to object information reported by /proc */
return (buf);
}
return (NULL);
}
/*
* Create label for anon mappings
*/
char *
{
int mtypes = 0;
if (shmid == -1)
else
if (shmid == -1)
else
} else {
if (nstacks > 0 &&
"altstack" : "stack",
stk->lwps_lwpid);
} else {
}
}
if (mtypesp)
return (name);
}