src/share/vm/memory/filemap.cpp

Print this page


   1 /*
   2  * Copyright (c) 2003, 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/_filemap.cpp.incl"
















  27 # include <sys/stat.h>
  28 # include <errno.h>
  29 
  30 #ifndef O_BINARY       // if defined (Win32) use binary files.
  31 #define O_BINARY 0     // otherwise do nothing.
  32 #endif
  33 
  34 
  35 extern address JVM_FunctionAtStart();
  36 extern address JVM_FunctionAtEnd();
  37 
  38 // Complain and stop. All error conditions occurring during the writing of
  39 // an archive file should stop the process.  Unrecoverable errors during
  40 // the reading of the archive file should stop the process.
  41 
  42 static void fail(const char *msg, va_list ap) {
  43   // This occurs very early during initialization: tty is not initialized.
  44   jio_fprintf(defaultStream::error_stream(),
  45               "An error has occurred while processing the"
  46               " shared archive file.\n");


   1 /*
   2  * Copyright (c) 2003, 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 "classfile/classLoader.hpp"
  27 #include "classfile/symbolTable.hpp"
  28 #include "memory/filemap.hpp"
  29 #include "runtime/arguments.hpp"
  30 #include "runtime/java.hpp"
  31 #include "runtime/os.hpp"
  32 #include "utilities/defaultStream.hpp"
  33 #ifdef TARGET_OS_FAMILY_linux
  34 # include "hpi_linux.hpp"
  35 #endif
  36 #ifdef TARGET_OS_FAMILY_solaris
  37 # include "hpi_solaris.hpp"
  38 #endif
  39 #ifdef TARGET_OS_FAMILY_windows
  40 # include "hpi_windows.hpp"
  41 #endif
  42 
  43 # include <sys/stat.h>
  44 # include <errno.h>
  45 
  46 #ifndef O_BINARY       // if defined (Win32) use binary files.
  47 #define O_BINARY 0     // otherwise do nothing.
  48 #endif
  49 
  50 
  51 extern address JVM_FunctionAtStart();
  52 extern address JVM_FunctionAtEnd();
  53 
  54 // Complain and stop. All error conditions occurring during the writing of
  55 // an archive file should stop the process.  Unrecoverable errors during
  56 // the reading of the archive file should stop the process.
  57 
  58 static void fail(const char *msg, va_list ap) {
  59   // This occurs very early during initialization: tty is not initialized.
  60   jio_fprintf(defaultStream::error_stream(),
  61               "An error has occurred while processing the"
  62               " shared archive file.\n");