Fix condition logic: The setup seems to support a network without sockets. That is not the case.

Squashed commit of the following:

    sched/sched/sched_getsockets.c:  Fix an error in conditional compilation.
    fs/:  Remove all conditional logic based on CONFIG_NSOCKET_DESCRIPTORS == 0
    Documentation/:  Remove all references to CONFIG_NSOCKET_DESCRIPTORS == 0
    include/:  Remove all conditional logic based on CONFIG_NSOCKET_DESCRIPTORS == 0
    libs/:  Remove all conditional logic based on CONFIG_NSOCKET_DESCRIPTORS == 0
    net/:  Remove all conditional logic based on CONFIG_NSOCKET_DESCRIPTORS == 0
    sched/:  Remove all conditional logic based on CONFIG_NSOCKET_DESCRIPTORS == 0
    syscall/:  Remove all conditional logic based on CONFIG_NSOCKET_DESCRIPTORS == 0
    tools/:  Fixups for CONFIG_NSOCKET_DESCRIPTORS no longer used to disable sockets.
This commit is contained in:
Gregory Nutt 2019-02-11 15:47:25 -06:00
parent 0cb1c2c0b6
commit efe65749ce
50 changed files with 58 additions and 148 deletions

View File

@ -8590,7 +8590,6 @@ interface of the same name.
<ul>
<li><code>CONFIG_NET</code> Defined for general network support</li>
<li><code>CONFIG_NET_TCP</code> Defined for TCP/IP support</li>
<li><code>CONFIG_NSOCKET_DESCRIPTORS</code> Defined to be greater than 0</li>
<li><code>CONFIG_NET_TCP_READAHEAD</code> Define to enable read-ahead buffering</li>
<li><code>CONFIG_NET_NTCP_READAHEAD_BUFFERS</code> Defined to be greater than zero</li>
</ul>

View File

@ -65,7 +65,7 @@
#undef AIO_HAVE_PSOCK
#if defined(CONFIG_NET_TCP) && CONFIG_NSOCKET_DESCRIPTORS > 0
#ifdef CONFIG_NET_TCP
# define AIO_HAVE_PSOCK
#endif

View File

