activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chir...@apache.org
Subject svn commit: r880916 - in /activemq/sandbox/activemq-apollo/activemq-syscall/src/main/java/org/apache/activemq/syscall: CLibrary.java IO.java
Date Mon, 16 Nov 2009 19:18:53 GMT
Author: chirino
Date: Mon Nov 16 19:18:53 2009
New Revision: 880916

URL: http://svn.apache.org/viewvc?rev=880916&view=rev
Log:
working on aio

Modified:
    activemq/sandbox/activemq-apollo/activemq-syscall/src/main/java/org/apache/activemq/syscall/CLibrary.java
    activemq/sandbox/activemq-apollo/activemq-syscall/src/main/java/org/apache/activemq/syscall/IO.java

Modified: activemq/sandbox/activemq-apollo/activemq-syscall/src/main/java/org/apache/activemq/syscall/CLibrary.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-apollo/activemq-syscall/src/main/java/org/apache/activemq/syscall/CLibrary.java?rev=880916&r1=880915&r2=880916&view=diff
==============================================================================
--- activemq/sandbox/activemq-apollo/activemq-syscall/src/main/java/org/apache/activemq/syscall/CLibrary.java
(original)
+++ activemq/sandbox/activemq-apollo/activemq-syscall/src/main/java/org/apache/activemq/syscall/CLibrary.java
Mon Nov 16 19:18:53 2009
@@ -40,15 +40,21 @@
     
     @JniMethod(flags={MethodFlag.CONSTANT})
     public static final native int errno();
-    
-    ///////////////////////////////////////////////////////////////////
-    //
-    // String related methods 
-    //
-    ///////////////////////////////////////////////////////////////////
+
+    @JniMethod(cast="char *")
+    public static final native long strerror(int errnum);
     
     public static final native int strlen(
             @JniArg(cast="char *")long s);
+    
+    public static String string(long ptr) {
+        if( ptr == NULL )
+            return null;
+        int length = strlen(ptr);
+        byte[] data = new byte[length];
+        memmove(data, ptr, length);
+        return new String(data);
+    }
 
     ///////////////////////////////////////////////////////////////////
     //

Modified: activemq/sandbox/activemq-apollo/activemq-syscall/src/main/java/org/apache/activemq/syscall/IO.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-apollo/activemq-syscall/src/main/java/org/apache/activemq/syscall/IO.java?rev=880916&r1=880915&r2=880916&view=diff
==============================================================================
--- activemq/sandbox/activemq-apollo/activemq-syscall/src/main/java/org/apache/activemq/syscall/IO.java
(original)
+++ activemq/sandbox/activemq-apollo/activemq-syscall/src/main/java/org/apache/activemq/syscall/IO.java
Mon Nov 16 19:18:53 2009
@@ -68,6 +68,40 @@
     public static int O_ASYNC;
 
     @JniField(flags={CONSTANT})
+    public static int S_IRWXU;
+    @JniField(flags={CONSTANT})
+    public static int S_IRUSR;
+    @JniField(flags={CONSTANT})
+    public static int S_IWUSR;
+    @JniField(flags={CONSTANT})
+    public static int S_IXUSR;
+            
+    @JniField(flags={CONSTANT})
+    public static int S_IRWXG;
+    @JniField(flags={CONSTANT})
+    public static int S_IRGRP;
+    @JniField(flags={CONSTANT})
+    public static int S_IWGRP;
+    @JniField(flags={CONSTANT})
+    public static int S_IXGRP;
+            
+    @JniField(flags={CONSTANT})
+    public static int S_IRWXO;
+    @JniField(flags={CONSTANT})
+    public static int S_IROTH;
+    @JniField(flags={CONSTANT})
+    public static int S_IWOTH;
+    @JniField(flags={CONSTANT})
+    public static int S_IXOTH;
+            
+    @JniField(flags={CONSTANT})
+    public static int S_ISUID;
+    @JniField(flags={CONSTANT})
+    public static int S_ISGID;
+    @JniField(flags={CONSTANT})
+    public static int S_ISVTX;
+    
+    @JniField(flags={CONSTANT})
     public static int F_DUPFD;
     @JniField(flags={CONSTANT})
     public static int F_GETFD;
@@ -113,7 +147,13 @@
     // IO related methods 
     //
     ///////////////////////////////////////////////////////////////////
-
+    /**
+     * <code><pre>
+     * int open(const char *path, int oflags, ...);
+     * </pre></code>
+     */
+    public static final native int open(String path, int oflags);
+    
     /**
      * <code><pre>
      * int open(const char *path, int oflags, ...);



Mime
View raw message