1 / 3

UNIX Fork/Exec Example

UNIX Fork/Exec Example. int pid = fork(); if ( pid == 0) { exec("foo"); } else { waitpid ( pid , &status, options); };. Child process. Parent process. Windows Process Creation. BOOL CreateProcess ( LPCTSTR lpApplicationName , LPTSTR lpCommandLine ,

marcus
Download Presentation

UNIX Fork/Exec Example

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. UNIX Fork/Exec Example intpid = fork(); if (pid == 0) { exec("foo"); } else { waitpid(pid, &status, options); }; Child process Parent process CS 140 Lecture Notes: Threads, Processes, and Dispatching

  2. Windows Process Creation BOOL CreateProcess( LPCTSTR lpApplicationName, LPTSTR lpCommandLine, LPSECURITY_ATTRIBUTES lpProcessAttributes, LPSECURITY_ATTRIBUTES lpThreadAttributes, BOOL bInheritHandles, DWORD dwCreationFlags, LPVOID lpEnvironment, LPCTSTR lpCurrentDirectory, LPSTARTUPINFO lpStartupInfo, LPPROCESS_INFORMATION lpProcessInformation ); WaitForSingleObject(lpProcessInformation->hProcess, INFINITE); CS 140 Lecture Notes: Threads, Processes, and Dispatching

  3. CS 140 Lecture Notes: Threads, Processes, and Dispatching

More Related