@ -1050,7 +1050,7 @@ static ssize_t proc_groupfd(FAR struct proc_file_s *procfile,
{
FAR struct task_group_s *group = tcb->group;
FAR struct file *file;
#if CONFIG_NSOCKET_DESCRIPTORS > 0
#ifdef CONFIG_NET
FAR struct socket *socket;
#endif
size_t remaining;
@ -1102,7 +1102,7 @@ static ssize_t proc_groupfd(FAR struct proc_file_s *procfile,
}
}
#if CONFIG_NSOCKET_DESCRIPTORS > 0
#ifdef CONFIG_NET
linesize = snprintf(procfile->line, STATUS_LINELEN, "\n%-3s %-2s %-3s %s\n",
"SD", "RF", "TYP", "FLAGS");
copysize = procfs_memcpy(procfile->line, linesize, buffer, remaining, &offset);
@ -1118,7 +1118,9 @@ static ssize_t proc_groupfd(FAR struct proc_file_s *procfile,
/* Examine each open socket descriptor */
for (i = 0, socket = group->tg_socketlist.sl_sockets; i < CONFIG_NSOCKET_DESCRIPTORS; i++, socket++)
for (i = 0, socket = group->tg_socketlist.sl_sockets;
i < CONFIG_NSOCKET_DESCRIPTORS;
i++, socket++)
{
/* Is there an connection associated with the socket descriptor? */

View File

@ -46,7 +46,7 @@
#include <nuttx/cancelpt.h>
#include <nuttx/fs/fs.h>
#if defined(CONFIG_NET) && CONFIG_NSOCKET_DESCRIPTORS > 0
#ifdef CONFIG_NET
# include <nuttx/net/net.h>
#endif
@ -94,7 +94,7 @@ int close(int fd)
{
/* Close a socket descriptor */
#if defined(CONFIG_NET) && CONFIG_NSOCKET_DESCRIPTORS > 0
#ifdef CONFIG_NET
if ((unsigned int)fd < (CONFIG_NFILE_DESCRIPTORS + CONFIG_NSOCKET_DESCRIPTORS))
{
ret = net_close(fd);

View File

@ -78,7 +78,7 @@ int dup(int fd)
{
/* Not a valid file descriptor. Did we get a valid socket descriptor? */
#if defined(CONFIG_NET) && CONFIG_NSOCKET_DESCRIPTORS > 0
#ifdef CONFIG_NET
if ((unsigned int)fd < (CONFIG_NFILE_DESCRIPTORS + CONFIG_NSOCKET_DESCRIPTORS))
{
/* Yes.. dup the socket descriptor. The errno value is not set. */

View File

@ -51,7 +51,7 @@
* performed.
*/
#if defined(CONFIG_NET) && CONFIG_NSOCKET_DESCRIPTORS > 0
#ifdef CONFIG_NET
/****************************************************************************
* Public Functions
@ -111,5 +111,5 @@ int dup2(int fd1, int fd2)
}
}
#endif /* CONFIG_NET && CONFIG_NSOCKET_DESCRIPTORS > 0 */
#endif /* CONFIG_NET */

View File

@ -76,7 +76,7 @@
*
****************************************************************************/
#if defined(CONFIG_NET) && CONFIG_NSOCKET_DESCRIPTORS > 0
#ifdef CONFIG_NET
int fs_dupfd2(int fd1, int fd2)
#else
int dup2(int fd1, int fd2)

View File

@ -305,7 +305,7 @@ int fcntl(int fd, int cmd, ...)
{
/* No... check for operations on a socket descriptor */
#if defined(CONFIG_NET) && CONFIG_NSOCKET_DESCRIPTORS > 0
#ifdef CONFIG_NET
if ((unsigned int)fd < (CONFIG_NFILE_DESCRIPTORS + CONFIG_NSOCKET_DESCRIPTORS))
{
/* Yes.. defer socket descriptor operations to net_vfcntl(). The

View File

@ -163,7 +163,7 @@ FAR struct file_struct *fs_fdopen(int fd, int oflags, FAR struct tcb_s *tcb)
* descriptor.
*/
#if defined(CONFIG_NET) && CONFIG_NSOCKET_DESCRIPTORS > 0
#ifdef CONFIG_NET
ret = net_checksd(fd, oflags);
#else
/* No networking... it is just a bad descriptor */

View File

@ -147,7 +147,7 @@ int fstat(int fd, FAR struct stat *buf)
if ((unsigned int)fd >= CONFIG_NFILE_DESCRIPTORS)
{
#if CONFIG_NSOCKET_DESCRIPTORS > 0
#ifdef CONFIG_NET
/* Let the networking logic handle the fstat() */
ret = net_fstat(fd, buf);

View File

@ -47,7 +47,7 @@
#include <net/if.h>
#if defined(CONFIG_NET) && CONFIG_NSOCKET_DESCRIPTORS > 0
#ifdef CONFIG_NET
# include <nuttx/net/net.h>
#endif
@ -146,7 +146,7 @@ int ioctl(int fd, int req, unsigned long arg)
{
/* Perform the socket ioctl */
#if defined(CONFIG_NET) && CONFIG_NSOCKET_DESCRIPTORS > 0
#ifdef CONFIG_NET
if ((unsigned int)fd < (CONFIG_NFILE_DESCRIPTORS + CONFIG_NSOCKET_DESCRIPTORS))
{
ret = netdev_ioctl(fd, req, arg);

View File

@ -106,7 +106,7 @@ static int poll_fdsetup(int fd, FAR struct pollfd *fds, bool setup)
{
/* Perform the socket ioctl */
#if defined(CONFIG_NET) && CONFIG_NSOCKET_DESCRIPTORS > 0
#ifdef CONFIG_NET
if ((unsigned int)fd < (CONFIG_NFILE_DESCRIPTORS + CONFIG_NSOCKET_DESCRIPTORS))
{
return net_poll(fd, fds, setup);

View File

@ -142,7 +142,7 @@ ssize_t nx_read(int fd, FAR void *buf, size_t nbytes)
if ((unsigned int)fd >= CONFIG_NFILE_DESCRIPTORS)
{
#if defined(CONFIG_NET) && CONFIG_NSOCKET_DESCRIPTORS > 0
#ifdef CONFIG_NET
/* No.. If networking is enabled, read() is the same as recv() with
* the flags parameter set to zero.
*/

View File

@ -103,7 +103,7 @@
ssize_t sendfile(int outfd, int infd, off_t *offset, size_t count)
{
#if defined(CONFIG_NET_SENDFILE) && CONFIG_NSOCKET_DESCRIPTORS > 0
#ifdef CONFIG_NET_SENDFILE
/* Check the destination file descriptor: Is it a (probable) file
* descriptor? Check the source file: Is it a normal file?
*/

View File

@ -47,7 +47,7 @@
#include <errno.h>
#include <assert.h>
#if defined(CONFIG_NET) && CONFIG_NSOCKET_DESCRIPTORS > 0
#ifdef CONFIG_NET_TCP
# include <sys/socket.h>
#endif
@ -149,7 +149,7 @@ ssize_t nx_write(int fd, FAR const void *buf, size_t nbytes)
if ((unsigned int)fd >= CONFIG_NFILE_DESCRIPTORS)
{
#if defined(CONFIG_NET_TCP) && CONFIG_NSOCKET_DESCRIPTORS > 0
#ifdef CONFIG_NET_TCP
/* Write to a socket descriptor is equivalent to send with flags == 0. */
ret = nx_send(fd, buf, nbytes, 0);

View File

@ -789,7 +789,7 @@ int file_dup(FAR struct file *filep, int minfd);
*
****************************************************************************/
#if defined(CONFIG_NET) && CONFIG_NSOCKET_DESCRIPTORS > 0
#ifdef CONFIG_NET
int fs_dupfd2(int fd1, int fd2);
#else
# define fs_dupfd2(fd1, fd2) dup2(fd1, fd2)

View File

@ -227,7 +227,7 @@ struct socket
/* This defines a list of sockets indexed by the socket descriptor */
#if CONFIG_NSOCKET_DESCRIPTORS > 0
#ifdef CONFIG_NET
struct socketlist
{
sem_t sl_sem; /* Manage access to the socket list */

View File

@ -230,7 +230,7 @@ struct net_driver_s
* Must be the first field in the structure due to blink type casting.
*/
#if CONFIG_NSOCKET_DESCRIPTORS > 0
#ifdef CONFIG_NET
FAR struct net_driver_s *flink;
/* This is the name of network device assigned when netdev_register was called.

View File

@ -544,7 +544,7 @@ struct task_group_s
#endif
#endif
#if CONFIG_NSOCKET_DESCRIPTORS > 0
#ifdef CONFIG_NET
/* Sockets ********************************************************************/
struct socketlist tg_socketlist; /* Maps socket descriptor to socket */
@ -826,9 +826,9 @@ FAR struct filelist *sched_getfiles(void);
FAR struct streamlist *sched_getstreams(void);
#endif /* CONFIG_NFILE_STREAMS */
#if CONFIG_NSOCKET_DESCRIPTORS > 0
#ifdef CONFIG_NET
FAR struct socketlist *sched_getsockets(void);
#endif /* CONFIG_NSOCKET_DESCRIPTORS */
#endif
/********************************************************************************
* Name: nxtask_starthook

View File

@ -45,7 +45,6 @@
#include <nuttx/config.h>
#include <nuttx/fs/ioctl.h>
#if CONFIG_NSOCKET_DESCRIPTORS > 0
#ifdef CONFIG_NET
/* Include network IOCTL definitions */
@ -77,7 +76,6 @@
# include <nuttx/wireless/ieee802154/ieee802154_mac.h>
#endif /* CONFIG_WIRELESS_IEEE802154 */
#endif /* CONFIG_NSOCKET_DESCRIPTORS > 0 */
/****************************************************************************
* Pre-processor Definitions

View File

@ -270,11 +270,6 @@
* enabled.
*/
#ifndef CONFIG_NET
# undef CONFIG_NSOCKET_DESCRIPTORS
# define CONFIG_NSOCKET_DESCRIPTORS 0
#endif
#define SYS_close (__SYS_descriptors + 0)
#ifdef CONFIG_LIBC_IOCTL_VARIADIC
@ -524,7 +519,7 @@
/* The following are defined only if networking AND sockets are supported */
#if CONFIG_NSOCKET_DESCRIPTORS > 0
#ifdef CONFIG_NET
# define SYS_accept (__SYS_network + 0)
# define SYS_bind (__SYS_network + 1)
# define SYS_connect (__SYS_network + 2)

View File

@ -52,10 +52,6 @@
* Pre-processor Definitions
****************************************************************************/
#if CONFIG_NSOCKET_DESCRIPTORS < 1
# error CONFIG_NSOCKET_DESCRIPTORS must be greater than zero
#endif
#if CONFIG_NET_SOCKOPTS < 1
# error CONFIG_NET_SOCKOPTS required by this logic
#endif

View File

@ -74,7 +74,6 @@ extern "C"
#define EXTERN extern
#endif
#if CONFIG_NSOCKET_DESCRIPTORS > 0
/* List of registered Ethernet device drivers. You must have the network
* locked in order to access this list.
*
@ -82,7 +81,6 @@ extern "C"
*/
EXTERN struct net_driver_s *g_netdevices;
#endif
#ifdef CONFIG_NETDEV_IFINDEX
/* The set of network devices that have been registered. This is used to
@ -155,9 +153,7 @@ bool netdev_verify(FAR struct net_driver_s *dev);
*
****************************************************************************/
#if CONFIG_NSOCKET_DESCRIPTORS > 0
FAR struct net_driver_s *netdev_findbyname(FAR const char *ifname);
#endif
/****************************************************************************
* Name: netdev_foreach
@ -178,8 +174,6 @@ FAR struct net_driver_s *netdev_findbyname(FAR const char *ifname);
int netdev_foreach(netdev_callback_t callback, FAR void *arg);
#if CONFIG_NSOCKET_DESCRIPTORS > 0
/****************************************************************************
* Name: netdev_findby_lipv4addr
*
@ -265,7 +259,6 @@ FAR struct net_driver_s *netdev_findby_ripv4addr(in_addr_t lipaddr,
FAR struct net_driver_s *netdev_findby_ripv6addr(const net_ipv6addr_t lipaddr,
const net_ipv6addr_t ripaddr);
#endif
#endif /* CONFIG_NSOCKET_DESCRIPTORS > 0 */
/****************************************************************************
* Name: netdev_findbyindex
@ -368,9 +361,7 @@ unsigned int netdev_nametoindex(FAR const char *ifname);
*
****************************************************************************/
#if CONFIG_NSOCKET_DESCRIPTORS > 0
FAR struct net_driver_s *netdev_default(void);
#endif
/****************************************************************************
* Name: netdev_ipv4_txnotify
@ -388,7 +379,6 @@ FAR struct net_driver_s *netdev_default(void);
*
****************************************************************************/
#if CONFIG_NSOCKET_DESCRIPTORS > 0
#ifdef CONFIG_NET_IPv4
void netdev_ipv4_txnotify(in_addr_t lipaddr, in_addr_t ripaddr);
#endif /* CONFIG_NET_IPv4 */
@ -413,7 +403,6 @@ void netdev_ipv4_txnotify(in_addr_t lipaddr, in_addr_t ripaddr);
void netdev_ipv6_txnotify(FAR const net_ipv6addr_t lipaddr,
FAR const net_ipv6addr_t ripaddr);
#endif /* CONFIG_NET_IPv6 */
#endif /* CONFIG_NSOCKET_DESCRIPTORS > 0 */
/****************************************************************************
* Name: netdev_txnotify_dev
@ -447,9 +436,7 @@ void netdev_txnotify_dev(FAR struct net_driver_s *dev);
*
****************************************************************************/
#if CONFIG_NSOCKET_DESCRIPTORS > 0
int netdev_count(void);
#endif
/****************************************************************************
* Name: netdev_ipv4_ifconf

View File

@ -38,7 +38,6 @@
****************************************************************************/
#include <nuttx/config.h>
#if defined(CONFIG_NET) && CONFIG_NSOCKET_DESCRIPTORS > 0
#include <sys/socket.h>
#include <stdio.h>
@ -110,4 +109,3 @@ int netdev_carrier_off(FAR struct net_driver_s *dev)
return -EINVAL;
}
#endif /* CONFIG_NET && CONFIG_NSOCKET_DESCRIPTORS */

View File

@ -38,7 +38,6 @@
****************************************************************************/
#include <nuttx/config.h>
#if defined(CONFIG_NET) && CONFIG_NSOCKET_DESCRIPTORS > 0
#include <string.h>
#include <errno.h>
@ -77,4 +76,3 @@ int netdev_count(void)
return ndev;
}
#endif /* CONFIG_NET && CONFIG_NSOCKET_DESCRIPTORS */

View File

@ -38,7 +38,6 @@
****************************************************************************/
#include <nuttx/config.h>
#if defined(CONFIG_NET) && CONFIG_NSOCKET_DESCRIPTORS > 0
#include <nuttx/net/netdev.h>
@ -101,4 +100,3 @@ FAR struct net_driver_s *netdev_default(void)
return ret;
}
#endif /* CONFIG_NET */

View File

@ -39,7 +39,6 @@
****************************************************************************/
#include <nuttx/config.h>
#if defined(CONFIG_NET) && CONFIG_NSOCKET_DESCRIPTORS > 0
#include <stdbool.h>
#include <string.h>
@ -345,4 +344,3 @@ FAR struct net_driver_s *netdev_findby_ripv6addr(const net_ipv6addr_t lipaddr,
}
#endif /* CONFIG_NET_IPv6 */
#endif /* CONFIG_NET && CONFIG_NSOCKET_DESCRIPTORS */

View File

@ -48,8 +48,6 @@
#include "utils/utils.h"
#include "netdev/netdev.h"
#if CONFIG_NSOCKET_DESCRIPTORS > 0
/****************************************************************************
* Public Functions
****************************************************************************/
@ -177,4 +175,3 @@ int netdev_nextindex(int ifindex)
}
#endif
#endif /* CONFIG_NSOCKET_DESCRIPTORS */

View File

@ -38,7 +38,6 @@
****************************************************************************/
#include <nuttx/config.h>
#if defined(CONFIG_NET) && CONFIG_NSOCKET_DESCRIPTORS > 0
#include <string.h>
#include <errno.h>
@ -89,4 +88,3 @@ FAR struct net_driver_s *netdev_findbyname(FAR const char *ifname)
return NULL;
}
#endif /* CONFIG_NET && CONFIG_NSOCKET_DESCRIPTORS */

View File

@ -38,7 +38,6 @@
****************************************************************************/
#include <nuttx/config.h>
#if defined(CONFIG_NET) && CONFIG_NSOCKET_DESCRIPTORS > 0
#include <debug.h>
@ -90,4 +89,3 @@ int netdev_foreach(netdev_callback_t callback, FAR void *arg)
return ret;
}
#endif /* CONFIG_NET && CONFIG_NSOCKET_DESCRIPTORS */

View File

@ -90,8 +90,6 @@
#include "icmpv6/icmpv6.h"
#include "route/route.h"
#if defined(CONFIG_NET) && CONFIG_NSOCKET_DESCRIPTORS > 0
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
@ -1810,4 +1808,3 @@ void netdev_ifdown(FAR struct net_driver_s *dev)
}
}
#endif /* CONFIG_NET && CONFIG_NSOCKET_DESCRIPTORS */

View File

@ -60,8 +60,6 @@
#include "mld/mld.h"
#include "netdev/netdev.h"
#if defined(CONFIG_NET) && CONFIG_NSOCKET_DESCRIPTORS > 0
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
@ -440,4 +438,3 @@ int netdev_register(FAR struct net_driver_s *dev, enum net_lltype_e lltype)
return -EINVAL;
}
#endif /* CONFIG_NET && CONFIG_NSOCKET_DESCRIPTORS */

View File

@ -38,7 +38,6 @@
****************************************************************************/
#include <nuttx/config.h>
#if defined(CONFIG_NET) && CONFIG_NSOCKET_DESCRIPTORS > 0
#include <sys/types.h>
#include <string.h>
@ -147,4 +146,3 @@ void netdev_txnotify_dev(FAR struct net_driver_s *dev)
}
}
#endif /* CONFIG_NET && CONFIG_NSOCKET_DESCRIPTORS */

View File

@ -38,7 +38,6 @@
****************************************************************************/
#include <nuttx/config.h>
#if defined(CONFIG_NET) && CONFIG_NSOCKET_DESCRIPTORS > 0
#include <sys/socket.h>
#include <stdio.h>
@ -184,4 +183,3 @@ int netdev_unregister(FAR struct net_driver_s *dev)
return -EINVAL;
}
#endif /* CONFIG_NET && CONFIG_NSOCKET_DESCRIPTORS */

View File

@ -6,8 +6,9 @@
menu "Socket Support"
config NSOCKET_DESCRIPTORS
int "Number of socket descriptor"
int "Number of socket descriptors"
default 8
range 1 99999
---help---
Maximum number of socket descriptors per task/thread.

View File

@ -51,8 +51,6 @@
#include "socket/socket.h"
#if defined(CONFIG_NET) && CONFIG_NSOCKET_DESCRIPTORS > 0
/****************************************************************************
* Public Functions
****************************************************************************/
@ -308,4 +306,3 @@ errout:
return ERROR;
}
#endif /* CONFIG_NET && CONFIG_NSOCKET_DESCRIPTORS */

View File

@ -46,8 +46,6 @@
#include "socket/socket.h"
#if defined(CONFIG_NET) && CONFIG_NSOCKET_DESCRIPTORS > 0
/****************************************************************************
* Public Functions
****************************************************************************/
@ -184,4 +182,3 @@ int listen(int sockfd, int backlog)
return OK;
}
#endif /* CONFIG_NET && CONFIG_NSOCKET_DESCRIPTORS */

View File

@ -46,8 +46,6 @@
#include "socket/socket.h"
#if defined(CONFIG_NET) && CONFIG_NSOCKET_DESCRIPTORS > 0
/****************************************************************************
* Public Functions
****************************************************************************/
@ -156,4 +154,3 @@ int net_dupsd(int sockfd, int minsd)
return psock_dupsd(sockfd_socket(sockfd), minsd);
}
#endif /* defined(CONFIG_NET) && CONFIG_NSOCKET_DESCRIPTORS > 0 */

View File

@ -48,8 +48,6 @@
#include "socket/socket.h"
#if defined(CONFIG_NET) && CONFIG_NSOCKET_DESCRIPTORS > 0
/****************************************************************************
* Public Functions
****************************************************************************/
@ -112,5 +110,3 @@ errout:
return ret;
}
#endif /* CONFIG_NET && CONFIG_NSOCKET_DESCRIPTORS > 0 */

View File

@ -51,8 +51,6 @@
#include "socket/socket.h"
#if CONFIG_NSOCKET_DESCRIPTORS > 0
/****************************************************************************
* Private Functions
****************************************************************************/
@ -295,4 +293,3 @@ FAR struct socket *sockfd_socket(int sockfd)
return NULL;
}
#endif /* CONFIG_NSOCKET_DESCRIPTORS > 0 */

View File

@ -52,8 +52,6 @@
#include "socket/socket.h"
#include "usrsock/usrsock.h"
#if defined(CONFIG_NET) && CONFIG_NSOCKET_DESCRIPTORS > 0
/****************************************************************************
* Public Functions
****************************************************************************/
@ -318,4 +316,3 @@ int net_vfcntl(int sockfd, int cmd, va_list ap)
return psock_vfcntl(sockfd_socket(sockfd), cmd, ap);
}
#endif /* CONFIG_NET && CONFIG_NSOCKET_DESCRIPTORS > 0 */

