0 votes 0 votes On Solving manually I too getting 14 as answer. but on running more than 14 * are printed. Operating System operating-system ace-test-series fork-system-call + – Overflow04 asked Aug 29, 2022 Overflow04 861 views answer comment Share Follow See all 7 Comments See all 7 7 Comments reply Show 4 previous comments Arjun commented Aug 31, 2022 reply Follow Share Since the buffer is not emptied in the given code before a call to fork, there is no answer to this question. For those wondering what should be given as answer if this question comes in GATE – GATE questions are made by IIT professors and not by GATE aspirants. But such questions can come for PSU exams and there one can follow any given logic and if your stars match you get correct mark. 1 votes 1 votes afroze commented Sep 1, 2022 i edited by afroze Sep 10, 2022 reply Follow Share Ok bt if use CLR buffer then ans should be 14? 0 votes 0 votes ADITYARAJ commented Feb 28 reply Follow Share correct Ans: 36 0 votes 0 votes Please log in or register to add a comment.
1 votes 1 votes bcoz not possible to determine order of fork() execution it’s cpu scheduling dependent afroze answered Aug 29, 2022 • edited Aug 29, 2022 by afroze afroze comment Share Follow See all 9 Comments See all 9 9 Comments reply Show 6 previous comments Arjun commented Aug 29, 2022 reply Follow Share That doesn't mean that. Buffers are private to a given process. 0 votes 0 votes afroze commented Aug 29, 2022 reply Follow Share Ok means wl hv to CLR buffer before every fork() call 0 votes 0 votes Arjun commented Aug 29, 2022 reply Follow Share Yes 1 votes 1 votes Please log in or register to add a comment.
1 votes 1 votes For the child processes pid=0 hence the star in the conditional operator won’t be printed sankalps answered Oct 12, 2022 sankalps comment Share Follow See all 0 reply Please log in or register to add a comment.