mirror of
https://github.com/MariaDB/server.git
synced 2025-01-17 20:42:30 +01:00
5dae19b394
BUILD/compile-alpha-cxx: Building on Alpha with Compaq C and C+++ Docs/manual.texi: Changelogs and update of links myisam/mi_key.c: Fixed multi_part keys where first part where of TEXT/BLOB type mysys/Makefile.am: Makefile.am now works with Compaq make sql-bench/Results/ATIS-mysql-Linux_2.2.13_SMP_alpha: New benchmark results sql-bench/Results/RUN-mysql-Linux_2.2.13_SMP_alpha: New benchmark results sql-bench/Results/alter-table-mysql-Linux_2.2.13_SMP_alpha: New benchmark results sql-bench/Results/big-tables-mysql-Linux_2.2.13_SMP_alpha: New benchmark results sql-bench/Results/connect-mysql-Linux_2.2.13_SMP_alpha: New benchmark results sql-bench/Results/create-mysql-Linux_2.2.13_SMP_alpha: New benchmark results sql-bench/Results/insert-mysql-Linux_2.2.13_SMP_alpha: New benchmark results sql-bench/Results/select-mysql-Linux_2.2.13_SMP_alpha: New benchmark results sql-bench/Results/wisconsin-mysql-Linux_2.2.13_SMP_alpha: New benchmark results sql-bench/test-select.sh: Made the count_distinct_big test a bit smaller sql/log.cc: Changed the slow log format to have more information by default sql/mysqld.cc: false->FALSE sql/share/german/errmsg.sys: Update of messages sql/share/german/errmsg.txt: Update of messages sql/sql_base.cc: Fixed SELECT DISTINCT * sql/sql_insert.cc: Cleanup sql/sql_table.cc: Added logging of DROP of temporary tables vio/VioFd.cc: false -> FALSE vio/VioSSL.cc: false -> FALSE vio/VioSSLFactoriesFd.cc: false -> FALSE vio/VioSocket.cc: false -> FALSE
156 lines
1.8 KiB
C++
156 lines
1.8 KiB
C++
/*
|
|
** Virtual I/O library for files
|
|
** Written by Andrei Errapart <andreie@no.spam.ee>
|
|
** Checked and modfied by Monty
|
|
*/
|
|
|
|
#include "vio-global.h"
|
|
#include <assert.h>
|
|
|
|
#ifdef __GNUC__
|
|
#pragma implementation // gcc: Class implementation
|
|
#endif
|
|
|
|
VIO_NS_BEGIN
|
|
|
|
VioFd::VioFd( int fd) : fd_(fd)
|
|
{
|
|
sprintf(desc_, "VioFd(%d)", fd_);
|
|
}
|
|
|
|
VioFd:: ~VioFd()
|
|
{
|
|
if (fd_ >= 0)
|
|
{
|
|
it r = ::close(fd_);
|
|
if ( r < 0)
|
|
{
|
|
/* FIXME: error handling (Not Critical for MySQL) */
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
bool
|
|
VioFd::open() const
|
|
{
|
|
return fd_ >= 0;
|
|
}
|
|
|
|
int
|
|
VioFd::read(vio_ptr buf, int size)
|
|
{
|
|
assert(fd_>=0);
|
|
return ::read(fd_, buf, size);
|
|
}
|
|
|
|
int
|
|
VioFd::write(const vio_ptr buf, int size)
|
|
{
|
|
assert(fd_>=0);
|
|
return ::write(fd_, buf, size);
|
|
}
|
|
|
|
int
|
|
VioFd::blocking(bool onoff)
|
|
{
|
|
if (onoff)
|
|
return 0;
|
|
else
|
|
return -1;
|
|
}
|
|
|
|
bool
|
|
VioFd::blocking() const
|
|
{
|
|
return true;
|
|
}
|
|
|
|
int
|
|
VioFd::fastsend(bool tmp)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
|
|
int
|
|
VioFd::keepalive(boolonoff)
|
|
{
|
|
return -2; // Why -2 ? (monty)
|
|
}
|
|
|
|
bool
|
|
VioFd::fcntl() const
|
|
{
|
|
return FALSE;
|
|
}
|
|
|
|
bool
|
|
VioFd::should_retry() const
|
|
{
|
|
return FALSE;
|
|
}
|
|
|
|
int
|
|
VioFd::fcntl(int cmd)
|
|
{
|
|
assert(fd_>=0);
|
|
return ::fcntl(fd_, cmd);
|
|
}
|
|
|
|
int
|
|
VioFd::fcntl(int cmd, long arg)
|
|
{
|
|
assert(fd_>=0);
|
|
return ::fcntl(fd_, cmd, arg);
|
|
}
|
|
|
|
int
|
|
VioFd::fcntl(int cmd, struct flock* lock)
|
|
{
|
|
assert(fd_>=0);
|
|
return ::fcntl(fd_, cmd, lock);
|
|
}
|
|
|
|
int
|
|
VioFd::close()
|
|
{
|
|
int r = -2;
|
|
if (fd_>=0)
|
|
{
|
|
|
|
if ((r= ::close(fd_)) == 0)
|
|
fd_ = -1;
|
|
}
|
|
else
|
|
{
|
|
/* FIXME: error handling */
|
|
}
|
|
return r;
|
|
}
|
|
|
|
const char*
|
|
VioFd::description() const
|
|
{
|
|
return desc_;
|
|
}
|
|
|
|
const char*
|
|
VioFd::peer_addr() const
|
|
{
|
|
return "";
|
|
}
|
|
|
|
const char*
|
|
VioFd::peer_name() const
|
|
{
|
|
return "localhost";
|
|
}
|
|
|
|
const char*
|
|
VioFd::cipher_description() const
|
|
{
|
|
return "";
|
|
}
|
|
|
|
VIO_NS_END
|