View File

@ -63,8 +63,7 @@
/* Conditions for support TCP poll/select operations */
#if !defined(CONFIG_DISABLE_POLL) && CONFIG_NSOCKET_DESCRIPTORS > 0 && \
defined(CONFIG_NET_TCP_READAHEAD)
#if !defined(CONFIG_DISABLE_POLL) 0 && defined(CONFIG_NET_TCP_READAHEAD)
# define HAVE_TCP_POLL
#endif
@ -312,7 +311,6 @@ extern "C"
# define EXTERN extern
#endif
#if CONFIG_NSOCKET_DESCRIPTORS > 0
/* List of registered Ethernet device drivers. You must have the network
* locked in order to access this list.
*
@ -320,7 +318,6 @@ extern "C"
*/
EXTERN struct net_driver_s *g_netdevices;
#endif
/****************************************************************************
* Public Function Prototypes

View File

@ -38,7 +38,7 @@
****************************************************************************/
#include <nuttx/config.h>
#if defined(CONFIG_NET) && CONFIG_NSOCKET_DESCRIPTORS > 0 && defined(CONFIG_NET_TCP)
#ifdef CONFIG_NET_TCP
#include <sys/types.h>
#include <sys/socket.h>
@ -335,4 +335,4 @@ int psock_tcp_accept(FAR struct socket *psock, FAR struct sockaddr *addr,
return OK;
}
#endif /* CONFIG_NET && CONFIG_NSOCKET_DESCRIPTORS && CONFIG_NET_TCP */
#endif /* CONFIG_NET_TCP */

