[問題] 關於dlsym()這個函數的問題
大家好,關於dlsym()這個函數,在網路上有看到一段解釋如下
dlsym() will return a NULL result if the symbol wasn't found. If you know
that the symbol could never have the value of NULL or zero, that may be fine,
but there's a potential ambiguity otherwise: if you got a NULL, does that
mean there is no such symbol, or that NULL is the value of the symbol? The
standard solution is to call dlerror() first (to clear any error condition
that may have existed), then call dlsym() to request a symbol, then call
dlerror() again to see if an error occurred.
中間有一段話 (抱歉不會上色,所以另外標出來) :
if you got a NULL, does that mean there is no such symbol,
or that NULL is the value of the symbol?
假設這個symbol是一個函數,會發生symbol成功取得,但是卻指向NULL的情況嗎?
想像不太出來這到底是什麼狀況,能否舉個例子讓小弟了解
謝謝大家的回答。
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 114.45.230.2
→
08/15 23:13, , 1F
08/15 23:13, 1F
→
08/15 23:14, , 2F
08/15 23:14, 2F
→
08/17 22:45, , 3F
08/17 22:45, 3F