code:gtty - ikarishinjieva/unixV6-code-analyze-chs GitHub Wiki
- gtty 的系统调用函数
- 得到 tty 参数(参看struct tty)
- t_speeds
- t_erase
- t_kill
- t_flags
- 传入2个参数 fildes, arg
- arg : 保存tty参数的地址,保存在u.u_arg[0]
8162 /* The routine implementing the gtty system call.
8163 * Just call lower level routine and pass back values.
8164 */
8165 gtty()
8166 {
8167 int v[3];
8168 register *up, *vp;
8169
8170 vp = v;
8171 sgtty(vp);
8172 if (u.u_error)
- tty 参数 传入到 缓存区v
8173 return;
8174 up = u.u_arg[0];
8175 suword(up, *vp++);
8176 suword(++up, *vp++);
8177 suword(++up, *vp++);
8178 }
- 将 v 中参数 写入到 u.u_arg[]
8179 /* ------------------------- */
- (gtty = 32.)
- (file descriptor in r0)
- sys gtty; arg
- ...
- arg: .=.+6