]> Zhao Yanbai Git Server - minix.git/commitdiff
Hide SO_PASSCRED and SO_PEERCRED by default.
authorLionel Sambuc <lionel@minix3.org>
Tue, 22 Apr 2014 15:37:52 +0000 (17:37 +0200)
committerLionel Sambuc <lionel@minix3.org>
Mon, 28 Jul 2014 15:05:22 +0000 (17:05 +0200)
This cause in some software to assume we are linux, as this is rightly
only used there.

By default hide it behind _MINIX_SYSTEM, until we have removed traces
of it from getpeereid/[gs]etsocketopt and replaced it by the NetBSD
mechanism.

Change-Id: Iacd4cc1b152bcb7e90f5b1249185a222c90351d6

lib/libc/net/Makefile.inc
sys/sys/socket.h
test/Makefile

index 953e961dc5386a5ddb30da1bbe4e29aef82f9ff2..e8db73446db185ab6235a757089ab60ae6cd7ac2 100644 (file)
@@ -4,6 +4,10 @@
 # net sources
 .if defined(__MINIX)
 .PATH: ${.CURDIR}/net/minix
+
+CPPFLAGS.getpeereid.c+= -D_MINIX_SYSTEM=1
+CPPFLAGS.getsockopt.c+= -D_MINIX_SYSTEM=1
+CPPFLAGS.setsockopt.c+= -D_MINIX_SYSTEM=1
 .endif
 .PATH: ${ARCHDIR}/net ${.CURDIR}/net
 
index cfea658554e3c431df82bdd064bd95d2e6b9a204..e910d1656b0c30fc374cbe394bf3c5de6caa503a 100644 (file)
@@ -131,7 +131,8 @@ typedef     _BSD_SSIZE_T_   ssize_t;
 #define        SO_ACCEPTFILTER 0x1000          /* there is an accept filter */
 #define        SO_TIMESTAMP    0x2000          /* timestamp received dgram traffic */
 
-#if defined(__minix)
+#if defined(__minix) && defined(_MINIX_SYSTEM)
+/* Minixism which should go, so hide it from userland. */
 #define SO_PASSCRED    0x100000
 #define SO_PEERCRED    0x200000
 #endif /* defined(__minix) */
index 80e59d494d6e209a5f08060112d65a838619adc3..410c5b798749ba0abfbc5c60a007e39aed13551c 100644 (file)
@@ -26,6 +26,8 @@ COPTS.test51.c=       -mhard-float
 COPTS.test52.c=        -mhard-float
 .endif
 
+CPPFLAGS.test56.c += -D_MINIX_SYSTEM=1
+
 WARNS=
 COPTS.test9.c= -O0
 COPTS.test37.c=        -O0