Renamed VFS syscalls to the new style.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@7977 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
b1753651c6
commit
b640ca789b
@ -200,7 +200,7 @@ static status_t
|
||||
console_read(void *cookie, off_t pos, void *buf, size_t *len)
|
||||
{
|
||||
/* XXX - optimistic!! */
|
||||
*len = sys_read(keyboard_fd, 0, buf, *len);
|
||||
*len = _kern_read(keyboard_fd, 0, buf, *len);
|
||||
return B_OK;
|
||||
}
|
||||
|
||||
@ -327,7 +327,7 @@ console_dev_init(kernel_args *ka)
|
||||
update_cursor(x, y);
|
||||
|
||||
mutex_init(&console_lock, "console_lock");
|
||||
keyboard_fd = sys_open("/dev/keyboard", 0);
|
||||
keyboard_fd = _kern_open("/dev/keyboard", 0);
|
||||
if (keyboard_fd < 0)
|
||||
panic("console_dev_init: error opening /dev/keyboard\n");
|
||||
|
||||
|
@ -31,15 +31,15 @@ fs_read_attr(int fd, const char *attribute, uint32 type, off_t pos, void *buffer
|
||||
{
|
||||
ssize_t bytes;
|
||||
|
||||
int attr = sys_open_attr(fd, attribute, O_RDONLY);
|
||||
int attr = _kern_open_attr(fd, attribute, O_RDONLY);
|
||||
if (attr < 0)
|
||||
RETURN_AND_SET_ERRNO(attr);
|
||||
|
||||
// type is not used at all in this function
|
||||
(void)type;
|
||||
|
||||
bytes = sys_read(fd, pos, buffer, readBytes);
|
||||
sys_close(attr);
|
||||
bytes = _kern_read(fd, pos, buffer, readBytes);
|
||||
_kern_close(attr);
|
||||
|
||||
RETURN_AND_SET_ERRNO(bytes);
|
||||
}
|
||||
@ -50,12 +50,12 @@ fs_write_attr(int fd, const char *attribute, uint32 type, off_t pos, const void
|
||||
{
|
||||
ssize_t bytes;
|
||||
|
||||
int attr = sys_create_attr(fd, attribute, type, O_WRONLY);
|
||||
int attr = _kern_create_attr(fd, attribute, type, O_WRONLY);
|
||||
if (attr < 0)
|
||||
RETURN_AND_SET_ERRNO(attr);
|
||||
|
||||
bytes = sys_write(fd, pos, buffer, readBytes);
|
||||
sys_close(attr);
|
||||
bytes = _kern_write(fd, pos, buffer, readBytes);
|
||||
_kern_close(attr);
|
||||
|
||||
RETURN_AND_SET_ERRNO(bytes);
|
||||
}
|
||||
@ -64,7 +64,7 @@ fs_write_attr(int fd, const char *attribute, uint32 type, off_t pos, const void
|
||||
int
|
||||
fs_remove_attr(int fd, const char *attribute)
|
||||
{
|
||||
status_t status = sys_remove_attr(fd, attribute);
|
||||
status_t status = _kern_remove_attr(fd, attribute);
|
||||
|
||||
RETURN_AND_SET_ERRNO(status);
|
||||
}
|
||||
@ -76,7 +76,7 @@ fs_stat_attr(int fd, const char *attribute, struct attr_info *attrInfo)
|
||||
struct stat stat;
|
||||
status_t status;
|
||||
|
||||
int attr = sys_open_attr(fd, attribute, O_RDONLY);
|
||||
int attr = _kern_open_attr(fd, attribute, O_RDONLY);
|
||||
if (attr < 0)
|
||||
RETURN_AND_SET_ERRNO(attr);
|
||||
|
||||
@ -85,7 +85,7 @@ fs_stat_attr(int fd, const char *attribute, struct attr_info *attrInfo)
|
||||
attrInfo->type = stat.st_type;
|
||||
attrInfo->size = stat.st_size;
|
||||
}
|
||||
sys_close(attr);
|
||||
_kern_close(attr);
|
||||
|
||||
RETURN_AND_SET_ERRNO(status);
|
||||
}
|
||||
@ -108,9 +108,9 @@ fs_open_attr(int fd, const char *attribute, uint32 type, int openMode)
|
||||
status_t status;
|
||||
|
||||
if (openMode & O_CREAT)
|
||||
status = sys_create_attr(fd, attribute, type, openMode);
|
||||
status = _kern_create_attr(fd, attribute, type, openMode);
|
||||
else
|
||||
status = sys_open_attr(fd, attribute, openMode);
|
||||
status = _kern_open_attr(fd, attribute, openMode);
|
||||
|
||||
RETURN_AND_SET_ERRNO(status);
|
||||
}
|
||||
@ -119,7 +119,7 @@ fs_open_attr(int fd, const char *attribute, uint32 type, int openMode)
|
||||
int
|
||||
fs_close_attr(int fd)
|
||||
{
|
||||
status_t status = sys_close(fd);
|
||||
status_t status = _kern_close(fd);
|
||||
|
||||
RETURN_AND_SET_ERRNO(status);
|
||||
}
|
||||
@ -130,7 +130,7 @@ open_attr_dir(int file, const char *path)
|
||||
{
|
||||
DIR *dir;
|
||||
|
||||
int fd = sys_open_attr_dir(file, path);
|
||||
int fd = _kern_open_attr_dir(file, path);
|
||||
if (fd < 0) {
|
||||
errno = fd;
|
||||
return NULL;
|
||||
@ -139,7 +139,7 @@ open_attr_dir(int file, 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;
|
||||
}
|
||||
|
||||
@ -166,7 +166,7 @@ fs_fopen_attr_dir(int fd)
|
||||
int
|
||||
fs_close_attr_dir(DIR *dir)
|
||||
{
|
||||
int status = sys_close(dir->fd);
|
||||
int status = _kern_close(dir->fd);
|
||||
|
||||
free(dir);
|
||||
|
||||
@ -177,7 +177,7 @@ fs_close_attr_dir(DIR *dir)
|
||||
struct dirent *
|
||||
fs_read_attr_dir(DIR *dir)
|
||||
{
|
||||
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;
|
||||
@ -191,7 +191,7 @@ fs_read_attr_dir(DIR *dir)
|
||||
void
|
||||
fs_rewind_attr_dir(DIR *dir)
|
||||
{
|
||||
int status = sys_rewind_dir(dir->fd);
|
||||
int status = _kern_rewind_dir(dir->fd);
|
||||
if (status < 0)
|
||||
errno = status;
|
||||
}
|
||||
|
@ -29,7 +29,7 @@
|
||||
int
|
||||
fs_create_index(dev_t device, const char *name, uint32 type, uint32 flags)
|
||||
{
|
||||
status_t status = sys_create_index(device, name, type, flags);
|
||||
status_t status = _kern_create_index(device, name, type, flags);
|
||||
|
||||
RETURN_AND_SET_ERRNO(status);
|
||||
}
|
||||
@ -38,7 +38,7 @@ fs_create_index(dev_t device, const char *name, uint32 type, uint32 flags)
|
||||
int
|
||||
fs_remove_index(dev_t device, const char *name)
|
||||
{
|
||||
status_t status = sys_remove_index(device, name);
|
||||
status_t status = _kern_remove_index(device, name);
|
||||
|
||||
RETURN_AND_SET_ERRNO(status);
|
||||
}
|
||||
@ -49,7 +49,7 @@ fs_stat_index(dev_t device, const char *name, struct index_info *indexInfo)
|
||||
{
|
||||
struct stat stat;
|
||||
|
||||
status_t status = sys_read_index_stat(device, name, &stat);
|
||||
status_t status = _kern_read_index_stat(device, name, &stat);
|
||||
if (status == B_OK) {
|
||||
indexInfo->type = stat.st_type;
|
||||
indexInfo->size = stat.st_size;
|
||||
@ -68,7 +68,7 @@ fs_open_index_dir(dev_t device)
|
||||
{
|
||||
DIR *dir;
|
||||
|
||||
int fd = sys_open_index_dir(device);
|
||||
int fd = _kern_open_index_dir(device);
|
||||
if (fd < 0) {
|
||||
errno = fd;
|
||||
return NULL;
|
||||
@ -77,7 +77,7 @@ fs_open_index_dir(dev_t device)
|
||||
/* 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;
|
||||
}
|
||||
|
||||
@ -90,7 +90,7 @@ fs_open_index_dir(dev_t device)
|
||||
int
|
||||
fs_close_index_dir(DIR *dir)
|
||||
{
|
||||
int status = sys_close(dir->fd);
|
||||
int status = _kern_close(dir->fd);
|
||||
|
||||
free(dir);
|
||||
|
||||
@ -101,7 +101,7 @@ fs_close_index_dir(DIR *dir)
|
||||
struct dirent *
|
||||
fs_read_index_dir(DIR *dir)
|
||||
{
|
||||
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;
|
||||
@ -115,7 +115,7 @@ fs_read_index_dir(DIR *dir)
|
||||
void
|
||||
fs_rewind_index_dir(DIR *dir)
|
||||
{
|
||||
int status = sys_rewind_dir(dir->fd);
|
||||
int status = _kern_rewind_dir(dir->fd);
|
||||
if (status < 0)
|
||||
errno = status;
|
||||
}
|
||||
|
@ -29,56 +29,56 @@
|
||||
SYSCALL0(sys_null, 0)
|
||||
|
||||
/* VFS calls */
|
||||
SYSCALL4(sys_mount, 1)
|
||||
SYSCALL1(sys_unmount, 2)
|
||||
SYSCALL0(sys_sync, 3)
|
||||
SYSCALL2(sys_open, 4)
|
||||
SYSCALL5(sys_open_entry_ref, 81)
|
||||
SYSCALL1(sys_close, 5)
|
||||
SYSCALL1(sys_fsync, 6)
|
||||
SYSCALL5(sys_read, 7)
|
||||
SYSCALL5(sys_write, 8)
|
||||
SYSCALL4(sys_seek, 9)
|
||||
SYSCALL1(sys_open_dir, 77)
|
||||
SYSCALL4(sys_open_dir_entry_ref, 82)
|
||||
SYSCALL3(sys_open_dir_node_ref, 83)
|
||||
SYSCALL2(sys_create_dir, 78)
|
||||
SYSCALL5(sys_create_dir_entry_ref, 85)
|
||||
SYSCALL1(sys_remove_dir, 93)
|
||||
SYSCALL3(sys_create_symlink, 86)
|
||||
SYSCALL2(sys_create_link, 92)
|
||||
SYSCALL3(sys_read_link, 87)
|
||||
SYSCALL4(sys_read_dir, 75)
|
||||
SYSCALL1(sys_rewind_dir, 76)
|
||||
SYSCALL4(sys_ioctl, 10)
|
||||
SYSCALL3(sys_create, 11)
|
||||
SYSCALL6(sys_create_entry_ref, 84)
|
||||
SYSCALL1(sys_unlink, 12)
|
||||
SYSCALL2(sys_rename, 13)
|
||||
SYSCALL2(sys_access, 73);
|
||||
SYSCALL4(_kern_mount, 1)
|
||||
SYSCALL1(_kern_unmount, 2)
|
||||
SYSCALL0(_kern_sync, 3)
|
||||
SYSCALL2(_kern_open, 4)
|
||||
SYSCALL5(_kern_open_entry_ref, 81)
|
||||
SYSCALL1(_kern_close, 5)
|
||||
SYSCALL1(_kern_fsync, 6)
|
||||
SYSCALL5(_kern_read, 7)
|
||||
SYSCALL5(_kern_write, 8)
|
||||
SYSCALL4(_kern_seek, 9)
|
||||
SYSCALL1(_kern_open_dir, 77)
|
||||
SYSCALL4(_kern_open_dir_entry_ref, 82)
|
||||
SYSCALL3(_kern_open_dir_node_ref, 83)
|
||||
SYSCALL2(_kern_create_dir, 78)
|
||||
SYSCALL5(_kern_create_dir_entry_ref, 85)
|
||||
SYSCALL1(_kern_remove_dir, 93)
|
||||
SYSCALL3(_kern_create_symlink, 86)
|
||||
SYSCALL2(_kern_create_link, 92)
|
||||
SYSCALL3(_kern_read_link, 87)
|
||||
SYSCALL4(_kern_read_dir, 75)
|
||||
SYSCALL1(_kern_rewind_dir, 76)
|
||||
SYSCALL4(_kern_ioctl, 10)
|
||||
SYSCALL3(_kern_create, 11)
|
||||
SYSCALL6(_kern_create_entry_ref, 84)
|
||||
SYSCALL1(_kern_unlink, 12)
|
||||
SYSCALL2(_kern_rename, 13)
|
||||
SYSCALL2(_kern_access, 73);
|
||||
SYSCALL3(_kern_read_stat, 74)
|
||||
SYSCALL4(_kern_write_stat, 100)
|
||||
SYSCALL4(_kern_read_path_stat, 14)
|
||||
SYSCALL5(_kern_write_path_stat, 15)
|
||||
SYSCALL2(sys_getcwd, 41)
|
||||
SYSCALL2(sys_setcwd, 42)
|
||||
SYSCALL1(sys_dup, 61)
|
||||
SYSCALL2(sys_dup2, 62)
|
||||
SYSCALL7(sys_select, 112)
|
||||
SYSCALL4(sys_poll, 113)
|
||||
SYSCALL2(_kern_getcwd, 41)
|
||||
SYSCALL2(_kern_setcwd, 42)
|
||||
SYSCALL1(_kern_dup, 61)
|
||||
SYSCALL2(_kern_dup2, 62)
|
||||
SYSCALL7(_kern_select, 112)
|
||||
SYSCALL4(_kern_poll, 113)
|
||||
|
||||
/* VFS attribute calls */
|
||||
SYSCALL2(sys_open_attr_dir, 97)
|
||||
SYSCALL4(sys_create_attr, 98)
|
||||
SYSCALL3(sys_open_attr, 99)
|
||||
SYSCALL2(sys_remove_attr, 101)
|
||||
SYSCALL4(sys_rename_attr, 102)
|
||||
SYSCALL2(_kern_open_attr_dir, 97)
|
||||
SYSCALL4(_kern_create_attr, 98)
|
||||
SYSCALL3(_kern_open_attr, 99)
|
||||
SYSCALL2(_kern_remove_attr, 101)
|
||||
SYSCALL4(_kern_rename_attr, 102)
|
||||
|
||||
/* VFS index calls */
|
||||
SYSCALL1(sys_open_index_dir, 106)
|
||||
SYSCALL4(sys_create_index, 107)
|
||||
SYSCALL3(sys_read_index_stat, 108)
|
||||
SYSCALL2(sys_remove_index, 109)
|
||||
SYSCALL1(_kern_open_index_dir, 106)
|
||||
SYSCALL4(_kern_create_index, 107)
|
||||
SYSCALL3(_kern_read_index_stat, 108)
|
||||
SYSCALL2(_kern_remove_index, 109)
|
||||
|
||||
/* semaphore calls */
|
||||
SYSCALL2(sys_create_sem, 18)
|
||||
|
@ -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.
|
||||
*/
|
||||
|
||||
@ -11,6 +11,6 @@
|
||||
int
|
||||
poll(struct pollfd *fds, nfds_t numfds, int timeout)
|
||||
{
|
||||
return sys_poll(fds, numfds, timeout * 1000LL);
|
||||
return _kern_poll(fds, numfds, timeout * 1000LL);
|
||||
}
|
||||
|
||||
|
@ -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
|
||||
mkdir(const char *path, mode_t mode)
|
||||
{
|
||||
status_t status = sys_create_dir(path, mode);
|
||||
status_t status = _kern_create_dir(path, mode);
|
||||
|
||||
RETURN_AND_SET_ERRNO(status);
|
||||
}
|
||||
|
@ -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.
|
||||
*/
|
||||
|
||||
@ -16,7 +16,7 @@ pselect(int numBits, struct fd_set *readBits, struct fd_set *writeBits,
|
||||
if (tv)
|
||||
timeout = tv->tv_sec * 1000000LL + tv->tv_nsec / 1000LL;
|
||||
|
||||
return sys_select(numBits, readBits, writeBits, errorBits, timeout, sigMask);
|
||||
return _kern_select(numBits, readBits, writeBits, errorBits, timeout, sigMask);
|
||||
}
|
||||
|
||||
|
||||
@ -28,6 +28,6 @@ select(int numBits, struct fd_set *readBits, struct fd_set *writeBits,
|
||||
if (tv)
|
||||
timeout = tv->tv_sec * 1000000LL + tv->tv_usec;
|
||||
|
||||
return sys_select(numBits, readBits, writeBits, errorBits, timeout, NULL);
|
||||
return _kern_select(numBits, readBits, writeBits, errorBits, timeout, NULL);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user