< prev index next >

src/jdk.hotspot.agent/macosx/native/libsaproc/libproc.h

Print this page
rev 59383 : [mq]: final
   1 /*
   2  * Copyright (c) 2003, 2013, 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  *


  42 #ifndef psaddr_t
  43 #define psaddr_t uintptr_t
  44 #endif
  45 
  46 #ifndef bool
  47 typedef int bool;
  48 #define true  1
  49 #define false 0
  50 #endif  // bool
  51 
  52 #ifndef lwpid_t
  53 #define lwpid_t uintptr_t
  54 #endif
  55 
  56 #include <mach/thread_status.h>
  57 #else   // __APPLE__
  58 #include <elf.h>
  59 #include <link.h>
  60 #include <machine/reg.h>
  61 #include <proc_service.h>
  62 #if defined(sparc) || defined(sparcv9)
  63 /*
  64   If _LP64 is defined ptrace.h should be taken from /usr/include/asm-sparc64
  65   otherwise it should be from /usr/include/asm-sparc
  66   These two files define pt_regs structure differently
  67 */
  68 #ifdef _LP64
  69 #include "asm-sparc64/ptrace.h"
  70 #else
  71 #include "asm-sparc/ptrace.h"
  72 #endif
  73 
  74 #endif //sparc or sparcv9
  75 
  76 // This C bool type must be int for compatibility with BSD calls and
  77 // it would be a mistake to equivalence it to C++ bool on many platforms
  78 typedef int bool;
  79 #define true  1
  80 #define false 0
  81 
  82 #endif // __APPLE__
  83 
  84 /************************************************************************************
  85 
  86 0. This is very minimal subset of Solaris libproc just enough for current application.
  87 Please note that the bulk of the functionality is from proc_service interface. This
  88 adds Pgrab__ and some missing stuff. We hide the difference b/w live process and core
  89 file by this interface.
  90 
  91 1. pthread_id is unique. We store this in OSThread::_pthread_id in JVM code.
  92 
  93 2. All threads see the same pid when they call getpid().
  94 We used to save the result of ::getpid() call in OSThread::_thread_id.


   1 /*
   2  * Copyright (c) 2003, 2020, 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  *


  42 #ifndef psaddr_t
  43 #define psaddr_t uintptr_t
  44 #endif
  45 
  46 #ifndef bool
  47 typedef int bool;
  48 #define true  1
  49 #define false 0
  50 #endif  // bool
  51 
  52 #ifndef lwpid_t
  53 #define lwpid_t uintptr_t
  54 #endif
  55 
  56 #include <mach/thread_status.h>
  57 #else   // __APPLE__
  58 #include <elf.h>
  59 #include <link.h>
  60 #include <machine/reg.h>
  61 #include <proc_service.h>













  62 
  63 // This C bool type must be int for compatibility with BSD calls and
  64 // it would be a mistake to equivalence it to C++ bool on many platforms
  65 typedef int bool;
  66 #define true  1
  67 #define false 0
  68 
  69 #endif // __APPLE__
  70 
  71 /************************************************************************************
  72 
  73 0. This is very minimal subset of Solaris libproc just enough for current application.
  74 Please note that the bulk of the functionality is from proc_service interface. This
  75 adds Pgrab__ and some missing stuff. We hide the difference b/w live process and core
  76 file by this interface.
  77 
  78 1. pthread_id is unique. We store this in OSThread::_pthread_id in JVM code.
  79 
  80 2. All threads see the same pid when they call getpid().
  81 We used to save the result of ::getpid() call in OSThread::_thread_id.


< prev index next >