We now have a working fcntl() function.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9202 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
d6571884c7
commit
d590ff3d36
|
@ -1,18 +1,37 @@
|
|||
/*
|
||||
** Copyright 2003, Axel Dörfler, axeld@pinc-software.de. All rights reserved.
|
||||
** Distributed under the terms of the OpenBeOS License.
|
||||
** Copyright 2003-2004, Axel Dörfler, axeld@pinc-software.de. All rights reserved.
|
||||
** Distributed under the terms of the Haiku License.
|
||||
*/
|
||||
|
||||
|
||||
#include <unistd.h>
|
||||
#include <fcntl.h>
|
||||
#include <stdarg.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include <syscalls.h>
|
||||
|
||||
|
||||
#define RETURN_AND_SET_ERRNO(err) \
|
||||
if (err < 0) { \
|
||||
errno = err; \
|
||||
return -1; \
|
||||
} \
|
||||
return err;
|
||||
|
||||
|
||||
int
|
||||
fcntl(int fd, int op, ...)
|
||||
{
|
||||
// ToDo: implement me!
|
||||
return 0;
|
||||
status_t status;
|
||||
uint32 argument;
|
||||
va_list args;
|
||||
|
||||
va_start(args, op);
|
||||
argument = va_arg(args, uint32);
|
||||
va_end(args);
|
||||
|
||||
status = _kern_fcntl(fd, op, argument);
|
||||
|
||||
RETURN_AND_SET_ERRNO(status)
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue