/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
#include <door.h>
#include <stdlib.h>
#include <unistd.h>
#include <signal.h>
#include <string.h>
#include <fcntl.h>
#include <errno.h>
#include <limits.h>
#include "jni.h"
#include "jni_util.h"
#include "sun_tools_attach_SolarisVirtualMachine.h"
do { \
} while(0)
/*
* Class: sun_tools_attach_SolarisVirtualMachine
* Method: open
*/
{
if (p == NULL) {
return 0;
} else {
int fd;
int err = 0;
if (fd == -1) {
}
if (isCopy) {
}
if (fd == -1) {
} else {
}
}
}
return fd;
}
}
/*
* Class: sun_tools_attach_SolarisVirtualMachine
* Method: checkPermissions
*/
{
if (p != NULL) {
int res;
/*
*/
if (res != 0) {
/* save errno */
}
/* release p here before we throw an I/O exception */
if (isCopy) {
}
if (res == 0) {
}
} else {
}
}
}
}
/*
* Class: sun_tools_attach_SolarisVirtualMachine
* Method: close
* Signature: (I)V
*/
{
int ret;
}
/*
* Class: sun_tools_attach_SolarisVirtualMachine
* Method: read
* Signature: (I[BI)I
*/
{
ssize_t n;
}
if (n == -1) {
} else {
if (n == 0) {
n = -1; // EOF
} else {
}
}
return n;
}
/*
* Class: sun_tools_attach_SolarisVirtualMachine
* Method: sigquit
* Signature: (I)V
*/
{
}
}
/*
* A simple table to translate some known errors into reasonable
* error messages
*/
static struct {
const char* msg;
} const error_messages[] = {
{ 100, "Bad request" },
{ 101, "Protocol mismatch" },
{ 102, "Resource failure" },
{ 103, "Internal error" },
{ 104, "Permission denied" },
};
/*
* Lookup the given error code and return the appropriate
* message. If not found return NULL.
*/
int i;
for (i=0; i<table_size; i++) {
return error_messages[i].msg;
}
}
return NULL;
}
/*
* Current protocol version
*/
/*
* Class: sun_tools_attach_SolarisVirtualMachine
* Method: enqueue
*/
{
int rc;
const char* cstr;
char* buf;
/*
* First we get the command string and create the start of the
* argument string to send to the target VM:
* <ver>\0<cmd>\0
*/
return -1; /* pending exception */
}
}
if (isCopy) {
}
return -1;
}
/*
* Next we iterate over the arguments and extend the buffer
* to include them.
*/
for (i=0; i<arg_count; i++) {
}
if (isCopy) {
}
return -1;
}
}
}
return -1;
}
}
/*
* The arguments to the door function are in 'buf' so we now
* do the door call
*/
/*
* door_call failed
*/
if (rc == -1) {
} else {
/*
* door_call succeeded but the call didn't return the the expected jint.
*/
} else {
} else {
}
} else {
/*
* The door call should return a file descriptor to one end of
* a socket pair
*/
} else {
}
}
}
}
return result;
}