Xiang Xiao
60fe0a0f96
libc: Refine the inline handling
...
1.Remove CONFIG_HAVE_INLINE macro
2.Change the ANSI C function to normal function
3.Other simple non ANSI function to macro
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-07-04 11:10:29 +09:00
Xiang Xiao
43b613877d
libc/stdio: Remove sys/types.h inclusion for printf/scanf
...
since double_t move from sys/types.h to math.h now and remove
math.h inclusion too because lib_dtoa_engine.h already include
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I3497a73908301d999cf1cfc4a66552a7ca4868c6
2020-06-29 16:25:22 +01:00
Xiang Xiao
d17b963bca
libc: Move double_t typedef from sys/types.h to math.h
...
specified here:
https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/math.h.html
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I3497a73908301d999cf1cfc4a66552a7ca4868c6
2020-06-29 13:37:41 +01:00
Xiang Xiao
676a2b77f8
stdio.h: Implement fseeko and ftello function
...
specified here:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/fseek.html
https://pubs.opengroup.org/onlinepubs/9699919799/functions/ftell.html
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-06-29 14:26:19 +09:00
YAMAMOTO Takashi
ef5d204fd2
rewind: clear the error indicator
...
Make rewind() clear the error indicator of the stream
as it's specified by the standards.
2020-06-24 16:56:44 +08:00
Xiang Xiao
0317eae801
libc: support CONFIG_ARCH_ROMGETC for scanf function series
...
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: Ieb524fa431ad60eb586a99d68aed4a022fb87ae7
2020-06-10 00:03:53 -07:00
Xiang Xiao
43d7c1e807
libc: Add IPTR for puts/fputs
...
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I2a83afb4d934a44ad1b56ec6dd72e654f4e112a3
2020-06-10 00:03:53 -07:00
Gregory Nutt
4935ab5243
printf() and vprintf() must use C buffered I/O if available.
...
This backs out a part of PR 1179 which has a very serious error: If C buffered I/O is available, then printf() and vprintf MUST use it. Otherwise, the ordering of the I/O will be screwed up. They must not use direct file descriptor I/O UNLESS C buffered I/O is disabled.
2020-06-03 18:38:19 +01:00
Xiang Xiao
4029706583
libc: tmpfile shouldn't hardcode the folder to /tmp
...
use P_tmpdir macro instead
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-06-03 07:46:02 -06:00
Xiang Xiao
29f9d97420
libc: Call vdprintf in printf/vprintf for CONFIG_NFILE_STREAMS == 0
...
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I3c49ec02a9444f039ac7aac7b8ea6de5d1090340
2020-06-03 07:35:08 -06:00
Xiang Xiao
a55f8d24a2
libc: Implement vscanf() function
...
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I2421e57b2c848c43afb749b8ebfa79ec457cde26
2020-06-03 07:35:08 -06:00
Xiang Xiao
6b3ac93e78
libc: Fix a typo error in tmpfile
...
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: Ic6db2c76844a5a9d503fc46bb4b930870afbd9ed
2020-06-02 10:18:55 -06:00
Xiang Xiao
9ff32427bf
libc: Implement tmpfile() function
...
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I00bdb42006b40bf1b9bc0bb6865b9b88b4acbb7b
2020-06-02 09:32:25 -06:00
YAMAMOTO Takashi
86b7c20b7d
Implement "j" modifier for printf format
...
It's a part of C99 and commonly used these days.
2020-06-02 11:18:16 +02:00
YAMAMOTO Takashi
d884dd301f
Fix nxstyle complaints
...
various nxstyle fixed to avoid the CI warnings
2020-06-02 11:18:16 +02:00
Gregory Nutt
154a87993f
fs/vfs/fd_open.c: fs_fdopen() must not set errno
...
Functions within the OS must never set the errno value. fs_fdopen() was setting the errno value. Now, after some parameter changes, it reports errors via a negated errno integer return value as do most all other internal OS functions.
2020-05-23 15:22:09 +08:00
Gregory Nutt
a4218e2144
include/nuttx/sched.h: Make naming of all internal names consistent:
...
1. Add internal scheduler functions should begin with nxsched_, not sched_
2. Follow the consistent naming patter of https://cwiki.apache.org/confluence/display/NUTTX/Naming+of+OS+Internal+Functions
2020-05-09 14:19:08 -03:00
Xiang Xiao
a2d924eea4
syscall: Fix typo error in cvs and header file
...
and reoder the entry in cvs file
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-05-07 10:31:05 -06:00
Brennan Ashton
8110ea6a7a
x86_64: Make sure to clone ap list in vasprintf
...
VA_LIST is getting clobbered because it is a pointer to a structure
on the stack and we must traverse it twice. Clone it like we do
for x86_32
2020-05-04 08:37:22 -06:00
Alan Carvalho de Assis
8c0fc09853
Vik memcpy() is already defined on string/Kconfig
2020-05-02 08:41:45 -06:00
Xiang Xiao
f8a809eb5b
Fix nxstyle issue
...
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-05-01 10:43:47 -03:00
Xiang Xiao
eca7059785
Refine __KERNEL__ and CONFIG_BUILD_xxx usage in the code base
...
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-05-01 10:43:47 -03:00
Gregory Nutt
382513e997
libs/libc: Remove support for CONFIG_FS_WRITABLE
...
The mktemp family of functions are built unconditionally now (but not necessarily included in any build).
2020-03-22 08:24:07 -05:00
Gregory Nutt
199b4d6852
z20x: Changes to reduce serial Rx data overrun
...
boards/z80/ez80/z20x: Increase RX buffer size to 4Kb, reduce BAUD to 2400 in w25boot configuration
arch/z80/src/ez80/ez80_serial.c: Reduce Rx FIFO trigger level for eZ80F92 to 1 so that will respond more quickly to incoming data.
2020-03-09 22:51:54 +01:00
Gregory Nutt
82df8b3eba
libs/libc/stdio: Names of files do not match content
...
Rename lib_rawinstream.c to lib_rawsistream.c and lib_rawsistream.c to lib_rawinstream.c so that the content of the files match the name of the files. While we are at it, update the file license to Apache 2.0
2020-03-08 20:59:46 -05:00
Xiang Xiao
bd4e8e19d3
Run codespell -w against all files
...
and fix the wrong correction
2020-02-22 14:45:07 -06:00
chao.an
b438d529f1
libs/libc/stdio/lib_getdelim.c: Correct the character slash
2020-02-19 12:47:25 -06:00
Xiang Xiao
5c80b94820
Replace #include <semaphore.h> to #include <nuttx/semaphore.h>
...
Since the kernel side should call nxsem_xxx instead and remove the unused inclusion
2020-02-01 08:27:30 -06:00
Xiang Xiao
68951e8d72
Remove exra whitespace from files ( #189 )
...
* Remove multiple newlines at the end of files
* Remove the whitespace from the end of lines
2020-01-31 09:24:49 -06:00
YAMAMOTO Takashi
ba1a150dd2
snprintf: Fix a comment typo
2020-01-29 09:04:25 +01:00
Xiang Xiao
6a3c2aded6
Fix wait loop and void cast ( #24 )
...
* Simplify EINTR/ECANCEL error handling
1. Add semaphore uninterruptible wait function
2 .Replace semaphore wait loop with a single uninterruptible wait
3. Replace all sem_xxx to nxsem_xxx
* Unify the void cast usage
1. Remove void cast for function because many place ignore the returned value witout cast
2. Replace void cast for variable with UNUSED macro
2020-01-02 10:54:43 -06:00
Gregory Nutt
ace25a78d9
include/cxx/ctime: Remove gititimer and setitimer. These are prototyped in sys/time.h, not time.h. Alternatively, ctime could include sys/time.h. Those APIs should also be in the std namespace.
2019-11-13 14:01:25 -06:00
Gregory Nutt
dbf266b9d4
libs/libc/stdio/lib_getdelim.c: Initial allocation should be larger; incremental reallocs should be smaller. Update some comments.
2019-11-13 11:45:26 -06:00
Gregory Nutt
675bf4e9b7
libs/libc/stdio/lib_getdelim.c: Make getdelim() behave per specification on OpenGroup.org. Specificailly, needs to reallocate buffer if more data is received than will fit.
2019-11-13 09:01:52 -06:00
Gregory Nutt
14fcacaf27
libs/libc/stdio/lib_libfgets.c: Because of how the function is defined, getline() canot be used on platforms that require CR-LF line terminations.
2019-11-12 19:43:42 -06:00
Gregory Nutt
0820af5f8d
libs/libc/stdio/lib_getdelim.c: Add implementations of the POSIX functions getdelim() and getline().
2019-11-12 18:58:50 -06:00
Juha Niskanen
5c853cd1dc
libs/libc/unistd/lib_getcwd.c: remove stray sched_unlock(). Also fixes several typos.
2019-09-20 06:23:48 -06:00
Juha Niskanen
e8b5dd4528
Fix use of undefined pp-token #errror, other typos.
2019-09-19 18:19:18 -06:00
David S. Alessio
f2b96016ad
libs/libc/machine/arm/armv7-m: Add Cortex M4F mach optimized fabsf and sqrtf.
2019-07-29 20:27:33 -06:00
Gregory Nutt
9f24fb5b4b
sched/: Add some missing FAR. Update some comments.
2019-07-29 15:04:39 -06:00
Gregory Nutt
eef2f4599e
Commit 933e9e407b
broke the simulator on a 64-bit platform.
2019-07-29 14:34:29 -06:00
David Sidrane
933e9e407b
libs/libc/stdio/lib_libvsprintf.c: Add support for the size_t integer qualifier 'z'. This is kind of tricky due the variety of sizeof(size_t) on different platforms.
2019-07-24 12:49:56 -06:00
Gregory Nutt
7ab149d8e9
Various fixes to get a clean compile with the SDCC compiler. Compile is 'almost' clean.
2019-06-03 16:53:11 -06:00
Gregory Nutt
d375a26a6c
libs/libc/stdio: Fix long long usage in all of the newer printf-related logic: The selection CONFIG_LIBC_LONG_LONG must be ignored if the architecture does not support long long types.
2019-06-03 08:45:57 -06:00
Jussi Kivilinna
fd4db67b43
libs/libc/stdio/lib_libvsprintf.c: Restore support for printing NULL string as "(null)". Legacy printf supported printing "(null)" in place for NULL string:
...
printf("null: %s\n", NULL); => null: (null).
This commit restores this functionality for new printf library.
2019-04-04 06:31:25 -06:00
Gregory Nutt
dc8c814ca3
Squashed commit of the following:
...
Fixed coding standard error in several files. Use of while( is incorrect; a space is required between while and (. Also ran tools/nxstyle and fix thoses complaints as well in most files.
Changes to comply with coding standard. Mostly focused on files with missing space after keyword in if(, switch(, and for(. Offending files also got changes to comply with tools nxstyle. If there were logs of nxstyle complaints, the file also got a taste of tools/indent.sh. Still need to fix occurrences of while( with missing space. There are a lot of them.
2019-02-27 08:41:08 -06:00
Gregory Nutt
0951151c33
libs/libc/pthread, syscall/, and include/sys/syscall.h: Support for pthread_mutex_timedlock() was added recently, however no new system call was added for the API make is usable only in the FLAT build. With a pthread_mutex_timedlock() system call, there is no reason for a pthread_mutex_lock() system call since it is now nothing more than an wrapper around pthread_mutex_timedlock(), passing NULL for the time value. The pthread_mutex_lock() syscall was removed and the pthread_mutex_lock() implemented was moved from /sched/pthread to where it now belows in libs/libc/pthread.
2019-02-25 18:19:13 -06:00
Gregory Nutt
40889daf97
libs/libc/stdio/lib_libvsprintf.c and include/limits.h: Some minor corrections.
2019-02-21 14:52:44 -06:00
Gregory Nutt
d7586c27a5
libs/libc/stdio/Kconfig: Add 'range 9 999999' to CONFIG_LIBC_NL_ARGMAX. Per OpenGroup.org, the minimum value for NL_ARGMAX is 9.
2019-02-21 14:04:46 -06:00
Gregory Nutt
533fd0636e
libs/libc/lib_libvsprintf.c and Kconfig: Remove CONFIG_LIBC_PRINT_MINIMAL. The output in that configuration is unsatisfactory and inappropriate for use with NuttX. For example, the output from many NSH commands become corrupted and useless. Doesn't belong in this context.
2019-02-21 13:53:34 -06:00