Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Blake <eblake@redhat.com>2009-09-27 01:01:10 +0400
committerEric Blake <eblake@redhat.com>2009-09-27 01:01:10 +0400
commit15e9ecd14ad43013294092d1b6118d9ad0fe9f4c (patch)
treebd0ea71008834ae0ac4a92dcc658b205e40b049b /winsup/cygwin/exec.cc
parentb14f894fd157fd65f9abd223832d2feed05e2aca (diff)
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.
Diffstat (limited to 'winsup/cygwin/exec.cc')
-rw-r--r--winsup/cygwin/exec.cc18
1 files changed, 17 insertions, 1 deletions
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);
+}