Monday, February 23, 2009

exit, _exit

exit() 與 _exit() 之間的差異性

1)fork()出來的process, 不要用exit(), 用_exit()
2)exit()會依序呼叫以下函式
cleanup()
atexit()時註冊的callback function
_exit()

我的想法如下
為什麼child process, 不要用exit()
因為atexit()註冊的callback function, 可能會含有移除一些共用的resource釋放的程式碼
所以如果在child process結束時, 移除共用的resource, 可能會造成其他process的問題
尚待驗證

Thursday, February 19, 2009

strace on macosx

cannot find out strace on macosx or fink

using tool below instead,
1) /usr/bin/fs_usage
2) ktrace & kdump
3) /Application/Utility > Acitvity Monitor > Inspector or Sample Process

wget easy howto

如果wget遇到要username跟password時

wget --user=XXX --password=??? http_download_url

Wednesday, February 18, 2009

dropbox

Install dropbox on ubuntu 8.10

0) get dropbox source
1) sudo apt-get install libnautilus-extension-dev
2) sudo apt-get install libnotify-dev
3) ./configure && make
4) make install

The most important is logout & login to launch dropbox.