Permalink
Browse files

Add env var support to exec and add execve. Needs Windows love.

  • Loading branch information...
1 parent 2d1a99e commit e307afe458b7aed61ec45a98e9a2df9fbe93910d @headius headius committed Jun 22, 2011
View

Large diffs are not rendered by default.

Oops, something went wrong.
@@ -4,5 +4,5 @@ build.xml.stylesheet.CRC32=958a1d3e@1.26.2.45
# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
nbproject/build-impl.xml.data.CRC32=e5ed31b5
-nbproject/build-impl.xml.script.CRC32=93352728
-nbproject/build-impl.xml.stylesheet.CRC32=576378a2@1.32.1.45
+nbproject/build-impl.xml.script.CRC32=d9e69b9c
+nbproject/build-impl.xml.stylesheet.CRC32=0c01fd8e@1.43.1.45
@@ -42,14 +42,23 @@ public int chown(String filename, int user, int group) {
return libc().chown(filename, user, group);
}
- public int exec(String path, String[] args) {
+ public int exec(String path, String... args) {
+ handler.unimplementedError("exec unimplemented");
+ return -1;
+ }
+
+ public int exec(String path, String[] args, String[] envp) {
handler.unimplementedError("exec unimplemented");
return -1;
}
public int execv(String path, String[] args) {
return libc().execv(path, args);
- }
+ }
+
+ public int execve(String path, String[] args, String[] env) {
+ return libc().execve(path, args, env);
+ }
public FileStat fstat(FileDescriptor fileDescriptor) {
FileStat stat = allocateStat();
@@ -38,12 +38,25 @@ public int exec(String path, String... argv) {
return -1;
}
- public int execv(String path, String... argv) {
+
+ public int exec(String path, String[] argv, String[] envp) {
+ handler.unimplementedError("No exec in Java (yet)");
+
+ return -1;
+ }
+
+ public int execv(String path, String[] argv) {
handler.unimplementedError("No execv in Java (yet)");
return -1;
}
+ public int execve(String path, String[] argv, String[] envp) {
+ handler.unimplementedError("No execve in Java (yet)");
+
+ return -1;
+ }
+
public FileStat fstat(FileDescriptor descriptor) {
handler.unimplementedError("fstat unimplemented");
@@ -58,13 +58,21 @@ public void errno(int value) {
posix().errno(value);
}
- public int exec(String path, String[] args) {
+ public int exec(String path, String... args) {
return posix().exec(path, args);
}
+
+ public int exec(String path, String[] args, String[] envp) {
+ return posix().exec(path, args, envp);
+ }
- public int execv(String path, String... argv) {
+ public int execv(String path, String[] argv) {
return posix().execv(path, argv);
}
+
+ public int execve(String path, String[] argv, String[] envp) {
+ return posix().execve(path, argv, envp);
+ }
public int fork() {
return posix().fork();
@@ -93,4 +93,5 @@
int write(int fd, @In ByteBuffer src, int len);
int close(int fd);
int execv(CharSequence path, @In CharSequence... argv);
+ int execve(CharSequence path, @In CharSequence[] argv, @In CharSequence[] envp);
}
@@ -2,8 +2,6 @@
import java.io.FileDescriptor;
import java.io.IOException;
-import java.util.Map;
-
public interface POSIX {
FileStat allocateStat();
@@ -14,7 +12,10 @@
* preparation of a command line or command list.
*/
int exec(String path, String... argv);
- int execv(String path, String... argv);
+ int exec(String path, String[] argv, String[] envp);
+
+ int execv(String path, String[] argv);
+ int execve(String path, String[] argv, String[] envp);
int fork();
FileStat fstat(FileDescriptor descriptor);
String getenv(String envName);

0 comments on commit e307afe

Please sign in to comment.