Commit Graph

13 Commits

Author SHA1 Message Date
Jiuzhu Dong
4d5a964f29 net: unify socket into file descriptor
Change-Id: I9bcd21564e6c97d3edbb38aed1748c114160ea36
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2021-03-03 19:01:41 -08:00
Xiang Xiao
b598ab43d7 fs: Implement lstat function
specified here:
https://pubs.opengroup.org/onlinepubs/009695399/functions/lstat.html

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: Iefc23a02d425ff84fa4027aea7da1181b01eced7
2020-06-30 13:09:58 -06:00
Gregory Nutt
1c002e1049 fs/vfs/fs_fstat: Correct fstat() for proxied block and MTD drivers.
Block and MTD drivers may be opened and managed as though they were character drivers.  But this is really sleight of hand; there is a hidden character driver proxy that mediates the interface to the block and MTD drivers in this case.

fstat(), however, did not account for this.  It would report the characteristics of the proxy character driver, not of the underlying block or MTD driver.

This change corrects that.  fstat now checks if the character driver is such a proxy and, if so, reports the characteristics of the underlying block or MTD driver, not the proxy character driver.
2020-05-28 17:34:09 +01:00
Gregory Nutt
efe65749ce 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.
2019-02-11 15:47:25 -06:00
Gregory Nutt
05faba2514 include/nuttx/fs/fs.h: ... conflicting types for file_fstat(). 2018-08-26 16:13:09 -06:00
ligd
aa52c457cc fs/vfs/fs_fstat.c: Add file_fstat() function for internal OS use. 2018-08-26 13:26:37 -06:00
Gregory Nutt
f5d0fc7447 fs/vfs and net/udp: Repartition logic of commit 0c963449d6, moving into net/udp. Add support to handle connected UDP sockets. The correct 'optimal blksize' to return is the MSS. The MTU is always too big. 2018-04-27 08:36:25 -06:00
Pelle Windestam
0c963449d6 fs/vfs: Added support for checking if a descriptor is a socket in fstat(). 2018-04-26 06:49:13 -06:00
Gregory Nutt
536e4d7fa6 fs/vfs: Change the return value of internal function fs_getfilep(). It no longer sets the errno variable but, rather, returns errors in the same manner as other internal OS functions. 2017-10-11 08:39:19 -06:00
Gregory Nutt
656935ed7e C library: Add fstatfs(); fix a reference counting error in fstat(). 2017-02-17 08:35:59 -06:00
Gregory Nutt
10378bb10b fstat: Add fstat() support to nfs. 2017-02-13 10:07:43 -06:00
Gregory Nutt
4748e9352d fstat: Add fstat() support to romfs 2017-02-12 16:25:12 -06:00
Gregory Nutt
c5a8e96dbc Add basic fstat() support. Now all that is needed is to modify ALL of the file systems. 2017-02-12 12:48:24 -06:00