(* forktest (C) 2008 Kim, Taegyoon *)
open Unix
let main () =
let pid = fork () in
if pid = 0 then
print_string "child\n"
else
(print_string "pid of the child: ";
print_int pid;
print_newline ())
let _ = main ()
$ more Makefile
all:
ocamlopt.opt -o forktest unix.cmxa forktest.ml
clean:
rm -f *.cm?
rm -f *.o
rm -f forktest
open Unix
let main () =
let pid = fork () in
if pid = 0 then
print_string "child\n"
else
(print_string "pid of the child: ";
print_int pid;
print_newline ())
let _ = main ()
$ more Makefile
all:
ocamlopt.opt -o forktest unix.cmxa forktest.ml
clean:
rm -f *.cm?
rm -f *.o
rm -f forktest
'Programming' 카테고리의 다른 글
Why I don't want to use Go (0) | 2012.05.28 |
---|---|
(JSP) 서버관련 정보 가져오기 (0) | 2012.05.28 |
(C++) TinyXML - 작고 가벼운 XML 라이브러리 (0) | 2012.05.28 |
The Go Programming Language, or: Why all C-like languages except one suck. (0) | 2012.05.28 |
(C#) 오라클 DB 연결 예제 (0) | 2012.05.28 |