This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: FD_SET and FORTIFY_SOURCE
- From: KOSAKI Motohiro <kosaki dot motohiro at gmail dot com>
- To: libc-alpha at sourceware dot org
- Cc: kosaki dot motohiro at gmail dot com
- Date: Sun, 24 Mar 2013 21:58:49 -0400
- Subject: Re: FD_SET and FORTIFY_SOURCE
- References: <512F0CC6 dot 8080302 at redhat dot com> <20130228134139 dot GL20323 at brightrain dot aerifal dot cx> <512F84B2 dot 1000501 at redhat dot com> <512FCFD0 dot 5050108 at gmail dot com> <CAHGf_=pYJKnSbMu-N0_OLg7X+oNBa3527BbOXLeuiWzEZ1MPAg at mail dot gmail dot com>
> 1. only turn on __FD_ELT check when running on hurd.
> 2. only turn on __FD_ELT check when defined some specific macro. (e.g.
> likes darwin,
> but disable by default)
> 2-2. make FORTIFY_SOURCE variant and check POSIX compliance if enabled.
> 3. provide select_large_fdset() likes solaris. (I strongly don't
> recommend. all application
> need to modify and recompilation)
>
> What do you think?
Attached simplest patch that just disable __FD_ELT parameter check when running Linux.
commit 6fd535d2a6b4d70c79c408dce0440a2d4cb37673
Author: KOSAKI Motohiro <kosaki.motohiro@gmail.com>
Date: Sun Mar 24 21:55:40 2013 -0400
[PATCH] Don't enable FD_* argument check when running on Linux.
Signed-off-by: KOSAKI Motohiro <kosaki.motohiro@gmail.com>
diff --git a/ChangeLog b/ChangeLog
index e7991c9..ef9d4f3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2013-03-24 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * misc/sys/select.h: Don't enable FD_* argument check
+ when running on Linux.
+
2013-01-09 Anton Blanchard <anton@samba.org>
* sysdeps/unix/sysv/linux/powerpc/sched_getcpu.c: New file.
diff --git a/misc/sys/select.h b/misc/sys/select.h
index 21351fe..37a1b04 100644
--- a/misc/sys/select.h
+++ b/misc/sys/select.h
@@ -124,7 +124,7 @@ extern int pselect (int __nfds, fd_set *__restrict __readfds,
/* Define some inlines helping to catch common problems. */
-#if __USE_FORTIFY_LEVEL > 0 && defined __GNUC__
+#if __USE_FORTIFY_LEVEL > 0 && defined __GNUC__ && !defined(__linux__)
# include <bits/select2.h>
#endif