Changeset 1433ecda in mainline for uspace/lib/posix/src
- Timestamp:
- 2018-04-04T15:42:37Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 2c4e1cc
- Parents:
- 47b2d7e3
- Location:
- uspace/lib/posix/src
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/posix/src/internal/common.h
r47b2d7e3 r1433ecda 56 56 * If so, writes the error code to errno and returns true. 57 57 */ 58 static inline bool failed(int rc) { 58 static inline bool failed(int rc) 59 { 59 60 if (rc != EOK) { 60 61 errno = rc; -
uspace/lib/posix/src/pthread/keys.c
r47b2d7e3 r1433ecda 57 57 } 58 58 59 int pthread_key_create(pthread_key_t *key, void (*destructor)(void *))59 int pthread_key_create(pthread_key_t *key, void (*destructor)(void *)) 60 60 { 61 61 not_implemented(); -
uspace/lib/posix/src/pwd.c
r47b2d7e3 r1433ecda 163 163 164 164 static const char bf[] = { 'u', 's', 'e', 'r', '\0', 165 165 '/', '\0', 'b', 'd', 's', 'h', '\0' }; 166 166 167 167 if (uid != 0) { -
uspace/lib/posix/src/stdio.c
r47b2d7e3 r1433ecda 63 63 // TODO: return a real terminal path 64 64 65 static char dummy_path[L_ctermid] = { '\0'};65 static char dummy_path[L_ctermid] = { '\0' }; 66 66 67 67 if (s == NULL) { -
uspace/lib/posix/src/stdio/scanf.c
r47b2d7e3 r1433ecda 95 95 int (*undo)(struct __input_provider *); 96 96 /** Lend the cursor to the caller. */ 97 const char * 97 const char *(*borrow_cursor)(struct __input_provider *); 98 98 /** Take control over possibly incremented cursor and update the internal 99 99 * structures if necessary. */ … … 1001 1001 } 1002 1002 1003 char * 1003 char *buf = NULL; 1004 1004 size_t buf_size = 0; 1005 char * 1005 char *cur = NULL; 1006 1006 size_t alloc_step = 80; /* Buffer size gain during reallocation. */ 1007 1007 int my_buffer_idx = 0; … … 1216 1216 { 1217 1217 _input_provider provider = { 1218 1219 1220 1218 { 0 }, 0, 0, NULL, 0, NULL, _PROV_CONSTRUCTED, 1219 _capture_stream, _pop_stream, _undo_stream, 1220 _borrow_cursor_universal, _return_cursor_stream, _release_stream 1221 1221 }; 1222 1222 provider.source.stream = stream; … … 1236 1236 { 1237 1237 _input_provider provider = { 1238 1239 1240 1238 { 0 }, 0, 0, NULL, 0, NULL, _PROV_CONSTRUCTED, 1239 _capture_string, _pop_string, _undo_string, 1240 _borrow_cursor_universal, _return_cursor_string, _release_string 1241 1241 }; 1242 1242 provider.source.string = s; -
uspace/lib/posix/src/stdlib.c
r47b2d7e3 r1433ecda 204 204 * or not (zero). 205 205 */ 206 int system(const char *string) { 206 int system(const char *string) 207 { 207 208 // TODO: does nothing at the moment 208 209 not_implemented(); … … 222 223 char *realpath(const char *restrict name, char *restrict resolved) 223 224 { 224 225 226 225 #ifndef PATH_MAX 226 assert(resolved == NULL); 227 #endif 227 228 228 229 if (name == NULL) { … … 238 239 * to be updated when that support is implemented. 239 240 */ 240 char *absolute = vfs_absolutize(name, NULL);241 char *absolute = vfs_absolutize(name, NULL); 241 242 242 243 if (absolute == NULL) { … … 252 253 return absolute; 253 254 } else { 254 255 256 255 #ifdef PATH_MAX 256 str_cpy(resolved, PATH_MAX, absolute); 257 #endif 257 258 free(absolute); 258 259 return resolved; -
uspace/lib/posix/src/stdlib/strtold.c
r47b2d7e3 r1433ecda 51 51 52 52 #ifndef HUGE_VALL 53 53 #define HUGE_VALL (+1.0l / +0.0l) 54 54 #endif 55 55 56 56 #ifndef abs 57 57 #define abs(x) (((x) < 0) ? -(x) : (x)) 58 58 #endif 59 59 60 60 /* If the constants are not defined, use double precision as default. */ 61 61 #ifndef LDBL_MANT_DIG 62 62 #define LDBL_MANT_DIG 53 63 63 #endif 64 64 #ifndef LDBL_MAX_EXP 65 65 #define LDBL_MAX_EXP 1024 66 66 #endif 67 67 #ifndef LDBL_MIN_EXP 68 68 #define LDBL_MIN_EXP (-1021) 69 69 #endif 70 70 #ifndef LDBL_DIG 71 71 #define LDBL_DIG 15 72 72 #endif 73 73 #ifndef LDBL_MIN 74 74 #define LDBL_MIN 2.2250738585072014E-308 75 75 #endif 76 76 -
uspace/lib/posix/src/string.c
r47b2d7e3 r1433ecda 198 198 assert(src != NULL); 199 199 200 unsigned char *bdest = dest;201 const unsigned char *bsrc = src;200 unsigned char *bdest = dest; 201 const unsigned char *bsrc = src; 202 202 203 203 for (size_t i = 0; i < n; ++i) { … … 458 458 j = prefix_table[j]; 459 459 } 460 i++; j++; 460 i++; 461 j++; 461 462 prefix_table[i] = j; 462 463 } … … 518 519 519 520 /* Skip over leading delimiters. */ 520 while (*s && (strchr(delim, *s) != NULL)) ++s; 521 while (*s && (strchr(delim, *s) != NULL)) 522 ++s; 521 523 start = s; 522 524 523 525 /* Skip over token characters. */ 524 while (*s && (strchr(delim, *s) == NULL)) ++s; 526 while (*s && (strchr(delim, *s) == NULL)) 527 ++s; 525 528 end = s; 526 529 *next = (*s ? s + 1 : s); -
uspace/lib/posix/src/sys/wait.c
r47b2d7e3 r1433ecda 45 45 #include "posix/signal.h" 46 46 47 int __posix_wifexited(int status) { 47 int __posix_wifexited(int status) 48 { 48 49 return status != INT_MIN; 49 50 } 50 51 51 int __posix_wexitstatus(int status) { 52 int __posix_wexitstatus(int status) 53 { 52 54 assert(__posix_wifexited(status)); 53 55 return status; 54 56 } 55 57 56 int __posix_wifsignaled(int status) { 58 int __posix_wifsignaled(int status) 59 { 57 60 return status == INT_MIN; 58 61 } 59 62 60 int __posix_wtermsig(int status) { 63 int __posix_wtermsig(int status) 64 { 61 65 assert(__posix_wifsignaled(status)); 62 66 /* There is no way to distinguish reason
Note:
See TracChangeset
for help on using the changeset viewer.