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
+2 -2
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);
+1 -1
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. */
+2 -2
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 */
+1 -1
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)
+1 -1
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
+1 -1
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 */
+1 -1
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);
+2 -2
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);
+1 -1
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);
+1 -1
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.
*/
+1 -1
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?
*/
+2 -2
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);