Module Name:    src
Committed By:   christos
Date:           Sat Jan 31 23:10:57 UTC 2015

Modified Files:
        src/lib/libc/sys: Makefile.inc

Log Message:
PR/49617: Kirk Russell: posix_fallocate() should be returning an error on
failure, without setting errno, so make it PSEUDO_NOERROR, by adding a new
category GLUENOERR.


To generate a diff of this commit:
cvs rdiff -u -r1.226 -r1.227 src/lib/libc/sys/Makefile.inc

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libc/sys/Makefile.inc
diff -u src/lib/libc/sys/Makefile.inc:1.226 src/lib/libc/sys/Makefile.inc:1.227
--- src/lib/libc/sys/Makefile.inc:1.226	Tue Dec  9 19:37:30 2014
+++ src/lib/libc/sys/Makefile.inc	Sat Jan 31 18:10:56 2015
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.inc,v 1.226 2014/12/10 00:37:30 pooka Exp $
+#	$NetBSD: Makefile.inc,v 1.227 2015/01/31 23:10:56 christos Exp $
 #	@(#)Makefile.inc	8.3 (Berkeley) 10/24/94
 
 # sys sources
@@ -30,10 +30,10 @@ CLEANFILES+=	${_LSRC:MLintSys*.c}
 
 # glue to provide compatibility between GCC 1.X and 2.X and for compat
 # with old syscall interfaces.
-GLUE+= fdiscard.c ftruncate.c lseek.c mmap.c posix_fallocate.c \
+GLUE+= fdiscard.c ftruncate.c lseek.c mmap.c \
 	pread.c preadv.c pwrite.c pwritev.c truncate.c ntp_adjtime.c \
 	mknodat.c
-
+GLUENOERR+= posix_fallocate.c
 GLUE50+= adjtime.c clock_settime.c settimeofday.c
 
 # 'glue' files might .c or .S depending on the architecture
@@ -54,6 +54,23 @@ ASM_GLUE+= tmp_${glue:.c=.S}
 .endfor
 
 # 'glue' files might .c or .S depending on the architecture
+.for glue in ${GLUENOERR}
+. if exists(${glue:.c=.S})
+# Build the ASM glue file
+SRCS+=${glue:.c=.S}
+. else
+.  if exists(__${glue:.c=.S})
+SRCS+=__${glue:.c=.S} ${glue}
+.  else
+# Build the C glue file
+SRCS+= ${glue}
+# and an asm entry for __<syscall>
+ASM_GLUENOERR+= tmp_${glue:.c=.S}
+.  endif
+. endif
+.endfor
+
+# 'glue' files might .c or .S depending on the architecture
 .for glue in ${GLUE50}
 . if exists(${glue:.c=.S})
 # Build the ASM glue file
@@ -163,8 +180,11 @@ NOERR=	getegid.S geteuid.S getgid.S getp
 
 PSEUDONOERR=	_exit.S
 
-SRCS+=		${ASM} ${WEAKASM} ${NOERR} ${PSEUDONOERR} ${ASM_GLUE}
-CLEANFILES+=	${ASM} ${WEAKASM} ${NOERR} ${PSEUDONOERR} ${ASM_GLUE}
+_GENFILES=	${ASM} ${WEAKASM} ${NOERR} ${PSEUDONOERR} \
+	${ASM_GLUE} ${ASM_GLUENOERR}
+
+SRCS+=		${_GENFILES}
+CLEANFILES+=	${_GENFILES}
 
 ASMDEPS=	${.CURDIR}/sys/Makefile.inc ${ARCHDIR}/SYS.h \
 		${DESTDIR}/usr/include/sys/syscall.h
@@ -180,6 +200,10 @@ ${ASM_GLUE}: ${ASMDEPS}
 	${_MKTARGET_CREATE}
 	printf '#include "SYS.h"\nPSEUDO(${.PREFIX:S/tmp_/__/},${.PREFIX:S/tmp_//})\n' >${.TARGET}
 
+${ASM_GLUENOERR}: ${ASMDEPS}
+	${_MKTARGET_CREATE}
+	printf '#include "SYS.h"\nPSEUDO_NOERROR(${.PREFIX:S/tmp_/__/},${.PREFIX:S/tmp_//})\n' >${.TARGET}
+
 ${WEAKASM}: ${ASMDEPS}
 	${_MKTARGET_CREATE}
 	printf '#include "SYS.h"\nWSYSCALL(${.PREFIX},_sys_${.PREFIX})\nWEAK_ALIAS(_${.PREFIX},_sys_${.PREFIX})\n' >${.TARGET}

Reply via email to