View File

@ -67,8 +67,7 @@
/* Conditions for support UDP poll/select operations */
#if !defined(CONFIG_DISABLE_POLL) && CONFIG_NSOCKET_DESCRIPTORS > 0 && \
defined(CONFIG_NET_UDP_READAHEAD)
#if !defined(CONFIG_DISABLE_POLL) && defined(CONFIG_NET_UDP_READAHEAD)
# define HAVE_UDP_POLL
#endif

View File

@ -175,11 +175,11 @@ static inline void group_release(FAR struct task_group_s *group)
#endif /* CONFIG_NFILE_STREAMS */
#if CONFIG_NSOCKET_DESCRIPTORS > 0
#ifdef CONFIG_NET
/* Free resource held by the socket list */
net_releaselist(&group->tg_socketlist);
#endif /* CONFIG_NSOCKET_DESCRIPTORS */
#endif
#ifndef CONFIG_DISABLE_ENVIRON
/* Release all shared environment variables */

View File

@ -85,7 +85,7 @@ int group_setupidlefiles(FAR struct task_tcb_s *tcb)
files_initlist(&group->tg_filelist);
#if CONFIG_NSOCKET_DESCRIPTORS > 0
#ifdef CONFIG_NET
/* Allocate socket descriptors for the TCB */
net_initlist(&group->tg_socketlist);

