code:stty - ikarishinjieva/unixV6-code-analyze-chs GitHub Wiki
- stty 的系统调用函数
- 设置 tty参数
- t_speeds
- t_erase
- t_kill
- t_flags
- 传入2个参数 fildes, arg
- arg : 存放tty参数的地址,保存在u.u_arg[0]
8180 /* The routine implementing the stty system call.
8181 * Read in values and call lower level.
8182 */
8183 stty()
8184 {
8185 register int *up;
8186
8187 up = u.u_arg[0];
8189 u.u_arg[1] = fuword(++up);
8190 u.u_arg[2] = fuword(++up);
8191 sgtty(0);
- u.u_arg[] ← 欲设置的tty参数值
8192 }
- 根据u.u_arg[]设置tty参数
8193 /* ------------------------- */
- (stty = 31.)
- (file descriptor in r0)
- sys stty; arg
- ...
- arg: .byte ispeed, ospeed; .byte erase, kill; mode