일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 |
- data-root
- nestjs
- dockerd
- 42Seoul
- Daemon
- 42
- django #ninja #django-ninja #장고
- Spring
- docker
- 데이터중심애플리케이션설계
- pipex
- ecole42
- Spring-Boot
- Born2beroot #42
- 네스트JS
- Today
- Total
목록42/pipex (3)
혼자 정리
open 함수 #include 늘 써오던대로 파이프 라인의 끝에 명시한 파일이 없는 경우 생성하므로 기존에 쓰던 플래그에 더해서 O_CREAT플래그를 사용해야할 것 같다. error발생시 -1 반환 close 함수 #include 파일 디스크립터 넘겨주면 fd table에서 descriptor 삭제. open과 맞물려서 사용 fork() 호출시 부모 프로세스와 자식 프로세스 간 파일 디스크립터 테이블 동일하므로 같은 파일에 대해 같은 fd를 가짐. 그렇지만 이는 복사본이므로 한쪽 프로세스에서 close(fd)를 하는 경우에 다른 프로세스에서 닫히지는 않는다. read 함수 #include or or 읽은 만큼 반환, 그 후 eof 만나면 0 반환, 오류시 -1 반환 write 함수 #include 쓴 바..
(Advanced Programming in the UNIX Environment, Rago, Stephen A., Stevens, W. Richard 저. 3판 참조) 책에서 사용하는 헤더 && 자체 에러 함수 apue.h /* * Our own header, to be included before all standard system headers. */ #ifndef _APUE_H #define _APUE_H #define _POSIX_C_SOURCE 200809L #if defined(SOLARIS) /* Solaris 10 */ #define _XOPEN_SOURCE 600 #else #define _XOPEN_SOURCE 700 #endif #include /* some systems still..
https://www.gnu.org/software/bash/manual/html_node/Redirections.html Redirections (Bash Reference Manual) 3.6 Redirections Before a command is executed, its input and output may be redirected using a special notation interpreted by the shell. Redirection allows commands’ file handles to be duplicated, opened, closed, made to refer to different files, and can www.gnu.org https://architectophile.t..