Linux Programming Interface: Chapter 4

Beschreibung

Chapter 4 of the Linux Programming Interface book by Michael Kerrisk
Jon Schipp
Quiz von Jon Schipp, aktualisiert more than 1 year ago
Jon Schipp
Erstellt von Jon Schipp vor fast 9 Jahre
35
0

Zusammenfassung der Ressource

Frage 1

Frage
The three standard file descriptor's are opened on the program's behalf by the [blank_start]______[blank_end]
Antworten
  • shell

Frage 2

Frage
The O_CREAT flag to open(2) can be used in conjunction with [blank_start]______[blank_end] flag to create a file exclusively (atomically).
Antworten
  • O_EXCL

Frage 3

Frage
The [blank_start]_____[blank_end] flag to open(2) prevents dereferencing symbolic links and its absence is the cause of some vulnerabilities in privileged programs.
Antworten
  • O_NOFOLLOW

Frage 4

Frage
When file descriptors are open in a program and a fork(2) and exec(2) happen before closing them - the descriptors can end up being passed to a new program. The [blank_start]_____[blank_end] flag to open(2) closes them for you.
Antworten
  • O_CLOEXEC

Frage 5

Frage
The [blank_start]____[blank_end] is a directory in the proc filesystem which contains information about each file descriptor opened by a program.
Antworten
  • fdinfo

Frage 6

Frage
The two size types in the function prototype translate to what standard C types (in order of appearance)?
Antworten
  • signed integer type, unsigned integer type
  • unsigned integer type, signed integer type
  • integer type, signed integer type
  • signed integer type, integer type

Frage 7

Frage
Which of the following flags to open(2) are not a part of the Single UNIX Specification?
Antworten
  • O_DIRECT
  • O_LARGEFILE
  • O_NOATIME
  • O_ASYNC
  • O_DSYNC
  • O_SYNC

Frage 8

Frage
The creat(2) system call is equivalent to this open(2) system call
Antworten
  • fd = open(pathname, O_WRONLY | O_CREAT | O_TRUNC, mode);
  • fd = open(pathname, O_WRONLY | O_TRUNC, mode);
  • fd = open(pathname, O_WRONLY | O_CREAT |O_APPEND, mode);
  • fd = open(pathname, O_WRONLY | O_APPENDT | O_TRUNC, mode);

Frage 9

Frage
During which system calls does the kernel set the file offset or file pointer?
Antworten
  • read()
  • write()
  • lseek()
  • open()
  • close()
  • creat()

Frage 10

Frage
During which system calls does the kernel update a pointer called the file offset or file pointer.
Antworten
  • read()
  • write()
  • close()
  • creat()
  • lseek()
  • open()

Frage 11

Frage
With file holes the file system doesn’t allocate any disk blocks for a hole until, at some later point, data is written into it
Antworten
  • True
  • False

Frage 12

Frage
The return value from a successful lseek() is a?
Antworten
  • file offset
  • number of seeked bytes
  • number of read bytes

Frage 13

Frage
Writing to a file hole performs what action?
Antworten
  • Allocating disk blocks but not writing null bytes in them
  • Writing null bytes but not allocating disk blocks
  • Allocating disk blocks and writing null byes within the blocks
  • Neither, system assumes null byte are there
Zusammenfassung anzeigen Zusammenfassung ausblenden

ähnlicher Inhalt

Computing Hardware - CPU and Memory
ollietablet123
SFDC App Builder 2
Parker Webb-Mitchell
Data Types
Jacob Sedore
Intake7 BIM L1
Stanley Chia
Software Processes
Nurul Aiman Abdu
Design Patterns
Erica Solum
CCNA Answers – CCNA Exam
Abdul Demir
Abstraction
Shannon Anderson-Rush
Spyware
Sam2
HTTPS explained with Carrier Pigeons
Shannon Anderson-Rush
Data Analytics
anelvr