A portability gotcha with accept()

Today's excitement came from trying to bring a local network daemonfrontend up and running on a FreeBSD machine. It would spawn programswhen you connected to it, but they always exited immediately afterthey printed their greeting banner; it was as if they were seeing animmediate end of file.

FreeBSD's ktrace revealed that when the spawned programs went toread from standard input, they got an EAGAIN result. Fortunately I'vestubbed my toe on this one before: this is the exact symptom of yourstandard


讀網誌


我出身市井,對於報章文字,慣性稱呼為“吠”,評論也好,抒情也罷,總之比我大聲,訊息傳得夠遠,就是吠。澳門街的吠聲,水準不一,有時吠得好,夠中氣;有時吠得人反感,添煩添亂。
寫了這個專欄,並不自高自大,想

Intel

The economics of CPU performance

Recently, Intel and AMD have been telling everyone who would listenthat single CPU performance is more or less all tapped out, and thatfuture improvements would come from various multi-* developments;multi-core, multi-processor, and so on. Ominous pronouncements haveemerged about how programmers need to bite the bullet and move to(highly) concurrent programming if they want their gravy train tocontinue.

When reading this sort of news coverage, it's worthwhile to rememberwhat sells CPUs and software. Namely:


20060117網摘 – 人聲扮車聲

New

  • New IE7 Beta 2 Screens Leak 看起來很不錯呢
  • Wizlite 讓你在任何的網頁 highlight 文字和分享 highlight 的部份,可以只裝 bookmarklet
  • Rex V 用 Ajax 寫的 Regular Expression 工具,可以分別使用PHP PCRE , Posix 和 Javascript 本身的 Regexp engine

Google Video

Our Media


Rock 版卡農

對於 EVA 迷來說,對放在《Death》片尾的《Canon in D》 是非常深刻的吧?來個 Rock 版如何? 連結: Rock Canon

鏡住

本blog則常有人叫鄙人落地d、寫淺d。難得有文章明白的許寶強險險拉到了有關問題,一定要貼出來,借位鳴冤。

許寶強﹕〈為何知識型經濟那麼反智〉

統計處最近發表了《香港——知識型經濟統計透視2005》,本地傳媒抽

Some words of wisdom for all ISPs

Vernon Schryver, in news.admin.net-abuse.email:

Spam complaints must be viewed like complaints from your neighborsthat your children or other pets have again wrecked gardens. Spamcomplaints are evidence of failures, and should be exceptionsinstead of part of the main anti-spam machinery.

(From Message-ID <95cqle $80v$1@calcite.rhyolite.com> .)


The danger of specific errno values

One of the things I've learned the hard way in writing Unix programsis that you should almost never expect to know all of the errno valuesthat system calls can return. In theory it's documented in themanpages, but in practice a manpage's list is never comprehensive.The safest thing to do is to assume that any system call can returnalmost any errno value.

The example I remember most vividly is that our SMTP server daemonused to carefully check the result of accept() . If


答留言.薦書

前文見此

暉:

你說的話我並不完全反對。確然很多人都將韓農想像成受難者,好像他們不是受難者,或者有更苦的受難者,韓農就不值得支持。不過,我認為你也是抱持這種邏輯的人。否則,你發現中國農民比韓國農民更慘,那

到了深夜,仍然有人會令我食慾不振


星期六,我們又要上班了,P、Y、A 由早上工作到深夜一點,我在下午加入,自問貢獻不多,也是極累。

工作就是這樣,到了一個地步,你會不計付出,只希望圓滿結束。

回到家裡已是一點半,準備吃我的“晚飯”,卻被服務