< prev index next >

src/java.base/unix/classes/sun/nio/fs/UnixConstants.java.template

Print this page
rev 50258 : [mq]: 8203369-Check-for-both-EAGAIN-and-EWOULDBLOCK-error-codes
   1 /*
   2  * Copyright (c) 2008, 2017, Oracle and/or its affiliates. All rights reserved.
   3  *
   4  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   5  *
   6  * This code is free software; you can redistribute it and/or modify it
   7  * under the terms of the GNU General Public License version 2 only, as
   8  * published by the Free Software Foundation.  Oracle designates this
   9  * particular file as subject to the "Classpath" exception as provided
  10  * by Oracle in the LICENSE file that accompanied this code.
  11  *
  12  * This code is distributed in the hope that it will be useful, but WITHOUT
  13  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  14  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  15  * version 2 for more details (a copy is included in the LICENSE file that
  16  * accompanied this code).
  17  *
  18  * You should have received a copy of the GNU General Public License version
  19  * 2 along with this work; if not, write to the Free Software Foundation,
  20  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  21  *
  22  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  23  * or visit www.oracle.com if you need additional information or have any
  24  * questions.
  25  *
  26  */
  27 
  28 @@END_COPYRIGHT@@
  29 
  30 #include <stdio.h>
  31 #include <errno.h>
  32 #include <unistd.h>
  33 #include <fcntl.h>
  34 #include <sys/stat.h>
  35 
  36 /* On Solaris, "sun" is defined as a macro. Undefine to make package
  37    declaration valid */
  38 #undef sun
  39 
  40 /* To be able to name the Java constants the same as the C constants without
  41    having the preprocessor rewrite those identifiers, add PREFIX_ to all
  42    identifiers matching a C constant. The PREFIX_ is filtered out in the
  43    makefile. */
  44 
  45 @@START_HERE@@


  94     static final int PREFIX_S_IFDIR = S_IFDIR;
  95     static final int PREFIX_S_IFLNK = S_IFLNK;
  96     static final int PREFIX_S_IFCHR = S_IFCHR;
  97     static final int PREFIX_S_IFBLK = S_IFBLK;
  98     static final int PREFIX_S_IFIFO = S_IFIFO;
  99     static final int PREFIX_R_OK = R_OK;
 100     static final int PREFIX_W_OK = W_OK;
 101     static final int PREFIX_X_OK = X_OK;
 102     static final int PREFIX_F_OK = F_OK;
 103     static final int PREFIX_ENOENT = ENOENT;
 104     static final int PREFIX_ENXIO = ENXIO;
 105     static final int PREFIX_EACCES = EACCES;
 106     static final int PREFIX_EEXIST = EEXIST;
 107     static final int PREFIX_ENOTDIR = ENOTDIR;
 108     static final int PREFIX_EINVAL = EINVAL;
 109     static final int PREFIX_EXDEV = EXDEV;
 110     static final int PREFIX_EISDIR = EISDIR;
 111     static final int PREFIX_ENOTEMPTY = ENOTEMPTY;
 112     static final int PREFIX_ENOSPC = ENOSPC;
 113     static final int PREFIX_EAGAIN = EAGAIN;

 114     static final int PREFIX_ENOSYS = ENOSYS;
 115     static final int PREFIX_ELOOP = ELOOP;
 116     static final int PREFIX_EROFS = EROFS;
 117 
 118 #ifndef ENODATA
 119     // Only used in Linux java source, provide any value so it compiles
 120     static final int PREFIX_ENODATA = ELAST;
 121 #else
 122     static final int PREFIX_ENODATA = ENODATA;
 123 #endif
 124 
 125     static final int PREFIX_ERANGE = ERANGE;
 126     static final int PREFIX_EMFILE = EMFILE;
 127 
 128     // flags used with openat/unlinkat/etc.
 129 #if defined(AT_SYMLINK_NOFOLLOW) && defined(AT_REMOVEDIR)
 130     static final int PREFIX_AT_SYMLINK_NOFOLLOW = AT_SYMLINK_NOFOLLOW;
 131     static final int PREFIX_AT_REMOVEDIR = AT_REMOVEDIR;
 132 #else
 133     // not supported (dummy values will not be used at runtime).
   1 /*
   2  * Copyright (c) 2008, 2018, 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.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.

  24  */
  25 
  26 @@END_COPYRIGHT@@
  27 
  28 #include <stdio.h>
  29 #include <errno.h>
  30 #include <unistd.h>
  31 #include <fcntl.h>
  32 #include <sys/stat.h>
  33 
  34 /* On Solaris, "sun" is defined as a macro. Undefine to make package
  35    declaration valid */
  36 #undef sun
  37 
  38 /* To be able to name the Java constants the same as the C constants without
  39    having the preprocessor rewrite those identifiers, add PREFIX_ to all
  40    identifiers matching a C constant. The PREFIX_ is filtered out in the
  41    makefile. */
  42 
  43 @@START_HERE@@


  92     static final int PREFIX_S_IFDIR = S_IFDIR;
  93     static final int PREFIX_S_IFLNK = S_IFLNK;
  94     static final int PREFIX_S_IFCHR = S_IFCHR;
  95     static final int PREFIX_S_IFBLK = S_IFBLK;
  96     static final int PREFIX_S_IFIFO = S_IFIFO;
  97     static final int PREFIX_R_OK = R_OK;
  98     static final int PREFIX_W_OK = W_OK;
  99     static final int PREFIX_X_OK = X_OK;
 100     static final int PREFIX_F_OK = F_OK;
 101     static final int PREFIX_ENOENT = ENOENT;
 102     static final int PREFIX_ENXIO = ENXIO;
 103     static final int PREFIX_EACCES = EACCES;
 104     static final int PREFIX_EEXIST = EEXIST;
 105     static final int PREFIX_ENOTDIR = ENOTDIR;
 106     static final int PREFIX_EINVAL = EINVAL;
 107     static final int PREFIX_EXDEV = EXDEV;
 108     static final int PREFIX_EISDIR = EISDIR;
 109     static final int PREFIX_ENOTEMPTY = ENOTEMPTY;
 110     static final int PREFIX_ENOSPC = ENOSPC;
 111     static final int PREFIX_EAGAIN = EAGAIN;
 112     static final int PREFIX_EWOULDBLOCK = EWOULDBLOCK;
 113     static final int PREFIX_ENOSYS = ENOSYS;
 114     static final int PREFIX_ELOOP = ELOOP;
 115     static final int PREFIX_EROFS = EROFS;
 116 
 117 #ifndef ENODATA
 118     // Only used in Linux java source, provide any value so it compiles
 119     static final int PREFIX_ENODATA = ELAST;
 120 #else
 121     static final int PREFIX_ENODATA = ENODATA;
 122 #endif
 123 
 124     static final int PREFIX_ERANGE = ERANGE;
 125     static final int PREFIX_EMFILE = EMFILE;
 126 
 127     // flags used with openat/unlinkat/etc.
 128 #if defined(AT_SYMLINK_NOFOLLOW) && defined(AT_REMOVEDIR)
 129     static final int PREFIX_AT_SYMLINK_NOFOLLOW = AT_SYMLINK_NOFOLLOW;
 130     static final int PREFIX_AT_REMOVEDIR = AT_REMOVEDIR;
 131 #else
 132     // not supported (dummy values will not be used at runtime).
< prev index next >