Commit Graph

738 Commits

Author SHA1 Message Date
Jussi Kivilinna
705185be1e libc/string/lib_vikmemcpy.c: fix 'casting pointer to integer of different size' compiler warnings 2017-05-31 09:33:44 -06:00
Masayuki Ishikawa
6ccc01ad46 netdb: Fix bugs in lib_gethostbynamer.c
This fix sets h_name in struct hostent returned by gethostbyname()

Signed-off-by: Masayuki Ishikawa <masayuki.ishikawa@gmail.com>
2017-05-25 10:59:10 +09:00
Masayuki Ishikawa
2b028bc4e5 netdb: Fix time info in lib_dnscache.c
Signed-off-by: Masayuki Ishikawa <masayuki.ishikawa@gmail.com>
2017-05-23 16:02:41 +09:00
Matias v01d
820ef7059e libc/wchar: Versions mbrlen and mbsrtowcs taken and adapted from FreeBSD code (at https://github.com/freebsd/freebsd/) 2017-05-13 17:07:40 -06:00
Matias v01d
7cc2ee25ec libc/wchar: Versions mbrlen and mbsrtowcs taken and adapted from FreeBSD code (at https://github.com/freebsd/freebsd/) 2017-05-13 17:06:58 -06:00
Gregory Nutt
6e4918c557 Remove CONFIG_ARM_TOOLCHAIN_GNU; replace with CONFIG_ARCH_TOOLCHAIN_GNU 2017-05-13 13:28:15 -06:00
Gregory Nutt
0de294a586 Fix lots of occurrences of 'the the', 'the there', 'the these', 'the then', 'the they. 2017-05-11 13:35:56 -06:00
Jussi Kivilinna
afc46cb7ba fixedmath: add square root and b32_t conversion operators 2017-05-04 06:50:08 -06:00
Gregory Nutt
d5207efb5a Be consistent... Use Name: consistent in function headers vs Function: 2017-04-21 16:33:14 -06:00
Ritajina
eab139a539 libc/netdb: in dns_query_callback, ret != -EADDRNOTAVAIL condition consumes error returns including EAGAIN in this case, dns query retransmission doesn't work 2017-04-12 06:41:08 -06:00
Gregory Nutt
948332ca34 pthreads: Backed most of last pthread changes. Found the 'real' root poblem. A one like error in pthread_mutex.c. 2017-04-10 09:51:03 -06:00
Gregory Nutt
84849cfc5e examples/ostest: pthread rwlock cleanup handlers must call pthread_consistent, not pthread_mutex_unlock() on cancellation if robust mutexes are enabled. 2017-04-10 08:44:08 -06:00
Juha Niskanen
755e9312b5 pthread: use cancel cleanup handlers in rwlock 2017-04-10 07:18:16 -06:00
Mark Schulte
2b1ca79b4b pthread rwlock bugfixes 2017-04-07 15:45:24 -06:00
Gregory Nutt
b631dc886f Remove CONFIG_PTHREAD_RWLOCK. Rwlock interfaces built unconditionally. 2017-04-07 07:34:22 -06:00
Mark Schulte
7bb26d2615 pthreads: Adding rwlock implementation
Adding an implementation for read/write locks into the pthread library.
These locks are writer priority, such that if any writers come in they
are given priority for writing.
2017-04-07 07:03:00 -06:00
Gregory Nutt
1b6630ee75 6loWPAN: Fix compile errors and warnings when building the complete 6loWPAN configuration. 2017-04-02 17:46:22 -06:00
Gregory Nutt
0ded0f5866 Update README and comments 2017-03-30 08:43:07 -06:00
Jussi Kivilinna
dffb8a67e3 Add entropy pool and strong random number generator
Entropy pool gathers environmental noise from device drivers, user-space, etc., and returns good random numbers, suitable for cryptographic use. Based on entropy pool design from *BSDs and uses BLAKE2Xs algorithm for CSPRNG output.

Patch also adds /dev/urandom support for using entropy pool RNG and new 'getrandom' system call for getting randomness without file-descriptor usage (thus avoiding file-descriptor exhaustion attacks). The 'getrandom' interface is similar as 'getentropy' and 'getrandom' available on OpenBSD and Linux respectively.
2017-03-30 07:38:37 -06:00
Gregory Nutt
b07d3fc305 Rename CONFIG_MUTEX_TYPES to CONFIG_PTHREAD_MUTEX_TYPES 2017-03-27 09:08:14 -06:00
Gregory Nutt
d1196ddb60 pthread mutex: Forgot to add files in last commit 2017-03-27 07:49:13 -06:00
Gregory Nutt
666208cf23 pthread mutexes: Add option to support both unsafe and robust mutexes via pthread_mutexattr_get/setrobust(). 2017-03-26 18:37:24 -06:00
Gregory Nutt
bacc4e9b93 Update errno values. Add new values; remove obsolete values 2017-03-26 09:22:00 -06:00
Jussi Kivilinna
d0c54039dc Add ffsl(), ffsll(), fls(), flsl(), flsll() and use GCC's __builtin_ctz/__builtin_clz for faster implementation of these 2017-03-24 09:41:31 -06:00
Jussi Kivilinna
acec5e3199 vsnprintf(): If size is zero, then vsnprintf() should return the size of the required buffer without writing anything. This is same fix that was done for snprintf in 2014 by commit 59846a8fe9. 2017-03-17 17:34:56 -06:00
Jussi Kivilinna
ac0d957f26 libc: printf: fix precision for string formatting. Fixes use of format precision to truncate input string. 2017-03-17 17:32:44 -06:00
Gregory Nutt
360539afac Priority inheritance: When CONFIG_SEM_PREALLOCHOLDERS==0, there is only a single, hard-allocated holder structure. This is problem because in sem_wait() the holder is released, but needs to remain in the holder container until sem_restorebaseprio() is called. The call to sem_restorebaseprio() must be one of the last things the sem_wait() does because it can cause the task to be suspended. If in sem_wait(), a new task gets the semaphore count then it will fail to allocate the holder and will not participate in priority inheritance. This fix is to add two hard-allocated holders in the sem_t structure: One of the old holder and one for the new holder. 2017-03-10 09:30:15 -06:00
Gregory Nutt
769427ed5a pthreads: Fix pthread_mutexattr_init(). It was not initializing the protocol field when priority inheritance is enabled. 2017-03-10 09:24:41 -06:00
Gregory Nutt
ba117284c2 Update some coments. 2017-03-08 14:30:47 -06:00
Alan Carvalho de Assis
d43380d543 Add wcstoull function 2017-03-08 13:28:50 -06:00
Alan Carvalho de Assis
d9bfcfc330 Add mbsnrtowcs wcsnrtombs just returning sucess 2017-03-08 13:24:03 -06:00
Alan Carvalho de Assis
8bc080b7c6 Add swprintf function 2017-03-08 13:00:37 -06:00
Alan Carvalho de Assis
5e3280bba1 C Library: Add wcstod function 2017-03-08 12:52:03 -06:00
Alan Carvalho de Assis
2d1ace3ee5 Add wcstof function 2017-03-08 12:47:23 -06:00
Alan Carvalho de Assis
6e0afb2905 C library: Ad wcstol() and wcstold(). 2017-03-08 12:42:20 -06:00
Alan Carvalho de Assis
2f5024b4a1 Add wcstoul function 2017-03-08 12:32:36 -06:00
Alan Carvalho de Assis
3ccef07863 C library: Add wcstoll function 2017-03-08 12:26:35 -06:00
Gregory Nutt
05a288f2e1 C library: Add strerror_r 2017-03-08 12:14:07 -06:00
Gregory Nutt
f97a99e051 C library: Remove unused static global from lib_dtoa.c 2017-02-26 18:17:08 -06:00
David Sidrane
4692399e18 Fixes warning and file name 2017-02-22 19:19:49 +00:00
Gregory Nutt
4539988d00 Removed CONFIG_LIBC_ARCH_BZERO. bzero() is a deprecated interface. There are no architecture-specific replacements and, if there were, they should replace memset(), not bzero(). 2017-02-22 10:41:49 -06:00
Gregory Nutt
4d23bfd73d Update libc/libc.csv 2017-02-16 16:35:24 -06:00
Gregory Nutt
4f5879f998 C library: Add ffs(). Add strings.h. Move strcasecmp, strncasecmp, bzero, bcmp, and bcopy to where they belong in strings.h.h, not string.h. bzero, bcmp, and bcopy are legacy functions; the contemporary counterparts should be used instead. 2017-02-16 16:10:09 -06:00
Gregory Nutt
2cfbf9c8d8 C library: Add strtoimax and strtoumax. 2017-02-16 15:12:37 -06:00
Gregory Nutt
4ed3ae19d7 Add file that I forgot to add in last commit. Move libc/stdlib/lib_imaxabs.c to inittypes/. 2017-02-16 14:54:35 -06:00
Gregory Nutt
a49b349614 C library: Add swab() 2017-02-16 14:42:27 -06:00
Gregory Nutt
fed9d5a0f8 cunistd: Fix stray single back quote the crept in in last commit. 2017-02-16 11:22:02 -06:00
Gregory Nutt
b4d378adb8 Don't build libc/pthread if pthreasa are disable. Fix a warning in dirent logic if mountpoints are disabled. 2017-02-16 09:53:13 -06:00
Gregory Nutt
1ca0437909 libc/Kconfig: Remove source'ing file twice. Use cleaner dependencies in some menus. 2017-02-10 10:28:34 -06:00
Gregory Nutt
67feda60b2 libc/Kconfig: Use menus vs. comments to better organize the C library menus 2017-02-10 10:04:56 -06:00
Gregory Nutt
de1b68dc4e libc/Kconfig: Break big Kconfig up into separate Kconfig files in each libc subdirectory. 2017-02-10 09:32:55 -06:00
David Sidrane
6295d571ce Minor typos 2017-02-09 22:58:37 +00:00
Gregory Nutt
9946969c6c libc/stdio/Make.defs: the no-flush stubs now need to be built unconditionally 2017-02-09 16:37:17 -06:00
Gregory Nutt
0b4a9539be tools/mkconfig.c: Add logic to keep all of the buffering options in sync. 2017-02-09 16:17:54 -06:00
Gregory Nutt
98d072a1f7 Apparently setvbuf() size can be nonzero with _IONBF. That makes no sense, but is necessary if setbuf() is to work as it is defined at OpenGroup.org. 2017-02-09 15:39:33 -06:00
Gregory Nutt
ffbf6bc9a6 libc/misc/fs_filesem.c references struct file_struct. Should include nuttx/fs/fs.h 2017-02-09 15:16:36 -06:00
Gregory Nutt
c19aa094e1 C Library: Add setbuf() which is a trivial wrapper around setvbuf(). 2017-02-09 15:04:53 -06:00
Gregory Nutt
085dcf92e3 Update Coding Standard and some Kconfig comments. 2017-02-09 12:57:44 -06:00
Gregory Nutt
abcbb24cf2 sem_open(): Fix a compiler error introduced with the setvbuf() changes. 2017-02-09 10:56:12 -06:00
Gregory Nutt
03120aca70 C Library: Clean-up buffer selections in Kconfig 2017-02-09 10:28:18 -06:00
Gregory Nutt
889ff4b01e setvbuf: Fix some compile errors in first build of logic to enable/disable buffering. 2017-02-09 09:53:50 -06:00
Gregory Nutt
1d290c2b37 setvbuf: Add support for disabling I/O buffering. Initially cut; untested. 2017-02-09 09:24:44 -06:00
Gregory Nutt
f126cd9d46 Remove comment about being based on a Newlib implementation. That is not true. This is an original work. 2017-02-08 14:17:25 -06:00
Gregory Nutt
a92887c63d setvbuf: Correct some errors detected by code review. 2017-02-08 14:06:29 -06:00
Gregory Nutt
1393061400 Update some comments 2017-02-08 11:47:12 -06:00
Gregory Nutt
9f859774a1 setvbuf: Add support for configuration of line buffering. 2017-02-08 11:28:24 -06:00
Gregory Nutt
51a14c9b2f C Library: Add a very limited, first step implementation of setvbuf(). This is a collaborative effort. Alan Carvalho de Assis did the initial prototype. 2017-02-08 10:33:18 -06:00
Gregory Nutt
4700499b59 C library: Remove comments blocks before empty sections 2017-02-08 07:55:37 -06:00
Gregory Nutt
e30b2617e3 Shared Libs: Implement module based shared libraries for the PROTECTED mode build 2017-01-29 13:03:53 -06:00
Gregory Nutt
2c45f482b1 Module names are not needed in libc/modlib when the module library is used only for shared library support. 2017-01-29 12:23:24 -06:00
Gregory Nutt
86bdd0a4c7 Modules: Move last of many C files from sched/module to libc/modlib 2017-01-29 11:54:54 -06:00
Gregory Nutt
6da66fb5c8 Modules: Move next five of many C files from sched/module to libc/modlib 2017-01-29 11:17:29 -06:00
Gregory Nutt
5e94dd22bb Modules: Move first five of many C files from sched/module to libc/modlib 2017-01-29 10:05:15 -06:00
Gregory Nutt
00e46b5966 Move gnu-elf.ld from sched/module to libc/modlib. Update paths in Make.defs files to account for new location of file 2017-01-29 09:03:01 -06:00
Gregory Nutt
2717e781f0 libc/modlib: Add build a configuration logic for a shared module library. 2017-01-29 08:55:27 -06:00
Gregory Nutt
3af8da9c48 Fix 'the the' 2017-01-29 07:52:44 -06:00
Gregory Nutt
a06d26e044 Shared libraries: Add a non-standard dllfnc.h function to set the symbol table. 2017-01-23 08:20:24 -06:00
Gregory Nutt
c4acabaa74 In dlopen(), use the basename of the file as the module name 2017-01-22 16:01:03 -06:00
Gregory Nutt
8d52ad9dd6 Shared Libraries: In the FLAT build mode, kernel modules may be used to provide minimal shared library functionality. 2017-01-22 15:33:19 -06:00
Gregory Nutt
2a284a95b1 C library: Add framework that may (or may not) eventually support shared libraries. 2017-01-22 09:14:18 -06:00
Gregory Nutt
ba2b345990 Remove a few remaining use of the obsolteted 'Compilation Switches' program section 2017-01-22 08:57:18 -06:00
Gregory Nutt
b656e371d3 ELF: Move sim and x86 ARM versions of ELF relocation logic to libc/machine 2017-01-21 15:40:51 -06:00
Gregory Nutt
4a8c6a6d2d ELF: Move ARMv6-M, ARMv7-M, and legacy ARM versions of ELF relocation logic to libc/machine 2017-01-21 15:24:25 -06:00
Gregory Nutt
edd9186540 ELF: Move ARMv7-A and ARMv7-R versions of ELF relocation logic to libc/machine 2017-01-21 14:40:26 -06:00
Gregory Nutt
49c39f0999 libc/machine/: Move all ARM subdirectories under a common arm/ sub-directory 2017-01-21 13:43:45 -06:00
Gregory Nutt
7578382890 Add dllfcn.h header file (no implementation of shared objects yet in place). 2017-01-21 13:07:40 -06:00
Gregory Nutt
4346a66ad7 ARM memcpy(): Use DWord vs. HWord offset. ARM 32-bit instructions must be aligned to DWord boundaries and this gives us more range in the jump tables. 2017-01-20 14:53:50 -06:00
Gregory Nutt
2782ce10d3 Update copyright notice. 2017-01-20 14:35:27 -06:00
Gregory Nutt
a8a66667c1 libc: Fix ARMv7-A/R memcpy assembly. 2017-01-20 13:33:50 -06:00
Gregory Nutt
be5ba90d4f Move optimized ARM memcpy functions from arch/arm/src/ to libc/machine/. This is necessary for the PROTECTED and KERNEL build modes. Otherwise, memcpy() will be built in to kernel space and not accessible to applications. 2017-01-20 10:53:46 -06:00
Gregory Nutt
3c4684ef5f Eliminate CONFIG_ARCH_OPTIMIZED_FUNCTIONS. Move options to select architectur-specific C library options from libc/Kconfig to libc/machine/Kconfig and rename. 2017-01-20 09:30:07 -06:00
Gregory Nutt
9cc37d8ee1 Math library optimatizations for FPU only apply to ARMv8 which is not yet supported. 2017-01-20 08:24:59 -06:00
Gregory Nutt
2f8c2b62e1 Correct cloned typographical error in name of Rhombus OS 2017-01-19 12:11:30 -06:00
Gregory Nutt
21746c588f Update Copyright for NuttX adaption 2017-01-19 09:57:16 -06:00
Gregory Nutt
eba03c2590 Math library: Leverage optimized ARM functions from BSD license ARM file. 2017-01-19 09:37:33 -06:00
Gregory Nutt
e3a535f66f Fix verboten C99/C11 construct in sscanf() 2017-01-09 11:23:05 -06:00
Gregory Nutt
bbc16f9aea libc/Kconfig: Correct an error in variable type 2017-01-09 11:15:06 -06:00
Gregory Nutt
81712be04e sscanf: Backs out logic of ca1150ce6c 2017-01-09 10:35:28 -06:00
Gregory Nutt
7fbc3ba1e1 Comments should begin with uppercase letters. 2017-01-09 09:22:46 -06:00
Gregory Nutt
07e832340f dtoa: More white space 2017-01-07 15:13:48 -06:00