1 / 6

CS311 – Lecture 25 Outline

CS311 – Lecture 25 Outline. Discussion on Project 5. Summary of Interprocess Communication Mechanisms Review of CS311 Learning Objectives Note: These lecture notes are not intended replace your notes. This is what I expect your notes to already look like, but with more explanation as needed.

amie
Download Presentation

CS311 – Lecture 25 Outline

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. CS311 – Lecture 25 Outline Discussion on Project 5. Summary of Interprocess Communication Mechanisms Review of CS311 Learning Objectives Note: These lecture notes are not intended replace your notes. This is what I expect your notes to already look like, but with more explanation as needed. CS311 – Operating Systems 1 1

  2. Discussion on Project 5 How to get input from users: fgets(), getline() Removing newline character from user input: http://classes.engr.oregonstate.edu/eecs/summer2009/cs311/node/179 Common problems in project 5: http://classes.engr.oregonstate.edu/eecs/summer2009/cs311/node/180 CS311 – Operating Systems 1 2

  3. fgets() • An input function (file get string) char* fgets(char *string, int length, FILE *stream) • fgets reads a string of specific length from a file (or standard input) pointed to by stream. • fgets terminates reading: • after a new-line character (\n) is found, OR • after it reaches end-of-file (EOF), OR • after (length - 1) characters have been read • Fgets stores a '\0‘ after the last character in the buffer. CS311 – Operating Systems 1

  4. getline() ssize_t getline (char **lineptr, size_t *n, FILE *stream) This function reads an entire line from stream, storing the text (including the newline and a terminating null character) in a buffer and storing the buffer address in *lineptr. Before calling getline, you should place in *lineptr the address of a buffer *n bytes long, allocated with malloc. When successful, it returns the number of characters read (including the newline, but not including the terminating null). Otherwise, it returns -1. CS311 – Operating Systems 1

  5. IPC Summary CS311 – Operating Systems 1

  6. CS311 Learning Objectives Explain why multiprogramming is important for modern operating systems. Explain the general structure of a multiprogrammed operating system. Explain the purpose and operation of system calls. Write a program utilizing system calls. Write a program using a scripting language. Write a program that uses regular expressions to parse input data. Explain how a common file system works, including structure, I/O operations, and security. Describe the memory organization of a typical process in a common operating system. Write a program that spawns processes and provides mutual exclusion for variables or other resources shared by the processes. Write a program that uses sockets to implement a client/server system. CS311 – Operating Systems 1 6

More Related