•  Back 
  •  GEMDOS Function Reference 
  •  Index 
  •  Tree View 
  •  Cross references 
  •  %About 
  •  Show info about hypertext 
  •  View a new file 
Topic       : The ATARI Compendium
Author      : Scott Sanders / JAY Software
Version     : 1.25 (20/6/2003)
Subject     : Documentation
Nodes       : 1117
Index Size  : 32614
HCP-Version : 6
Compiled on : Atari
@charset    : UTF-8
@lang       : en
@default    : 
@help       : %About
@options    : +g -i -t4 +y +z
@width      : 100
View Ref-FilePexec()
Pfork()
Pvfork()                                                             GEMDOS

Syntax

WORD Pvfork( VOID )

Function      Pvfork() creates a duplicate of the current process which
              shares address and data space with the parent.

Opcode        275 (0x113)

Availability  This function is available under all MiNT versions
              integrated with MultiTOS.

Binding       move.w   #$113,-(sp)
              trap     #1
              addq.l   #2,sp

Return Value  Pvfork() returns the new process ID to the parent and 0 to
              the child. If an error occurs the parent receives a negative
              GEMDOS error code.

Caveats       If the parent is in supervisor mode when this call is made
              the child is placed in user mode anyway.

Comments      The child process spawned by this function shares all
              address and data space with the parent. In other words, any
              variables altered by the parent will also be altered by the
              child and vice versa. The child process should not call
              Mshrink() as its TPA is already correctly sized. The two
              processes do not execute concurrently. The parent is blocked
              until either the child terminates or calls Pexec()'s mode
              200.

See Also      Pexec(), Pfork()