how to known whether system is available or not at the time of start up of operating system
in unix systems

7 Years
Discussion Span
Last Post by L7Sqr

Is thsi a C++ specific question? You might want to do this via a command line as the tools are already available for you.

If you must do this from within another program, I'd suggest you fork/exec a child process and execute the ping command. Use the return value of that to determine if ping was successful.


at the time of start up of solaris operating system my application is using ping command to known whether GPS device is available or not. PING cmd some times its not working properly. so i need any command or c++ code to find whether GPS device is available or not


Ping is fairly well tested. I'm pretty sure that is 'works'. What about it doesn't seem to be working for you? If there are major problems with your version maybe think about getting a new version and installing it again.
In either case, if all you are doing is using ping to test connectivity to a well known address you can do that purely in sockets code.
I'm not familiar with Solaris so you'll have to google for insight on how to use sockets on Solaris.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.