
|
[openbeosstorage]
||
[Date Prev]
[02-2002 Date Index]
[Date Next]
||
[Thread Prev]
[02-2002 Thread Index]
[Thread Next]
[openbeosstorage] Re: Kernel Interface Design
- From: Keith Poole <keef@xxxxxxxxxxxxxxx>
- To: openbeosstorage@xxxxxxxxxxxxx
- Date: Mon, 11 Feb 2002 22:26:18 +0000
The kernel returns errors defined in include/sys/errors.h:
#define ERR_GENERAL -1
#define ERR_NO_MEMORY ERR_GENERAL-1
#define ERR_IO_ERROR ERR_GENERAL-2
#define ERR_INVALID_ARGS ERR_GENERAL-3
#define ERR_TIMED_OUT ERR_GENERAL-4
#define ERR_NOT_ALLOWED ERR_GENERAL-5
#define ERR_PERMISSION_DENIED ERR_GENERAL-6
#define ERR_INVALID_BINARY ERR_GENERAL-7
#define ERR_INVALID_HANDLE ERR_GENERAL-8
#define ERR_NO_MORE_HANDLES ERR_GENERAL-9
#define ERR_UNIMPLEMENTED ERR_GENERAL-10
#define ERR_TOO_BIG ERR_GENERAL-11
#define ERR_NOT_FOUND ERR_GENERAL-12
#define ERR_NOT_IMPLEMENTED_YET ERR_GENERAL-13
#define ERR_NOMORE_HANDLES ERR_GENERAL-14
#define ERR_VFS_GENERAL -3072
#define ERR_VFS_INVALID_FS ERR_VFS_GENERAL-1
#define ERR_VFS_NOT_MOUNTPOINT ERR_VFS_GENERAL-2
#define ERR_VFS_PATH_NOT_FOUND ERR_VFS_GENERAL-3
#define ERR_VFS_INSUFFICIENT_BUF ERR_VFS_GENERAL-4
#define ERR_VFS_READONLY_FS ERR_VFS_GENERAL-5
#define ERR_VFS_ALREADY_EXISTS ERR_VFS_GENERAL-6
#define ERR_VFS_FS_BUSY ERR_VFS_GENERAL-7
#define ERR_VFS_FD_TABLE_FULL ERR_VFS_GENERAL-8
#define ERR_VFS_CROSS_FS_RENAME ERR_VFS_GENERAL-9
#define ERR_VFS_DIR_NOT_EMPTY ERR_VFS_GENERAL-10
#define ERR_VFS_NOT_DIR ERR_VFS_GENERAL-11
#define ERR_VFS_WRONG_STREAM_TYPE ERR_VFS_GENERAL-12
#define ERR_VFS_ALREADY_MOUNTPOINT ERR_VFS_GENERAL-13
The above are the most useful for the file system - we should either
return or throw these.
If you like, I'll do the following functions:
//int sync(void);
//int open(const char *path, stream_type st, int omode);
//int close(int fd);
//int fsync(int fd);
//ssize_t read(int fd, void *buf, off_t pos, ssize_t len);
//ssize_t write(int fd, const void *buf, off_t pos, ssize_t len);
//int seek(int fd, off_t pos, seek_type seek_type);
//int ioctl(int fd, int op, void *buf, size_t len);
//int create(const char *path, stream_type stream_type);
//int unlink(const char *path);
//int rename(const char *oldpath, const char *newpath);
Also, rather than returning FILE* as fds, we could use an array (or
vector) of structures and return the index of one of these - this is the
system the kernel uses (and why you're limited to 256 open files per
process in BeOS) .
Keith
|

|