I am doing a standard fork/execl in C++ on my Ubuntu PC to scan for Wi-Fi SSIDs. It looks like the interface name is not taking effect when called with excel.
execl( "/sbin/iwlist", "wlp4s0", "scanning", (char*) NULL );
This succeeds but I get this in stderr:
lo Interface doesn't support scanning.
enp0s25 Interface doesn't support scanning.
It looks like iwlist is trying to scan all interfaces.
If instead I do:
system( "/sbin/iwlist wlp4s0 scanning" );
I do not get these messages in stderr.
Is there something I am doing wrong in my execl call?