View File

@ -140,7 +140,7 @@ static inline void sched_dupfiles(FAR struct task_tcb_s *tcb)
*
****************************************************************************/
#if CONFIG_NSOCKET_DESCRIPTORS > 0 && !defined(CONFIG_SDCLONE_DISABLE)
#if defined(CONFIG_NET) && !defined(CONFIG_SDCLONE_DISABLE)
static inline void sched_dupsockets(FAR struct task_tcb_s *tcb)
{
/* The parent task is the one at the head of the ready-to-run list */
@ -178,9 +178,9 @@ static inline void sched_dupsockets(FAR struct task_tcb_s *tcb)
}
}
}
#else /* CONFIG_NSOCKET_DESCRIPTORS && !CONFIG_SDCLONE_DISABLE */
#else /* CONFIG_NET && !CONFIG_SDCLONE_DISABLE */
# define sched_dupsockets(tcb)
#endif /* CONFIG_NSOCKET_DESCRIPTORS && !CONFIG_SDCLONE_DISABLE */
#endif /* CONFIG_NET && !CONFIG_SDCLONE_DISABLE */
/****************************************************************************
* Public Functions
@ -217,7 +217,7 @@ int group_setuptaskfiles(FAR struct task_tcb_s *tcb)
files_initlist(&group->tg_filelist);
#if CONFIG_NSOCKET_DESCRIPTORS > 0
#ifdef CONFIG_NET
/* Allocate socket descriptors for the TCB */
net_initlist(&group->tg_socketlist);

