📢 Too many exams? Don’t know which one suits you best? Book Your Free Expert 👉 call Now!


    âš¡ Azaadi sale - Celebrate Independence Day with Flat 55% Off On all courses! 13 to 17 Aug âš¡ Enroll Now

    Question

    Standard C library functions will always invoke a system

    call when executed from a single-threaded process in a UNIX/Linux operating system?
    A Sleep Correct Answer Incorrect Answer
    B Malloc Correct Answer Incorrect Answer
    C Exit Correct Answer Incorrect Answer
    D Both 1 and 3 Correct Answer Incorrect Answer
    E None of these Correct Answer Incorrect Answer

    Solution

    exit C library functions - Terminates the process normally, performing the regular cleanup for terminating programs. malloc - This is a function defined in standard C library and it does not always invoke the system call. When a process is created, certain amount of heap memory is already allocated to it, when required to expand or shrink that memory, it internally uses sbrk/brk system call on Unix/Linux. sleep - This is not even standard C library function, it is a POSIX standard c library function which always invokes the system call.

    Practice Next
    ask-question

    Not sure which exam is best for you Talk to our expert

    Get My Free Call