1 / 9

Standard I/O & System Call

Standard I/O & System Call. Jungsik Yoon NML. GIST 2009. 10. 28. C Standard Library ( libc ). 여러 가지 공통 연산과 입출력 , 문자열 처리에 대한 표준 기능들의 모음 System Call ( 운영체제에서 제공하는 기능 ) 은 운영체제마다 사용법이 다르다 . VC++(MS libc ), gcc ( glibc ) 각자 다른 C Standard Library 내부 구현을 포함하고 있다 . ( 사용법은 동일 !).

gavan
Download Presentation

Standard I/O & System Call

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. Standard I/O & System Call Jungsik Yoon NML. GIST 2009. 10. 28

  2. C Standard Library (libc) • 여러 가지 공통 연산과 입출력, 문자열 처리에 대한 표준 기능들의 모음 • System Call (운영체제에서 제공하는 기능) 은 운영체제마다 사용법이 다르다. • VC++(MS libc), gcc(glibc) 각자 다른 C Standard Library 내부 구현을 포함하고 있다. (사용법은 동일!)

  3. File I/O (stdio.h) • 파일 입출력을 위한 함수 집합 • 사용자에게 편리하도록 많은 부분들을 추상화 • FILE pointer 를 사용한 편한 데이터 관리 • 대부분의 libc구현체들은 내부적으로 buffering 수행을 통해 성능이 좋다 • open, write 등의 system 함수보다 일반적으로 빠르다

  4. 시스템 호출 (System Calls) (1/2)

  5. 시스템 호출 (System Calls) (2/2) • Application programs talk to the operating systems via system calls. • The programmer's functional interface to the UNIX kernel.

  6. User Mode Trap Kernel Mode 실행 Mode • User mode • System에 나쁜영향을 미칠 수 없는 user application code • Trap (system call) • 실행중인 프로그램 내에 테스트를 위해 특별한 조건을 걸어 놓은 것 • Kernel mode • System에 있는 모든 code

  7. System Calls & Library Functions

  8. stdin, stdout, stderr • Standard I/O device (defined in stdio.h) • stdin: 기본입력 – 사용자 키보드로부터의 입력이나 pipe 를 사용한 입력에 해당 • stdout: 기본출력 – printf등의 함수 사용시 출력이 되는 통로 • stderr: stdout과 기능상 동일하나 에러 출력을 위해 추가됨

  9. 스트림의 개념 • 스트림(Stream) • 실행 중인 프로그램과 하드웨어 장치 사이에 존재하는 추상적인 계층 • 물리적인 장치 (Devices)와 프로그램 과의 데이터 입출력을 중계 • 표준 스트림 • Standard Input (stdin) • Standard Ouput (stdout) • Standard Error (stderr) • 콘솔 (Console) • the text entry and display device for system administration messages. • consists of a keyboard (stdin) and a screen (stdout, and stderr).

More Related