include/os.h File Reference

#include <build.h>
#include <stdio.h>
#include <sys/mman.h>
#include <sys/shm.h>
#include <sys/errno.h>
#include <crypt.h>
#include <unistd.h>
#include <string.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <pthread.h>
#include <signal.h>
#include <ctype.h>
#include <sys/socket.h>
#include <sys/time.h>
#include <stdarg.h>

Include dependency graph for os.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

class  os

Defines

#define MAX_FILE_LEN   1024
#define IDENTIFIER_LENGTH   128
#define DEFAULT_VALUE_BUF_LENGTH   32
#define SYSTEMDB   "SYSTEMDB"
#define DBAUSER   "root"
#define DBAPASS   "manager"
#define LOCK_BUCKET_SIZE   2048
#define MAX_CHUNKS   20
#define PAGE_SIZE   Conf::config.getPageSize()
#define MAX_MUTEX_PER_THREAD   3
#define MAX_THREADS_PER_PROCESS   30
#define MAX_FILE_PATH_LEN   1024
#define BIT(x)   (1 << (x))
#define SETBITS(x, y)   ((x) |= (y))
#define CLEARBITS(x, y)   ((x) &= (~(y)))
#define SETBIT(x, y)   SETBITS((x), (BIT((y))))
#define CLEARBIT(x, y)   CLEARBITS((x), (BIT((y))))
#define BITSET(x, y)   ((x) & (BIT(y)))

Typedefs

typedef void(*) sighandler_t (int)
typedef key_t shared_memory_key
typedef int shared_memory_id

Enumerations

enum  FileOpenMode {
  fileOpenReadOnly = O_RDONLY, fileOpenWriteOnly = O_WRONLY, fileOpenReadWrite = O_RDWR, fileOpenAppend = O_APPEND |O_RDWR,
  fileOpenCreat = O_CREAT |O_RDWR, fileOpenExcl = O_EXCL, fileOpenTrunc = O_TRUNC
}
enum  MapProtMode { mapProtRead = PROT_READ, mapProtWrite = PROT_WRITE, mapProcExec = PROT_EXEC, mapProcNone = PROT_NONE }
enum  MapMode {
  mapShared = MAP_SHARED, mapPrivate = MAP_PRIVATE, mapFixed = MAP_FIXED, mapNoReserve = MAP_NORESERVE,
  mapSync = MS_SYNC, mapASync = MS_ASYNC
}


Define Documentation

#define BIT (  )     (1 << (x))

Definition at line 98 of file os.h.

#define BITSET ( x,
 )     ((x) & (BIT(y)))

Definition at line 103 of file os.h.

Referenced by TableImpl::isFldNull(), and TableImpl::markFldNull().

#define CLEARBIT ( x,
 )     CLEARBITS((x), (BIT((y))))

Definition at line 102 of file os.h.

Referenced by TableImpl::clearFldNull().

#define CLEARBITS ( x,
 )     ((x) &= (~(y)))

Definition at line 100 of file os.h.

#define DBAPASS   "manager"

Definition at line 89 of file os.h.

Referenced by SessionImpl::initSystemDatabase().

#define DBAUSER   "root"

Definition at line 88 of file os.h.

Referenced by CatalogTableUSER::authenticate(), SessionImpl::getUserManager(), and SessionImpl::initSystemDatabase().

#define DEFAULT_VALUE_BUF_LENGTH   32

Definition at line 86 of file os.h.

Referenced by TableDef::addField(), CatalogTableFIELD::getFieldInfo(), CatalogTableFIELD::insert(), and ParsedData::setDefaultValue().

#define IDENTIFIER_LENGTH   128

Definition at line 85 of file os.h.

Referenced by TableDef::addField(), CreateTblStatement::execute(), CatalogTableFIELD::getFieldInfo(), isCached(), CacheTableLoader::load(), main(), SqlOdbcStatement::prepare(), TableImpl::printSQLIndexString(), NetworkTable::readNetworkConfig(), CacheTableLoader::recoverAllCachedTables(), CacheTableLoader::removeFromCacheTableFile(), ParsedData::setFldName(), and verifyPrimKeyFldVal().

#define LOCK_BUCKET_SIZE   2048

Definition at line 90 of file os.h.

Referenced by Database::createSystemTables(), LockManager::printDebugInfo(), and LockManager::printUsageStatistics().

#define MAX_CHUNKS   20

Definition at line 91 of file os.h.

