JavaProphet
JavaProphet

Reputation: 991

What is the integer value of AF_UNIX?

So, I'm trying to write some JNA code to work with Unix sockets, and I'm trying to reference AF_UNIX for sockets. I looked through some of the gcc included files, but I couldn't find anything.

Upvotes: 2

Views: 1003

Answers (2)

JesperE
JesperE

Reputation: 64434

On my Ubuntu-machine it is defined in /usr/include/x86_64-linux-gnu/bits/socket.h as 1. I haven't checked around in other Unix source trees, but I have a feeling that it is probably defined as 1 in most other Unix dialects.

Upvotes: 2

It may be platform-dependent, which is why you should use the define. It should be in sys/socket.h.

Upvotes: 3

Related Questions