mirror of
https://review.haiku-os.org/haiku
synced 2025-01-20 05:21:28 +01:00
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
This commit is contained in:
parent
b657eab3cf
commit
d7dd1c2ac2
@ -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);
|
||||
|
@ -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 <ktypes.h>
|
||||
|
||||
#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
|
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user