svc_fdset

fd_set svc_fdset;

A global variable reflecting the RPC service side's read file descriptor bit mask; it is suitable as a template argument to the select(2) system call. This is only of interest if a service implementor does not call svc_run(), but rather does his own asynchronous event processing. This variable is read-only (do not pass its address to select(2)!), yet it may change after calls to svc_getreqset() or any creation routines. As well, note that if the process has descriptor limits which are extended beyond FD_SETSIZE, this variable will only be usable for the first FD_SETSIZE descriptors.

原來在 svc.h 裡面定義了一個 svc_fdset,可以直接 copy 它並丟進去做 poll/select。

這個 set 裡面記綠現在這個 program 建立了哪些 services。對它做 poll/select 就能知道哪些 service 已經準備可以取得 reqeust。

而且 svc_run() 就是透過 svc_fdset, select(), svc_getreqset() 實作的。

F6F - VIM Tips: Block Insert - VIM Tips: Block Insert

VIM Tips: Block Insert

:help v_b_I for more information.

如果想對多行插入(例如加上 // 註解一大段 javascript)

  • ctrl-v 進入 visual block
  • 方向鍵向下選擇要註解的連續幾行(選頭,因為要註解頭,選其它地方就會插到別地方)
  • 按大寫的 i
  • 鍵入 // (到此,會只看到 // 出現在第一行)
  • Esc (其它行都會出現 // 了)

自 po 自 po

F6F - FreeBSD ports 反安裝裝到一半的套件 - FreeBSD ports 反安裝裝到一半的套件

FreeBSD ports 反安裝裝到一半的套件

如果你編某個 ports 已經編到一半了,回來看才發現它開始編 X 了,忘了加 WITHOUT_X11 或是 make config:

  • Ctrl-C 中斷現在編的程序
  • 到那個 ports 的目錄
  • make all-depends-list | awk -F '/' '{print $5}' | xargs pkg_deinstall

好早以前發現的,每次都忘記…

自 po 自記