CSI 3336 - Exam 2 Review

0.0(0)
studied byStudied by 0 people
0.0(0)
full-widthCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/18

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

19 Terms

1
New cards

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

2
New cards

What does the strptime function do?

fills a struct, tm, based on contents of a string

3
New cards

the ________ function fills a struct, tm, based on contents of a string.

strptime

4
New cards

what does the uname function do? `

Provides information about the system, inclusing the OS

5
New cards

the ________ function provides information about the system, inclusing the OS?

uname

6
New cards

What does open() return on the first call?

3;

0 - stdin

1 - stdout

2 - stderr

3 - filedescriptor

7
New cards

What do

$?

$0

$@

store?

- the status of the most recently run program

- exit status of the last program

- list of all parameters

8
New cards

What is a path that starts with a '/'?

an absolute path

9
New cards

How to you specify an absolute path?

preceding the path with a '/'

10
New cards

Preceding a path with '/' specifies what?

That it is an absolute path

11
New cards

What is the syntax for a makefile recipe?

The recipe must be preceeded by a tab

12
New cards

Write a one-liner to print everyone on the system

who | cut -d ' ' -f1

13
New cards

Write a one-liner to list all files in the current directory with a double letter.

ls -a | grep -E '(.)\1'

14
New cards

____ is a system call that can be used to determine if a string corresponds to a file or a directory.

stat

15
New cards

How do you reset a file pointer to the beginning of the file using only system calls? (12)

-

16
New cards

Write a function named grow that doubles the capacity of a struct string with members capacity, length, and data. (13)

-

17
New cards

Write a bash script which has a function sumIt() that sums a sequence of integers passed to the function. (14)

-

18
New cards

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)

-

19
New cards

Write a program in C that sums the number of v options given in the command line using getopts. (16)

-