what 0 indicates in following line?
what are other flags i can use?
server = socket(AF_UNIX, SOCK_STREAM, 0)
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
As others have likely said, the third argument to
socketis generally anintindicating the protocol.0indicates that the caller does not want to specify the protocol and will leave it up to the service provider.Other than zero, another common one is
IPPROTO_TCP.Full details can be found on the man page using
man 2 socketon your machine or visiting here.