diff --git a/include/errno.h b/include/errno.h
index 7df41df..a7615a4 100644
--- a/include/errno.h
+++ b/include/errno.h
@@ -40,6 +40,9 @@ extern __thread int errno attribute_tls_model_ie;
 
 # ifndef __ASSEMBLER__
 extern int *__errno_location (void) __THROW __attribute__ ((__const__))
+#  if __GNUC_PREREQ(4,9)
+     __attribute__((returns_nonnull))
+#  endif
 #  if RTLD_PRIVATE_ERRNO
      attribute_hidden
 #  endif
diff --git a/sysdeps/mach/hurd/bits/errno.h b/sysdeps/mach/hurd/bits/errno.h
index d20ffe6..5e84174 100644
--- a/sysdeps/mach/hurd/bits/errno.h
+++ b/sysdeps/mach/hurd/bits/errno.h
@@ -317,7 +317,11 @@ typedef enum __error_t_codes error_t;
 
 /* Return the current thread's location for `errno'.
    The syntax of this function allows redeclarations like `int errno'.  */
-extern int *__errno_location (void) __THROW __attribute__ ((__const__));
+extern int *__errno_location (void) __THROW __attribute__ ((__const__))
+#if __GNUC_PREREQ(4,9)
+     __attribute__((returns_nonnull))
+#endif
+;
 
 #define errno			(*__errno_location ())
 
diff --git a/sysdeps/unix/sysv/linux/alpha/bits/errno.h b/sysdeps/unix/sysv/linux/alpha/bits/errno.h
index 6e8c5cd..02dd301 100644
--- a/sysdeps/unix/sysv/linux/alpha/bits/errno.h
+++ b/sysdeps/unix/sysv/linux/alpha/bits/errno.h
@@ -46,7 +46,11 @@
 
 # ifndef __ASSEMBLER__
 /* Function to get address of global `errno' variable.  */
-extern int *__errno_location (void) __THROW __attribute__ ((__const__));
+extern int *__errno_location (void) __THROW __attribute__ ((__const__))
+#  if __GNUC_PREREQ(4,9)
+     __attribute__((returns_nonnull))
+#  endif
+;
 
 #  if !defined _LIBC || defined _LIBC_REENTRANT
 /* When using threads, errno is a per-thread value.  */
diff --git a/sysdeps/unix/sysv/linux/bits/errno.h b/sysdeps/unix/sysv/linux/bits/errno.h
index b00c621..a982669 100644
--- a/sysdeps/unix/sysv/linux/bits/errno.h
+++ b/sysdeps/unix/sysv/linux/bits/errno.h
@@ -47,7 +47,11 @@
 
 # ifndef __ASSEMBLER__
 /* Function to get address of global `errno' variable.  */
-extern int *__errno_location (void) __THROW __attribute__ ((__const__));
+extern int *__errno_location (void) __THROW __attribute__ ((__const__))
+#  if __GNUC_PREREQ(4,9)
+     __attribute__((returns_nonnull))
+#  endif
+;
 
 #  if !defined _LIBC || defined _LIBC_REENTRANT
 /* When using threads, errno is a per-thread value.  */
diff --git a/sysdeps/unix/sysv/linux/hppa/bits/errno.h b/sysdeps/unix/sysv/linux/hppa/bits/errno.h
index ad8f0b2..a46c752 100644
--- a/sysdeps/unix/sysv/linux/hppa/bits/errno.h
+++ b/sysdeps/unix/sysv/linux/hppa/bits/errno.h
@@ -47,7 +47,11 @@
 
 # ifndef __ASSEMBLER__
 /* Function to get address of global `errno' variable.  */
-extern int *__errno_location (void) __THROW __attribute__ ((__const__));
+extern int *__errno_location (void) __THROW __attribute__ ((__const__))
+#  if __GNUC_PREREQ(4,9)
+     __attribute__((returns_nonnull))
+#  endif
+;
 
 #  if !defined _LIBC || defined _LIBC_REENTRANT
 /* When using threads, errno is a per-thread value.  */
diff --git a/sysdeps/unix/sysv/linux/mips/bits/errno.h b/sysdeps/unix/sysv/linux/mips/bits/errno.h
index 26e5a77..9da9bed 100644
--- a/sysdeps/unix/sysv/linux/mips/bits/errno.h
+++ b/sysdeps/unix/sysv/linux/mips/bits/errno.h
@@ -46,7 +46,11 @@
 
 # ifndef __ASSEMBLER__
 /* Function to get address of global `errno' variable.  */
-extern int *__errno_location (void) __THROW __attribute__ ((__const__));
+extern int *__errno_location (void) __THROW __attribute__ ((__const__))
+#  if __GNUC_PREREQ(4,9)
+     __attribute__((returns_nonnull))
+#  endif
+;
 
 #  if !defined _LIBC || defined _LIBC_REENTRANT
 /* When using threads, errno is a per-thread value.  */
diff --git a/sysdeps/unix/sysv/linux/sparc/bits/errno.h b/sysdeps/unix/sysv/linux/sparc/bits/errno.h
index 2fbafac..ce2d32e 100644
--- a/sysdeps/unix/sysv/linux/sparc/bits/errno.h
+++ b/sysdeps/unix/sysv/linux/sparc/bits/errno.h
@@ -46,7 +46,11 @@
 
 # ifndef __ASSEMBLER__
 /* Function to get address of global `errno' variable.  */
-extern int *__errno_location (void) __THROW __attribute__ ((__const__));
+extern int *__errno_location (void) __THROW __attribute__ ((__const__))
+#  if __GNUC_PREREQ(4,9)
+     __attribute__((returns_nonnull))
+#  endif
+;
 
 #  if !defined _LIBC || defined _LIBC_REENTRANT
 /* When using threads, errno is a per-thread value.  */
