Masayuki Ishikawa
191ada2296
libs: misc: Remove critical section in lib_filesem.c for SMP
...
Summary:
- The code was added in Mar 2018 to stabilize the SMP kernel
- I confirmed that the code is no longer needed now.
Impact:
- SMP only
Testing:
- Tested with ostest the following configs
- esp32-devkitc:smp (QEMU), sabre-6quad:smp (QEMU)
- maix-bit:smp (QEMU), sim:smp
- spresense:smp
- Tested with nxplayer and stress test with spresense:wifi_smp
Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2021-03-01 03:44:25 -08:00
Xiang Xiao
151cf49562
Fix nxstyle warning
...
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-03-01 09:23:09 +09:00
Xiang Xiao
9473434587
Ensure the kernel component don't call userspace API
...
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-03-01 09:23:09 +09:00
Jiuzhu Dong
fecc68d1bb
mm/umm_heap: move memory-related api from libc/stdlib to umm
...
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2021-02-26 11:47:11 -08:00
Jiuzhu Dong
6cac6c50d1
unistd/getcwd: enhance getcwd when buf is NULL
...
Change-Id: I595e1874349f089691dc5291f31fb376cf0e2e2c
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2021-02-26 02:32:14 -08:00
YAMAMOTO Takashi
542574acd6
libs/libc/modlib/modlib_init.c: initialize file descriptor with -1
...
Use -1 instead of 0 to represent an invalid descriptor
so that modlib_uninitialize doesn't try to close the descriptor 0.
2021-02-24 23:42:06 -08:00
Byron Ellacott
41b805813f
libc/hex2bin: fix handling of segment offsets
2021-02-24 07:01:45 -08:00
Jiuzhu Dong
142406bd2a
builtin: execute app whose filename is longer than NAME_MAX
...
Change-Id: I0d8ed47c0391e65467cc8a2f4f499b0fbfa8c122
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2021-02-24 05:21:39 -08:00
Xiang Xiao
5f387bebc6
fs: Don't call _NX_SETERRNO in fopen and fdopen
...
since fs_fdopen always return the error code directly
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-02-21 12:40:43 +00:00
Xiang Xiao
f3043d133e
netdb: Don't call _NX_RECV and _NX_SEND
...
since netdb should only be called from userspace
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-02-21 12:33:02 +00:00
Xiang Xiao
533a7319d9
libc: Move stack check stuff from libc/stdlib/ to libc/assert/
...
since the new location is more reasonable
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-02-20 10:10:15 -08:00
hotislandn
0337cd05d7
libc:machine:risc-v:unifying elf relocation code.
...
Signed-off-by: hotislandn <hotislandn@hotmail.com>
2021-02-19 11:09:18 -08:00
hotislandn
d9a1b67120
libs:machine:rv64:add missing logic for elf relocation type: R_RISCV_LO12_S.
...
Signed-off-by: hotislandn <hotislandn@hotmail.com>
2021-02-15 06:57:30 -08:00
hotislandn
256b83ef8a
arch:risc-v:bl602:add support for elf file apps.
...
Signed-off-by: hotislandn <hotislandn@hotmail.com>
2021-02-13 10:29:12 -08:00
hotislandn
07792a696b
RV64: handle relocation type R_RISCV_CALL_PLT in PIC build.
...
Signed-off-by: hotislandn <hotislandn@hotmail.com>
2021-02-03 02:27:03 -08:00
hotislandn
de8e3a130c
RV64: add R_RISCV_HI20 and R_RISCV_LO12_I to elf relocateadd for absolute address loading.
...
Signed-off-by: hotislandn <hotislandn@hotmail.com>
2021-02-01 21:35:48 -08:00
Pavel Pisa
17c3118b85
libs/libc: libc.csv fill in calloc, gethostbyname and signal.
...
Signed-off-by: Pavel Pisa <ppisa@pikron.com>
2021-01-29 10:40:03 -08:00
Pavel Pisa
0a5e7bd3ef
libs/libc: libc.csv "mkfifo" and "pipe" has to be conditionalized same as in the sources.
...
The CONFIG_PIPES, CONFIG_DEV_FIFO_SIZE and CONFIG_DEV_PIPE_SIZE setting
has to be considered.
Signed-off-by: Pavel Pisa <ppisa@pikron.com>
2021-01-29 10:40:03 -08:00
Xiang Xiao
8e6cdd0375
pthread: Return get_errno instead the hardcode value
...
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I1830a473da179d3a1280d3482b0f000ce72de107
2021-01-28 11:31:40 -03:00
YAMAMOTO Takashi
6b48f8b397
netdb: A few build fixes
2021-01-27 11:04:58 +00:00
Jiuzhu Dong
bdd2c96f08
unistd/fpathconf: enhance fpathconf
...
Change-Id: Id780d7b56b9790206d572d22aa210a8e0222108c
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2021-01-26 03:25:47 -08:00
Jiuzhu Dong
28167c14a3
pthread/cond: enhance pthread_cond_destroy
...
follow: https://pubs.opengroup.org/onlinepubs/009695399/functions/pthread_cond_destroy.html
Change-Id: If645120cbac72975671768159d03f211c4940cca
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2021-01-25 09:55:25 -03:00
chao.an
bd3a843ffe
libc/machine/arch: fix build break if enable armv8 ELF
...
Signed-off-by: chao.an <anchao@xiaomi.com>
2021-01-16 11:17:02 -08:00
Xiang Xiao
4d4cba41f6
Move the declaration of nx_mkfifo/nx_pipe to nuttx/fs/fs.h
...
the new location is better than nuttx/drivers/drivers.h
since they are part of the file system api.
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-01-08 11:03:19 +08:00
chao.an
c8784faf3c
ctype/iscntrl: correct the control character function
...
all the characters placed before the space on the ASCII table
and the 0x7F character (DEL) are control characters.
Signed-off-by: chao.an <anchao@xiaomi.com>
2021-01-05 01:34:36 -06:00
danguanghua
7d33f73e27
libs/libc/net: implement socketpair
...
N/A
Reference here:
https://www.freebsd.org/cgi/man.cgi?apropos=0&sektion=2&query=socketpair&manpath=FreeBSD+7.0-current&format=html
Change-Id: I959b4d661cd436f5d5050baf9e821db84139d482
Signed-off-by: danguanghua <danguanghua@xiaomi.com>
2021-01-03 20:56:27 -06:00
chao.an
d7b004e179
libc/dumpvbuffer: update the vector ptr correctly
...
fix a bug that the vector pointer is not updated correctly.
Signed-off-by: chao.an <anchao@xiaomi.com>
2020-12-29 15:42:33 -08:00
Xiang Xiao
10adf76209
libc: Add b64_ntop and b64_pton implementation
...
implemented by many libc(e.g. freebsd, glibc, newlib)
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-12-28 13:53:20 -03:00
chao.an
2980792efd
libs/libc: add lib_dumpvbuffer support
...
e.g: Encapsulation Type: Bluetooth H4: add packet type dump support
From:
lib_dumpvbuffer(NULL, data, len);
[ 1.567100] 0000 03 0c 00 ...
[ 1.890100] 0000 0e 04 01 03 0c 00 ......
[ 1.890100] 0000 03 10 00 ...
[ 1.892900] 0000 0e 0c 01 03 10 00 ff ff 8f fe db ff 5b 87 ............[.
[ 1.892900] 0000 01 10 00 ...
[ 1.894900] 0000 0e 0c 01 01 10 00 06 bb 22 06 0a 00 bb 22 ........"...."
[ 1.894900] 0000 02 10 00 ...
[ 1.901900] 0000 0e 44 01 02 10 00 ff ff ff 03 fe ff ff ff ff ff .D..............
[ 1.901900] 0010 ff ff f3 0f e8 fe 3f f7 83 ff 1c 00 00 00 61 f7 ......?.......a.
[ 1.901900] 0020 ff ff 7f 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
[ 1.901900] 0030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
[ 1.901900] 0040 00 00 00 00 00 00 ......
To:
struct iovec bufs[2];
bufs[0].iov_base = &type;
bufs[0].iov_len = 1;
bufs[1].iov_base = data;
bufs[1].iov_len = len;
lib_dumpvbuffer(NULL, bufs, 2);
[ 3.711400] 0000 01 03 0c 00 ....
[ 4.035400] 0000 04 0e 04 01 03 0c 00 .......
[ 4.035400] 0000 01 03 10 00 ....
[ 4.037400] 0000 04 0e 0c 01 03 10 00 ff ff 8f fe db ff 5b 87 .............[.
[ 4.037400] 0000 01 01 10 00 ....
[ 4.039400] 0000 04 0e 0c 01 01 10 00 06 bb 22 06 0a 00 bb 22 ........."...."
[ 4.039400] 0000 01 02 10 00 ....
[ 4.046400] 0000 04 0e 44 01 02 10 00 ff ff ff 03 fe ff ff ff ff ..D.............
[ 4.046400] 0010 ff ff ff f3 0f e8 fe 3f f7 83 ff 1c 00 00 00 61 .......?.......a
[ 4.046400] 0020 f7 ff ff 7f 00 00 00 00 00 00 00 00 00 00 00 00 ................
[ 4.046400] 0030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
[ 4.046400] 0040 00 00 00 00 00 00 00 .......
Signed-off-by: chao.an <anchao@xiaomi.com>
2020-12-23 00:11:38 -08:00
chao.an
826e74a13d
libs/libc/dumpbuffer: remove the unnecessary printable characters traversal
...
Signed-off-by: chao.an <anchao@xiaomi.com>
2020-12-23 00:11:38 -08:00
chao.an
48db71aa24
libs/libc/dumpbuffer: fix nxstyle warning
...
Signed-off-by: chao.an <anchao@xiaomi.com>
2020-12-23 00:11:38 -08:00
chao.an
e32e341886
libs/libc/dumpbuffer: add support to recognizable from wireshark
...
e.g: Encapsulation Type: Bluetooth H4
From:
[ 2.196000] 0000: 030c00 ...
[ 2.514600] 0000: 0e0401030c00 ......
[ 2.514600] 0000: 031000 ...
[ 2.517600] 0000: 0e0c01031000ffff8ffedbff5b87 ............[.
[ 2.517600] 0000: 011000 ...
[ 2.520600] 0000: 0e0c0101100006bb22060a00bb22 ........"...."
[ 2.520600] 0000: 021000 ...
[ 2.527600] 0000: 0e4401021000ffffff03feffffffffff fffff30fe8fe3ff783ff1c00000061f7 .D.............. ......?.......a.
[ 2.527600] 0020: ffff7f00000000000000000000000000 00000000000000000000000000000000 ................ ................
[ 2.527600] 0040: 000000000000 ......
To:
[ 1.567100] 0000 03 0c 00 ...
[ 1.890100] 0000 0e 04 01 03 0c 00 ......
[ 1.890100] 0000 03 10 00 ...
[ 1.892900] 0000 0e 0c 01 03 10 00 ff ff 8f fe db ff 5b 87 ............[.
[ 1.892900] 0000 01 10 00 ...
[ 1.894900] 0000 0e 0c 01 01 10 00 06 bb 22 06 0a 00 bb 22 ........"...."
[ 1.894900] 0000 02 10 00 ...
[ 1.901900] 0000 0e 44 01 02 10 00 ff ff ff 03 fe ff ff ff ff ff .D..............
[ 1.901900] 0010 ff ff f3 0f e8 fe 3f f7 83 ff 1c 00 00 00 61 f7 ......?.......a.
[ 1.901900] 0020 ff ff 7f 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
[ 1.901900] 0030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
[ 1.901900] 0040 00 00 00 00 00 00 ......
Signed-off-by: chao.an <anchao@xiaomi.com>
2020-12-23 00:11:38 -08:00
Xiang Xiao
922cf0612b
libc/netdb: Move hostbuffer out of the stack
...
The length of hostbuffer come from Kconfig, it isn't safe to
allocate this variable on the stack.
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I75213688153a1cba738544de2a51fa3247626dd3
2020-12-22 10:40:22 -03:00
Huang Qi
073912e232
Replace all wget with curl
...
wget is missing from some system (like macOS and Windows native),
it's better to use curl to simplify build environment.
Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2020-12-22 03:36:10 -06:00
Xiang Xiao
98be50a9bc
libc: Implement posix_fallocate
...
as specified here:
https://pubs.opengroup.org/onlinepubs/007904875/functions/posix_fallocate.html
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-12-14 09:20:15 +01:00
Juha Niskanen
eaa75b11f8
libs/libc: fix typos in comments
...
Signed-off-by: Juha Niskanen <juha.niskanen@haltian.com>
2020-12-13 09:06:28 -06:00
chao.an
859e1ce63a
crypto/arc4random: rename getrandom to arc4random_buf
...
Change-Id: I5c9f0c9acf5af71f01beceaf06ebe0a2c87676bc
Signed-off-by: chao.an <anchao@xiaomi.com>
2020-12-13 08:49:51 -06:00
chao.an
866bb35d2d
libs/libc/net: implement ether_aton/ether_aton_r
...
Reference here:
https://www.unix.com/man-page/linux/3/ether_aton
Signed-off-by: chao.an <anchao@xiaomi.com>
2020-12-10 20:37:32 -06:00
Juha Niskanen
21271c44b7
libs/libc/string/lib_strcspn.c: fix function name in comment
...
Signed-off-by: Juha Niskanen <juha.niskanen@haltian.com>
2020-12-08 12:58:40 -06:00
YAMAMOTO Takashi
f0fc385232
libs/libc/machine/risc-v/rv64/arch_elf.c: Don't assume binfo expansion
2020-12-06 09:03:09 -06:00
YAMAMOTO Takashi
c7a2ee11ca
libs/libc/machine/arm/armv6-m/arch_elf.c: Appease nxstyle
...
The following errors are intentionally left.
They are a part of tables which are not trivial to fix.
libs/libc/machine/arm/armv6-m/arch_elf.c:228:94: error: Long line found
libs/libc/machine/arm/armv6-m/arch_elf.c:230:89: error: Long line found
libs/libc/machine/arm/armv6-m/arch_elf.c:238:94: error: Long line found
libs/libc/machine/arm/armv6-m/arch_elf.c:240:89: error: Long line found
libs/libc/machine/arm/armv6-m/arch_elf.c:401:94: error: Long line found
libs/libc/machine/arm/armv6-m/arch_elf.c:403:91: error: Long line found
libs/libc/machine/arm/armv6-m/arch_elf.c:411:94: error: Long line found
libs/libc/machine/arm/armv6-m/arch_elf.c:413:91: error: Long line found
2020-12-06 09:03:09 -06:00
YAMAMOTO Takashi
0117d2b2f6
libs/libc/machine/arm/armv7-a/arch_elf.c: Fix syslog formats
2020-12-06 07:41:37 -06:00
YAMAMOTO Takashi
51b6a3cd1a
libs/libc/machine/arm/armv7-a/arch_elf.c: Appease nxstyle
2020-12-06 07:41:37 -06:00
YAMAMOTO Takashi
9579fe1444
libs/libc/spawn/lib_psa_dump.c: Fix a syslog format
2020-12-05 08:13:32 -06:00
dongjiuzhu
11617fe5ab
unistd/getopt: remove count of arguments limits
...
For commands without "-" arguments, ex:"ls", we should always let
optind = 1 after getopt is called in order to get what follows
correctly.
Change-Id: Iac3cfbadd27fb96e47070c4e3198229306299b6b
Signed-off-by: dongjiuzhu <dongjiuzhu1@xiaomi.com>
2020-12-02 02:56:23 -06:00
dongjiuzhu
9315fe21ed
pthread_mutexattr_getprotocol: modify prototype
...
modify the return value according to posix standard
Change-Id: I6e32a8f7a5cac85fe7a395a8115710fdff61d985
Signed-off-by: dongjiuzhu <dongjiuzhu1@xiaomi.com>
2020-12-02 07:52:15 +01:00
Matias N
88f1cdb915
build system: add missing --obj-path to MKDEP
2020-11-28 09:59:56 -06:00
chao.an
c56785bd0d
style/Makefile: remove unnecessary trailing whitespace
...
N/A
Signed-off-by: chao.an <anchao@xiaomi.com>
2020-11-28 12:20:30 +01:00
Xiang Xiao
d6c24312aa
Fix nxstyle warning
...
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-11-26 18:42:18 -03:00
Xiang Xiao
afb0e33138
libc/machine/arch: Support armv8-m relocation
...
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-11-26 18:42:18 -03:00
Xiang Xiao
74ab69af62
libs/libc/machine/arm: Rename armv8 to armv8-m
...
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-11-26 18:42:18 -03:00
Xiang Xiao
edca49fb5f
libc/machine/arm: Use the correct arch Kconfig for variant check
...
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-11-26 18:42:18 -03:00
Xiang Xiao
baabe5e08a
libs/libc/machine: Remove ARCH_CORTEXM33 dependence from LIBM_ARCH_xxx
...
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-11-26 18:42:18 -03:00
Alin Jerpelea
9f6a43d0b0
libs: audio: libsamplerate: drop local patches
...
The needed patches were accepted upstream and now there is no need to
carry local patches.
Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2020-11-24 10:54:57 -08:00
YAMAMOTO Takashi
5566d9ad03
libs/libc/netdb/lib_dnsquery.c: Fix a syslog format
2020-11-23 05:00:10 -08:00
YAMAMOTO Takashi
c1f9d8adb1
libs/libc/machine/risc-v/rv64/arch_elf.c: Fix syslog formats
2020-11-22 19:01:05 -08:00
Matias N
d5b6ec450f
Parallelize depend file generation
2020-11-22 09:02:59 -03:00
YAMAMOTO Takashi
42a218dabb
libs/libc/machine/arm/armv7-m/arch_elf.c: Fix syslog formats
2020-11-21 19:38:32 -08:00
YAMAMOTO Takashi
04f2542cc2
libs/libc/machine/arm/armv7-m/arch_elf.c: Appease nxstyle
...
The following errors are intentionally left.
They are a part of tables which are not trivial to fix.
libs/libc/machine/arm/armv7-m/arch_elf.c:230:94: error: Long line found
libs/libc/machine/arm/armv7-m/arch_elf.c:232:89: error: Long line found
libs/libc/machine/arm/armv7-m/arch_elf.c:240:94: error: Long line found
libs/libc/machine/arm/armv7-m/arch_elf.c:242:89: error: Long line found
libs/libc/machine/arm/armv7-m/arch_elf.c:403:94: error: Long line found
libs/libc/machine/arm/armv7-m/arch_elf.c:405:91: error: Long line found
libs/libc/machine/arm/armv7-m/arch_elf.c:413:94: error: Long line found
libs/libc/machine/arm/armv7-m/arch_elf.c:415:91: error: Long line found
2020-11-21 19:38:32 -08:00
YAMAMOTO Takashi
34cd44f8d7
libs/libc/modlib/modlib_symbols.c: Fix syslog formats
2020-11-21 19:38:32 -08:00
YAMAMOTO Takashi
6bdca69a32
libs/libc/modlib/modlib_bind.c: Fix syslog formats
2020-11-21 19:38:32 -08:00
Xiang Xiao
759b63d4be
libc: implement getopt_long partially
...
only the short option is supported now
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-11-21 07:01:08 -06:00
Xiang Xiao
af53bdb048
libc: Add opterr global variable
...
defined here:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/getopt.html
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-11-21 07:01:08 -06:00
YAMAMOTO Takashi
02b92c5ad9
libs/libc/pthread/pthread_attr_setstacksize.c: Fix a syslog format
2020-11-20 22:22:53 -08:00
Alin Jerpelea
48e6f2051d
audio: libsamplerate: add initial audio Sample Rate Converter
...
Add audio sample rate conversion library from
http://www.mega-nerd.com/SRC/index.html
Source:
https://github.com/libsndfile/libsamplerate
Add needed patches for NuttX OS and embedded boards.
NOTE:
We must use master branch until next stable release
2020-11-19 18:05:47 -08:00
YAMAMOTO Takashi
bc4780b8ba
libs/libc/uuid/lib_uuid_from_string.c: Fix scanf format warnings
2020-11-18 00:44:55 -08:00
liuhaitao
fd94a32468
sysconf: add _SC_PAGESIZE sysconf support
...
Also implement getpagesize() based on sysconf(_SC_PAGESIZE).
Change-Id: I812eb8f34ed602f7bc12c4cafafcebc0d98fd136
Signed-off-by: liuhaitao <liuhaitao@xiaomi.com>
2020-11-17 02:03:23 -08:00
YAMAMOTO Takashi
1b4f65c7f2
libs/libc/uuid/lib_uuid_to_string.c: Fix a printf format warning
2020-11-16 08:29:00 -08:00
YAMAMOTO Takashi
9c08c53e81
libs/libc/time/lib_strftime.c: Fix a printf format warning
2020-11-16 08:29:00 -08:00
YAMAMOTO Takashi
2342b929e7
libs/libc/time/lib_strftime.c: Appease nxstyle
2020-11-16 05:46:53 -08:00
Peter Bee
1f5786f5ea
libc/stdlib: Fix range check in strtoul(l)
...
The previous implementation of strtoul(l) is flawed. The range check
assumed that when overflow happens, the truncated value is smaller than
the original value. As a counter example, passing "10000000000" to
strtol will not trigger ERANGE, but return a truncated value. This patch
adds more accurate range checks.
Change-Id: I239e034e390b4974157ed6efa17110f2e74904cf
Signed-off-by: Peter Bee <bijunda1@xiaomi.com>
2020-11-12 06:01:33 -08:00
Xiang Xiao
84b90e00f0
libc/stdio: Preallocate the stdin, stdout and stderr
...
to handle the uninitialized stdin/stdout/stderr gracefully
report here:
https://github.com/apache/incubator-nuttx/issues/2203
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-11-11 09:56:10 -08:00
YAMAMOTO Takashi
f307d999e6
lib_libvsprintf.c: Implement "t" modifier for printf
...
Introduced by C99 for ptrdiff_t.
2020-11-10 00:03:06 -08:00
Xiang Xiao
e160bffe28
Remove all fclose with stdin, stdout and stderr
...
since it is wrong to close the builtin stream and specially note
https://pubs.opengroup.org/onlinepubs/9699919799/functions/fclose.html :
Since after the call to fclose() any use of stream results in
undefined behavior, fclose() should not be used on stdin, stdout,
or stderr except immediately before process termination (see XBD
Process Termination), so as to avoid triggering undefined behavior
in other standard interfaces that rely on these streams. If there
are any atexit() handlers registered by the application, such a
call to fclose() should not occur until the last handler is
finishing. Once fclose() has been used to close stdin, stdout, or
stderr, there is no standard way to reopen any of these streams.
and it is also unnecessary because the stream always get flushed.
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-10-29 20:43:50 +09:00
Yoshinori Sugino
c13f869432
Modify SIGSTP to SIGTSTP
...
Follow the POSIX description.
SIGTSTP should be sent when the Ctrl-Z characters is encountered, not SIGSTP.
Testing:
Built with hifive1-revb:nsh (CONFIG_SERIAL_TERMIOS=y, CONFIG_SIG_DEFAULT=y and CONFIG_TTY_SIGTSTP=y)
2020-10-29 01:12:43 -07:00
Yoshinori Sugino
079737dd0c
libs/libc/signal/sig_pause.c: Fix a comment
2020-10-28 07:12:46 +01:00
Xiang Xiao
2b9282d5ee
libc: Skip close stdin/stdout/stderr in fclose
...
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-10-26 22:16:53 -07:00
ligd
b69c587dc9
stdio: remove depends on setbuf setvbuf
...
N/A
Cause the function realize will handle this
Change-Id: I154c21c7a40667afae423bb0ebb67de8f5fc42fd
Signed-off-by: ligd <liguiding1@xiaomi.com>
2020-10-26 22:12:02 -07:00
YAMAMOTO Takashi
df812d09a2
math: Make this friendly with libcxx
...
- Turn some macros into functions
- Implement some type-agnostic functions.
(Just use __builtin_xxx)
- Add some missing function prototypes
(Just prototypes, not actually implemented in this commit)
2020-10-25 07:30:14 -07:00
Yoshinori Sugino
7b3cb0a23b
libs/libc/string/lib_strsignal.c: Fix a comment
2020-10-25 08:49:44 -03:00
dongjiuzhu
2b5be56bd0
serial/termios: support custom baud rate setting
...
N/A
Change-Id: I0cc00f6d0fda852533bd4a38ea6fc39e0d0059da
Signed-off-by: dongjiuzhu <dongjiuzhu1@xiaomi.com>
2020-10-21 10:11:21 -07:00
Xiang Xiao
eb4121ce38
Change all 'Nuttx' to 'NuttX'
...
Unify the naming convention
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-10-20 01:45:06 -07:00
Xiang Xiao
9928088868
libc: Don't fclose and fopen file in freopen
...
to avoid FILE pointer change after this commit:
commit b0797263ca
Author: Xiang Xiao <xiaoxiang@xiaomi.com>
Date: Thu Aug 13 18:17:29 2020 +0800
libc/stdio: Allocate file_struct dynamically
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>
2020-10-19 21:31:31 -07:00
Yoshinori Sugino
5a1788822d
libs/libc/signal/sig_wait.c: Fix a typo
2020-10-11 13:00:25 +08:00
Gregory Nutt
32b0562375
Add some comments to inet_ntop()
...
Endian-ness issues are mind boggling sometimes. I have been confused by the logic in inet_ntop() a few times so I thought I would add some comments so that I (and others) will understand the endian-ness issues in the future. No change to logic, only comments changed.
2020-10-05 03:00:22 +08:00
Nathan Hartman
80ce7800a9
Sources and Docs: Fix typos and nxstyle issues
...
Documentation/contributing/coding_style.rst:
* Fix repeated words: ("this this").
* Remove trailing spaces.
boards/z80/z80/z80sim/README.txt:
* Fix repeated words: ("this this") and rewrap lines.
graphics/Kconfig,
libs/libc/math/Kconfig:
* Fix repeated words: ("this this").
arch/arm/src/armv7-a/arm_assert.c,
arch/arm/src/armv7-r/arm_assert.c,
arch/arm/src/imxrt/imxrt_enet.c,
arch/arm/src/kinetis/kinetis_enet.c,
arch/arm/src/kinetis/kinetis_flexcan.c,
arch/arm/src/s32k1xx/s32k1xx_enet.c,
arch/arm/src/s32k1xx/s32k1xx_flexcan.c,
arch/arm/src/stm32/stm32_pwm.c,
arch/arm/src/stm32h7/stm32_pwm.c,
arch/arm/src/stm32l4/stm32l4_pwm.c,
arch/renesas/src/rx65n/rx65n_usbdev.c,
binfmt/libnxflat/libnxflat_bind.c,
drivers/pipes/pipe_common.c,
net/igmp/igmp_input.c,
net/tcp/tcp_conn.c,
sched/sched/sched_roundrobin.c:
* Fix typo in comment ("this this").
arch/arm/src/cxd56xx/cxd56_usbdev.c,
arch/arm/src/lc823450/lc823450_usbdev.c:
* Fix typo in comment and rewrap lines.
arch/arm/src/imxrt/imxrt_usbdev.c,
arch/arm/src/stm32/stm32_dac.c,
arch/arm/src/stm32f0l0g0/stm32_pwm.c,
arch/arm/src/stm32f7/stm32_pwm.c,
arch/arm/src/tiva/lm/lm4f_gpio.h,
fs/nxffs/nxffs_write.c,
include/nuttx/analog/pga11x.h,
include/nuttx/usb/usbdev.h,
net/mld/mld_join.c:
* Fix typo in comment ("this this").
* Fix nxstyle issues.
2020-10-02 04:54:52 +02:00
YAMAMOTO Takashi
3e6561c3cf
lib_libvscanf.c: Implement "j" modifier for scanf
...
It's a part of C99 and commonly used these days.
2020-09-23 03:28:40 -07:00
Gregory Nutt
ebdfd16f0f
Move gettid() implementation to /libs/libc/unistd
...
Move sched/task/task/task_gettid.c to libs/libc/unistd/lib_gettid.c. gettid() is a dumb wrapper around getpid(). It is wasteful of resources to support TWO systme calls, one for getpid() and one for gettid(). Instead, move gettid() in the C library where it calls the single sysgtem call, getpid(). Much cleaner.
2020-09-22 19:40:56 -07:00
Xiang Xiao
f4794f0b48
libc: Implement access function correctly
...
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I6ae3abf79bd9aa8cfb54b8bbe302d69c4d9cb8ff
2020-09-22 10:30:36 +02:00
spiriou
a1c047fe53
libc/uio: enable writev() for sockets
2020-09-21 19:31:06 -07:00
Xiang Xiao
ba3f12c93f
libc: Implement popcount/popcountl/popcountll
...
specified here:
https://www.unix.com/man-page/netbsd/3/popcountll/
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-09-21 07:37:04 -07:00
chao.an
216c33a5c7
libs/libc/stdlib: Implement mkdtemp(3) syscall
...
See the reference here:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/mkdtemp.html
Change-Id: I49081ecafc011a843e6067b1118b53bf65d4418b
Signed-off-by: chao.an <anchao@xiaomi.com>
2020-09-19 04:16:14 -07:00
chao.an
4067a9f057
libs/libc/stdio: correct the prototype of mktemp(3)
...
From: int mktemp(FAR char *path_template);
To: FAR char *mktemp(FAR char *path_template);
See the reference here:
https://pubs.opengroup.org/onlinepubs/009695399/functions/mktemp.html
Signed-off-by: chao.an <anchao@xiaomi.com>
2020-09-19 04:16:14 -07:00
chao.an
0826b827ee
libs/libc/time: add stub for futimes/ns(2)
...
Change-Id: I231817d10b9e2071b1f642e8694839b2a64b1c4c
Signed-off-by: chao.an <anchao@xiaomi.com>
2020-09-19 03:20:09 -07:00
chao.an
0f06c35640
unistd/priority: Implement [s/g]etpriority(2) syscall
...
See the reference here:
https://pubs.opengroup.org/onlinepubs/009695399/functions/getpriority.html
Signed-off-by: chao.an <anchao@xiaomi.com>
2020-09-19 01:06:51 -07:00
chao.an
b8fa1e51d8
time/tm: add "tm_zone" member into tm
...
base/time/time_exploded_posix.cc:190:14: error: ‘struct tm’ has no member named ‘tm_zone’; did you mean ‘tm_mon’?
190 | timestruct.tm_zone = nullptr; // not a POSIX field, so mktime/timegm ignore
| ^~~~~~~
| tm_mon
Change-Id: I9f93e63b50c0692a7a2bfc47abd9d07aa2c8e8db
Signed-off-by: chao.an <anchao@xiaomi.com>
2020-09-18 20:03:05 -07:00
chao.an
614ac5b0f2
libs/libc/unistd: Implement pipe2(2) syscall
...
See the reference here:
https://www.man7.org/linux/man-pages/man2/pipe2.2.html
Change-Id: Ife19b9bdbde73c7421be381a094da67017819e63
Signed-off-by: chao.an <anchao@xiaomi.com>
2020-09-18 20:01:26 -07:00
Matias N
166242c171
use "export" to expose TOPDIR to all child make instead of passing it around every time
2020-09-15 21:11:33 -07:00
ligd
c38c821fc2
libs/libc/time: add gethrtime() support
...
Change-Id: I8882207d3a7e5062f70c7b4b95205361c71f8744
Signed-off-by: ligd <liguiding1@xiaomi.com>
2020-09-15 10:28:21 -03:00
ligd
b3541ccaf8
libs/libc/unistd: add dummy getrlimit & setrlimit support
...
Change-Id: Iee826204596c492ace853e49ab7ff26a2ae7fe60
Signed-off-by: ligd <liguiding1@xiaomi.com>
2020-09-15 10:28:21 -03:00