diff options
author | yugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-05-17 02:48:59 +0000 |
---|---|---|
committer | yugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-05-17 02:48:59 +0000 |
commit | 76bc2d1ed7f13fb329c33f48756ea3c24c59a6ea (patch) | |
tree | 3ec93c5eb45d0bc6e6eb53d2efebd2f8c0c8ee3d /process.c | |
parent | 0a7aada5d18441b437f5e406a991d963b3613d9a (diff) | |
download | ruby-76bc2d1ed7f13fb329c33f48756ea3c24c59a6ea.tar.gz |
Imports Ruby's port to NativeClient (a.k.a NaCl).
Patch by Google Inc. [ruby-core:45073].
* configure.in (RUBY_NACL): New M4 func to configure variables for
NaCl.
(RUBY_NACL_CHECK_PEPPER_TYPES): New M4 func to check the old names
of Pepper interface types.
(BTESTRUBY): New variable to specify which ruby should be run on
"make btest". NaCl can run the built binary by sel_ldr, but it need
rbconfig.rb. So this variable is distinguished from $MINIRUBY.
* thread_pthread.c: Disabled some features on NaCl.
* io.c: ditto.
* process.c: ditto.
* signal.c: ditto.
* file.c: ditto.
* missing/flock.c: ditto.
* nacl/pepper_main.c: An example implementation of Pepper application
that embeds Ruby.
* nacl/example.html: An example of web page that uses the Pepper
application.
* nacl/nacl-config.rb: Detects variants of NaCl SDK.
* nacl/GNUmakefile.in: Makefile template for NaCl specific build
process.
* nacl/package.rb: script for packaging a NaCl-Ruby embedding
application.
* nacl/reate_nmf.rb: Wrapper script of create_nmf.py
* dln.c (dln_load): Added a hack to call on NaCl.
* util.c (ruby_getcwd): Path to the current directort is not available
on NaCl.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35672 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'process.c')
-rw-r--r-- | process.c | 37 |
1 files changed, 29 insertions, 8 deletions
@@ -62,6 +62,11 @@ #endif #include <sys/stat.h> +#if defined(__native_client__) && defined(NACL_NEWLIB) +# include "nacl/stat.h" +# include "nacl/unistd.h" +#endif + #ifdef HAVE_SYS_TIMES_H #include <sys/times.h> @@ -1042,7 +1047,7 @@ security(const char *str) } } -#ifdef HAVE_FORK +#if defined(HAVE_FORK) && !defined(__native_client__) #define try_with_sh(prog, argv) ((saved_errno == ENOEXEC) ? exec_with_sh((prog), (argv)) : (void)0) static void exec_with_sh(const char *prog, char **argv) @@ -1061,13 +1066,20 @@ exec_with_sh(const char *prog, char **argv) #define ALLOC_ARGV_WITH_STR(n, v, s, l) \ (char **)(((s) = ALLOCV_N(char, (v), ARGV_SIZE(n) + (l)) + ARGV_SIZE(n)) - ARGV_SIZE(n)) +#ifdef __native_client__ +static int +proc_exec_v(char **argv, const char *prog) +{ + rb_notimplement(); +} +#else static int proc_exec_v(char **argv, const char *prog) { char fbuf[MAXPATHLEN]; -#if defined(__EMX__) || defined(OS2) +# if defined(__EMX__) || defined(OS2) char **new_argv = NULL; -#endif +# endif if (!prog) prog = argv[0]; @@ -1077,9 +1089,9 @@ proc_exec_v(char **argv, const char *prog) return -1; } -#if defined(__EMX__) || defined(OS2) +# if defined(__EMX__) || defined(OS2) { -#define COMMAND "cmd.exe" +# define COMMAND "cmd.exe" char *extension; if ((extension = strrchr(prog, '.')) != NULL && STRCASECMP(extension, ".bat") == 0) { @@ -1104,18 +1116,19 @@ proc_exec_v(char **argv, const char *prog) } } } -#endif /* __EMX__ */ +# endif /* __EMX__ */ before_exec(); execv(prog, argv); preserving_errno(try_with_sh(prog, argv); after_exec()); -#if defined(__EMX__) || defined(OS2) +# if defined(__EMX__) || defined(OS2) if (new_argv) { xfree(new_argv[0]); xfree(new_argv); } -#endif +# endif return -1; } +#endif int rb_proc_exec_n(int argc, VALUE *argv, const char *prog) @@ -1137,6 +1150,13 @@ rb_proc_exec_n(int argc, VALUE *argv, const char *prog) return ret; } +#ifdef __native_client__ +int +rb_proc_exec(const char *str) +{ + rb_notimplement(); +} +#else int rb_proc_exec(const char *str) { @@ -1206,6 +1226,7 @@ rb_proc_exec(const char *str) return ret; #endif /* _WIN32 */ } +#endif enum { EXEC_OPTION_PGROUP, |