/*
* 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 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include <stdio.h>
#include <errno.h>
#include <unistd.h>
#include <string.h>
#include <wait.h>
#include <limits.h>
#include "machdep.h"
#include "sgs.h"
#include "rtc.h"
#include "conv.h"
#include "_crle.h"
#include "msg.h"
/*
* Having gathered together any dependencies, dldump(3x) any necessary images.
*
* All dldump(3x) processing is carried out from the audit library. The
* temporary configuration file is read and all alternative marked files are
* dumped. If a -E application requires RTLD_REL_EXEC then that application
* acts as the new process, otherwise lddstub is used.
*
* Besides dldump(3x)'ing any images the audit library returns the address
* range of the images which will used to update the configuration file.
*/
int
{
if (orgapp == 0)
/*
* Set up a pipe through which the audit library will write the image
* address ranges.
*/
return (1);
}
/*
* Fork ourselves to run the application and collect its dependencies.
*/
return (1);
}
if (pid) {
/*
* Parent. Read memory range entries from the audit library.
* The read side of the pipe is attached to stdio to make
* obtaining the individual dependencies easier.
*/
char *str;
/*
* Make sure we recognize the message, remove
* the newline (which allowed fgets() use) and
* register the memory range entry;
*/
continue;
*str = '\0';
str, MSG_AUD_RESBGN_SIZE) == 0) {
(char **)NULL, 0);
str, MSG_AUD_RESEND_SIZE) == 0) {
(char **)NULL, 0);
} else {
continue;
}
}
} else
;
if (status) {
if (WIFSIGNALED(status)) {
}
return (status);
}
return (error);
} else {
/*
* Child. Set up environment variables to enable and identify
* auditing.
*/
crle->c_tempname);
/*
* Put strings in the environment for exec().
* NOTE, use of automatic variables for construction of the
* environment variables is legitimate here, as they are local
* to the child process and are established solely for exec().
*/
return (1);
}
/* NOTREACHED */
}
}
return (0);
}