I build libbusybox.so.1.31.1 and put on /usr/local/lib. In addition, I created
a symbolic link /usr/local/lib/libbusybox.soI have a file, the content of which
is:
$ cat ogt.cextern int lbb_main(char **argv);
int main()
{
char* strarray[] = {"ifconfig",0};
lbb_main(strarray);
return 1;
}
I compile the above file with the following command:
$ gcc -o ogt ogt.c -lbusybox
And run:
$ ./ogteth0 Link encap:Ethernet HWaddr 07:1F:EA:C9:3B:4C
inet addr:172.16.51.62 Bcast:172.16.51.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:7989695 errors:0 dropped:258 overruns:0 frame:0
TX packets:4696710 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:2659885363 (2.4 GiB) TX bytes:7111442553 (6.6 GiB)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:2654 errors:0 dropped:0 overruns:0 frame:0
TX packets:2654 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:225192 (219.9 KiB) TX bytes:225192 (219.9 KiB)
How do I redirect the output of command "lbb_main (strarray);" for a variable,
inside the ogt.c program?
_______________________________________________
busybox mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/busybox