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:
parent
f0dd6fc2c8
commit
c89cbee2cf
@ -11,6 +11,8 @@ KernelMergeObject posix_sys.o :
|
|||||||
select.c
|
select.c
|
||||||
stat.c
|
stat.c
|
||||||
sysctl.c
|
sysctl.c
|
||||||
|
times.c
|
||||||
|
uio.c
|
||||||
umask.c
|
umask.c
|
||||||
wait.c
|
wait.c
|
||||||
: -fPIC -DPIC
|
: -fPIC -DPIC
|
||||||
|
24
src/kernel/libroot/posix/sys/times.c
Normal file
24
src/kernel/libroot/posix/sys/times.c
Normal 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;
|
||||||
|
}
|
||||||
|
|
55
src/kernel/libroot/posix/sys/uio.c
Normal file
55
src/kernel/libroot/posix/sys/uio.c
Normal 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);
|
||||||
|
}
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user