/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (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 2004 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include <sys/sysmacros.h>
#include <sys/pathname.h>
#include <sys/old_procfs.h>
#include <sys/systeminfo.h>
#include "elf_impl.h"
void
{
sizeof (Word))
if (prhasfp())
#if defined(__sparc)
/*
* Figure out the number and sizes of register windows.
*/
{
do {
size = sizeof (gwindows_t) -
(SPARC_MAXREGWINDOW - size) *
sizeof (struct rwindow);
}
}
#endif /* __sparc */
}
int
{
union {
#if defined(__sparc)
#endif /* __sparc */
} *bigwad;
kthread_t *t;
int i;
int nlwp;
int error;
/*
* The order of the elfnote entries should be same here and in
* the gcore(1) command. Synchronization is needed between the
* kernel and libproc's Pfgcore() function where the meat of
* the gcore(1) command lives.
*/
mutex_enter(&p->p_lock);
mutex_exit(&p->p_lock);
if (error)
goto done;
if (error)
goto done;
for (i = 0; i < __KERN_NAUXV_IMPL; i++) {
}
if (error)
goto done;
t = curthread;
do {
nlwp--;
mutex_enter(&p->p_lock);
if (t == curthread) {
/*
* Modify t_whystop and lwp_cursig so it appears that
* the current LWP is stopped after faulting on the
* signal that caused the core dump. As a result,
* oprgetstatus() will record that signal, the saved
* lwp_siginfo, and its signal handler in the core file
* status. We restore lwp_cursig in case a subsequent
* signal was received while dumping core.
*/
t->t_whystop = PR_FAULTED;
t->t_whystop = 0;
} else {
}
mutex_exit(&p->p_lock);
if (error)
goto done;
if (prhasfp()) {
if (error)
goto done;
}
#if defined(__sparc)
/*
* Unspilled SPARC register windows.
*/
{
if (size != 0) {
size = sizeof (gwindows_t) -
(SPARC_MAXREGWINDOW - size) *
sizeof (struct rwindow);
if (error)
goto done;
}
}
#endif /* __sparc */
if (xregsize) {
if (error)
goto done;
}
done:
return (error);
}