Changeset 8b863a62 in mainline for uspace/lib/posix/source
- Timestamp:
- 2014-04-16T17:14:06Z (12 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- f857e8b
- Parents:
- dba3e2c (diff), 70b570c (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)links above to see all the changes relative to each parent. - Location:
- uspace/lib/posix/source
- Files:
-
- 4 added
- 1 deleted
- 20 edited
- 1 moved
-
ctype.c (modified) (1 diff)
-
errno.c (modified) (2 diffs)
-
fcntl.c (modified) (1 diff)
-
fnmatch.c (modified) (1 diff)
-
getopt.c (modified) (1 diff)
-
internal/common.h (modified) (1 diff)
-
locale.c (modified) (1 diff)
-
math.c (deleted)
-
pthread/condvar.c (added)
-
pthread/keys.c (added)
-
pthread/mutex.c (added)
-
pthread/threads.c (added)
-
pwd.c (modified) (1 diff)
-
signal.c (modified) (1 diff)
-
stdio.c (modified) (2 diffs)
-
stdio/scanf.c (modified) (1 diff)
-
stdlib.c (modified) (5 diffs)
-
stdlib/strtol.c (modified) (1 diff)
-
stdlib/strtold.c (modified) (1 diff)
-
string.c (modified) (1 diff)
-
strings.c (modified) (1 diff)
-
sys/mman.c (moved) (moved from uspace/lib/c/generic/mman.c ) (3 diffs)
-
sys/stat.c (modified) (1 diff)
-
sys/wait.c (modified) (1 diff)
-
time.c (modified) (2 diffs)
-
unistd.c (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/posix/source/ctype.c
rdba3e2c r8b863a62 35 35 36 36 #define LIBPOSIX_INTERNAL 37 #define __POSIX_DEF__(x) posix_##x 37 38 38 39 #include "posix/ctype.h" -
uspace/lib/posix/source/errno.c
rdba3e2c r8b863a62 32 32 /** @file System error numbers. 33 33 */ 34 #define LIBPOSIX_INTERNAL 35 #define __POSIX_DEF__(x) posix_##x 34 36 35 37 #include "posix/errno.h" … … 43 45 { 44 46 if (*__errno() != 0) { 45 _posix_errno = abs(*__errno());47 _posix_errno = posix_abs(*__errno()); 46 48 *__errno() = 0; 47 49 } -
uspace/lib/posix/source/fcntl.c
rdba3e2c r8b863a62 34 34 35 35 #define LIBPOSIX_INTERNAL 36 #define __POSIX_DEF__(x) posix_##x 36 37 37 38 #include "internal/common.h" -
uspace/lib/posix/source/fnmatch.c
rdba3e2c r8b863a62 43 43 44 44 #define LIBPOSIX_INTERNAL 45 #define __POSIX_DEF__(x) posix_##x 45 46 46 47 #include "libc/stdbool.h" -
uspace/lib/posix/source/getopt.c
rdba3e2c r8b863a62 33 33 */ 34 34 #define LIBPOSIX_INTERNAL 35 #define __POSIX_DEF__(x) posix_##x 35 36 36 37 #include "internal/common.h" -
uspace/lib/posix/source/internal/common.h
rdba3e2c r8b863a62 39 39 #include <stdlib.h> 40 40 41 #define not_implemented() (fprintf(stderr, \ 42 "Function %s() in file %s at line %d is not implemented\n", \ 43 __func__, __FILE__, __LINE__), abort()) 41 #define not_implemented() do { \ 42 static int __not_implemented_counter = 0; \ 43 if (__not_implemented_counter == 0) { \ 44 fprintf(stderr, "%s() not implemented in %s:%d, something will NOT work.\n", \ 45 __func__, __FILE__, __LINE__); \ 46 } \ 47 __not_implemented_counter++; \ 48 } while (0) 44 49 45 50 /* A little helper macro to avoid typing this over and over. */ -
uspace/lib/posix/source/locale.c
rdba3e2c r8b863a62 34 34 35 35 #define LIBPOSIX_INTERNAL 36 #define __POSIX_DEF__(x) posix_##x 36 37 37 38 #include "internal/common.h" -
uspace/lib/posix/source/pwd.c
rdba3e2c r8b863a62 34 34 35 35 #define LIBPOSIX_INTERNAL 36 #define __POSIX_DEF__(x) posix_##x 36 37 37 38 #include "libc/stdbool.h" -
uspace/lib/posix/source/signal.c
rdba3e2c r8b863a62 34 34 35 35 #define LIBPOSIX_INTERNAL 36 #define __POSIX_DEF__(x) posix_##x 36 37 37 38 #include "posix/signal.h" -
uspace/lib/posix/source/stdio.c
rdba3e2c r8b863a62 35 35 36 36 #define LIBPOSIX_INTERNAL 37 #define __POSIX_DEF__(x) posix_##x 37 38 38 39 #include "internal/common.h" … … 308 309 } 309 310 310 struct _posix_fpos {311 off64_t offset;312 };313 314 311 /** Restores stream a to position previously saved with fgetpos(). 315 312 * -
uspace/lib/posix/source/stdio/scanf.c
rdba3e2c r8b863a62 34 34 35 35 #define LIBPOSIX_INTERNAL 36 #define __POSIX_DEF__(x) posix_##x 36 37 37 38 #include "posix/assert.h" -
uspace/lib/posix/source/stdlib.c
rdba3e2c r8b863a62 35 35 36 36 #define LIBPOSIX_INTERNAL 37 #define __POSIX_DEF__(x) posix_##x 37 38 38 39 #include "internal/common.h" … … 62 63 // TODO: low priority, just a compile-time dependency of binutils 63 64 not_implemented(); 65 return 0; 64 66 } 65 67 … … 231 233 // TODO: low priority, just a compile-time dependency of binutils 232 234 not_implemented(); 235 return 0; 233 236 } 234 237 … … 243 246 int posix_system(const char *string) { 244 247 // TODO: does nothing at the moment 248 not_implemented(); 245 249 return 0; 246 250 } … … 387 391 free(ptr); 388 392 } 393 } 394 395 /** 396 * Generate a pseudo random integer in the range 0 to RAND_MAX inclusive. 397 * 398 * @return The pseudo random integer. 399 */ 400 int posix_rand(void) 401 { 402 return (int) random(); 403 } 404 405 /** 406 * Initialize a new sequence of pseudo-random integers. 407 * 408 * @param seed The seed of the new sequence. 409 */ 410 void posix_srand(unsigned int seed) 411 { 412 srandom(seed); 389 413 } 390 414 -
uspace/lib/posix/source/stdlib/strtol.c
rdba3e2c r8b863a62 34 34 35 35 #define LIBPOSIX_INTERNAL 36 #define __POSIX_DEF__(x) posix_##x 36 37 37 38 #include "../internal/common.h" -
uspace/lib/posix/source/stdlib/strtold.c
rdba3e2c r8b863a62 34 34 35 35 #define LIBPOSIX_INTERNAL 36 #define __POSIX_DEF__(x) posix_##x 36 37 37 38 #include "../internal/common.h" -
uspace/lib/posix/source/string.c
rdba3e2c r8b863a62 35 35 36 36 #define LIBPOSIX_INTERNAL 37 #define __POSIX_DEF__(x) posix_##x 37 38 38 39 #include "internal/common.h" -
uspace/lib/posix/source/strings.c
rdba3e2c r8b863a62 35 35 36 36 #define LIBPOSIX_INTERNAL 37 #define __POSIX_DEF__(x) posix_##x 37 38 38 39 #include "internal/common.h" -
uspace/lib/posix/source/sys/mman.c
rdba3e2c r8b863a62 27 27 */ 28 28 29 /** @addtogroup lib c29 /** @addtogroup libposix 30 30 * @{ 31 31 */ … … 33 33 */ 34 34 35 #include <sys/mman.h> 36 #include <sys/types.h> 37 #include <as.h> 38 #include <unistd.h> 35 #define LIBPOSIX_INTERNAL 36 #define __POSIX_DEF__(x) posix_##x 39 37 40 void *mmap(void *start, size_t length, int prot, int flags, int fd, 41 aoff64_t offset) 38 #include "../internal/common.h" 39 #include <posix/sys/mman.h> 40 #include <posix/sys/types.h> 41 #include <libc/as.h> 42 #include <posix/unistd.h> 43 44 void *posix_mmap(void *start, size_t length, int prot, int flags, int fd, 45 __POSIX_DEF__(off_t) offset) 42 46 { 43 47 if (!start) … … 53 57 } 54 58 55 int munmap(void *start, size_t length)59 int posix_munmap(void *start, size_t length) 56 60 { 57 61 return as_area_destroy(start); -
uspace/lib/posix/source/sys/stat.c
rdba3e2c r8b863a62 35 35 36 36 #define LIBPOSIX_INTERNAL 37 #define __POSIX_DEF__(x) posix_##x 37 38 38 39 #include "../internal/common.h" -
uspace/lib/posix/source/sys/wait.c
rdba3e2c r8b863a62 35 35 36 36 #define LIBPOSIX_INTERNAL 37 #define __POSIX_DEF__(x) posix_##x 37 38 38 39 #include "../internal/common.h" -
uspace/lib/posix/source/time.c
rdba3e2c r8b863a62 35 35 36 36 #define LIBPOSIX_INTERNAL 37 #define __POSIX_DEF__(x) posix_##x 37 38 38 39 #include "internal/common.h" … … 73 74 posix_daylight = 0; 74 75 posix_timezone = 0; 76 } 77 78 /** 79 * Get the time in seconds 80 * 81 * @param t If t is non-NULL, the return value is also stored in the memory 82 * pointed to by t. 83 * @return On success, the value of time in seconds since the Epoch 84 * is returned. On error, (time_t)-1 is returned. 85 */ 86 time_t posix_time(time_t *t) 87 { 88 return time(t); 75 89 } 76 90 -
uspace/lib/posix/source/unistd.c
rdba3e2c r8b863a62 35 35 36 36 #define LIBPOSIX_INTERNAL 37 #define __POSIX_DEF__(x) posix_##x 37 38 38 39 #include "internal/common.h" … … 220 221 { 221 222 return errnify(write, fildes, buf, nbyte); 223 } 224 225 /** 226 * Reposition read/write file offset 227 * 228 * @param fildes File descriptor of the opened file. 229 * @param offset New offset in the file. 230 * @param whence The position from which the offset argument is specified. 231 * @return Upon successful completion, returns the resulting offset 232 * as measured in bytes from the beginning of the file, -1 otherwise. 233 */ 234 posix_off_t posix_lseek(int fildes, posix_off_t offset, int whence) 235 { 236 return errnify(lseek, fildes, offset, whence); 222 237 } 223 238 … … 374 389 // TODO: low priority, just a compile-time dependency of binutils 375 390 not_implemented(); 391 return -1; 376 392 } 377 393 … … 384 400 // TODO: low priority, just a compile-time dependency of binutils 385 401 not_implemented(); 402 return -1; 386 403 } 387 404 … … 396 413 // TODO: low priority, just a compile-time dependency of binutils 397 414 not_implemented(); 415 return -1; 398 416 } 399 417 … … 408 426 // TODO: low priority, just a compile-time dependency of binutils 409 427 not_implemented(); 428 return -1; 410 429 } 411 430 … … 419 438 // TODO: low priority, just a compile-time dependency of binutils 420 439 not_implemented(); 440 return -1; 441 } 442 443 unsigned int posix_alarm(unsigned int seconds) 444 { 445 not_implemented(); 446 return 0; 421 447 } 422 448
Note:
See TracChangeset
for help on using the changeset viewer.
