System Programming MCQs with Answers
Practice important System Programming MCQs with answers and explanations.
Chapter: 105
Q2341:
If a process ID in the job record is 0, the function will _______.
A. Terminate the process
B. Skip the record
C. Mark the job done
D. Restart the process
Correct Answer:
B
Chapter: 105
Q2342:
What is the purpose of OpenProcess in the job listing function?
A. To create a new process
B. To get access to a process
C. To kill a process
D. To list process threads
Correct Answer:
B
Chapter: 105
Q2343:
When GetExitCodeProcess returns a value different from STILL_ACTIVE, it means the job is _______.
A. Running
B. Waiting
C. Completed
D. Paused
Correct Answer:
C
Chapter: 105
Q2344:
The job management shell handles jobs that no longer exist in the system by _______.
A. Reactivating them
B. Removing them
C. Making them background
D. Restarting them
Correct Answer:
B
Chapter: 105
Q2345:
Which Windows API function is used to move the file pointer backward to update a job record?
A. SetFilePointer()
B. SetFilePointerEx()
C. MoveFile()
D. SeekFile()
Correct Answer:
A
Chapter: 105
Q2346:
LOCKFILE_EXCLUSIVE_LOCK ensures _______ to the job file.
A. Multiple access
B. Exclusive access
C. No access
D. Read-only access
Correct Answer:
B
Chapter: 105
Q2347:
If the job process handle is NULL, the job status displayed will be _______.
A. Done
B. Running
C. Waiting
D. Unknown
Correct Answer:
A
Chapter: 105
Q2348:
What happens if WriteFile fails when rewriting the job record?
A. Error is reported
B. The job is deleted
C. The job is restarted
D. Nothing happens
Correct Answer:
A
Chapter: 105
Q2349:
Which data structure stores job information during processing in the job listing function?
A. JM_JOB
B. JobData
C. JobRecord
D. JobList
Correct Answer:
A
Chapter: 105
Q2350:
How does the job listing function ensure thread safety when multiple shells access the job file?
A. Using mutex
B. Using file locking
C. Using semaphore
D. No safety mechanism
Correct Answer:
B
Chapter: 105
Q2351:
The job listing function returns FALSE when the job file cannot be _______.
A. Opened
B. Created
C. Deleted
D. Locked
Correct Answer:
A
Chapter: 105
Q2352:
Which function unlocks the job file after processing in the job listing system?
A. UnlockFileEx()
B. UnlockFile()
C. CloseHandle()
D. ReleaseLock()
Correct Answer:
A
Chapter: 105
Q2353:
The flags FILE_SHARE_READ | FILE_SHARE_WRITE allow _______ access to the job file.
A. Read only
B. Write only
C. Read and write
D. No access
Correct Answer:
C
Chapter: 105
Q2354:
What does the variable 'nXfer' represent in the job listing function?
A. Number of bytes transferred
B. Process ID
C. Number of jobs
D. Job exit code
Correct Answer:
A
Chapter: 105
Q2355:
The main purpose of DisplayJobs() is to _______.
A. List jobs
B. Terminate jobs
C. Create jobs
D. Update jobs
Correct Answer:
A
Chapter: 105
Q2356:
If a job has exit code STILL_ACTIVE, the job status displayed is _______.
A. =+ Done
B. Done
C. Running
D. Waiting
Correct Answer:
C
Chapter: 105
Q2357:
What is performed inside the try block in the DisplayJobs function?
A. Lock file
B. Read job records
C. Close process handles
D. Delete job file
Correct Answer:
B
Chapter: 106
Q2358:
The function used to obtain the process ID of a given job number is _______.
A. FindProcessId()
B. DisplayJobs()
C. GetProcessID()
D. FindJob()
Correct Answer:
A
Chapter: 106
Q2359:
FindProcessId() opens the job management file with _______ access.
A. GENERIC_WRITE
B. GENERIC_READ
C. GENERIC_READ_WRITE
D. GENERIC_EXECUTE
Correct Answer:
B
Chapter: 106
Q2360:
Which API function is used to open the job data file in FindProcessId()?
A. CreateFile()
B. OpenFile()
C. ReadFile()
D. WriteFile()
Correct Answer:
A