1 /*
   2  * Copyright (c) 2016, 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 package jdk.tools.jaotc.jnilibelf.linux;
  25 
  26 /**
  27  * Represent Elf_Cmd enums defined in libelf.h on Linux as they slightly different from libelf.h on
  28  * SunOS.
  29  */
  30 public enum Elf_Cmd {
  31     /** Nothing, terminate, or compute only. */
  32     ELF_C_NULL,
  33 
  34     /** Read. */
  35     ELF_C_READ,
  36 
  37     /** Read and write. */
  38     ELF_C_RDWR,
  39 
  40     /** Write. */
  41     ELF_C_WRITE,
  42 
  43     /** Clear flag. */
  44     ELF_C_CLR,
  45 
  46     /** Set flag. */
  47     ELF_C_SET,
  48 
  49     /**
  50      * Signal that file descriptor will not be used anymore.
  51      */
  52     ELF_C_FDDONE,
  53 
  54     /**
  55      * Read rest of data so that file descriptor is not used anymore.
  56      */
  57     ELF_C_FDREAD,
  58 
  59     /* The following are extensions. */
  60 
  61     /** Read, but mmap the file if possible. */
  62     ELF_C_READ_MMAP,
  63 
  64     /** Read and write, with mmap. */
  65     ELF_C_RDWR_MMAP,
  66 
  67     /** Write, with mmap. */
  68     ELF_C_WRITE_MMAP,
  69 
  70     /**
  71      * Read, but memory is writable, results are not written to the file.
  72      */
  73     ELF_C_READ_MMAP_PRIVATE,
  74 
  75     /** Copy basic file data but not the content. */
  76     ELF_C_EMPTY,
  77 
  78     /** Keep this the last entry. */
  79     ELF_C_NUM;
  80 }