C/C++ CGIスレッド ..
[
2ch
|
▼Menu
]
■コピペモード
□
スレを通常表示
□
オプションモード
□このスレッドのURL
■項目テキスト
387:nobodyさん 05/07/27 15:50:58 >Cで接続 (;´Д`)ハァハァ 388:nobodyさん 05/07/28 07:20:11 ボキもSegmentation faultで泣かされますた 389:nobodyさん 05/08/25 07:40:55 URNXAJj0 以下のプログラムが思惑通りの挙動を示してくれません。 C言語でのCGIでは、forkは使えないのでしょうか? #include <stdio.h> #include <sys/types.h> #include <unistd.h> #include <sys/wait.h> int main(void) { pid_t pid; int status; printf("Content-type: text/html\n\n"); printf("<html>\n"); printf("<head>\n"); printf("<title>test</title>\n"); printf("</head>\n"); printf("<body>\n"); pid = fork(); if(pid == 0){ printf("child<br>\n"); } else{ wait(&status); printf("parent<br>\n"); } return 0; } 390:nobodyさん 05/08/25 07:43:44 URNXAJj0 思惑とは、CGI実行時のHTMLソースで、 <html> <head> <title>show sFlow statistics</title> </head> <body> child<br> parent<br> と、なってほしいのに、実際実行すると、 <html> <head> <title>show sFlow statistics</title> </head> <body> child<br> Content-type: text/html <html> <head> <title>show sFlow statistics</title> </head> <body> parent<br> と、なってしまっております。
次ページ
最新レス表示
スレッドの検索
類似スレ一覧
話題のニュース
おまかせリスト
▼オプションを表示
レスジャンプ
mixiチェック!
Twitterに投稿
オプション
しおりを挟む
スレッドに書込
スレッドの一覧
暇つぶし2ch
5150日前に更新/150 KB
担当:undef