#define SCM_RIGHTS 1

Alex Belits (abelits@phobos.illtel.denver.co.us)
Fri, 23 Jan 1998 23:59:42 -0800 (PST)


...at least /usr/include/linux/socket.h has it in all versions since 2.0.

However after a user of my program complained about it not compiling on
Red Hat 5.0, I have installed Red Hat 5.0 with libc 6, changed various
definitions and signedness incompatibilities in my source, recompiled it
only to find that...

/usr/include/socketbits.h:

---8<---
/* Socket level message types. */
enum
{
SCM_RIGHTS, /* Data array contains access rights. */
/*#define SCM_RIGHTS SCM_RIGHTS*/
__SCM_CREDENTIALS, /* Data array is `struct ucred'. */
__SCM_CONNECT /* Data array is `struct scm_connect'. */
};
--->8---

...in other words, SCM_RIGHTS now is zero in user space, so kernel 2.0.32,
not being enlightened about glibc opinion about SCM_RIGHTS, loudly
complained to every attempt of sending file descriptors. Placing
SCM_RIGHT=1 in that enum and recompiling program again produced perfectly
usable executable.

And, of course, kernel sources have no traces of __SCM_CREDENTIALS or
__SCM_CONNECT. What is that? And what should I tell to users that compile
my program, patch socketbits.h?

--
Alex