View File

@ -42,8 +42,6 @@
#include <sched.h>
#include "sched/sched.h"
#if CONFIG_NSOCKET_DESCRIPTORS > 0
/****************************************************************************
* Public Functions
****************************************************************************/
@ -64,6 +62,7 @@
*
****************************************************************************/
#ifdef CONFIG_NET
FAR struct socketlist *sched_getsockets(void)
{
FAR struct tcb_s *rtcb = this_task();
@ -72,5 +71,6 @@ FAR struct socketlist *sched_getsockets(void)
DEBUGASSERT(group);
return &group->tg_socketlist;
}
#endif
#endif /* CONFIG_NSOCKET_DESCRIPTORS */

View File

@ -4,9 +4,9 @@
"aio_fsync","aio.h","defined(CONFIG_FS_AIO)","int","int","FAR struct aiocb *"
"aio_read","aio.h","defined(CONFIG_FS_AIO)","int","FAR struct aiocb *"
"aio_write","aio.h","defined(CONFIG_FS_AIO)","int","FAR struct aiocb *"
"accept","sys/socket.h","CONFIG_NSOCKET_DESCRIPTORS > 0 && defined(CONFIG_NET)","int","int","struct sockaddr*","socklen_t*"
"accept","sys/socket.h","defined(CONFIG_NET)","int","int","struct sockaddr*","socklen_t*"
"atexit","stdlib.h","defined(CONFIG_SCHED_ATEXIT)","int","void (*)(void)"
"bind","sys/socket.h","CONFIG_NSOCKET_DESCRIPTORS > 0 && defined(CONFIG_NET)","int","int","FAR const struct sockaddr*","socklen_t"
"bind","sys/socket.h","defined(CONFIG_NET)","int","int","FAR const struct sockaddr*","socklen_t"
"boardctl","sys/boardctl.h","defined(CONFIG_LIB_BOARDCTL)","int","unsigned int","uintptr_t"
"clearenv","stdlib.h","!defined(CONFIG_DISABLE_ENVIRON)","int"
"clock","time.h","","clock_t"
@ -16,7 +16,7 @@
"clock_settime","time.h","","int","clockid_t","const struct timespec*"
"close","unistd.h","","int","int"
"closedir","dirent.h","","int","FAR DIR*"
"connect","sys/socket.h","CONFIG_NSOCKET_DESCRIPTORS > 0 && defined(CONFIG_NET)","int","int","FAR const struct sockaddr*","socklen_t"
"connect","sys/socket.h","defined(CONFIG_NET)","int","int","FAR const struct sockaddr*","socklen_t"
"dup","unistd.h","","int","int"
"dup2","unistd.h","","int","int","int"
"exec","nuttx/binfmt/binfmt.h","!defined(CONFIG_BINFMT_DISABLE) && !defined(CONFIG_BUILD_KERNEL)","int","FAR const char *","FAR char * const *","FAR const struct symtab_s *","int"
@ -32,18 +32,18 @@
"get_errno","errno.h","!defined(__DIRECT_ERRNO_ACCESS)","int"
"get_errno_ptr","errno.h","defined(__DIRECT_ERRNO_ACCESS)","FAR int*"
"getenv","stdlib.h","!defined(CONFIG_DISABLE_ENVIRON)","FAR char*","FAR const char*"
"getpeername","sys/socket.h","CONFIG_NSOCKET_DESCRIPTORS > 0 && defined(CONFIG_NET)","int","int","FAR struct sockaddr *","FAR socklen_t *"
"getpeername","sys/socket.h","defined(CONFIG_NET)","int","int","FAR struct sockaddr *","FAR socklen_t *"
"getpid","unistd.h","","pid_t"
"getrandom","sys/random.h","defined(CONFIG_CRYPTO_RANDOM_POOL)","void","FAR void*","size_t"
"getsockname","sys/socket.h","CONFIG_NSOCKET_DESCRIPTORS > 0 && defined(CONFIG_NET)","int","int","FAR struct sockaddr *","FAR socklen_t *"
"getsockopt","sys/socket.h","CONFIG_NSOCKET_DESCRIPTORS > 0 && defined(CONFIG_NET)","int","int","int","int","FAR void*","FAR socklen_t*"
"getsockname","sys/socket.h","defined(CONFIG_NET)","int","int","FAR struct sockaddr *","FAR socklen_t *"
"getsockopt","sys/socket.h","defined(CONFIG_NET)","int","int","int","int","FAR void*","FAR socklen_t*"
"if_indextoname","net/if.h","defined(CONFIG_NETDEV_IFINDEX)","FAR char *","unsigned int","FAR char *"
"if_nametoindex","net/if.h","defined(CONFIG_NETDEV_IFINDEX)","unsigned int","FAR const char *"
"insmod","nuttx/module.h","defined(CONFIG_MODULE)","FAR void *","FAR const char *","FAR const char *"
"ioctl","sys/ioctl.h","!defined(CONFIG_LIBC_IOCTL_VARIADIC)","int","int","int","unsigned long"
"kill","signal.h","!defined(CONFIG_DISABLE_SIGNALS)","int","pid_t","int"
"link","unistd.h","defined(CONFIG_PSEUDOFS_SOFTLINKS)","int","FAR const char *","FAR const char *"
"listen","sys/socket.h","CONFIG_NSOCKET_DESCRIPTORS > 0 && defined(CONFIG_NET)","int","int","int"
"listen","sys/socket.h","defined(CONFIG_NET)","int","int","int"
"lseek","unistd.h","","off_t","int","off_t","int"
"mkdir","sys/stat.h","!defined(CONFIG_DISABLE_MOUNTPOINT)","int","FAR const char*","mode_t"
"mkfifo2","nuttx/drivers/drivers.h","defined(CONFIG_PIPES) && CONFIG_DEV_FIFO_SIZE > 0","int","FAR const char*","mode_t","size_t"
@ -106,8 +106,8 @@
"read","unistd.h","","ssize_t","int","FAR void*","size_t"
"readdir","dirent.h","","FAR struct dirent*","FAR DIR*"
"readlink","unistd.h","defined(CONFIG_PSEUDOFS_SOFTLINKS)","ssize_t","FAR const char *","FAR char *","size_t"
"recv","sys/socket.h","CONFIG_NSOCKET_DESCRIPTORS > 0 && defined(CONFIG_NET)","ssize_t","int","FAR void*","size_t","int"
"recvfrom","sys/socket.h","CONFIG_NSOCKET_DESCRIPTORS > 0 && defined(CONFIG_NET)","ssize_t","int","FAR void*","size_t","int","FAR struct sockaddr*","FAR socklen_t*"
"recv","sys/socket.h","defined(CONFIG_NET)","ssize_t","int","FAR void*","size_t","int"
"recvfrom","sys/socket.h","defined(CONFIG_NET)","ssize_t","int","FAR void*","size_t","int","FAR struct sockaddr*","FAR socklen_t*"
"rename","stdio.h","!defined(CONFIG_DISABLE_MOUNTPOINT)","int","FAR const char*","FAR const char*"
"rewinddir","dirent.h","","void","FAR DIR*"
"rmdir","unistd.h","!defined(CONFIG_DISABLE_MOUNTPOINT)","int","FAR const char*"
@ -133,13 +133,13 @@
"sem_trywait","semaphore.h","","int","FAR sem_t*"
"sem_unlink","semaphore.h","defined(CONFIG_FS_NAMED_SEMAPHORES)","int","FAR const char*"
"sem_wait","semaphore.h","","int","FAR sem_t*"
"send","sys/socket.h","CONFIG_NSOCKET_DESCRIPTORS > 0 && defined(CONFIG_NET)","ssize_t","int","FAR const void*","size_t","int"
"send","sys/socket.h","defined(CONFIG_NET)","ssize_t","int","FAR const void*","size_t","int"
"sendfile","sys/sendfile.h","defined(CONFIG_NET_SENDFILE)","ssize_t","int","int","FAR off_t*","size_t"
"sendto","sys/socket.h","CONFIG_NSOCKET_DESCRIPTORS > 0 && defined(CONFIG_NET)","ssize_t","int","FAR const void*","size_t","int","FAR const struct sockaddr*","socklen_t"
"sendto","sys/socket.h","defined(CONFIG_NET)","ssize_t","int","FAR const void*","size_t","int","FAR const struct sockaddr*","socklen_t"
"set_errno","errno.h","!defined(__DIRECT_ERRNO_ACCESS)","void","int"
"setenv","stdlib.h","!defined(CONFIG_DISABLE_ENVIRON)","int","FAR const char*","FAR const char*","int"
"sethostname","unistd.h","defined(CONFIG_LIBC_NETDB)","int","FAR const char*","size_t"
"setsockopt","sys/socket.h","CONFIG_NSOCKET_DESCRIPTORS > 0 && defined(CONFIG_NET)","int","int","int","int","FAR const void*","socklen_t"
"setsockopt","sys/socket.h","defined(CONFIG_NET)","int","int","int","int","FAR const void*","socklen_t"
"shmat", "sys/shm.h", "defined(CONFIG_MM_SHM)", "FAR void *", "int", "FAR const void *", "int"
"shmctl", "sys/shm.h", "defined(CONFIG_MM_SHM)", "int", "int", "int", "FAR struct shmid_ds *"
"shmdt", "sys/shm.h", "defined(CONFIG_MM_SHM)", "int", "FAR const void *"
@ -151,7 +151,7 @@
"sigsuspend","signal.h","!defined(CONFIG_DISABLE_SIGNALS)","int","FAR const sigset_t*"
"sigtimedwait","signal.h","!defined(CONFIG_DISABLE_SIGNALS)","int","FAR const sigset_t*","FAR struct siginfo*","FAR const struct timespec*"
"sigwaitinfo","signal.h","!defined(CONFIG_DISABLE_SIGNALS)","int","FAR const sigset_t*","FAR struct siginfo*"
"socket","sys/socket.h","CONFIG_NSOCKET_DESCRIPTORS > 0 && defined(CONFIG_NET)","int","int","int","int"
"socket","sys/socket.h","defined(CONFIG_NET)","int","int","int","int"
"stat","sys/stat.h","","int","const char*","FAR struct stat*"
"statfs","sys/statfs.h","","int","FAR const char*","FAR struct statfs*"
"task_create","sched.h","!defined(CONFIG_BUILD_KERNEL)", "int","FAR const char*","int","int","main_t","FAR char * const []|FAR char * const *"

