Git Product home page Git Product logo

mruby-exec's Introduction

mruby-exec Build Status

Small execv/execve wrapper

install by mrbgems

  • add conf.gem line to build_config.rb
MRuby::Build.new do |conf|

  # ... (snip) ...

  conf.gem :github => 'haconiwa/mruby-exec'
end

example

Exec.execv("/bin/bash")
#=> The process will become bash

# Also you can pass more than 1 params
Exec.execv("/bin/bash", "-l", "-c", "echo Hello exec")
Exec.execve({"FOO" => "bar"}, "/bin/bash", "-l")

# ... or
# env cleanup
Exec.execve({}, "/bin/bash", "-l")

License

  • under the MIT License: see LICENSE file

mruby-exec's People

Contributors

buty4649 avatar ksss avatar matsumotory avatar take-cheeze avatar udzura avatar yamori813 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

mruby-exec's Issues

Casual test case occurs SEGV?

When added this one:

assert("Exec#exec") do
  p = Process.fork { Exec.exec "/bin/sleep", "0.1" }
  p, status = Process.waitpid2 p
  assert_true(p.is_a?(Integer))
  assert_true(status.success?)
end

Then it makes SEGV once about every 4 times.

But, but this seems to make no SEGV...

loop do
  p = Process.fork { exec "/bin/bash", "-c", "echo -n ." }
  Process.waitpid p
end
$ ./mruby/bin/mruby /tmp/just_loop.rb
..........................................................................................
..........................................................................................
..........................................................................................
..........................................................................................
..........................................................................................
..........................................................................................
..........................................................................................
..........................................................................................
..........................................................................................
..........................................................................................
..........................................................................................
..........................................................................................
..........................................................................................
..........................................................................................
..........................................................................................
..........................................................................................
..........................................................................................
..........................................................................................
..................

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.