当前位置:网站首页>Dup2 use
Dup2 use
2022-06-13 05:00:00 【Clown clown clown】
The header file :
Parameters :
dup2 It is a system call interface to help us redirect
Usage method : hold fd_arrays[oldfd] copy to fd_arrays[newfd], Implement redirection
principle :
To be able to use dup2, First understand the file descriptor fd
File descriptor
The following code does not call dup2 Interface , The essence is to point to the original stdout Of fd Points to the newly opened file .
Use dup2 It's written like this .
principle : Put the newly opened file fd copy to fd_arrays[1] Inside , Implement redirection .
Therefore use dup2 When ,
边栏推荐
- Reductive elimination
- Advanced C language - Section 1 - data storage
- Win8.1和Win10各自的优势
- About mission planning and improving execution
- Promise processing JS multithreads get the same processing result after all the results are obtained
- Section 4 - arrays
- C language learning log 10.5
- Gradient descent, learning rate
- Force deduction 121 questions
- Kaggle time series tutorial
猜你喜欢
![[JS solution] leedcode 200 Number of islands](/img/c1/bcdb3fc079c634a9a1b3d0fc264987.png)
[JS solution] leedcode 200 Number of islands

Simple sr: Best Buddy Gans for highly detailed image super resolution Paper Analysis
![C # get all callable methods of WebService interface [webmethod]](/img/44/4429b78c5b8341ed9a4a08d75a683e.png)
C # get all callable methods of WebService interface [webmethod]

Explain the role of key attribute in V-for

Draw a hammer

利用Javeswingjdbc基於mvc設計系統

MySQL8.0.13安装教程(有图)

2021tami/ image processing: exploiting deep generative priority for versatile image restoration and manipulation

详解OpenCV的函数cv::add(),并附各种情况的示例代码和运行结果

lookup
随机推荐
Luogu p1012 guess
Keil uses j-link to burn the code, and an error occurs: Flash download failed - one of the "Cortex-M3" solutions
Article 49: understanding the behavior of new handler
C language learning log 12.25
lookup
[JS solution] leedcode 200 Number of islands
Interpretation of QT keypressevent
详解OpenCV的函数cv::add(),并附各种情况的示例代码和运行结果
How to use redis
Sub paragraph of Chapter 16
Chinese trumpet creeper
Hidden implementation and decoupling, knowing Pimpl mode
Analysis on the similarities and differences of MVC, MVP and mvvc
C language learning log 1.17
C language learning log 1.2
Clause 28: understanding reference folding
Wang Dao Chapter II linear table exercises
C language learning log 10.11
Force deduction 121 questions
Trust programming - linked lists: use struct to implement linked lists, use heap to merge K ascending linked lists, and customize display