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

Source

  • 设置 文件 的修改时间
  • 输入2个参数
  • 注意
    • 整个函数 被注释起来,函数入口也被取消,这个系统调用被取消,原因如下:
这个函数 违背了 文件修改时间的原则(修改 按 时间顺序进行),用户可以随意设置修改时间

3587

3588 /*

3589  * Change modified date of file:

3590  * time to r0-r1; sys smdate; file

3591  * This call has been withdrawn because it messes up

3592  * incremental dumps (pseudo-old files aren’t dumped).

3593  * It works though and you can uncomment it if you like.

3594

3595 smdate()

3596 {

3597     register struct inode *ip;

3598     register int *tp;

3599     int tbuf[2];

3600

3601     if ((ip = owner()) == NULL)

3602          return;

3603     ip->i_flag =| IUPD;

3604     tp = &tbuf[2];

3605     *--tp = u.u_ar0[R1];

3606     *--tp = u.u_ar0[R0];

3607     iupdat(ip, tp);

3608     ip->i_flag =& ~IUPD;

3609     iput(ip);

3610 }

3611 */

3612 /* ------------------------- */

Ref

⚠️ **GitHub.com Fallback** ⚠️