I’m writing a server and would like to check if the process has the capability to open a port below 1024, and use a port above 1024 otherwise.
How could this be done under Linux in C/C++?
The obvious solution is to just try, but that is less elegant as I use third party software to open the port (GstRtspServer) so that solution would be to open port 554 and if successful close it and tell GstRtspServer to use port 554 and otherwise 8554.
1