Module Name: src
Committed By: joerg
Date: Sat Nov 5 09:27:06 UTC 2011
Modified Files:
src/include: setjmp.h ucontext.h unistd.h
src/lib/libc/compat/include: setjmp.h
src/sys/sys: cdefs.h systm.h
Log Message:
Add __returns_twice for the attribute of the same name. This makes the
attribute explicit based on the functions GCC gives it too.
To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/include/setjmp.h
cvs rdiff -u -r1.6 -r1.7 src/include/ucontext.h
cvs rdiff -u -r1.127 -r1.128 src/include/unistd.h
cvs rdiff -u -r1.1 -r1.2 src/lib/libc/compat/include/setjmp.h
cvs rdiff -u -r1.88 -r1.89 src/sys/sys/cdefs.h
cvs rdiff -u -r1.250 -r1.251 src/sys/sys/systm.h
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/include/setjmp.h
diff -u src/include/setjmp.h:1.25 src/include/setjmp.h:1.26
--- src/include/setjmp.h:1.25 Wed Aug 12 04:57:36 2009
+++ src/include/setjmp.h Sat Nov 5 09:27:06 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: setjmp.h,v 1.25 2009/08/12 04:57:36 matt Exp $ */
+/* $NetBSD: setjmp.h,v 1.26 2011/11/05 09:27:06 joerg Exp $ */
/*-
* Copyright (c) 1990, 1993
@@ -62,18 +62,18 @@ typedef _BSD_JBSLOT_T_ jmp_buf[_JBLEN] _
__BEGIN_DECLS
#ifndef __LIBC12_SOURCE__
-int setjmp(jmp_buf) __RENAME(__setjmp14);
+int setjmp(jmp_buf) __RENAME(__setjmp14) __returns_twice;
void longjmp(jmp_buf, int) __RENAME(__longjmp14) __dead;
#if defined(_POSIX_C_SOURCE) || defined(_XOPEN_SOURCE) || \
defined(_NETBSD_SOURCE)
-int sigsetjmp(sigjmp_buf, int) __RENAME(__sigsetjmp14);
+int sigsetjmp(sigjmp_buf, int) __RENAME(__sigsetjmp14) __returns_twice;
void siglongjmp(sigjmp_buf, int) __RENAME(__siglongjmp14) __dead;
#endif /* not ANSI */
#endif /* __LIBC12_SOURCE__ */
#if defined(_XOPEN_SOURCE) || defined(_NETBSD_SOURCE)
-int _setjmp(jmp_buf);
+int _setjmp(jmp_buf) __returns_twice;
void _longjmp(jmp_buf, int) __dead;
#endif
Index: src/include/ucontext.h
diff -u src/include/ucontext.h:1.6 src/include/ucontext.h:1.7
--- src/include/ucontext.h:1.6 Thu Mar 19 08:04:38 2009
+++ src/include/ucontext.h Sat Nov 5 09:27:06 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: ucontext.h,v 1.6 2009/03/19 08:04:38 uebayasi Exp $ */
+/* $NetBSD: ucontext.h,v 1.7 2011/11/05 09:27:06 joerg Exp $ */
/*-
* Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -36,7 +36,7 @@
#include <sys/ucontext.h>
__BEGIN_DECLS
-int getcontext(ucontext_t *);
+int getcontext(ucontext_t *) __returns_twice;
int setcontext(const ucontext_t *);
void makecontext(ucontext_t *, void (*)(), int, ...);
int swapcontext(ucontext_t * __restrict, const ucontext_t * __restrict);
Index: src/include/unistd.h
diff -u src/include/unistd.h:1.127 src/include/unistd.h:1.128
--- src/include/unistd.h:1.127 Mon Aug 8 12:08:53 2011
+++ src/include/unistd.h Sat Nov 5 09:27:06 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: unistd.h,v 1.127 2011/08/08 12:08:53 manu Exp $ */
+/* $NetBSD: unistd.h,v 1.128 2011/11/05 09:27:06 joerg Exp $ */
/*-
* Copyright (c) 1998, 1999, 2008 The NetBSD Foundation, Inc.
@@ -274,7 +274,7 @@ void sync(void);
useconds_t ualarm(useconds_t, useconds_t);
int usleep(useconds_t);
#ifndef __LIBC12_SOURCE__
-pid_t vfork(void) __RENAME(__vfork14);
+pid_t vfork(void) __RENAME(__vfork14) __returns_twice;
#endif
#ifndef __AUDIT__
Index: src/lib/libc/compat/include/setjmp.h
diff -u src/lib/libc/compat/include/setjmp.h:1.1 src/lib/libc/compat/include/setjmp.h:1.2
--- src/lib/libc/compat/include/setjmp.h:1.1 Tue Sep 13 01:44:09 2005
+++ src/lib/libc/compat/include/setjmp.h Sat Nov 5 09:27:06 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: setjmp.h,v 1.1 2005/09/13 01:44:09 christos Exp $ */
+/* $NetBSD: setjmp.h,v 1.2 2011/11/05 09:27:06 joerg Exp $ */
/*-
* Copyright (c) 1990, 1993
@@ -40,11 +40,11 @@
#define _COMPAT_SETJMP_H_
__BEGIN_DECLS
-int __setjmp14(jmp_buf);
-void __longjmp14(jmp_buf, int) __attribute__((__noreturn__));
+int __setjmp14(jmp_buf) __returns_twice;
+void __longjmp14(jmp_buf, int) __dead;
-int __sigsetjmp14(sigjmp_buf, int);
-void __siglongjmp14(sigjmp_buf, int) __attribute__((__noreturn__));
+int __sigsetjmp14(sigjmp_buf, int) __returns_twice;
+void __siglongjmp14(sigjmp_buf, int) __dead;
__END_DECLS
#endif /* !_COMPAT_SETJMP_H_ */
Index: src/sys/sys/cdefs.h
diff -u src/sys/sys/cdefs.h:1.88 src/sys/sys/cdefs.h:1.89
--- src/sys/sys/cdefs.h:1.88 Sun Oct 9 20:30:19 2011
+++ src/sys/sys/cdefs.h Sat Nov 5 09:27:06 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: cdefs.h,v 1.88 2011/10/09 20:30:19 chs Exp $ */
+/* $NetBSD: cdefs.h,v 1.89 2011/11/05 09:27:06 joerg Exp $ */
/*
* Copyright (c) 1991, 1993
@@ -232,6 +232,12 @@
#define __noinline /* nothing */
#endif
+#if __GNUC_PREREQ__(4, 1)
+#define __returns_twice __attribute__((__returns_twice__))
+#else
+#define __returns_twice /* nothing */
+#endif
+
#if __GNUC_PREREQ__(4, 5)
#define __noclone __attribute__((__noclone__))
#else
Index: src/sys/sys/systm.h
diff -u src/sys/sys/systm.h:1.250 src/sys/sys/systm.h:1.251
--- src/sys/sys/systm.h:1.250 Fri Sep 30 10:23:03 2011
+++ src/sys/sys/systm.h Sat Nov 5 09:27:06 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: systm.h,v 1.250 2011/09/30 10:23:03 mrg Exp $ */
+/* $NetBSD: systm.h,v 1.251 2011/11/05 09:27:06 joerg Exp $ */
/*-
* Copyright (c) 1982, 1988, 1991, 1993
@@ -420,7 +420,7 @@ int uiomove(void *, size_t, struct uio *
int uiomove_frombuf(void *, size_t, struct uio *);
#ifdef _KERNEL
-int setjmp(label_t *);
+int setjmp(label_t *) __returns_twice;
void longjmp(label_t *) __dead;
#endif