Is there an API in Java parallel to the C getservbyname, that accepts a service name and returns the port number? Do not tell me about InetAddress class because what I need is to get the port number of a service (from /etc/services).
With all due respect, this is not a system-dependent function. The implementation may be (such as the location of the /etc/services file or whether it's a flat file or database), but the function can be implemented on any system.