From 08213f830db502f07316d2dd1851d1b02f1b1805 Mon Sep 17 00:00:00 2001
From: Gregory Nutt <gnutt@nuttx.org>
Date: Wed, 2 Dec 2015 05:30:52 -0600
Subject: [PATCH] poll() and select() should not be built if poll() is disabled

---
 arch             | 2 +-
 drivers/Kconfig  | 3 +++
 fs/vfs/Make.defs | 8 +++++++-
 3 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/arch b/arch
index 63bee79ab5..5c2e57602f 160000
--- a/arch
+++ b/arch
@@ -1 +1 @@
-Subproject commit 63bee79ab5f692cde88209ec72e00ae14de7204d
+Subproject commit 5c2e57602f96c5df32d1251df89332869c02c5c2
diff --git a/drivers/Kconfig b/drivers/Kconfig
index 3ed0446dd3..3a3bf176a3 100644
--- a/drivers/Kconfig
+++ b/drivers/Kconfig
@@ -11,6 +11,9 @@ config DISABLE_POLL
 		supported.  If you do not use poll() or select(), then you can
 		select DISABLE_POLL to reduce the code footprint by a small amount.
 
+		This selection disables the poll() interface as well as interfaces
+		the derive from poll() such as select().
+
 config DEV_NULL
 	bool "Enable /dev/null"
 	default y
diff --git a/fs/vfs/Make.defs b/fs/vfs/Make.defs
index 4c3fca0258..645e23f97e 100644
--- a/fs/vfs/Make.defs
+++ b/fs/vfs/Make.defs
@@ -41,7 +41,7 @@ ifneq ($(CONFIG_NSOCKET_DESCRIPTORS),0)
 
 # Socket descriptor support
 
-CSRCS += fs_close.c fs_read.c fs_write.c fs_ioctl.c fs_poll.c fs_select.c
+CSRCS += fs_close.c fs_read.c fs_write.c fs_ioctl.c
 
 # Support for network access using streams
 
@@ -49,6 +49,12 @@ ifneq ($(CONFIG_NFILE_STREAMS),0)
 CSRCS += fs_fdopen.c
 endif
 
+# Support for poll() and select() (which derives from poll()
+
+ifneq ($(CONFIG_DISABLE_POLL),y)
+CSRCS += fs_poll.c fs_select.c
+endif
+
 # Support for sendfile()
 
 ifeq ($(CONFIG_NET_SENDFILE),y)