Renamed VFS syscalls to the new style.

Improved returned types.
Removed dup2.c.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@7976 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler 2004-06-15 15:42:17 +00:00
parent b8599dec8e
commit b1753651c6
11 changed files with 42 additions and 42 deletions

View File

@ -7,7 +7,6 @@ KernelMergeObject posix_unistd.o :
<$(SOURCE_GRIST)>conf.c
<$(SOURCE_GRIST)>directory.c
<$(SOURCE_GRIST)>dup.c
<$(SOURCE_GRIST)>dup2.c
<$(SOURCE_GRIST)>fcntl.c
<$(SOURCE_GRIST)>getopt.c
<$(SOURCE_GRIST)>hostname.c
@ -37,7 +36,6 @@ MergeObjectFromObjects kernel_posix_unistd.o :
<$(SOURCE_GRIST)>conf.o
<$(SOURCE_GRIST)>directory.o
<$(SOURCE_GRIST)>dup.o
<$(SOURCE_GRIST)>dup2.o
<$(SOURCE_GRIST)>fcntl.o
<$(SOURCE_GRIST)>hostname.o
<$(SOURCE_GRIST)>ioctl.o

View File

@ -1,5 +1,5 @@
/*
** Copyright 2002, Axel Dörfler, axeld@pinc-software.de. All rights reserved.
** Copyright 2002-2004, Axel Dörfler, axeld@pinc-software.de. All rights reserved.
** Distributed under the terms of the OpenBeOS License.
*/
@ -20,7 +20,7 @@
int
access(const char *path, int accessMode)
{
status_t status = sys_access(path, accessMode);
status_t status = _kern_access(path, accessMode);
RETURN_AND_SET_ERRNO(status);
}

View File

