4
我發現http://support.zeus.com/zws/examples/2005/12/16/hello_world_in_perl_and_c,這兩個例子正在工作。FastCGI與Ada
現在我試了這個Ada,並且自2天以來我無法完成。
fcgi_stdio.ads
with Interfaces.C;
with Interfaces.C.Strings;
package fcgi_stdio is
function FCGI_Accept return Interfaces.C.int;
pragma Import (C, FCGI_Accept, "FCGI_Accept");
procedure FCGI_printf (str : Interfaces.C.Strings.chars_ptr);
pragma Import (C, FCGI_printf, "FCGI_printf");
end fcgi_stdio;
test.adb
with fcgi_stdio;
with Interfaces.C;
with Interfaces.C.Strings;
procedure Test is
begin
while Integer (fcgi_stdio.FCGI_Accept) >= 0 loop
fcgi_stdio.FCGI_printf (Interfaces.C.Strings.New_String ("Content-Type: text/plain" & ASCII.LF & ASCII.LF));
fcgi_stdio.FCGI_printf (Interfaces.C.Strings.New_String ("Hello World from Ada!" & ASCII.LF));
end loop;
end Test;
當我在控制檯中運行它,我得到以下錯誤:
$ ./test
raised STORAGE_ERROR : stack overflow or erroneous memory access
的Apache的error_log顯示:
Premature end of script headers: test
有沒有人有一個想法,我可以得到它的工作?
謝謝,我糾正它!但錯誤仍然是一樣的。 – user1091344
精彩,我的英雄:-)它正在工作。 – user1091344
請問,您如何在Mac上編程?你如何得到它在va_start(ap,format)行崩潰的信息;? – user1091344