code:read - ikarishinjieva/unixV6-code-analyze-chs GitHub Wiki
- 读文件 的 系统调用函数
- 由 用户态 传入3个参数 fildes, buffer, nbytes
- fildes : 文件打开标志, u.u_ofile[fildes] 指向对应的文件打开结构,参看内存打开文件结构
- buffer : 读取的起始偏移位
- nbytes : 读取的字节数
5707
5708 /*
5709 * read system call
5710 */
5711 read()
5712 {
5713 rdwr(FREAD);
5714 }
5715 /* ------------------------- */
- (read = 3.)
- (file descriptor in r0)
- sys read; buffer; nbytes
- (byte count in r0)