[ LUGOS ] coredump

Jernej Kovse jernej.kovse na uni-mb.si
Sob Dec 27 19:31:08 CET 1997


On Sat, 27 Dec 1997, David Klasinc wrote:

> Banzai!
> 
>  sem probaval ze s fork, ampak ni uporabno, ker child ne inherita
> vrednosti spremenjlivk... :)
> 

Kako da ne, definitivno bi moral, n.pr.: spodnji program izpise dvakrat 8:

#include <iostream.h>
#include <unistd.h>

int main()
{
  int a = 8;
  int ret = fork();
  if( ret )
  {
    cout << a << "\n";
  }
  else
  {
    cout << a << "\n";
  }
  return( 0 );
}

Malo dokumentacije:

The process that invokes fork si called the parent and the newly created
process is called the child. The child is a given a complete copy of the
parent's address space and process state that includes the values of the
program variables, registers, PC, etc., and access to all the UNIX system
services the parent had, such as the parent's open files.

Lp,

Jernej

*******************************************************************
  Jernej Kovse       E-mail: jernej.kovse na uni-mb.si
  Simekova 22           WWW: http://www2.feri.uni-mb.si/~jernej
  2000 Maribor                  
  Slovenia                 CS Student                   
                      University of Maribor
     Faculty of Electrical Engineering and Computer Science
*******************************************************************




Dodatne informacije o seznamu Starilist