bit / subprocess

subprocess.jsm - start a process in your Firefox Extension and read/write data to/from it using stdin/stdout/stderr streams.
26 stars 9 forks source link

Add rudimentary support for Android and B2G #6

Closed janjongboom closed 9 years ago

janjongboom commented 9 years ago

The Android version of libc does not support posix_spawn, which means Android & B2G cannot use the Linux version of subprocess. I added some rudimentary support for Android by using popen and fileno and then passing it to the worker. It only supports stdout at the moment by the way. But I guess all of Linux module could be replaced by this approach once it would be complete.

Let me know what you think.

bit commented 9 years ago

subprocess was previously using popen but that does not work for i/o. That's the reason for posix_spawn. If there is a more portable way keeping all features I am all for replacing the Linux part with it.