Skip to content

Commit

Permalink
Update APUE docs.
Browse files Browse the repository at this point in the history
  • Loading branch information
buaajz committed Apr 11, 2023
1 parent 6a10e24 commit 9657a94
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
6 changes: 5 additions & 1 deletion APUE/FileSystem.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# 文件系统

<hr/>

### 目标
类似`ls`的实现

Expand Down Expand Up @@ -121,6 +120,11 @@ int fchmod(int fd,mode_t mode); //修改一个已经成功打开的文件
~~~
### 粘住位
- `t位`

粘住位:给某一个命令的使用痕迹做保留,现在有page cache可以不用t位

现在主要是/tmp目录使用t位 :各个用户对目录的操作会特殊保留

~~~ bash
$ ls -l /
drwxrwxrwt 1 root root 3.6K 2月 8 17:58 tmp
Expand Down
9 changes: 9 additions & 0 deletions APUE/IO.md
Original file line number Diff line number Diff line change
Expand Up @@ -643,7 +643,10 @@ int main()
### 文件共享
`truncate` 或者 `ftruncate`
用来截断文件位指定大小
### 原子操作
不可分割的操作
- 作用: 解决竞争和冲突 比如`tmpnam`就操作不原子
Expand Down Expand Up @@ -724,3 +727,9 @@ int main()
刷新文件的数据
- fdatasync
刷新文件的数据部分,不修改文件元数据
```
/dev/fd
# 虚目录,显示的是当前进程文件描述符的信息
```

0 comments on commit 9657a94

Please sign in to comment.