drd.c revision 8fea755a86ff6c596183a4366bfbd59f1bfdfe55
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 2008 Sun Microsystems, Inc. All rights reserved. 2N/A * Use is subject to license terms. 2N/A#
pragma ident "%Z%%M% %I% %E% SMI" * Currently, the only supported backend is for the Reconfiguration * Coordination Manager (RCM). When there are other backends, this * variable should be set dynamically. * Process command line arguments opterr = 0;
/* disable getopt error messages */ drd_err(
"permission denied: must run as root");
/* open the drctl device */ drd_err(
"unable to initialize drctl device");
/* initialize door server */ drd_err(
"unable to initialize door server");
/* initialize the backend */ drd_err(
"unable to initialize backend processor");
* Initialize child process * Initialize file descriptors. Do not touch stderr * which is initialized by SMF to point to the drd /* open the drctl device */ /* send the door descriptor to drctl */ drd_dbg(
"connection to drctl established");
/* setup is complete in daemon mode */ * At this point, the daemon is running in standalone * mode for testing purposes. This allows the daemon * to be controlled directly through a door exported * to the filesystem. No drctl device is required in /* create the door file */ drd_err(
"failed to create door file '%s': %s",
/* attach the door file to the door descriptor */ drd_err(
"failed to fattach door file '%s': %s",
* Deallocate the global response buffer if it is * in use. This assumes that there will only ever * be one pending operation in the daemon. This is * enforced by the kernel. * Loop through all the resources and concatenate * all the error strings to the end of the resource * array. Also, update the offset field of each /* skip if no error string */ /* increase the size of the buffer */ /* clean up any remaining strings */ /* copy the error string into the response */ * Now that the error string has been copied * into the response message, the memory that * was allocated for it is no longer needed. /* update size and offset */ /* sanity check incoming arg */ /* pass off to backend for processing */ drd_err(
"memory DR operations not supported yet");