creating for raw socket needs root permision
I am trying to write a ping kind of program for my own application.
This needs me to create a raw socket. But I wondered that the creation of the raw saocket needs root permision. This means that a non root priviliged user will not be able to execute my program.:confused:
Is it possible to create the program as seting the effective user id to root.
If not then how does the ping program run on our machine even if we are not the super user? Ping internaly creates the raw socket!
I tried using setreuid(-1, 0); But it failed.
Can anybody guide me please.
Thanks in advance.