Referenced by DatabaseManagerImpl::createDatabase(), Database::getSystemDatabaseTrans(), and Database::getThreadInfo().

#define MAX_FILE_LEN   1024

Definition at line 84 of file os.h.

#define MAX_FILE_PATH_LEN   1024

Definition at line 95 of file os.h.

Referenced by CacheTableLoader::removeFromCacheTableFile().

#define MAX_MUTEX_PER_THREAD   3

Definition at line 93 of file os.h.

Referenced by ProcessManager::addMutex(), ProcessManager::deregisterThread(), ThreadInfo::init(), ThreadInfo::print(), releaseAllResources(), and ProcessManager::removeMutex().

#define MAX_THREADS_PER_PROCESS   30

Definition at line 94 of file os.h.

Referenced by ProcessManager::getThreadTransaction(), ProcessManager::getThreadTransAddr(), ThreadInfo::init(), ThreadInfo::print(), and ProcessManager::setThreadTransaction().

#define PAGE_SIZE   Conf::config.getPageSize()

Definition at line 92 of file os.h.

Referenced by Chunk::allocate(), Chunk::compact(), DatabaseManagerImpl::createDatabase(), Database::createSystemDatabaseChunk(), Chunk::free(), Database::getFreePage(), Chunk::getIterator(), Chunk::getPageInfo(), Chunk::getTotalDataNodes(), ChunkIterator::nextElement(), Database::printStatistics(), and PageInfo::setPageAsUsed().

#define SETBIT ( x,
 )     SETBITS((x), (BIT((y))))

Definition at line 101 of file os.h.

Referenced by TableImpl::markFldNull(), and DatabaseManagerImpl::openTable().

#define SETBITS ( x,
 )     ((x) |= (y))

Definition at line 99 of file os.h.

#define SYSTEMDB   "SYSTEMDB"

Definition at line 87 of file os.h.

Referenced by DatabaseManagerImpl::closeDatabase(), DatabaseManagerImpl::createDatabase(), DatabaseManagerImpl::deleteDatabase(), SessionImpl::destroySystemDatabase(), SessionImpl::initSystemDatabase(), and DatabaseManagerImpl::openDatabase().


Typedef Documentation

typedef int shared_memory_id

Definition at line 107 of file os.h.

typedef key_t shared_memory_key

Definition at line 106 of file os.h.

typedef void(*) sighandler_t(int)

Definition at line 45 of file os.h.


Enumeration Type Documentation

enum FileOpenMode

Enumerator:
fileOpenReadOnly 
fileOpenWriteOnly 
fileOpenReadWrite 
fileOpenAppend 
fileOpenCreat 
fileOpenExcl 
fileOpenTrunc 

Definition at line 47 of file os.h.

00048 {
00049     fileOpenReadOnly = O_RDONLY,
00050     fileOpenWriteOnly = O_WRONLY,
00051     fileOpenReadWrite = O_RDWR,
00052     fileOpenAppend = O_APPEND |O_RDWR,
00053     fileOpenCreat = O_CREAT |O_RDWR,
00054     // If set and fileOpenExcl is set, the
00055     // open will fail if the file already exists.
00056     fileOpenExcl = O_EXCL,
00057     fileOpenTrunc = O_TRUNC
00058 };

enum MapMode

Enumerator:
mapShared 
mapPrivate 
mapFixed 
mapNoReserve 
mapSync 
mapASync 

Definition at line 68 of file os.h.

00069 {
00070     mapShared = MAP_SHARED,
00071     mapPrivate = MAP_PRIVATE,
00072     mapFixed = MAP_FIXED,
00073     // Interpret address exactly.
00074     mapNoReserve = MAP_NORESERVE,
00075     // Don't reserver swap space.
00076 
00077     //mapAlign = MAP_ALIGN,
00078     //for msync system call
00079     mapSync = MS_SYNC ,
00080     mapASync = MS_ASYNC
00081 
00082 };

enum MapProtMode

Enumerator:
mapProtRead 
mapProtWrite 
mapProcExec 
mapProcNone 

Definition at line 60 of file os.h.

00061 {
00062     mapProtRead = PROT_READ,
00063     mapProtWrite = PROT_WRITE,
00064     mapProcExec = PROT_EXEC,
00065     mapProcNone = PROT_NONE
00066 };


Generated on Mon Jun 9 22:38:28 2008 for csql by  doxygen 1.4.7