Lecture 1 CSCE 510 - Overview
Aug 22 Links
- Previous Lecture -
- Index -
- Next Lecture -
I have continued to receive credit for the work of others - Ken Thompson
- Course Pragmatics
- text
- References
- Web site
- Late HW
- TextCode, Examples, Assignments, StevensCode
- man, man -k , whatis, whereis, info
- man -s 2 open
- Overview
- What is Systems Programming?
- Donavon Diagram
- Unix History
- Ken Thompson AT&T Bell Labs (1969)
- Dennis Ritchie C implementation
- Berkeley Software Division BSD
- vi - Bill Joy
- paging system
- System V Release 4 (SVR4) - unifying BSD and AT&T branches
- POSIX - Portable Operating System Interface for Computer Environments
- X Windows - MIT
- Free Software Foundation
- GNU Public License - Richard Stallman - software: emacs, g++, ...
- LINUX - Linus Torvalds
- C history
- Kernighan and Ritchie (K&R)
- ANSI Standard C
- C++ - Bjarne Stroustrup
- Primitive Unix I/O
- /usr/include/stdio.h
- Well actually /usr/ucbinclude
- Unix I/O = files
- standard descriptors
- _iob[_NFILES] struct
- Unix I/O system Calls
- ssize_t read(int fildes, void *buf, size_t nbyte);
- ssize_t write(int fildes, const void *buf, size_t nbyte);
- int open(const char *path, int oflag, /* mode_t mode */...);
- int close(int fildes);
- int creat(const char *path, mode_t mode);
- equivalent to open(path, O_WRONLY | O_CREAT | O_TRUNC, mode)
- off_t lseek(int fildes, off_t offset, int whence);
- Example: copy1.c
- Open file structures
- per process table
- open file table
- vtable
- getchar
- The string library
- /usr/include/string.h
- strings in C
- strlen
- strcmp
- strncmp
- strcat
- strncat
- strcpy
- strchr
- strstr
- strpbrk
- strspn
- strcspan
- strtok
- strerror
- unlink
- stdio.h /usr/ucbinclude
- getchar macro
#define getc(p) (--(p)->_cnt < 0 ? __filbuf(p) : (int)*(p)->_ptr++)
- file sharing
- dup and dup2
- < Stat Structure (stat.h) >
- st_mode
- < filetype >
- < stat, fstat, lstat system calls >
- int stat(const char *path, struct stat *buf);
- int lstat(const char *path, struct stat *buf);
- int fstat(int fildes, struct stat *buf);
- [Readings:]
-
- [Assignment:]
- Create a file with a hole in it and check the file size with "ls -s".
- Get a copy of hole.c, compile and run it.
- cp /class/csci510/Examples/hole.c . // copy files
- cp /class/csci510/Examples/ourhdr.h .
- cc hole.c // Compile the program
- a.out // Create the file file.hole
- Use man to see what "ls -s" tells you.
- Use "ls -s file.hole.
- Use "cp file.hole file2" to create another copy and then use "ls -s file2".
- Use "wc" (wordcount on both of these files.
- Previous Lecture -
- Index -
- Next Lecture -
URL = http://www.cs.sc.edu/~matthews/Courses/784/Lectures/lec2.html