gpt4 book ai didi

posix - 如果 _POSIX_VDISABLE 值为 -1 会怎样?

转载 作者:行者123 更新时间:2023-12-01 00:02:10 25 4
gpt4 key购买 nike

在POSIX _POSIX_VDISABLE 值中如果为-1,则所有终端设备文件的特殊字符都没有禁用字符;否则该值是禁用字符值..

可以请任何人帮助我理解这一点。我无法理解这个的确切含义。

最佳答案

如果您查看 definition of special characters ,那应该意味着(thre '-1' 值),所有这些特殊字符都处于事件状态:

In canonical input, the terminal driver recognizes a number of special characters which perform various control functions.
These include the ERASE character (usually DEL) for editing input, and other editing characters.
The INTR character (normally Ctrl-c) for sending a SIGINT signal, and other signal-raising characters, may be available in either canonical or noncanonical input mode.



你有很多这样的特殊角色:
  • Characters for Input Editing
  • BSD Extensions to Editing Characters
  • Characters that Cause Signals
  • Special Characters for Flow Control
  • Other Special Characters


  • 已经提出了一个问题,看看 such a value was portable (确实总是编译)是否在 1997 年:

    The wording in section 2.9.4:

    If any of the constants in Table 2-11 are defined to have value -1 in the header ....

    can suggest, on casual reading, code like the following to minimize size and optimize efficiency for each implementation:


    #ifdef _POSIX_VDISABLE
    #if _POSIX_VDISABLE == -1
    /* code that assumes no vdisable capability */
    #else
    /* code that assumes vdisable capability */
    #endif
    #else
    /* code that uses pathconf() to determine vdisable capability */
    #endif

    interpretation #34 表明它会。

    By using these values at COMPILE-TIME, a portable POSIX.1 application can avoid loading all pathconf() related code associated with a symbol in Table 2-11 when the symbol is defined.

    关于posix - 如果 _POSIX_VDISABLE 值为 -1 会怎样?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2891425/

    25 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com