sockets and proto

If I hard define IPPROTO_ICMP as 3 for the socket() call, will that work? If not, how does NetOS handle ICMP packets?