Added missing times() function (almost empty stub implementation).

Implemented uio.h functions: readv/writev[_pos]().


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9770 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler 2004-11-03 15:05:35 +00:00
parent f0dd6fc2c8
commit c89cbee2cf
3 changed files with 81 additions and 0 deletions

View File

@ -11,6 +11,8 @@ KernelMergeObject posix_sys.o :
select.c
stat.c
sysctl.c
times.c
uio.c
umask.c
wait.c
: -fPIC -DPIC

View File

@ -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 <OS.h>
#include <sys/times.h>
#include <time.h>
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;
}

View File

@ -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 <syscalls.h>
#include <sys/uio.h>
#include <errno.h>
#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);
}