C

動的共有オブジェクトの作成方法

C

コンパイル gcc -fPIC -shared -o a.so a.c リンク 普通にリンクすればよい。 動的ロード void *dlopen(const char *path, int mode); シンボルのポインタ取得 void *dlsym(void *handle); アンロード int dlclose(void *handle); エラー取得 char *dlerror(…

WEBアプリケーション速さ比較

C言語にはClearSilverというテンプレートエンジンがあるらしい。 WEBアプリはApacheモジュールで作れば一番速そうだけど、テンプレートエンジン使うとどうなのかなと思いテストしてみた。 結論 Resinが断トツで速かった。Apacheモジュール+ClearSilverより…

errno の値の一覧

C

gdbでデバッグする際に、errno.h の各値がわからなかったので、以下のプログラムでリストしてみた。 #include <stdio.h> #include <errno.h> main(){ printf("E2BIG:%d\n", E2BIG); printf("EACCES:%d\n", EACCES); printf("EADDRINUSE:%d\n", EADDRINUSE); printf("EADDRNOTAV</errno.h></stdio.h>…