McqMate
Sign In
Hamberger menu
McqMate
Sign in
Sign up
Home
Forum
Search
Ask a Question
Sign In
McqMate Copyright © 2025
→
Computer Science Engineering (CSE)
→
Operating System Architecture
→
All system calls return ……..if open or c...
Q.
All system calls return ……..if open or create call fails
A.
-2
B.
0
C.
1
D.
-1
Answer» D. -1
1.4k
0
Do you find this helpful?
20
View all MCQs in
Operating System Architecture
Discussion
No comments yet
Login to comment
Related MCQs
The open and create system calls returns an integer called a ……….
Given a code snippet below? #define PERMS (S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH) int main() { int fd1, fd2; umask(0); fd1 = open(“file1”, O_CREAT | O_RDWR, PERMS) umask(S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH); fd2 = open(“file2”, O_CREAT | O_RDWR, PERMS) return 0; } The newly created files file1 and file2 will have the permissions respectively
Below is the codeint main() { int fd1, fd2; struct stat buff1, buff2; fd1 = open(“1.txt”, O_RDWR); fd2 = open(“2.txt”, O_RDWR | O_APPEND); lseek(fd1, 10000, SEEK_SET); write(fd1, “abcdefghij”, 10); write(fd2, “abcdefghij”, 10); fstat(fd1, &buff1); fstat(fd2, &buff2); printf(“ %d %d”, buff1.st_size, buff2.st_size); return 0; } Before running the program, the file 1.txt and 2.txt size is 20 each. What is the output?
The read system calls return 0 when ………..
Which of the following system calls,does not return control to the calling point, on termination?
Which system call is used to create a hard link?
How many system calls in system V
Out of 64 system calls in system V how many are frequently used…
What is stored in logfile as per below mentioned code if we execute ./a.out > logfile?nt main() { int fd; close(1); fd = open(“logfile”,O_RDWR, 0744); write(fd, “Hello”, 5); printf(“World\n”); return 0; }
For the below mentioned codeint main() { int fd; fd = open(“logfile”, O_CREAT|O_RDWR, 0600); lseek(fd, 5, SEEK_CUR); write(fd, “Hello”, 5); return 0; },