From d7dd1c2ac240343aa44737b57bcf6c6c2e5e935a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Fri, 9 Aug 2002 16:57:25 +0000 Subject: [PATCH] Changed argument order for sys_read/write() to be more intuitive. Removed unistd.h (new BeOS-like unistd.h will be in posix/ shortly) git-svn-id: file:///srv/svn/repos/haiku/trunk/current@664 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- headers/private/kernel/fd.h | 4 +- headers/private/kernel/unistd.h | 69 --------------------------------- headers/private/kernel/vfs.h | 12 +++--- 3 files changed, 8 insertions(+), 77 deletions(-) delete mode 100755 headers/private/kernel/unistd.h diff --git a/headers/private/kernel/fd.h b/headers/private/kernel/fd.h index 208742ab8a..ee090b65f4 100644 --- a/headers/private/kernel/fd.h +++ b/headers/private/kernel/fd.h @@ -27,8 +27,8 @@ struct io_context { struct fd_ops { char *fs_name; // can be removed, it's not used anywhere - ssize_t (*fd_read) (struct file_descriptor *, void *buffer, off_t pos, size_t *length); - ssize_t (*fd_write)(struct file_descriptor *, const void *buffer, off_t pos, size_t *length); + ssize_t (*fd_read) (struct file_descriptor *, off_t pos, void *buffer, size_t *length); + ssize_t (*fd_write)(struct file_descriptor *, off_t pos, const void *buffer, size_t *length); off_t (*fd_seek)(struct file_descriptor *, off_t pos, int seekType); int (*fd_ioctl)(struct file_descriptor *, ulong op, void *buffer, size_t length); // int (*fd_poll)(struct file_descriptor *, int); diff --git a/headers/private/kernel/unistd.h b/headers/private/kernel/unistd.h deleted file mode 100755 index 62424682b8..0000000000 --- a/headers/private/kernel/unistd.h +++ /dev/null @@ -1,69 +0,0 @@ -/* -** Copyright 2001, Travis Geiselbrecht. All rights reserved. -** Copyright 2002, Manuel J. Petit. All rights reserved. -** Distributed under the terms of the NewOS License. -*/ - -/** - * @file unistd.h - * @brief Miscellaneous macro's and functions - */ - -#ifndef _UNISTD_H -#define _UNISTD_H - -/** - * @defgroup Unistd unistd.h - * @brief Miscellaneous macro's and functions - * @ingroup OpenBeOS_POSIX - * @{ - */ - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -int close(int); -int dup(int); -int dup2(int, int); - -ssize_t read(int, void *, size_t); -ssize_t write(int, const void *, size_t); - -int getopt(int, char * const *, const char *); -extern char *optarg; /* getopt(3) external variables */ -extern int opterr; -extern int optind; -extern int optopt; -extern int optreset; - -extern char **environ; - -int readlink(const char *path, char *buffer, size_t bufferSize); -int symlink(const char *path, const char *toPath); - -off_t lseek(int, off_t, int); -ssize_t read(int, void *, size_t); -ssize_t pread(int, void *, size_t, off_t); -ssize_t write(int, void const*, size_t); -ssize_t pwrite(int, void const*, size_t, off_t); - - -unsigned sleep(unsigned); -int usleep(unsigned); - -int getdtablesize(void); - -#define STDIN_FILENO 0 -#define STDOUT_FILENO 1 -#define STDERR_FILENO 2 - -/** @} */ -#ifdef __cplusplus -} /* extern "C" */ -#endif - - -#endif diff --git a/headers/private/kernel/vfs.h b/headers/private/kernel/vfs.h index 2733bc93ea..a403bcd075 100755 --- a/headers/private/kernel/vfs.h +++ b/headers/private/kernel/vfs.h @@ -72,8 +72,8 @@ struct fs_calls { int (*fs_open)(fs_cookie fs, fs_vnode v, int oflags, file_cookie *_cookie); int (*fs_close)(fs_cookie fs, fs_vnode v, file_cookie cookie); int (*fs_free_cookie)(fs_cookie fs, fs_vnode v, file_cookie cookie); - ssize_t (*fs_read)(fs_cookie fs, fs_vnode v, file_cookie cookie, void *buffer, off_t pos, size_t *length); - ssize_t (*fs_write)(fs_cookie fs, fs_vnode v, file_cookie cookie, const void *buffer, off_t pos, size_t *length); + ssize_t (*fs_read)(fs_cookie fs, fs_vnode v, file_cookie cookie, off_t pos, void *buffer, size_t *length); + ssize_t (*fs_write)(fs_cookie fs, fs_vnode v, file_cookie cookie, off_t pos, const void *buffer, size_t *length); off_t (*fs_seek)(fs_cookie fs, fs_vnode v, file_cookie cookie, off_t pos, int seekType); /* directory operations */ @@ -196,8 +196,8 @@ int user_getcwd(char *buf, size_t size); int user_setcwd(const char* path); /* fd kernel prototypes (implementation located in fd.c) */ -extern ssize_t sys_read(int fd, void *buf, off_t pos, size_t len); -extern ssize_t sys_write(int fd, const void *buf, off_t pos, size_t len); +extern ssize_t sys_read(int fd, off_t pos, void *buffer, size_t bufferSize); +extern ssize_t sys_write(int fd, off_t pos, const void *buffer, size_t bufferSize); extern int sys_ioctl(int fd, ulong cmd, void *data, size_t length); extern ssize_t sys_read_dir(int fd, struct dirent *buffer, size_t bufferSize, uint32 maxCount); extern status_t sys_rewind_dir(int fd); @@ -206,8 +206,8 @@ extern int sys_dup(int fd); extern int sys_dup2(int ofd, int nfd); /* fd user prototypes (implementation located in fd.c) */ -extern ssize_t user_read(int fd, void *buf, off_t pos, size_t len); -extern ssize_t user_write(int fd, const void *buf, off_t pos, size_t len); +extern ssize_t user_read(int fd, off_t pos, void *buffer, size_t bufferSize); +extern ssize_t user_write(int fd, off_t pos, const void *buffer, size_t bufferSize); extern int user_ioctl(int fd, ulong cmd, void *data, size_t length); extern ssize_t user_read_dir(int fd, struct dirent *buffer, size_t bufferSize, uint32 maxCount); extern status_t user_rewind_dir(int fd);