From 6bcace62a8d07b89a4929666b261e68a0bded207 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Tue, 14 Feb 2017 07:48:54 -0600 Subject: [PATCH] Update some C++ header files --- TODO | 13 ++--------- include/cxx/cstdio | 4 +++- include/cxx/cstdlib | 15 ++++++++++++- include/cxx/cstring | 5 ++++- include/cxx/cunistd | 54 ++++++++++++++++++++++++++++++++++++++++++++- 5 files changed, 76 insertions(+), 15 deletions(-) diff --git a/TODO b/TODO index 6cf10cf15e..7ff5d64d62 100644 --- a/TODO +++ b/TODO @@ -23,7 +23,7 @@ nuttx/: (4) USB (drivers/usbdev, drivers/usbhost) (0) Other drivers (drivers/) (12) Libraries (libc/, libm/) - (11) File system/Generic drivers (fs/, drivers/) + (10) File system/Generic drivers (fs/, drivers/) (9) Graphics Subsystem (graphics/) (2) Build system / Toolchains (3) Linux/Cywgin simulation (arch/sim) @@ -1463,7 +1463,7 @@ o File system / Generic drivers (fs/, drivers/) file descriptors could lie in the same range. Another example of how the current implementation limits - functionality: I recently started an implement of the FILEMAX + functionality: I recently started to implement of the FILEMAX (using pctl() instead sysctl()). My objective was to be able to control the number of available file descriptors on a task- by-task basis. The complexity due to the partitioning of @@ -1495,15 +1495,6 @@ o File system / Generic drivers (fs/, drivers/) Status: Open Priority: Low - Title: FAT LONG FILENAME COMPATIBILITY - Description: Recently there have been reports that file with long file - names created by NuttX don't have long file names when viewed - on Windows. The long file name support has been around for a - long time and I don't ever having seen this before so I am - suspecting that some evil has crept in. - Status: Open - Priority: Medium - Title: MISSING FILES IN NSH 'LS' OF A DIRECTORY Description: I have seen cases where (1) long file names are enabled, but (2) a short file name is created like: diff --git a/include/cxx/cstdio b/include/cxx/cstdio index 0074091a2f..e10311ae57 100644 --- a/include/cxx/cstdio +++ b/include/cxx/cstdio @@ -1,7 +1,7 @@ //*************************************************************************** // include/cxx/cstdio // -// Copyright (C) 2009, 2014 Gregory Nutt. All rights reserved. +// Copyright (C) 2009, 2014, 2017 Gregory Nutt. All rights reserved. // Author: Gregory Nutt // // Redistribution and use in source and binary forms, with or without @@ -69,6 +69,7 @@ namespace std using ::fputc; using ::fputs; using ::fread; + using ::freopen; using ::fseek; using ::fsetpos; using ::ftell; @@ -105,6 +106,7 @@ namespace std using ::tmpnam; using ::tempnam; + using ::remove; } #endif // __INCLUDE_CXX_CSTDIO diff --git a/include/cxx/cstdlib b/include/cxx/cstdlib index 65c200672a..ec632ed054 100644 --- a/include/cxx/cstdlib +++ b/include/cxx/cstdlib @@ -1,7 +1,7 @@ //*************************************************************************** // include/cxx/cstdlib // -// Copyright (C) 2009, 2012, 2015-2016 Gregory Nutt. All rights reserved. +// Copyright (C) 2009, 2012, 2015-2017 Gregory Nutt. All rights reserved. // Author: Gregory Nutt // // Redistribution and use in source and binary forms, with or without @@ -90,12 +90,25 @@ namespace std using ::strtoll; using ::strtoull; #endif + using ::strtof; +#ifdef CONFIG_HAVE_DOUBLE using ::strtod; +#endif +#ifdef CONFIG_HAVE_LONG_DOUBLE + using ::strtold; +#endif // Binary to string conversions using ::itoa; + // Wide character operations + +#ifdef CONFIG_LIBC_WCHAR + using ::mbtowc; + using ::wctomb; +#endif + // Memory Management using ::malloc; diff --git a/include/cxx/cstring b/include/cxx/cstring index 84d98277d2..a79dfbc204 100644 --- a/include/cxx/cstring +++ b/include/cxx/cstring @@ -1,7 +1,7 @@ //*************************************************************************** // include/cxx/cstring // -// Copyright (C) 2009-2012 Gregory Nutt. All rights reserved. +// Copyright (C) 2009-2012, 2017 Gregory Nutt. All rights reserved. // Author: Gregory Nutt // // Redistribution and use in source and binary forms, with or without @@ -62,6 +62,8 @@ namespace std using ::strncmp; using ::strcasecmp; using ::strncasecmp; + using ::strcoll; + using ::stpcpy; using ::strcpy; using ::strncpy; using ::strpbrk; @@ -73,6 +75,7 @@ namespace std using ::strcasestr; using ::strtok; using ::strtok_r; + using ::strxfrm; using ::memchr; using ::memccpy; diff --git a/include/cxx/cunistd b/include/cxx/cunistd index be1d2d5cfe..1fe7293137 100644 --- a/include/cxx/cunistd +++ b/include/cxx/cunistd @@ -1,7 +1,7 @@ //*************************************************************************** // include/cxx/cunistd // -// Copyright (C) 2012 Gregory Nutt. All rights reserved. +// Copyright (C) 2012, 2017 Gregory Nutt. All rights reserved. // Author: Gregory Nutt // // Redistribution and use in source and binary forms, with or without @@ -48,10 +48,17 @@ namespace std { + // Task control interfaces + + using ::vfork; using ::getpid; using ::_exit; using ::sleep; using ::usleep; + using ::pause; + + // File descriptor opertions +` using ::close; using ::dup; using ::dup2; @@ -61,15 +68,60 @@ namespace std using ::write; using ::pread; using ::pwrite; + + // Terminal I/O + + using ::isatty; + + // Memory management + +#if defined(CONFIG_ARCH_ADDRENV) && defined(CONFIG_MM_PGALLOC) && \ + defined(CONFIG_ARCH_USE_MMU) + using sbrk; +#endif + + // Special devices + using ::pipe; + + // Operations on working directories + using ::chdir; using ::getcwd; + + // Operations on file paths + + using ::access; using ::unlink; using ::rmdir; +#ifdef CONFIG_PSEUDOFS_SOFTLINKS + using ::link; + using ::readlink; +#endif + + // Execution of program files + +#ifdef CONFIG_LIBC_EXECFUNCS + using ::execl; + using ::execv; +#endif + + // Other + using ::getopt; + + // Non-standard accessor functions + using ::getoptargp; using ::getoptindp; using ::getoptoptp; + + // Networking + +#ifdef CONFIG_NET + using ::gethostname; + using ::sethostname; +#endif } #endif // __INCLUDE_CXX_CUNISTD