The BSD socket API on many systems implements a raw socket type[1], so you can use the socket APIs to talk raw IP.
Some systems (Linux, Darwin) also implement a special icmp socket type which can allow unprivileged ping.
Some systems (Linux, Darwin) also implement a special icmp socket type which can allow unprivileged ping.
Sockets are a transport layer feature e.g. TCP or UDP. ICMP works at the network layer and has no notion of sockets.