1.Reduce the default size of task_group_s(~512B each task)
2.Scale better between simple and complex application
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: Ia872137504fddcf64d89c48d6f0593d76d582710
Or close the fd2 return by dup() would segment fault since filep->f_priv
null access.
Change-Id: I285c86f54bbb486d6c2c5aea53952f69083dca72
Signed-off-by: liuhaitao <liuhaitao@xiaomi.com>
https://linux.die.net/man/2/epoll_ctl:
EPOLLONESHOT (since Linux 2.6.2)
Sets the one-shot behavior for the associated file descriptor.
This means that after an event is pulled out with epoll_wait(2)
the associated file descriptor is internally disabled and
no other events will be reported by the epoll interface.
The user must call epoll_ctl() with EPOLL_CTL_MOD to
rearm the file descriptor with a new event mask.
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I6c0dc93e1cdae0e8cea5b487c7005de2da2c2ec3
fs/procfs/fs_procfs.c contained an unused reference to an STM32 procfs structure. This is wrong in two ways: (1) There should be not STM32 references outside of arch/arm and boards/arm and (2) the declare STM32 structure is not used anyway.
Linux Programmer's Manual
NAME
epoll_create, epoll_create1 - open an epoll file descriptor
...
SYNOPSIS
#include <sys/epoll.h>
int epoll_create1(int flags);
...
epoll_create1()
If flags is 0, then, other than the fact that the obsolete
size argument is dropped, epoll_create1() is the same as
epoll_create(). The following value can be included in flags
to obtain different behavior:
EPOLL_CLOEXEC
Set the close-on-exec (FD_CLOEXEC) flag on the new file
descriptor. See the description of the O_CLOEXEC flag in
open(2) for reasons why this may be useful.
https://man7.org/linux/man-pages/man7/epoll.7.html
since these function don't depend on standard input/output function
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I011a387a1e2c1360e8f37716d512bd32f93ad467
to save the preserved space(1KB) and also avoid the heap overhead
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I694073f68e1bd63960cedeea1ddec441437be025
This will resolve numerous problems with the way that hard links, in particular "." and ".." are handled. Instead of trying to fudge the stat flags, the correct implementation is to follow the hard link to the final link target node. That is what must determine the attributes of the directory entry.
This PR corrects an error in the ROMFS file system. The error occurred after following a hard link (depending on how the ROMFS image is organized). The error occurred because some of the information buffered before following the links was stale and, hence, out of sync after following the hard link. This would cause random errors when paths containing hardlinks were used with ROMFS.
This PR resolves Issue #1543. Please compare the following output with the output in Issue #1543 to see how the problem was resolved:
NuttShell (NSH) NuttX-9.1.0
nsh> mount
/etc type romfs
/proc type procfs
/tmp type vfat
nsh> ls -Rl /etc
/etc:
dr-xr-xr-x 0 .
dr-xr-xr-x 0 ..
-r-xr-xr-x 20 group
dr-xr-xr-x 0 init.d/
-r-xr-xr-x 35 passwd
/etc/init.d:
dr-xr-xr-x 0 .
dr-xr-xr-x 0 ..
-r-xr-xr-x 71 rcS
nsh> ls -l /etc/init.d
/etc/init.d:
dr-xr-xr-x 0 .
dr-xr-xr-x 0 ..
-r-xr-xr-x 71 rcS
nsh> ls -l /etc/init.d/.
/etc/init.d/.:
dr-xr-xr-x 0 .
dr-xr-xr-x 0 ..
-r-xr-xr-x 71 rcS
nsh> ls -l /etc/init.d/..
/etc/init.d/..:
dr-xr-xr-x 0 .
dr-xr-xr-x 0 ..
-r-xr-xr-x 20 group
dr-xr-xr-x 0 init.d/
-r-xr-xr-x 35 passwd
nsh> ls -l /etc/init.d/../.
/etc/init.d/../.:
dr-xr-xr-x 0 .
dr-xr-xr-x 0 ..
-r-xr-xr-x 20 group
dr-xr-xr-x 0 init.d/
-r-xr-xr-x 35 passwd
nsh>
New CONFIG_FAT_LFN_UTF8: UTF8 strings are converted to UCS2-LFN
Bugfix in fat_createalias: space is now also converted to underbar.
Change (bugfix) in fat_getlfname: init characters (0xff) and '\0' are rewound as well.
Found by clang-check:
mqueue/mq_close.c:127:21: warning: Value stored to 'rtcb' during its initialization is never read
FAR struct tcb_s *rtcb = (FAR struct tcb_s *)nxsched_self();
^~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 warning generated.
Found by clang-check:
mount/fs_mount.c:287:8: warning: Although the value stored to 'ret' is used in
the enclosing expression, the value is never actually read from 'ret'
(ret = find_blockdriver(source, mountflags, &drvr_inode)) >= 0)
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 warning generated.
Found by clang-check:
romfs/fs_romfs.c:431:7: warning: Value stored to 'bytesread' is never read
bytesread = 0;
^ ~
romfs/fs_romfs.c:455:11: warning: Value stored to 'sector' is never read
sector += nsectors;
^ ~~~~~~~~
2 warnings generated.
Make.dep file should be updated by .config changed after first make.
There are 2 cases affected for this problem:
1) Add source files by config symbol
2) Include header files in #ifdef directive
These 2 cases may not be included in Make.dep and this may prevent the
differential build from working correctly.
If a existing file is opened with overwriting mode e.g. fopen(file, "w+"),
the file size will be incorrect after writing any data to the file.
This bug is caused by previous commit 10903b5, and its changes should be
limited to only O_APPEND mode.
since the current implementation is really a symoblic link not hard link
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I59d30d0a620b0b5714fe91bbe90d4405cf53d187
The use of uint64_t primitive type in NFS structures forces the compiler to align data on an 8-byte boundary.
As a result of this, unwanted gaps being created, which causes NFS to fail. (e.g., nfs_read/initialize the request)
Using nfsuint64 instead of uint64_t fixes this issue.
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.