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:


鏡住

本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 由早上工作到深夜一點,我在下午加入,自問貢獻不多,也是極累。

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

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

Weekly spam summary on January 14th, 2006

This week we received 12,785 email messages from 208 different IPaddresses. Our SMTP server handled 17,958 sessions from 984 differentIP addresses. Session volume is dramatically down from the levels of last week .

Connection volume is also down: 122,600 connections from at least44,760 different IP addresses. However, we hit a highwater mark of 50connections being processed at once on Tuesday, so we have had


How not to set up your DNS (part 8)

This is one of those amusingly creative mistakes to see in action:

  • microsoftglobal.com lists as nameservers ns1.one-dom4.com andns2.one-dom4.com.
  • both respond with errors if they are sent queries that allowrecursion.
  • sent queries marked non-recursive, both answer all DNS queries forthe domain with no actual data, but with an 'additional authority'section that says they're the nameservers for the domain.

Nameservers normally answer a query for a domain they