summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Blake <eblake@redhat.com>2009-09-26 21:01:10 +0000
committerEric Blake <eblake@redhat.com>2009-09-26 21:01:10 +0000
commit15e9ecd14ad43013294092d1b6118d9ad0fe9f4c (patch)
treebd0ea71008834ae0ac4a92dcc658b205e40b049b
parentb14f894fd157fd65f9abd223832d2feed05e2aca (diff)
downloadcygnal-15e9ecd14ad43013294092d1b6118d9ad0fe9f4c.tar.gz
cygnal-15e9ecd14ad43013294092d1b6118d9ad0fe9f4c.tar.bz2
cygnal-15e9ecd14ad43013294092d1b6118d9ad0fe9f4c.zip
Add fexecve, execvpe.
* exec.cc (fexecve): New function. * cygwin.din (execvpe, fexecve): Export new fexecve and existing execvpe. * include/cygwin/version.h (CYGWIN_VERSION_API_MINOR): Bump. * posix.sgml: Mention them.
-rw-r--r--winsup/cygwin/ChangeLog8
-rw-r--r--winsup/cygwin/cygwin.din2
-rw-r--r--winsup/cygwin/exec.cc18
-rw-r--r--winsup/cygwin/include/cygwin/version.h3
-rw-r--r--winsup/cygwin/posix.sgml3
5 files changed, 31 insertions, 3 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index b843f54b0..76c9e151e 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,5 +1,13 @@
2009-09-26 Eric Blake <ebb9@byu.net>
+ * exec.cc (fexecve): New function.
+ * cygwin.din (execvpe, fexecve): Export new fexecve and existing
+ execvpe.
+ * include/cygwin/version.h (CYGWIN_VERSION_API_MINOR): Bump.
+ * posix.sgml: Mention them.
+
+2009-09-26 Eric Blake <ebb9@byu.net>
+
* syscalls.cc (link): Delete obsolete comment. Reject directories
and missing source up front.
(rename): Use correct errno for trailing '.'. Detect empty
diff --git a/winsup/cygwin/cygwin.din b/winsup/cygwin/cygwin.din
index bee9cd1c1..a10d18ca0 100644
--- a/winsup/cygwin/cygwin.din
+++ b/winsup/cygwin/cygwin.din
@@ -356,6 +356,7 @@ execve SIGFE
_execve = execve SIGFE
execvp SIGFE
_execvp = execvp SIGFE
+execvpe SIGFE
exit = cygwin_exit SIGFE
_exit SIGFE
exp NOSIGFE
@@ -454,6 +455,7 @@ feof SIGFE
_feof = feof SIGFE
ferror SIGFE
_ferror = ferror SIGFE
+fexecve SIGFE
fflush SIGFE
_fflush = fflush SIGFE
ffs NOSIGFE
diff --git a/winsup/cygwin/exec.cc b/winsup/cygwin/exec.cc
index ee0709c98..131439fbc 100644
--- a/winsup/cygwin/exec.cc
+++ b/winsup/cygwin/exec.cc
@@ -1,6 +1,6 @@
/* exec.cc: exec system call support.
- Copyright 1996, 1997, 1998, 2000, 2001, 2002 Red Hat, Inc.
+ Copyright 1996, 1997, 1998, 2000, 2001, 2002, 2009 Red Hat, Inc.
This file is part of Cygwin.
@@ -14,6 +14,10 @@ details. */
#include "cygerrno.h"
#include "path.h"
#include "environ.h"
+#include "sync.h"
+#include "fhandler.h"
+#include "dtable.h"
+#include "cygheap.h"
#undef _execve
/* This is called _execve and not execve because the real execve is defined
@@ -91,3 +95,15 @@ execvpe (const char *path, char * const *argv, char *const *envp)
path_conv buf;
return execve (find_exec (path, buf), argv, envp);
}
+
+extern "C" int
+fexecve (int fd, char * const *argv, char *const *envp)
+{
+ cygheap_fdget cfd (fd);
+ if (cfd < 0)
+ {
+ syscall_printf ("-1 = fexecve (%d, %p, %p)", fd, argv, envp);
+ return -1;
+ }
+ return execve (cfd->pc.get_win32 (), argv, envp);
+}
diff --git a/winsup/cygwin/include/cygwin/version.h b/winsup/cygwin/include/cygwin/version.h
index bd051031a..a396b1fe1 100644
--- a/winsup/cygwin/include/cygwin/version.h
+++ b/winsup/cygwin/include/cygwin/version.h
@@ -367,12 +367,13 @@ details. */
211: Export fpurge, mkstemps.
212: Add and export libstdc++ malloc wrappers.
213: Export canonicalize_file_name, eaccess, euidaccess.
+ 214: Export execvpe, fexecve.
*/
/* Note that we forgot to bump the api for ualarm, strtoll, strtoull */
#define CYGWIN_VERSION_API_MAJOR 0
-#define CYGWIN_VERSION_API_MINOR 213
+#define CYGWIN_VERSION_API_MINOR 214
/* There is also a compatibity version number associated with the
shared memory regions. It is incremented when incompatible
diff --git a/winsup/cygwin/posix.sgml b/winsup/cygwin/posix.sgml
index 48dce6c96..06e49d20a 100644
--- a/winsup/cygwin/posix.sgml
+++ b/winsup/cygwin/posix.sgml
@@ -152,6 +152,7 @@ also IEEE Std 1003.1-2008 (POSIX.1-2008).</para>
fdopendir
feof
ferror
+ fexecve
fflush
ffs
fgetc
@@ -1015,6 +1016,7 @@ also IEEE Std 1003.1-2008 (POSIX.1-2008).</para>
envz_remove
envz_strip
euidaccess
+ execvpe
exp10
exp10f
fcloseall
@@ -1227,7 +1229,6 @@ also IEEE Std 1003.1-2008 (POSIX.1-2008).</para>
fesetround
fetestexcept
feupdateenv
- fexecve
floorl
fmal
fmaxl