@ -3,14 +3,16 @@
** Distributed under the terms of the NewOS License.
*/
#include <unistd.h>
#include <syscalls.h>
#include <errno.h>
int close(int fd)
{
int retval = sys_close(fd);
int
close(int fd)
{
int retval = _kern_close(fd);
if (retval < 0) {
errno = retval;
retval = -1;

View File

@ -29,7 +29,7 @@ opendir(const char *path)
{
DIR *dir;
int fd = sys_open_dir(path);
int fd = _kern_open_dir(path);
if (fd < 0) {
errno = fd;
return NULL;
@ -38,7 +38,7 @@ opendir(const char *path)
/* allocate the memory for the DIR structure */
if ((dir = (DIR *)malloc(sizeof(DIR) + BUFFER_SIZE)) == NULL) {
errno = B_NO_MEMORY;
sys_close(fd);
_kern_close(fd);
return NULL;
}
@ -51,7 +51,7 @@ opendir(const char *path)
int
closedir(DIR *dir)
{
int status = sys_close(dir->fd);
int status = _kern_close(dir->fd);
free(dir);
@ -66,7 +66,7 @@ readdir(DIR *dir)
* containing the data
*/
ssize_t count = sys_read_dir(dir->fd, &dir->ent, BUFFER_SIZE, 1);
ssize_t count = _kern_read_dir(dir->fd, &dir->ent, BUFFER_SIZE, 1);
if (count <= 0) {
if (count < 0)
errno = count;
@ -81,9 +81,7 @@ readdir(DIR *dir)
void
rewinddir(DIR *dirp)
{
status_t status;
status = sys_rewind_dir(dirp->fd);
status_t status = _kern_rewind_dir(dirp->fd);
if (status < 0)
errno = status;
}
@ -92,7 +90,7 @@ rewinddir(DIR *dirp)
int
chdir(const char *path)
{
int status = sys_setcwd(-1, path);
int status = _kern_setcwd(-1, path);
RETURN_AND_SET_ERRNO(status);
}
@ -101,7 +99,7 @@ chdir(const char *path)
int
fchdir(int fd)
{
int status = sys_setcwd(fd, NULL);
int status = _kern_setcwd(fd, NULL);
RETURN_AND_SET_ERRNO(status);
}
@ -110,7 +108,7 @@ fchdir(int fd)
char *
getcwd(char *buffer, size_t size)
{
int status = sys_getcwd(buffer, size);
int status = _kern_getcwd(buffer, size);
if (status < B_OK) {
errno = status;
return NULL;
@ -122,7 +120,7 @@ getcwd(char *buffer, size_t size)
int
rmdir(const char *path)
{
int status = sys_remove_dir(path);
int status = _kern_remove_dir(path);
RETURN_AND_SET_ERRNO(status);
}

View File

@ -31,7 +31,7 @@ ioctl(int fd, ulong cmd, ...)
size = va_arg(args, size_t);
va_end(args);
status = sys_ioctl(fd, cmd, argument, size);
status = _kern_ioctl(fd, cmd, argument, size);
RETURN_AND_SET_ERRNO(status)
}

View File

@ -1,5 +1,5 @@
/*
** Copyright 2002, Axel Dörfler, axeld@pinc-software.de. All rights reserved.
** Copyright 2002-2004, Axel Dörfler, axeld@pinc-software.de. All rights reserved.
** Distributed under the terms of the OpenBeOS License.
*/
@ -20,7 +20,7 @@
ssize_t
readlink(const char *path, char *buffer, size_t bufferSize)
{
int status = sys_read_link(path, buffer, bufferSize);
int status = _kern_read_link(path, buffer, bufferSize);
RETURN_AND_SET_ERRNO(status);
}
@ -29,7 +29,7 @@ readlink(const char *path, char *buffer, size_t bufferSize)
int
symlink(const char *path, const char *toPath)
{
int status = sys_create_symlink(path, toPath, 0);
int status = _kern_create_symlink(path, toPath, 0);
RETURN_AND_SET_ERRNO(status);
}
@ -38,7 +38,7 @@ symlink(const char *path, const char *toPath)
int
unlink(const char *path)
{
int status = sys_unlink(path);
int status = _kern_unlink(path);
RETURN_AND_SET_ERRNO(status);
}
@ -47,7 +47,7 @@ unlink(const char *path)
int
link(const char *path, const char *toPath)
{
int status = sys_create_link(path, toPath);
int status = _kern_create_link(path, toPath);
RETURN_AND_SET_ERRNO(status);
}

View File

@ -10,5 +10,5 @@
off_t
lseek(int fd, off_t pos, int whence)
{
return sys_seek(fd, pos, whence);
return _kern_seek(fd, pos, whence);
}

View File

@ -1,5 +1,5 @@
/*
** Copyright 2002, Axel Dörfler, axeld@pinc-software.de. All rights reserved.
** Copyright 2002-2004, Axel Dörfler, axeld@pinc-software.de. All rights reserved.
** Distributed under the terms of the OpenBeOS License.
*/
@ -21,7 +21,7 @@ int
mount(const char *filesystem, const char *where, const char *device, ulong flags, void *parms, int len)
{
// ToDo: consider parsing "parms" string in userland
int status = sys_mount(where, device, filesystem/*, flags*/, parms);
int status = _kern_mount(where, device, filesystem/*, flags*/, parms);
(void)len;
@ -32,8 +32,8 @@ mount(const char *filesystem, const char *where, const char *device, ulong flags
int
unmount(const char *path)
{
int status = sys_unmount(path);
int status = _kern_unmount(path);
RETURN_AND_SET_ERRNO(status);
}

View File

@ -1,4 +1,7 @@
/*
** Copyright 2002-2004, Axel Dörfler, axeld@pinc-software.de. All rights reserved.
** Distributed under the terms of the OpenBeOS License.
**
** Copyright 2001, Manuel J. Petit. All rights reserved.
** Distributed under the terms of the NewOS License.
*/
@ -14,7 +17,7 @@
int
creat(const char *path, mode_t mode)
{
int status = sys_create(path, O_CREAT | O_TRUNC | O_WRONLY, mode);
int status = _kern_create(path, O_CREAT | O_TRUNC | O_WRONLY, mode);
if (status < 0) {
errno = status;
@ -36,9 +39,9 @@ open(const char *path, int oflags, ...)
va_end(args);
if (oflags & O_CREAT)
status = sys_create(path, oflags, perms);
status = _kern_create(path, oflags, perms);
else
status = sys_open(path, oflags);
status = _kern_open(path, oflags);
if (status < 0) {
errno = status;

View File

@ -25,7 +25,7 @@
ssize_t
read(int fd, void *buffer, size_t bufferSize)
{
int status = sys_read(fd, -1, buffer, bufferSize);
ssize_t status = _kern_read(fd, -1, buffer, bufferSize);
RETURN_AND_SET_ERRNO(status);
}
@ -34,7 +34,7 @@ read(int fd, void *buffer, size_t bufferSize)
ssize_t
read_pos(int fd, off_t pos, void *buffer, size_t bufferSize)
{
int status = sys_read(fd, pos, buffer, bufferSize);
ssize_t status = _kern_read(fd, pos, buffer, bufferSize);
RETURN_AND_SET_ERRNO(status);
}
@ -43,7 +43,7 @@ read_pos(int fd, off_t pos, void *buffer, size_t bufferSize)
ssize_t
pread(int fd, void *buffer, size_t bufferSize, off_t pos)
{
int status = sys_read(fd, pos, buffer, bufferSize);
ssize_t status = _kern_read(fd, pos, buffer, bufferSize);
RETURN_AND_SET_ERRNO(status);
}

View File

@ -1,12 +1,11 @@
/*
** Copyright 2002-2004, Axel Dörfler, axeld@pinc-software.de. All rights reserved.
** Distributed under the terms of the OpenBeOS License.
**
** Copyright 2001, Manuel J. Petit. All rights reserved.
** Distributed under the terms of the NewOS License.
*/
/*
** Copyright 2002, Axel Dörfler, axeld@pinc-software.de. All rights reserved.
** Distributed under the terms of the OpenBeOS License.
*/
#include <unistd.h>
#include <syscalls.h>
@ -24,7 +23,7 @@
ssize_t
write(int fd, void const *buffer, size_t bufferSize)
{
int status = sys_write(fd, -1, buffer, bufferSize);
int status = _kern_write(fd, -1, buffer, bufferSize);
RETURN_AND_SET_ERRNO(status);
}
@ -33,7 +32,7 @@ write(int fd, void const *buffer, size_t bufferSize)
ssize_t
write_pos(int fd, off_t pos, const void *buffer, size_t bufferSize)
{
int status = sys_write(fd, pos, buffer, bufferSize);
int status = _kern_write(fd, pos, buffer, bufferSize);
RETURN_AND_SET_ERRNO(status);
}
@ -42,7 +41,7 @@ write_pos(int fd, off_t pos, const void *buffer, size_t bufferSize)
ssize_t
pwrite(int fd, const void *buffer, size_t bufferSize, off_t pos)
{
int status = sys_write(fd, pos, buffer, bufferSize);
int status = _kern_write(fd, pos, buffer, bufferSize);
RETURN_AND_SET_ERRNO(status);
}