Add __returns_twice for the attribute of the same name. This makes the

attribute explicit based on the functions GCC gives it too.
This commit is contained in:
joerg 2011-11-05 09:27:06 +00:00
parent 09bafcf1a9
commit 0b50389a15
6 changed files with 22 additions and 16 deletions

View File

@ -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] _JB_ATTRIBUTES;
__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

View File

@ -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);

View File

@ -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__

View File

@ -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_ */

View File

@ -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

View File

@ -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