From: Nobuyoshi Nakada Date: 2009-03-16T13:49:59+09:00 Subject: Re: execle ruby process from C ? Hi, At Mon, 16 Mar 2009 12:59:51 +0900, Michael Linfield wrote in [ruby-talk:331241]: > > The second string is concatenated at compile time into > > "/usr/bin/ruby test.rb", so you execute ruby with only that one > > argument, which is counted as the program name. Therefore ruby > > waits script from stdin. > > The HTTP server shouldn't be waiting for stdin because test.rb never > calls for it. Correct, but OP's code doesn't any arguments to /usr/bin/ruby. So ruby expects that the script will be given from stdin. That is, I meant a bug about string literal concatenation. It should be: if(execle("/usr/bin/ruby", "/usr/bin/ruby", "test.rb", NULL, NULL) == -1) Note that a comma between "/usr/bin/ruby" and "test.rb", and stripping a leading space from " test.rb", also. -- Nobu Nakada