src/os/solaris/vm/attachListener_solaris.cpp

Print this page


   1 /*
   2  * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 
  25 # include "incls/_precompiled.incl"
  26 # include "incls/_attachListener_solaris.cpp.incl"



  27 
  28 #include <door.h>
  29 #include <string.h>
  30 #include <signal.h>
  31 #include <sys/types.h>
  32 #include <sys/socket.h>
  33 #include <sys/stat.h>
  34 
  35 // stropts.h uses STR in stream ioctl defines
  36 #undef STR
  37 #include <stropts.h>
  38 #undef STR
  39 #define STR(a) #a
  40 
  41 // The attach mechanism on Solaris is implemented using the Doors IPC
  42 // mechanism. The first tool to attempt to attach causes the attach
  43 // listener thread to startup. This thread creats a door that is
  44 // associated with a function that enqueues an operation to the attach
  45 // listener. The door is attached to a file in the file system so that
  46 // client (tools) can locate it. To enqueue an operation to the VM the


   1 /*
   2  * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 
  25 #include "precompiled.hpp"
  26 #include "runtime/interfaceSupport.hpp"
  27 #include "runtime/os.hpp"
  28 #include "services/attachListener.hpp"
  29 #include "services/dtraceAttacher.hpp"
  30 
  31 #include <door.h>
  32 #include <string.h>
  33 #include <signal.h>
  34 #include <sys/types.h>
  35 #include <sys/socket.h>
  36 #include <sys/stat.h>
  37 
  38 // stropts.h uses STR in stream ioctl defines
  39 #undef STR
  40 #include <stropts.h>
  41 #undef STR
  42 #define STR(a) #a
  43 
  44 // The attach mechanism on Solaris is implemented using the Doors IPC
  45 // mechanism. The first tool to attempt to attach causes the attach
  46 // listener thread to startup. This thread creats a door that is
  47 // associated with a function that enqueues an operation to the attach
  48 // listener. The door is attached to a file in the file system so that
  49 // client (tools) can locate it. To enqueue an operation to the VM the