Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/lib/libc/sys PR/49617: Kirk Russell: posix_fallocate() shoul...



details:   https://anonhg.NetBSD.org/src/rev/a617c0bbe0a7
branches:  trunk
changeset: 335944:a617c0bbe0a7
user:      christos <christos%NetBSD.org@localhost>
date:      Sat Jan 31 23:10:56 2015 +0000

description:
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.

diffstat:

 lib/libc/sys/Makefile.inc |  34 +++++++++++++++++++++++++++++-----
 1 files changed, 29 insertions(+), 5 deletions(-)

diffs (71 lines):

diff -r 55ac27da98a6 -r a617c0bbe0a7 lib/libc/sys/Makefile.inc
--- a/lib/libc/sys/Makefile.inc Sat Jan 31 23:09:27 2015 +0000
+++ b/lib/libc/sys/Makefile.inc Sat Jan 31 23:10:56 2015 +0000
@@ -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 @@
 
 # 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 @@
 .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 @@
 
 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 @@
        ${_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}



Home | Main Index | Thread Index | Old Index