[討論] <errno> strerror()找不到errno定義的字串
目前在執行某支應用程式時
出現socket: Address family not supported by protocol
的錯誤訊息
就想說看一下errno部分
而在Linux source code找Address family not supported by protocol
的關鍵字(#grep -irn "Address family not supported by protocol" * --color)
只在./kernel/arch/mips/include/asm/errno.h
看到有定義
#define EAFNOSUPPORT 124 /* Address family not supported by protocol */
此外就找不到相關的關鍵字
很好奇是strerror(errno)可以秀出錯誤訊息的字串
但trace一下Linux source code
都找不到它如何利用strerror找到相對應的字串
只在 ./kernel/arch/um/include/shared/kern.h
裡面定義
extern void perror(char *err);
extern void strerror(char *err);
那它是如何利用errno來找到相對應的字串呢?
謝謝
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 122.116.219.143
→
07/27 00:45, , 1F
07/27 00:45, 1F
推
07/27 01:01, , 2F
07/27 01:01, 2F
→
07/27 01:04, , 3F
07/27 01:04, 3F
討論串 (同標題文章)
以下文章回應了本文:
完整討論串 (本文為第 1 之 2 篇):
C_and_CPP 近期熱門文章
PTT數位生活區 即時熱門文章