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:
Axel Dörfler 2004-10-05 13:40:13 +00:00
parent d6571884c7
commit d590ff3d36
1 changed files with 24 additions and 5 deletions

View File

@ -1,18 +1,37 @@
/* /*
** Copyright 2003, Axel Dörfler, axeld@pinc-software.de. All rights reserved. ** Copyright 2003-2004, Axel Dörfler, axeld@pinc-software.de. All rights reserved.
** Distributed under the terms of the OpenBeOS License. ** Distributed under the terms of the Haiku License.
*/ */
#include <unistd.h>
#include <fcntl.h> #include <fcntl.h>
#include <stdarg.h>
#include <errno.h>
#include <syscalls.h> #include <syscalls.h>
#define RETURN_AND_SET_ERRNO(err) \
if (err < 0) { \
errno = err; \
return -1; \
} \
return err;
int int
fcntl(int fd, int op, ...) fcntl(int fd, int op, ...)
{ {
// ToDo: implement me! status_t status;
return 0; 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)
} }