<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ??一站式輕松地調用各大LLM模型接口,支持GPT4、智譜、豆包、星火、月之暗面及文生圖、文生視頻 廣告
                ## 18.5.?TTY 設備的 proc 和 sysfs 處理 tty 核心提供一個非常容易的方式給任何 tty 驅動來維護一個文件在 /proc/tty/driver 目錄中. 如果驅動定義 read_proc 或者 write_proc 函數, 這個文件被創建. 接著, 任何在這個文件上的讀或寫調用被發送給這個驅動. 這些函數的格式只象標準的 /proc 文件處理函數. 作為一個例子, 由一個簡單的 read_proc tty 回調實現, 只是打印出當前注冊的端口號: ~~~ static int tiny_read_proc(char *page, char **start, off_t off, int count, int *eof, void *data) { struct tiny_serial *tiny; off_t begin = 0; int length = 0; int i; length += sprintf(page, "tinyserinfo:1.0 driver:%s\n", DRIVER_VERSION); for (i = 0; i < TINY_TTY_MINORS && length < PAGE_SIZE; ++i) { tiny = tiny_table[i]; if (tiny == NULL) continue; length += sprintf(page+length, "%d\n", i); if ((length + begin) > (off + count)) goto done; if ((length + begin) < off) { begin += length; length = 0; } } *eof = 1; done: if (off >= (length + begin)) return 0; *start = page + (off-begin); return (count < begin+length-off) ? count : begin + length-off; } ~~~ tty 核心處理所有的 sysfs 目錄和設備創建, 當 tty 驅動被注冊時, 或者當單個 tty 設備被創建時, 依賴在 struct tty_driver 中的 TTY_DRIVER_NO_DEVFS 標志. 單個目錄一直包含 dev 文件, 它允許用戶空間工具來決定分配給設備的主次號. 它還包含一個 device 和 driver 符號連接, 如果一個指向有效的 struct device 的指針被傳遞給讀 tty_register_device 的調用. 除了這 3 個文件, 對單個 tty 驅動不可能在這個位置創建新的 sysfs 文件. 這個會可能在將來的內核發行中改變.
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看