Can't render this file because it has a wrong number of fields in line 2.

View File

@ -193,26 +193,6 @@ int main(int argc, char **argv, char **envp)
printf("# define CONFIG_DISABLE_MQUEUE 1\n");
printf("#endif\n\n");
printf("/* The correct way to disable socket support is to set the number of\n");
printf(" * socket descriptors to zero.\n");
printf(" */\n\n");
printf("#ifndef CONFIG_NSOCKET_DESCRIPTORS\n");
printf("# define CONFIG_NSOCKET_DESCRIPTORS 0\n");
printf("#endif\n\n");
printf("/* There can be no network support with no socket descriptors */\n\n");
printf("#if CONFIG_NSOCKET_DESCRIPTORS <= 0\n");
printf("# undef CONFIG_NET\n");
printf("#endif\n\n");
printf("/* Conversely, if there is no network support, there is no need for\n");
printf(" * socket descriptors\n");
printf(" */\n\n");
printf("#ifndef CONFIG_NET\n");
printf("# undef CONFIG_NSOCKET_DESCRIPTORS\n");
printf("# define CONFIG_NSOCKET_DESCRIPTORS 0\n");
printf("#endif\n\n");
printf("#endif /* __INCLUDE_NUTTX_CONFIG_H */\n");
fclose(stream);