3

I have a cross platform library and use posix_spawn from libc to spawn new processes on Linux'y environments. However this is not included in the Bionic libc library included on Android. Is there an alternative way to spawn processes through Androids libc?

Jan Jongboom
  • 26,598
  • 9
  • 83
  • 120
  • 1
    In the end I went with `popen`, then get a fd via `fileno`, then use that to read from. – Jan Jongboom Dec 18 '14 at 14:30
  • Are you doing this with js-ctypes for mozilla related stuff? – Noitidart Jul 05 '15 at 07:18
  • 1
    @Noitidart yes, see https://github.com/jan-os/gecko-dev/blob/os-module/dom/os/subprocess.jsm#L1065 – Jan Jongboom Jul 07 '15 at 07:11
  • So cool thanks for that share this helps a lot! – Noitidart Jul 07 '15 at 15:28
  • 1
    If you want to hook this into core Moz codebase, might wanna take a look at https://bugzilla.mozilla.org/show_bug.cgi?id=1141021 – Jan Jongboom Jul 08 '15 at 11:57
  • Thanks @Jan thats really cool! Is this possible to be done on Firefox OS by any chance? – Noitidart Jul 08 '15 at 15:05
  • 1
    Yes, if you get a build from http://janos.io/ it includes (an earlier version of) this API already (see the docs page on the site). It's meant to run on non-phone FxOS devices (e.g. Raspberry Pi) – Jan Jongboom Jul 09 '15 at 08:13
  • Ah thanks @Jan Im trying to run on FxOS though, ideally i wanted to use js-ctypes like i do in firefox addons, but i think they wont let me use js-ctypes on fxos :( – Noitidart Jul 09 '15 at 08:18
  • 1
    You can use js-ctypes if you build your own Gecko (see f.e. http://blog.telenor.io/gonzo/firefox/2014/12/17/new-apis.html) in Firefox OS. So yeah, no add-ons yet. – Jan Jongboom Jul 09 '15 at 08:43
  • Awww so jealous you can use OS.File and all of Gecko!! That's what I was hoping I could do on Firefox OS as I have been that side of Firefox developing for desktop and android for long time, I wanted to bring my experience to FxOS. Dang custom build won't work right now for me :( as i wont be able to push my app to the store to public :( Drats, thanks so much for that article though its extremely informative! – Noitidart Jul 10 '15 at 06:36

0 Answers0