[問題] 請問應用程式如何取得網路裝置
我想在user-space下利用ioctl取得網路裝置的資訊
ioctl的系統呼叫如下:
int ioctl( int fd, int cmd, ...);
關於fd我應該怎麼取得?
我的意思是我怎麼在應用程式下開啟網路裝置?
以及我需要include哪些lib?
#include<stdio.h>
?
int main() {
int fd = ?
struct ifreq data;
....
ioctl(fd,cmd,&data);
return 0;
}
※ 編輯: ILYUJING 來自: 140.124.183.77 (10/18 20:47)
→
10/18 23:36, , 1F
10/18 23:36, 1F
討論串 (同標題文章)
LinuxDev 近期熱門文章
PTT數位生活區 即時熱門文章