Linux Set 3 (30 mcqs)

This set of Linux / Unix questions and answers focuses on sysfs. This is set 5.
1. Which one of the following is not true?
a) kobjects are included in a hierarchic organisation
b) kobjects can have a parent
c) kobjects can be included in a kset
d) none of the mentioned

2. In sysfs.h which one of the following structure represents the directory entries?
a) struct sysfs_dirent
b) struct sysfs_dir
c) struct sysfs
d) none of the mentioned

3. The name pointer of the attribute data structure represents the _____ in sysfs.
a) directory
b) file
c) symbolic link
d) none of the mentioned

4. To read/write attribute, which one of the following method is required?
a) show
b) store
c) both (a) and (b)
d) none of the mentioned

5. Which one of the following is not contained in the kobject data structure?
a) pointer to the kobject type descriptor
b) pointer to the containing kset
c) pointer to the parent kobject
d) none of the mentioned

6. The kobjects can be organized in a hierarchical tree by means of
a) ksets
b) kref
c) ktype
d) none of the mentioned

7. Which one of the following is a element of a kset data structure?
a) pointer to the subsystem descriptor
b) pointer to the kobject type descriptor of the kset
c) both (a) and (b)
d) none of the mentioned

8. Which one of the following function is used to add the kobject to sysfs?
a) kobject_add()
b) kobject_register()
c) kobject_init()
d) all of the mentioned

9. Which one of the following function is used to create a new attribute?
a) sysfs_create_file()
b) sysfs_attribute
c) both (a) and (b)
d) none of the mentioned

10. Sysfs attribute should export ____ value per file.
a) one
b) two
c) three
d) four

11. The command “cpp sanfoundry.c > sanfoundry.i” will
a) create the expanded source code file sanfoudry.i for the source code file sanfoundry.c
b) append the content of the sanfoundry.c into sanfoundry.i
c) give an error
d) none of the mentioned

12. Which option of gcc makes the compiler print out each function name as it is compiled, and print some statistics about each pass when it finishes?
a) -p
b) -P
c) -q
d) -Q

13. The -Wextra option of gcc
a) is same as -w option
b) does not exist
c) enables extra warning messages
d) none of the mentioned

14. Which gcc option undefines a preprocessor macro?
a) -U
b) -u
c) -undefine
d) none of the mentioned

15. Pipes are used rather than temporary files for communication between the various stages of compilation in gcc when
a) -pipe option is used
b) -temp option is used
c) –disable -temp option is used
d) none of the mentioned

16. The gcc option -Wunused warns when a _____ variable is unused aside from its declaration.
a) variable
b) function
c) macro
d) none of the mentioned

17. Which one of the following is not true?
a) source codes can not be compiled with static libraries in gcc
b) -O is used for optimization in gcc
c) both (a) and (b)
d) none of the mentioned

18. The command line options of gcc can also be read from a file with
a) @
b) $
c) #
d) none of the mentioned
.
19. Which option of the gcc is used to warn is padding is included in structure?
a) -Wpadded
b) -Wpad
c) -Wpadding
d) none of the mentioned

20. Which gcc option reports the cpu time taken by each subprocess in the compilation sequence?
a) -time
b) -cpu
c) -process
d) none of the mentioned

21. In GDB, a tracepoint can be set by the command
a) trace
b) set
c) break trace
d) none of the mentioned

22. Which one of the following command saves the command history of GDB in a file?
a) history
b) set history
c) set history save on
d) none of the mentioned

23. The command “show commands” of GDB
a) displays the last 10 commands in the command history
b) displays all commands of the command history
c) displays all the commands available in GDB
d) none of the mentioned

24. The GDB command “show output-radix”
a) sets the default base for numeric display
b) displays the current default base for numeric display
c) both (a) and (b)
d) none of the mentioned

25. The user can define a command for GDB with the command
a) define
b) command
c) assign
d) none of the mentioned

26. By default the GDB automatically executes the command from its
a) init files
b) start files
c) begin files
d) none of the mentioned

27. The GDB text user interface uses the ____ library to show the source file.
a) curses
b) YUI
c) JUI
d) none of the mentioned

28. Which one of the following GDB command allows to move from one stack frame to another without printing the frame?
a) select-frame
b) frame
c) frame move
d) none of the mentioned
.
29. Which one of the following GDB command deletes any breakpoint at the next instruction to be executed in the selected stack frame?
a) clear
b) delete
c) disable
d) none of the mentioned

30. The result of an expression can be assigned to an environement variable with the command
a) assign
b) set
c) env
d) none of the mentioned

Answers

1-d 2-a 3-b 4-c 5-d
6-a 7-c 8-d 9-a 10-a
11-a 12-d 13-c 14-a 15-a
16-a 17-a 18-c 19-a 20-a
21-a 22-c 23-a 24-b 25-a
26-a 27-a 28-a 29-a 30-b

Sharing is caring!

Leave a Comment

Your email address will not be published. Required fields are marked *

shares