From: Bora Şahi (borasah@netone.com.tr)
Date: Thu 21 Nov 2002 - 21:02:43 EET
SLmLar
> Hazır aklıma gelmişken şunu da sorayım: Windows altında fork() komutunu
> kullanmamız mümkün mü?
> --
> Sevgi Saygı Linux
> Tonguç Yumruk
Bildiğim kadarıyla yok. Ama Posix subsystem' in desteklediği _exec() ailesi
ve de bildiğim kadarıyla *nix' ler de olmayan _spawn() ailesi var. MSDN' den
ilgili bölümü buraya paste ediyorum.
"In Windows NT and Windows 95, the spawned process is equivalent to the
spawning process. Therefore, the OS/2® wait function, which allows a parent
process to wait for its children to terminate, is not available. Instead,
any process can use _cwait to wait for any other process for which the
process ID is known.
The difference between the _exec and _spawn families is that a _spawn
function can return control from the new process to the calling process. In
a _spawn function, both the calling process and the new process are present
in memory unless _P_OVERLAY is specified. In an _exec function, the new
process overlays the calling process, so control cannot return to the
calling process unless an error occurs in the attempt to start execution of
the new process.
The differences among the functions in the _exec family, as well as among
those in the _spawn family, involve the method of locating the file to be
executed as the new process, the form in which arguments are passed to the
new process, and the method of setting the environment, as shown in the
following table. Use a function that passes an argument list when the number
of arguments is constant or is known at compile time. Use a function that
passes a pointer to an array containing the arguments when the number of
arguments is to be determined at run time. The information in the following
table also applies to the wide-character counterparts of the _spawn and
_exec functions."
Saygılar
Bora ŞAHİN