SlideShare a Scribd company logo
1 of 1
/* Hackintoshrao:codes for GNU/LINUX
   ILLUSTRATION OF ORPHAN PROCESS AND ASSIGNMENT OF INIT AS A PARENT TO SUCH A
PROCESS
   SYSTEM CALLS USED
   1.fork()
   2.getpid()
   3.getppid()
   4.sleep()
   */
#include<stdlib.h>
#include<unistd.h>
#include<time.h>
int main()
{
    int pid;
    pid=fork();
    if(pid==0)
    {


        printf("nChild process here n");
        printf("nchild here..Parent id=%d,Process id=%dn",getppid(),getpid());
        sleep(3);
        printf("nChild process here,now its a orphan process,so init is my parent
process now n");
        printf("nchild here...Parent id=%d,Process id=%dn",getppid(),getpid());
        /*its clearly evident in the o/p that the parent process Id of the child
process will now be =1,
          the init process is made as a parent */
    }
    else{
        sleep(1);
        /*since parent process finishes earlier than the child ,the latter becomes
a orphan process */
        printf("nparent process here n");
        printf("nparent process..Process id=%dn",getpid());
        printf("nparent process Exiting,making the child process a orphan .......
nn") ;

    }
}

More Related Content

What's hot (20)

Sol8
Sol8Sol8
Sol8
 
8.2
8.28.2
8.2
 
Thread介紹
Thread介紹Thread介紹
Thread介紹
 
"A 1,500 line (!!) switch statement powers your Python!" - Allison Kaptur, !!...
"A 1,500 line (!!) switch statement powers your Python!" - Allison Kaptur, !!..."A 1,500 line (!!) switch statement powers your Python!" - Allison Kaptur, !!...
"A 1,500 line (!!) switch statement powers your Python!" - Allison Kaptur, !!...
 
Scripting ppt
Scripting pptScripting ppt
Scripting ppt
 
Vcs8
Vcs8Vcs8
Vcs8
 
Rcpp11 genentech
Rcpp11 genentechRcpp11 genentech
Rcpp11 genentech
 
3 rd animation
3 rd animation3 rd animation
3 rd animation
 
Loop
LoopLoop
Loop
 
Looping in C
Looping in CLooping in C
Looping in C
 
All I know about rsc.io/c2go
All I know about rsc.io/c2goAll I know about rsc.io/c2go
All I know about rsc.io/c2go
 
Advanced Scripting - 2 (Ch-8)
Advanced Scripting - 2 (Ch-8)Advanced Scripting - 2 (Ch-8)
Advanced Scripting - 2 (Ch-8)
 
[DevDay2018] How does JavaScript actually work? - By: Vi Nguyen, Senior Softw...
[DevDay2018] How does JavaScript actually work? - By: Vi Nguyen, Senior Softw...[DevDay2018] How does JavaScript actually work? - By: Vi Nguyen, Senior Softw...
[DevDay2018] How does JavaScript actually work? - By: Vi Nguyen, Senior Softw...
 
C++
C++C++
C++
 
R/C++ talk at earl 2014
R/C++ talk at earl 2014R/C++ talk at earl 2014
R/C++ talk at earl 2014
 
week-16x
week-16xweek-16x
week-16x
 
Load-time Hacking using LD_PRELOAD
Load-time Hacking using LD_PRELOADLoad-time Hacking using LD_PRELOAD
Load-time Hacking using LD_PRELOAD
 
関西アンカンファレンス PHP ではじめるテストコード
関西アンカンファレンス PHP ではじめるテストコード関西アンカンファレンス PHP ではじめるテストコード
関西アンカンファレンス PHP ではじめるテストコード
 
Sender
SenderSender
Sender
 
FSE 2008
FSE 2008FSE 2008
FSE 2008
 

Viewers also liked

Sesiã³n 1 de 6 desarrollo de proyectos ixtapaluca
Sesiã³n 1 de 6 desarrollo de proyectos ixtapalucaSesiã³n 1 de 6 desarrollo de proyectos ixtapaluca
Sesiã³n 1 de 6 desarrollo de proyectos ixtapalucaUSET
 
Superb Lenovo Laptops and their Models
Superb Lenovo Laptops and their ModelsSuperb Lenovo Laptops and their Models
Superb Lenovo Laptops and their ModelsEvetech
 
VIVIANA PUERTA English Homework
VIVIANA PUERTA English Homework VIVIANA PUERTA English Homework
VIVIANA PUERTA English Homework viviana puerta
 
MANEJO DEL PANEL DE CONTROL Y DESINSTALACION DE UNA APLICACION
MANEJO DEL PANEL DE CONTROL Y DESINSTALACION DE UNA APLICACIONMANEJO DEL PANEL DE CONTROL Y DESINSTALACION DE UNA APLICACION
MANEJO DEL PANEL DE CONTROL Y DESINSTALACION DE UNA APLICACIONEfrain Nava Ceja
 
Cronos Seminar 28 May 2015
Cronos Seminar 28 May 2015Cronos Seminar 28 May 2015
Cronos Seminar 28 May 2015CommaGroup
 
A φτηνα εργατικα χερια !!!
A φτηνα εργατικα χερια  !!!A φτηνα εργατικα χερια  !!!
A φτηνα εργατικα χερια !!!Stauros Genoardo
 
Citta 2 invånartidning_svenska
Citta 2 invånartidning_svenskaCitta 2 invånartidning_svenska
Citta 2 invånartidning_svenskaUlf Grindgards
 
Sql Server 2008 Product Overview
Sql Server 2008 Product OverviewSql Server 2008 Product Overview
Sql Server 2008 Product OverviewIsmail Muhammad
 
LCI -SA Minutes 7th March
LCI -SA Minutes 7th MarchLCI -SA Minutes 7th March
LCI -SA Minutes 7th Marchdanmrrt
 

Viewers also liked (16)

Sesiã³n 1 de 6 desarrollo de proyectos ixtapaluca
Sesiã³n 1 de 6 desarrollo de proyectos ixtapalucaSesiã³n 1 de 6 desarrollo de proyectos ixtapaluca
Sesiã³n 1 de 6 desarrollo de proyectos ixtapaluca
 
Primera lectura clinica_p
Primera lectura clinica_pPrimera lectura clinica_p
Primera lectura clinica_p
 
Superb Lenovo Laptops and their Models
Superb Lenovo Laptops and their ModelsSuperb Lenovo Laptops and their Models
Superb Lenovo Laptops and their Models
 
VIVIANA PUERTA English Homework
VIVIANA PUERTA English Homework VIVIANA PUERTA English Homework
VIVIANA PUERTA English Homework
 
MANEJO DEL PANEL DE CONTROL Y DESINSTALACION DE UNA APLICACION
MANEJO DEL PANEL DE CONTROL Y DESINSTALACION DE UNA APLICACIONMANEJO DEL PANEL DE CONTROL Y DESINSTALACION DE UNA APLICACION
MANEJO DEL PANEL DE CONTROL Y DESINSTALACION DE UNA APLICACION
 
Cronos Seminar 28 May 2015
Cronos Seminar 28 May 2015Cronos Seminar 28 May 2015
Cronos Seminar 28 May 2015
 
Salmo 146:11
Salmo 146:11Salmo 146:11
Salmo 146:11
 
smalBiz
smalBizsmalBiz
smalBiz
 
La Doctrina 19
La Doctrina 19La Doctrina 19
La Doctrina 19
 
A φτηνα εργατικα χερια !!!
A φτηνα εργατικα χερια  !!!A φτηνα εργατικα χερια  !!!
A φτηνα εργατικα χερια !!!
 
Citta 2 invånartidning_svenska
Citta 2 invånartidning_svenskaCitta 2 invånartidning_svenska
Citta 2 invånartidning_svenska
 
Sql Server 2008 Product Overview
Sql Server 2008 Product OverviewSql Server 2008 Product Overview
Sql Server 2008 Product Overview
 
детский кибо
детский кибодетский кибо
детский кибо
 
Treball cartes d_hivern_power2
Treball cartes d_hivern_power2Treball cartes d_hivern_power2
Treball cartes d_hivern_power2
 
LCI -SA Minutes 7th March
LCI -SA Minutes 7th MarchLCI -SA Minutes 7th March
LCI -SA Minutes 7th March
 
Labmetrics Januar 2013
Labmetrics Januar 2013Labmetrics Januar 2013
Labmetrics Januar 2013
 

Similar to Forkexpe

ood evening people. Ive been working on this code that sends a bur.pdf
ood evening people. Ive been working on this code that sends a bur.pdfood evening people. Ive been working on this code that sends a bur.pdf
ood evening people. Ive been working on this code that sends a bur.pdfaroramobiles1
 
OS presentation (1).pptx
OS presentation (1).pptxOS presentation (1).pptx
OS presentation (1).pptxJenish62
 
Consider the fork_examplec code under Example code for pr.pdf
Consider the fork_examplec code under Example code for pr.pdfConsider the fork_examplec code under Example code for pr.pdf
Consider the fork_examplec code under Example code for pr.pdfabinayamobiles
 
Unit 5
Unit 5Unit 5
Unit 5siddr
 
A CTF Hackers Toolbox
A CTF Hackers ToolboxA CTF Hackers Toolbox
A CTF Hackers ToolboxStefan
 
UNIX_Process Control_Module3.pptx
UNIX_Process Control_Module3.pptxUNIX_Process Control_Module3.pptx
UNIX_Process Control_Module3.pptxraunakkumar290158
 
Unit 6
Unit 6Unit 6
Unit 6siddr
 
System Calls.pptxnsjsnssbhsbbebdbdbshshsbshsbbs
System Calls.pptxnsjsnssbhsbbebdbdbshshsbshsbbsSystem Calls.pptxnsjsnssbhsbbebdbdbshshsbshsbbs
System Calls.pptxnsjsnssbhsbbebdbdbshshsbshsbbsashukiller7
 
Mychurch File Upload
Mychurch File UploadMychurch File Upload
Mychurch File UploadJoe Suh
 
Tested on ubuntu,Linux#include stdio.h #include string.h.pdf
Tested on ubuntu,Linux#include stdio.h #include string.h.pdfTested on ubuntu,Linux#include stdio.h #include string.h.pdf
Tested on ubuntu,Linux#include stdio.h #include string.h.pdfaquacare2008
 
Controlling Arduino With PHP
Controlling Arduino With PHPControlling Arduino With PHP
Controlling Arduino With PHPThomas Weinert
 
6. processes and threads
6. processes and threads6. processes and threads
6. processes and threadsMarian Marinov
 
What is-a-computer-process-os
What is-a-computer-process-osWhat is-a-computer-process-os
What is-a-computer-process-osManish Singh
 

Similar to Forkexpe (20)

ood evening people. Ive been working on this code that sends a bur.pdf
ood evening people. Ive been working on this code that sends a bur.pdfood evening people. Ive been working on this code that sends a bur.pdf
ood evening people. Ive been working on this code that sends a bur.pdf
 
process creation OS
process creation OSprocess creation OS
process creation OS
 
OS presentation (1).pptx
OS presentation (1).pptxOS presentation (1).pptx
OS presentation (1).pptx
 
Ipc
IpcIpc
Ipc
 
Os lab final
Os lab finalOs lab final
Os lab final
 
Consider the fork_examplec code under Example code for pr.pdf
Consider the fork_examplec code under Example code for pr.pdfConsider the fork_examplec code under Example code for pr.pdf
Consider the fork_examplec code under Example code for pr.pdf
 
Unit 5
Unit 5Unit 5
Unit 5
 
A CTF Hackers Toolbox
A CTF Hackers ToolboxA CTF Hackers Toolbox
A CTF Hackers Toolbox
 
UNIX_Process Control_Module3.pptx
UNIX_Process Control_Module3.pptxUNIX_Process Control_Module3.pptx
UNIX_Process Control_Module3.pptx
 
Unit 6
Unit 6Unit 6
Unit 6
 
forkwork.pptx
forkwork.pptxforkwork.pptx
forkwork.pptx
 
System Calls.pptxnsjsnssbhsbbebdbdbshshsbshsbbs
System Calls.pptxnsjsnssbhsbbebdbdbshshsbshsbbsSystem Calls.pptxnsjsnssbhsbbebdbdbshshsbshsbbs
System Calls.pptxnsjsnssbhsbbebdbdbshshsbshsbbs
 
Mychurch File Upload
Mychurch File UploadMychurch File Upload
Mychurch File Upload
 
Tested on ubuntu,Linux#include stdio.h #include string.h.pdf
Tested on ubuntu,Linux#include stdio.h #include string.h.pdfTested on ubuntu,Linux#include stdio.h #include string.h.pdf
Tested on ubuntu,Linux#include stdio.h #include string.h.pdf
 
Fork handout
Fork handoutFork handout
Fork handout
 
Unix kernal
Unix kernalUnix kernal
Unix kernal
 
Sysprog 11
Sysprog 11Sysprog 11
Sysprog 11
 
Controlling Arduino With PHP
Controlling Arduino With PHPControlling Arduino With PHP
Controlling Arduino With PHP
 
6. processes and threads
6. processes and threads6. processes and threads
6. processes and threads
 
What is-a-computer-process-os
What is-a-computer-process-osWhat is-a-computer-process-os
What is-a-computer-process-os
 

More from Karthic Rao

More from Karthic Rao (10)

Scaling your GraphQL applications with Dgraph
Scaling your GraphQL applications with DgraphScaling your GraphQL applications with Dgraph
Scaling your GraphQL applications with Dgraph
 
Childexittest
ChildexittestChildexittest
Childexittest
 
Childexittest
ChildexittestChildexittest
Childexittest
 
Fileinc
FileincFileinc
Fileinc
 
Usrinfogetpwuid
UsrinfogetpwuidUsrinfogetpwuid
Usrinfogetpwuid
 
Countrytime.c
Countrytime.cCountrytime.c
Countrytime.c
 
Timesleep
TimesleepTimesleep
Timesleep
 
Time2.c
Time2.cTime2.c
Time2.c
 
Fork.c
Fork.cFork.c
Fork.c
 
2 buffer overflows
2 buffer overflows2 buffer overflows
2 buffer overflows
 

Recently uploaded

Science 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptxScience 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptxMaryGraceBautista27
 
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...Postal Advocate Inc.
 
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Celine George
 
Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Jisc
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxthorishapillay1
 
Barangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptxBarangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptxCarlos105
 
Global Lehigh Strategic Initiatives (without descriptions)
Global Lehigh Strategic Initiatives (without descriptions)Global Lehigh Strategic Initiatives (without descriptions)
Global Lehigh Strategic Initiatives (without descriptions)cama23
 
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...JhezDiaz1
 
Culture Uniformity or Diversity IN SOCIOLOGY.pptx
Culture Uniformity or Diversity IN SOCIOLOGY.pptxCulture Uniformity or Diversity IN SOCIOLOGY.pptx
Culture Uniformity or Diversity IN SOCIOLOGY.pptxPoojaSen20
 
Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...Seán Kennedy
 
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONTHEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONHumphrey A Beña
 
ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4MiaBumagat1
 
Transaction Management in Database Management System
Transaction Management in Database Management SystemTransaction Management in Database Management System
Transaction Management in Database Management SystemChristalin Nelson
 
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxINTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxHumphrey A Beña
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxiammrhaywood
 
Concurrency Control in Database Management system
Concurrency Control in Database Management systemConcurrency Control in Database Management system
Concurrency Control in Database Management systemChristalin Nelson
 
Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Celine George
 
Karra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptxKarra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptxAshokKarra1
 
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...Nguyen Thanh Tu Collection
 

Recently uploaded (20)

Science 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptxScience 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptx
 
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
 
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
 
Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptx
 
Barangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptxBarangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptx
 
Global Lehigh Strategic Initiatives (without descriptions)
Global Lehigh Strategic Initiatives (without descriptions)Global Lehigh Strategic Initiatives (without descriptions)
Global Lehigh Strategic Initiatives (without descriptions)
 
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
 
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptxYOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
 
Culture Uniformity or Diversity IN SOCIOLOGY.pptx
Culture Uniformity or Diversity IN SOCIOLOGY.pptxCulture Uniformity or Diversity IN SOCIOLOGY.pptx
Culture Uniformity or Diversity IN SOCIOLOGY.pptx
 
Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...
 
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONTHEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
 
ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4
 
Transaction Management in Database Management System
Transaction Management in Database Management SystemTransaction Management in Database Management System
Transaction Management in Database Management System
 
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxINTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
 
Concurrency Control in Database Management system
Concurrency Control in Database Management systemConcurrency Control in Database Management system
Concurrency Control in Database Management system
 
Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17
 
Karra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptxKarra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptx
 
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
 

Forkexpe

  • 1. /* Hackintoshrao:codes for GNU/LINUX ILLUSTRATION OF ORPHAN PROCESS AND ASSIGNMENT OF INIT AS A PARENT TO SUCH A PROCESS SYSTEM CALLS USED 1.fork() 2.getpid() 3.getppid() 4.sleep() */ #include<stdlib.h> #include<unistd.h> #include<time.h> int main() { int pid; pid=fork(); if(pid==0) { printf("nChild process here n"); printf("nchild here..Parent id=%d,Process id=%dn",getppid(),getpid()); sleep(3); printf("nChild process here,now its a orphan process,so init is my parent process now n"); printf("nchild here...Parent id=%d,Process id=%dn",getppid(),getpid()); /*its clearly evident in the o/p that the parent process Id of the child process will now be =1, the init process is made as a parent */ } else{ sleep(1); /*since parent process finishes earlier than the child ,the latter becomes a orphan process */ printf("nparent process here n"); printf("nparent process..Process id=%dn",getpid()); printf("nparent process Exiting,making the child process a orphan ....... nn") ; } }