diff options
author | monty@hundin.mysql.fi <> | 2001-08-22 01:45:07 +0300 |
---|---|---|
committer | monty@hundin.mysql.fi <> | 2001-08-22 01:45:07 +0300 |
commit | 733f865f54e297bf512f10ec0631342303164b25 (patch) | |
tree | 32f2629127dea884d1930817179e72d2076be756 /mysys/my_write.c | |
parent | 063a1a6557ad2c501f4da9a47e633fb191ee2e00 (diff) | |
download | mariadb-git-733f865f54e297bf512f10ec0631342303164b25.tar.gz |
Fixes for OS2.
Fix bug in isamlog
Add argument types to function declarations.
Diffstat (limited to 'mysys/my_write.c')
-rw-r--r-- | mysys/my_write.c | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/mysys/my_write.c b/mysys/my_write.c index 61d6c7d2180..640043192ef 100644 --- a/mysys/my_write.c +++ b/mysys/my_write.c @@ -19,6 +19,46 @@ #include "mysys_err.h" #include <errno.h> +#ifdef OS2 + +int _write64( int fd, const void *buffer, unsigned int count) +{ + APIRET rc; + ULONG actual; + + rc = DosWrite( fd, (PVOID) buffer, count, &actual); + + switch (rc) { + case 0: /* NO_ERROR */ + errno = 0; + return( actual); + break; + case ERROR_INVALID_FUNCTION: + errno = EPERM; + break; + case ERROR_ACCESS_DENIED: + errno = EACCESS; + break; + case ERROR_INVALID_HANDLE: + errno = EBADF; + break; + case ERROR_DISK_FULL: + errno = ENOSPC; + break; + default: + errno = EINVAL; + break; + } + // write failed + return(-1); +} + +// redirect call +#define write _write64 + +#endif // OS2 + + /* Write a chunk of bytes to a file */ uint my_write(int Filedes, const byte *Buffer, uint Count, myf MyFlags) |