1/18
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced |
|---|
No study sessions yet.
When are system calls less efficient than library calls?
System calls are less efficient than library calls when there are a lot of system calls
What does the strptime function do?
fills a struct, tm, based on contents of a string
the ________ function fills a struct, tm, based on contents of a string.
strptime
what does the uname function do? `
Provides information about the system, inclusing the OS
the ________ function provides information about the system, inclusing the OS?
uname
What does open() return on the first call?
3;
0 - stdin
1 - stdout
2 - stderr
3 - filedescriptor
What do
$?
$0
$@
store?
- the status of the most recently run program
- exit status of the last program
- list of all parameters
What is a path that starts with a '/'?
an absolute path
How to you specify an absolute path?
preceding the path with a '/'
Preceding a path with '/' specifies what?
That it is an absolute path
What is the syntax for a makefile recipe?
The recipe must be preceeded by a tab
Write a one-liner to print everyone on the system
who | cut -d ' ' -f1
Write a one-liner to list all files in the current directory with a double letter.
ls -a | grep -E '(.)\1'
____ is a system call that can be used to determine if a string corresponds to a file or a directory.
stat
How do you reset a file pointer to the beginning of the file using only system calls? (12)
-
Write a function named grow that doubles the capacity of a struct string with members capacity, length, and data. (13)
-
Write a bash script which has a function sumIt() that sums a sequence of integers passed to the function. (14)
-
Write a C function: catfile() that opens a filename that is provided as a parameter and writes the contents to stdout, with ONLY access to systems calls. (15)
-
Write a program in C that sums the number of v options given in the command line using getopts. (16)
-