code:stty - ikarishinjieva/unixV6-code-analyze-chs GitHub Wiki

Source

  • stty 的系统调用函数
  • 设置 tty参数
    • t_speeds
    • t_erase
    • t_kill
    • t_flags
  • 传入2个参数 fildes, arg
    • fildes : 指定tty设备的字符设备装载文件的文件描述号,保存在u.u_ar0[R0](参看 文件系统)
(在 sgtty 中处理)
    • 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];

8188     u.u_arg[0] = fuword(up);

8189     u.u_arg[1] = fuword(++up);

8190     u.u_arg[2] = fuword(++up);

8191     sgtty(0);
8192 }

8193 /* ------------------------- */

Param

(stty = 31.)
(file descriptor in r0)
sys stty; arg
...
arg: .byte ispeed, ospeed; .byte erase, kill; mode
⚠️ **GitHub.com Fallback** ⚠️