diff --git a/src/kernel/libroot/posix/sys/Jamfile b/src/kernel/libroot/posix/sys/Jamfile index d9f6cd7492..5c3ec8cb11 100644 --- a/src/kernel/libroot/posix/sys/Jamfile +++ b/src/kernel/libroot/posix/sys/Jamfile @@ -11,6 +11,8 @@ KernelMergeObject posix_sys.o : select.c stat.c sysctl.c + times.c + uio.c umask.c wait.c : -fPIC -DPIC diff --git a/src/kernel/libroot/posix/sys/times.c b/src/kernel/libroot/posix/sys/times.c new file mode 100644 index 0000000000..e43d0ac758 --- /dev/null +++ b/src/kernel/libroot/posix/sys/times.c @@ -0,0 +1,24 @@ +/* +** Copyright 2004, Axel Dörfler, axeld@pinc-software.de. All rights reserved. +** Distributed under the terms of the Haiku License. +*/ + + +#include + +#include +#include + + +clock_t +times(struct tms *buffer) +{ + // ToDo: get some real values here! + buffer->tms_utime = 0; + buffer->tms_stime = 0; + buffer->tms_cutime = 0; + buffer->tms_cstime = 0; + + return real_time_clock() * CLK_TCK; +} + diff --git a/src/kernel/libroot/posix/sys/uio.c b/src/kernel/libroot/posix/sys/uio.c new file mode 100644 index 0000000000..77eb2e1d7f --- /dev/null +++ b/src/kernel/libroot/posix/sys/uio.c @@ -0,0 +1,55 @@ +/* +** Copyright 2004, Axel Dörfler, axeld@pinc-software.de. All rights reserved. +** Distributed under the terms of the Haiku License. +*/ + + +#include + +#include +#include + + +#define RETURN_AND_SET_ERRNO(err) \ + if (err < 0) { \ + errno = err; \ + return -1; \ + } \ + return err; + + +ssize_t +readv(int fd, const struct iovec *vecs, size_t count) +{ + ssize_t bytes = _kern_readv(fd, -1, vecs, count); + + RETURN_AND_SET_ERRNO(bytes); +} + + +ssize_t +readv_pos(int fd, off_t pos, const struct iovec *vecs, size_t count) +{ + ssize_t bytes = _kern_readv(fd, pos, vecs, count); + + RETURN_AND_SET_ERRNO(bytes); +} + + +ssize_t +writev(int fd, const struct iovec *vecs, size_t count) +{ + ssize_t bytes = _kern_writev(fd, -1, vecs, count); + + RETURN_AND_SET_ERRNO(bytes); +} + + +ssize_t +writev_pos(int fd, off_t pos, const struct iovec *vecs, size_t count) +{ + ssize_t bytes = _kern_writev(fd, pos, vecs, count); + + RETURN_AND_SET_ERRNO(bytes); +} +