From 72d4fbf168854e50843f5283d1046b008da7a3fa Mon Sep 17 00:00:00 2001 From: patacongo Date: Sun, 16 Nov 2008 22:05:28 +0000 Subject: [PATCH] Poll API may be disabled git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@1259 42af7a65-404d-4744-a932-0658087f49c3 --- Documentation/NuttxUserGuide.html | 2 +- configs/README.txt | 2 +- fs/fs_poll.c | 4 ++++ include/nuttx/fs.h | 4 +++- include/nuttx/net.h | 2 ++ net/net-poll.c | 4 ++-- 6 files changed, 13 insertions(+), 5 deletions(-) diff --git a/Documentation/NuttxUserGuide.html b/Documentation/NuttxUserGuide.html index 557d59036eb..7d37b73ef18 100644 --- a/Documentation/NuttxUserGuide.html +++ b/Documentation/NuttxUserGuide.html @@ -5772,7 +5772,7 @@ interface of the same name.
  • 2.10.5 unsetenv
  • Disabling Environment Variable Support. - All support for environment variables can be disabled by setting CONFIG_DISABLE_ENVIRONMENT + All support for environment variables can be disabled by setting CONFIG_DISABLE_ENVIRON in the board configuration file.

    diff --git a/configs/README.txt b/configs/README.txt index 71a1f49e488..750d945a95a 100644 --- a/configs/README.txt +++ b/configs/README.txt @@ -212,7 +212,7 @@ defconfig -- This is a configuration file similar to the Linux CONFIG_DISABLE_CLOCK, CONFIG_DISABLE_POSIX_TIMERS, CONFIG_DISABLE_PTHREAD. CONFIG_DISABLE_SIGNALS, CONFIG_DISABLE_MQUEUE, CONFIG_DISABLE_MOUNTPOUNT, - CONFIG_DISABLE_ENVIRON + CONFIG_DISABLE_ENVIRON, CONFIG_DISABLE_POLL Misc libc settings diff --git a/fs/fs_poll.c b/fs/fs_poll.c index 2f585d8183c..a59cee5aaf6 100644 --- a/fs/fs_poll.c +++ b/fs/fs_poll.c @@ -51,6 +51,8 @@ #include "fs_internal.h" +#ifndef CONFIG_DISABLE_POLL + /**************************************************************************** * Definitions ****************************************************************************/ @@ -313,3 +315,5 @@ int poll(FAR struct pollfd *fds, nfds_t nfds, int timeout) return count; } +#endif /* CONFIG_DISABLE_POLL */ + diff --git a/include/nuttx/fs.h b/include/nuttx/fs.h index 65e03320856..ced7beed1c9 100644 --- a/include/nuttx/fs.h +++ b/include/nuttx/fs.h @@ -75,7 +75,9 @@ struct file_operations ssize_t (*write)(FAR struct file *filp, FAR const char *buffer, size_t buflen); off_t (*seek)(FAR struct file *filp, off_t offset, int whence); int (*ioctl)(FAR struct file *filp, int cmd, unsigned long arg); - int (*poll)(FAR struct file *filp, struct pollfd *poll); +#ifndef CONFIG_DISABLE_POLL + int (*poll)(FAR struct file *filp, struct pollfd *fds); +#endif /* The two structures need not be common after this point */ }; diff --git a/include/nuttx/net.h b/include/nuttx/net.h index 5126e7b651c..9ae4217cc84 100644 --- a/include/nuttx/net.h +++ b/include/nuttx/net.h @@ -158,8 +158,10 @@ EXTERN int netdev_ioctl(int sockfd, int cmd, struct ifreq *req); * to this function. */ +#ifndef CONFIG_DISABLE_POLL struct pollfd; /* Forward reference -- see poll.h */ EXTERN int net_poll(int sockfd, struct pollfd *fds); +#endif /* netdev-register.c *********************************************************/ /* This function is called by network interface device drivers to inform the diff --git a/net/net-poll.c b/net/net-poll.c index ef4ba9dd3ad..b11cfe964bc 100644 --- a/net/net-poll.c +++ b/net/net-poll.c @@ -38,7 +38,7 @@ ****************************************************************************/ #include -#ifdef CONFIG_NET +#if defined(CONFIG_NET) && !defined(CONFIG_DISABLE_POLL) #include #include @@ -77,4 +77,4 @@ int net_poll(int sockfd, struct pollfd *fds) return -ENOSYS; } -#endif /* CONFIG_NET */ +#endif /* CONFIG_NET&& !CONFIG_DISABLE_POLL */