使用fopen開啟檔案時
有時會發生無法開啟的錯誤
此時可以在程式碼中加入
extern int errno;
取得開檔之錯誤代碼
smalldd 發表在 痞客邦 留言(1) 人氣(2,384)
1.
引用標頭檔 linux/ioctl.h
#include <linux/ioctl.h>
若 kernel 內有定義 CONFIG_COMPAT 這 defined constant
表示 ioctl 在 相容模式 (compatibility mode)
要多引用 linux/compat.h
#include <linux/compat.h>
smalldd 發表在 痞客邦 留言(0) 人氣(6,683)
假設寫了一支 smalldd 的程式是一支以網路核心功能開發的程式
1.
把 smalldd.h 檔放到 include/net/ 下
smalldd 發表在 痞客邦 留言(0) 人氣(5,258)
這是從 Joey 的 Who call me – kernel版 看來的
在 Linux kernel 中可以使用 sprint_symbol() 來查看函式指標指到的函式名稱和 stack 位址
用法相當簡單
假設有個加法函式
int add(int augend, int addend);
smalldd 發表在 痞客邦 留言(0) 人氣(576)