Skip to content

Commit

Permalink
修改
Browse files Browse the repository at this point in the history
  • Loading branch information
arkingc committed Jul 8, 2018
1 parent fb00a8d commit ea43419
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
Binary file added pic/unp-io-13.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 2 additions & 3 deletions 数据结构与算法/算法题总结.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
+ Leetcode78:[不含重复元素集合的所有子集](#不含重复元素集合的所有子集)(`组合` `medium`)
- *排序*
+ 《剑指offer》面试题21:[调整数组顺序使奇数位于偶数前面](#调整数组顺序使奇数位于偶数前面)(`partition`)
+ 《剑指offer》面试题61:[扑克牌中的顺子](#扑克牌中的顺子)
+ Leetcode179:[将一组数拼接成最大数字](#将一组数拼接成最大数字)(`medium`)
+ Leetcode384:[打乱数组](#打乱数组)(`Fisher–Yates shuffle洗牌算法` `medium`)
- *满足要求的元素对*
Expand All @@ -49,8 +50,6 @@
+ 《剑指offer》面试题29:[顺时针打印矩阵](#顺时针打印矩阵)
+ Leetcode48:[90度旋转图片](#90度旋转图片)(`medium`)
+ 《剑指offer》面试题66:[构建乘积数组](#构建乘积数组)
- *其它*
+ 《剑指offer》面试题61:[扑克牌中的顺子](#扑克牌中的顺子)

<h2 id="string"></h2>

Expand Down Expand Up @@ -10930,7 +10929,7 @@ public:
3. `part2`中最右边的元素(即`part2`最大的元素)为`l2`
4. `part4`中最左边的元素(即`part4`最小的元素)为`r2`

现在大小已经满足要求,由于`part1`和`part2`必须为数组`nums1`和`nums2`组成数组的前半部分,那么必须满足:
由于`part1`和`part2`必须为数组`nums1`和`nums2`组成数组的前半部分,那么必须满足:

```
l1 <= r1(已经满足)
Expand Down
12 changes: 10 additions & 2 deletions 计算机网络/UNIX网络编程卷1.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,10 @@
* [1.套接字超时](#1套接字超时)
* [2.排队的数据量](#2排队的数据量)
* [3.Unix I/O函数](#3unix-io函数)
- 1)[recv和send](#1recv和send函数)
- 2)[readv和writev](#2readv和writev函数)
- 3)[recvmsg和sendmsg](#3recvmsg和sendmsg函数)
- [5组I/O函数的对比](#5组io函数的对比)
* [4.标准I/O函数](#4标准io函数)

<h2 id="ch8"></h2>
Expand Down Expand Up @@ -1419,7 +1423,7 @@ getaddrinfo的互补函数
<div align="center"> <img src="../pic/unp-io-3.png"/> </div>

* **filedes**:文件描述符
* **iov**:指向某个iovec结构数组的一个指针,iovec结构定义在<sys/uio.h>中:
* **iov**:指向某个iovec结构数组的一个指针,iovec结构定义在`<sys/uio.h>`中:
* **opvcnt**:iov数组中元素个数

```c++
Expand All @@ -1436,7 +1440,7 @@ struct iovec{
* `writev`函数从缓冲区中聚集输出数据的顺序是:iov\[0\]、iov\[1\]直至iov\[iovcnt-1\]
* `readv`函数则将读入的数据按同样的顺序散步到缓冲区中

**iovec结构数组中元素的个数存在某个限制,取决于具体实现**。4.3BSD和Linux均最多允许1024个,而HP-UX最多允许2100个。**POSIX要求在头文件<sys/uio.h>中定义IOV_MAX常值,其值至少为16**
**iovec结构数组中元素的个数存在某个限制,取决于具体实现**。4.3BSD和Linux均最多允许1024个,而HP-UX最多允许2100个。**POSIX要求在头文件`<sys/uio.h>`中定义`IOV_MAX`常值,其值至少为16**

**这两个函数可用于任何描述符,writev是一个原子操作**

Expand Down Expand Up @@ -1506,6 +1510,10 @@ cmsg_level和cmsg_type的取值和说明如下表:

<div align="center"> <img src="../pic/unp-io-7.png"/> </div>

### 5组I/O函数的对比

<div align="center"> <img src="../pic/unp-io-13.png"/> </div>

## 4.标准I/O函数

执行I/O的另一个方法是使用标准I/O函数库,这个函数库由ANSI C标准规范,意在便于移植到支持ANSI C的非Unix系统上。标准I/O函数库处理直接使用Unix I/O函数时必须考虑的一些细节,譬如自动缓冲输入流和输出流。不幸的是,对于流的缓冲处理可能导致同样必须考虑的一组新的问题
Expand Down

0 comments on commit ea43419

Please sign in to comment.