a. What does “getcwd()” return (a float, an integer, string, array)? Show how to
ID: 3899535 • Letter: A
Question
a. What does “getcwd()” return (a float, an integer, string, array)? Show how to call it with a parameter named “d”, and what is the type of “d”?
b. 1. When a program calls “time()”, what is returned?
2. When a program calls “ctime()”, what is returned?
3. Are these system calls?, what makes them system calls (what makes a function call also a system call)?
c. What does the “system()” function do? Briefly, how does it work?
2. On most new PCs you may choose between:
1. using the Java Virtual Machine (JVM), 2.Dual boot (or multi OS boot) and
3. A VM such as Virtual Box or VMWare (hypervisor, or hardware VM or system VM) Briefly, how do these cases differ?
Explanation / Answer
a getcwd() returns a pointer to the chaarcter array. It is called with a parameter d which is a character array and size of that array.The signatures is as follows:
char *getcwd(char *buf, size_t size);
b) 1)It return current calendar time as a time_t object.
2) It returns a C string containing the date and time information in a human-readable format.
3) These are system calls.They are system calls becuase they are requesting
service from opearting system
c).system(const char *command) passes the command name or program name specified by command to the host environment to be executed by the command processor or shell and returns after the command has been completed.
2) JVM - JVM provides environment to run java programs. It can be understood as
a simulated environmenmt or machine.
2.Dual boot (multiboot OS) - This means that there are phisically two operating system in the computer and we can boot the computer in either of the
operating system.
Virtual Machine - Virtual machines are the emulation of real computer
systems. They give the same feeling as if the user is working on the
real machine.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.