jdk/src/solaris/classes/sun/tools/attach/SolarisVirtualMachine.java
author duke
Sat, 01 Dec 2007 00:00:00 +0000
changeset 2 90ce3da70b43
child 5506 202f599c92aa
permissions -rw-r--r--
Initial load
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
/*
90ce3da70b43 Initial load
duke
parents:
diff changeset
     2
 * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     4
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
90ce3da70b43 Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
90ce3da70b43 Initial load
duke
parents:
diff changeset
     7
 * published by the Free Software Foundation.  Sun designates this
90ce3da70b43 Initial load
duke
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
90ce3da70b43 Initial load
duke
parents:
diff changeset
     9
 * by Sun in the LICENSE file that accompanied this code.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    10
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
90ce3da70b43 Initial load
duke
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
90ce3da70b43 Initial load
duke
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
90ce3da70b43 Initial load
duke
parents:
diff changeset
    15
 * accompanied this code).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    16
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
90ce3da70b43 Initial load
duke
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    20
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    21
 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    22
 * CA 95054 USA or visit www.sun.com if you need additional information or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    23
 * have any questions.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    24
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    25
package sun.tools.attach;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    26
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
import com.sun.tools.attach.VirtualMachine;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    28
import com.sun.tools.attach.AgentLoadException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    29
import com.sun.tools.attach.AttachNotSupportedException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    30
import com.sun.tools.attach.spi.AttachProvider;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    31
import java.io.InputStream;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
import java.io.IOException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
import java.io.File;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
import java.io.FileNotFoundException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
import java.util.Properties;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
/*
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
 * Solaris implementation of HotSpotVirtualMachine.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
public class SolarisVirtualMachine extends HotSpotVirtualMachine {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
    // door descriptor;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
    private int fd = -1;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
     * Attaches to the target VM
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
    SolarisVirtualMachine(AttachProvider provider, String vmid)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
        throws AttachNotSupportedException, IOException
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
    {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
        super(provider, vmid);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
        // This provider only understands process-ids (pids).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
        int pid;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
        try {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
            pid = Integer.parseInt(vmid);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
        } catch (NumberFormatException x) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
            throw new AttachNotSupportedException("invalid process identifier");
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
        // Opens the door file to the target VM. If the file is not
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
        // found it might mean that the attach mechanism isn't started in the
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
        // target VM so we attempt to start it and retry.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
        try {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
            fd = openDoor(pid);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
        } catch (FileNotFoundException fnf1) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
            File f = createAttachFile(pid);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
            try {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
                // kill -QUIT will tickle target VM to check for the
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
                // attach file.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
                sigquit(pid);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
                // give the target VM time to start the attach mechanism
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
                int i = 0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
                long delay = 200;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
                int retries = (int)(attachTimeout() / delay);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
                do {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
                    try {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
                        Thread.sleep(delay);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
                    } catch (InterruptedException x) { }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
                    try {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
                        fd = openDoor(pid);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
                    } catch (FileNotFoundException fnf2) { }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
                    i++;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
                } while (i <= retries && fd == -1);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
                if (fd == -1) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
                    throw new AttachNotSupportedException(
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
                        "Unable to open door: target process not responding or " +
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
                        "HotSpot VM not loaded");
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
                }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
            } finally {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
                f.delete();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
        assert fd >= 0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
     * Detach from the target VM
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
    public void detach() throws IOException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   101
        synchronized (this) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   102
            if (fd != -1) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   103
                close(fd);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   104
                fd = -1;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   105
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   106
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   107
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   108
90ce3da70b43 Initial load
duke
parents:
diff changeset
   109
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   110
     * Execute the given command in the target VM.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   111
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   112
    InputStream execute(String cmd, Object ... args) throws AgentLoadException, IOException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   113
        assert args.length <= 3;                // includes null
90ce3da70b43 Initial load
duke
parents:
diff changeset
   114
90ce3da70b43 Initial load
duke
parents:
diff changeset
   115
        // first check that we are still attached
90ce3da70b43 Initial load
duke
parents:
diff changeset
   116
        int door;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   117
        synchronized (this) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   118
            if (fd == -1) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   119
                throw new IOException("Detached from target VM");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   120
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   121
            door = fd;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   122
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   123
90ce3da70b43 Initial load
duke
parents:
diff changeset
   124
        // enqueue the command via a door call
90ce3da70b43 Initial load
duke
parents:
diff changeset
   125
        int s = enqueue(door, cmd, args);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   126
        assert s >= 0;                          // valid file descriptor
90ce3da70b43 Initial load
duke
parents:
diff changeset
   127
90ce3da70b43 Initial load
duke
parents:
diff changeset
   128
        // The door call returns a file descriptor (one end of a socket pair).
90ce3da70b43 Initial load
duke
parents:
diff changeset
   129
        // Create an input stream around it.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   130
        SocketInputStream sis = new SocketInputStream(s);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   131
90ce3da70b43 Initial load
duke
parents:
diff changeset
   132
        // Read the command completion status
90ce3da70b43 Initial load
duke
parents:
diff changeset
   133
        int completionStatus;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   134
        try {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   135
            completionStatus = readInt(sis);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   136
        } catch (IOException ioe) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   137
            sis.close();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   138
            throw ioe;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   139
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   140
90ce3da70b43 Initial load
duke
parents:
diff changeset
   141
        // If non-0 it means an error but we need to special-case the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   142
        // "load" command to ensure that the right exception is thrown.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   143
        if (completionStatus != 0) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   144
            sis.close();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   145
            if (cmd.equals("load")) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   146
                throw new AgentLoadException("Failed to load agent library");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   147
            } else {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   148
                throw new IOException("Command failed in target VM");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   149
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   150
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   151
90ce3da70b43 Initial load
duke
parents:
diff changeset
   152
        // Return the input stream so that the command output can be read
90ce3da70b43 Initial load
duke
parents:
diff changeset
   153
        return sis;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   154
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   155
90ce3da70b43 Initial load
duke
parents:
diff changeset
   156
    // InputStream over a socket
90ce3da70b43 Initial load
duke
parents:
diff changeset
   157
    private class SocketInputStream extends InputStream {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   158
        int s;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   159
90ce3da70b43 Initial load
duke
parents:
diff changeset
   160
        public SocketInputStream(int s) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   161
            this.s = s;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   162
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   163
90ce3da70b43 Initial load
duke
parents:
diff changeset
   164
        public synchronized int read() throws IOException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   165
            byte b[] = new byte[1];
90ce3da70b43 Initial load
duke
parents:
diff changeset
   166
            int n = this.read(b, 0, 1);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   167
            if (n == 1) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   168
                return b[0] & 0xff;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   169
            } else {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   170
                return -1;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   171
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   172
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   173
90ce3da70b43 Initial load
duke
parents:
diff changeset
   174
        public synchronized int read(byte[] bs, int off, int len) throws IOException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   175
            if ((off < 0) || (off > bs.length) || (len < 0) ||
90ce3da70b43 Initial load
duke
parents:
diff changeset
   176
                ((off + len) > bs.length) || ((off + len) < 0)) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   177
                throw new IndexOutOfBoundsException();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   178
            } else if (len == 0)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   179
                return 0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   180
90ce3da70b43 Initial load
duke
parents:
diff changeset
   181
            return SolarisVirtualMachine.read(s, bs, off, len);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   182
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   183
90ce3da70b43 Initial load
duke
parents:
diff changeset
   184
        public void close() throws IOException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   185
            SolarisVirtualMachine.close(s);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   186
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   187
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   188
90ce3da70b43 Initial load
duke
parents:
diff changeset
   189
    // The door is attached to .java_pid<pid> in the target VM's working
90ce3da70b43 Initial load
duke
parents:
diff changeset
   190
    // directory or /tmp.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   191
    private int openDoor(int pid) throws IOException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   192
        // First check for a .java_pid<pid> file in the working directory
90ce3da70b43 Initial load
duke
parents:
diff changeset
   193
        // of the target process
90ce3da70b43 Initial load
duke
parents:
diff changeset
   194
        String fn = ".java_pid" + pid;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   195
        String path = "/proc/" + pid + "/cwd/" + fn;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   196
        try {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   197
            fd = open(path);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   198
        } catch (FileNotFoundException fnf) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   199
            path = "/tmp/" + fn;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   200
            fd = open(path);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   201
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   202
90ce3da70b43 Initial load
duke
parents:
diff changeset
   203
        // Check that the file owner/permission to avoid attaching to
90ce3da70b43 Initial load
duke
parents:
diff changeset
   204
        // bogus process
90ce3da70b43 Initial load
duke
parents:
diff changeset
   205
        try {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   206
            checkPermissions(path);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   207
        } catch (IOException ioe) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   208
            close(fd);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   209
            throw ioe;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   210
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   211
        return fd;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   212
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   213
90ce3da70b43 Initial load
duke
parents:
diff changeset
   214
    // On Solaris/Linux a simple handshake is used to start the attach mechanism
90ce3da70b43 Initial load
duke
parents:
diff changeset
   215
    // if not already started. The client creates a .attach_pid<pid> file in the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   216
    // target VM's working directory (or /tmp), and the SIGQUIT handler checks
90ce3da70b43 Initial load
duke
parents:
diff changeset
   217
    // for the file.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   218
    private File createAttachFile(int pid) throws IOException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   219
        String fn = ".attach_pid" + pid;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   220
        String path = "/proc/" + pid + "/cwd/" + fn;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   221
        File f = new File(path);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   222
        try {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   223
            f.createNewFile();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   224
        } catch (IOException x) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   225
            path = "/tmp/" + fn;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   226
            f = new File(path);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   227
            f.createNewFile();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   228
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   229
        return f;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   230
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   231
90ce3da70b43 Initial load
duke
parents:
diff changeset
   232
    //-- native methods
90ce3da70b43 Initial load
duke
parents:
diff changeset
   233
90ce3da70b43 Initial load
duke
parents:
diff changeset
   234
    static native int open(String path) throws IOException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   235
90ce3da70b43 Initial load
duke
parents:
diff changeset
   236
    static native void close(int fd) throws IOException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   237
90ce3da70b43 Initial load
duke
parents:
diff changeset
   238
    static native int read(int fd, byte buf[], int off, int buflen) throws IOException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   239
90ce3da70b43 Initial load
duke
parents:
diff changeset
   240
    static native void checkPermissions(String path) throws IOException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   241
90ce3da70b43 Initial load
duke
parents:
diff changeset
   242
    static native void sigquit(int pid) throws IOException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   243
90ce3da70b43 Initial load
duke
parents:
diff changeset
   244
    // enqueue a command (and arguments) to the given door
90ce3da70b43 Initial load
duke
parents:
diff changeset
   245
    static native int enqueue(int fd, String cmd, Object ... args)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   246
        throws IOException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   247
90ce3da70b43 Initial load
duke
parents:
diff changeset
   248
    static {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   249
        System.loadLibrary("attach");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   250
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   251
}