diff options
Diffstat (limited to 'ace')
-rw-r--r-- | ace/Hash_Map_Manager.cpp | 450 | ||||
-rw-r--r-- | ace/Hash_Map_Manager.h | 268 | ||||
-rw-r--r-- | ace/High_Res_Timer.h | 5 | ||||
-rw-r--r-- | ace/High_Res_Timer.i | 4 | ||||
-rw-r--r-- | ace/Log_Record.cpp | 2 | ||||
-rw-r--r-- | ace/Map_Manager.cpp | 81 | ||||
-rw-r--r-- | ace/Map_Manager.h | 43 | ||||
-rw-r--r-- | ace/OS.h | 19 | ||||
-rw-r--r-- | ace/OS.i | 9 | ||||
-rw-r--r-- | ace/README | 2 | ||||
-rw-r--r-- | ace/SString.h | 1 | ||||
-rw-r--r-- | ace/config-aix-3.2.5.h | 1 | ||||
-rw-r--r-- | ace/config-aix-4.1.x.h | 17 | ||||
-rw-r--r-- | ace/config-aix-4.2.x.h | 127 | ||||
-rw-r--r-- | ace/config-linux-lxpthreads.h | 2 | ||||
-rw-r--r-- | ace/config-linux.h | 2 |
16 files changed, 947 insertions, 86 deletions
diff --git a/ace/Hash_Map_Manager.cpp b/ace/Hash_Map_Manager.cpp new file mode 100644 index 00000000000..e75d04e646a --- /dev/null +++ b/ace/Hash_Map_Manager.cpp @@ -0,0 +1,450 @@ +#include "ace/Service_Config.h" +#include "ace/Hash_Map_Manager.h" + +template <class EXT_ID, class INT_ID> +ACE_Hash_Map_Entry<EXT_ID, INT_ID>::ACE_Hash_Map_Entry (void) +{ +} + +template <class EXT_ID, class INT_ID> void +ACE_Hash_Map_Entry<EXT_ID, INT_ID>::dump (void) const +{ + ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this)); + ACE_DEBUG ((LM_DEBUG, "next_ = %d", this->next_)); + ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP)); +} + +template <class EXT_ID, class INT_ID> +ACE_Hash_Map_Entry<EXT_ID, INT_ID>::ACE_Hash_Map_Entry (const EXT_ID &ext_id, + const INT_ID &int_id, + ACE_Hash_Map_Entry<EXT_ID, INT_ID> *ptr) + : ext_id_ (ext_id), + int_id_ (int_id), + next_ (ptr) +{ +} + +template <class EXT_ID, class INT_ID> +ACE_Hash_Map_Entry<EXT_ID, INT_ID>::~ACE_Hash_Map_Entry (void) +{ +} + +template <class EXT_ID, class INT_ID, class LOCK> void +ACE_Hash_Map_Manager<EXT_ID, INT_ID, LOCK>::dump (void) const +{ + ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this)); + ACE_DEBUG ((LM_DEBUG, "total_size_ = %d", this->total_size_)); + ACE_DEBUG ((LM_DEBUG, "\ncur_size_ = %d", this->cur_size_)); + this->allocator_->dump (); + this->lock_.dump (); + ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP)); +} + +template <class EXT_ID, class INT_ID, class LOCK> int +ACE_Hash_Map_Manager<EXT_ID, INT_ID, LOCK>::resize_i (size_t size) +{ + size_t bytes = size * sizeof (ACE_Hash_Map_Entry<EXT_ID, INT_ID> *); + void *ptr; + + ACE_ALLOCATOR_RETURN (ptr, + this->allocator_->malloc (bytes), + -1); + + this->table_ = (ACE_Hash_Map_Entry<EXT_ID, INT_ID> **) ptr; + + this->sentinel_ = (ACE_Hash_Map_Entry<EXT_ID, INT_ID> *) this->allocator_->malloc (sizeof (ACE_Hash_Map_Entry<EXT_ID, INT_ID>)); + + if (this->sentinel_ == 0) + { + this->allocator_->free (this->table_); + errno = ENOMEM; + return -1; + } + else + new (this->sentinel_) ACE_Hash_Map_Entry<EXT_ID, INT_ID>; + + // This isn't strictly necessary, but we'll do it to make life + // easier. + this->sentinel_->next_ = this->sentinel_; + + this->total_size_ = size; + + // Initialize the hash table to point to the sentinel node. + for (size_t i = 0; i < this->total_size_; i++) + this->table_[i] = this->sentinel_; + + return 0; +} + +template <class EXT_ID, class INT_ID, class LOCK> int +ACE_Hash_Map_Manager<EXT_ID, INT_ID, LOCK>::open (size_t size, + ACE_Allocator *allocator) +{ + ACE_WRITE_GUARD_RETURN (LOCK, ace_mon, this->lock_, -1); + + if (allocator == 0) + allocator = ACE_Service_Config::alloc (); + + this->allocator_ = allocator; + + // If we need to grow buffer, then remove the existing buffer. + if (this->total_size_ < size) + return this->resize_i (size); + else + return 0; +} + +template <class EXT_ID, class INT_ID, class LOCK> +ACE_Hash_Map_Manager<EXT_ID, INT_ID, LOCK>::ACE_Hash_Map_Manager (size_t size, + ACE_Allocator *allocator) + : total_size_ (0), + cur_size_ (0), + allocator_ (allocator) +{ + if (this->open (size, allocator) == -1) + ACE_ERROR ((LM_ERROR, "ACE_Hash_Map_Manager\n")); +} + +template <class EXT_ID, class INT_ID, class LOCK> int +ACE_Hash_Map_Manager<EXT_ID, INT_ID, LOCK>::close_i (void) +{ + if (this->table_ != 0) + { + for (size_t i = 0; i < this->total_size_; i++) + { + for (ACE_Hash_Map_Entry<EXT_ID, INT_ID> *temp_ptr = this->table_[i]; + temp_ptr != sentinel_;) + { + ACE_Hash_Map_Entry<EXT_ID, INT_ID> *hold_ptr = temp_ptr; + temp_ptr = temp_ptr->next_; + this->allocator_->free (hold_ptr); + } + } + + this->allocator_->free (this->table_); + this->table_ = 0; + this->allocator_->free (this->sentinel_); + } + return 0; +} + +template <class EXT_ID, class INT_ID, class LOCK> int +ACE_Hash_Map_Manager<EXT_ID, INT_ID, LOCK>::close (void) +{ + ACE_WRITE_GUARD_RETURN (LOCK, ace_mon, this->lock_, -1); + + return this->close_i (); +} + +template <class EXT_ID, class INT_ID, class LOCK> +ACE_Hash_Map_Manager<EXT_ID, INT_ID, LOCK>::~ACE_Hash_Map_Manager (void) +{ + this->close (); +} + +template <class EXT_ID, class INT_ID, class LOCK> size_t +ACE_Hash_Map_Manager<EXT_ID, INT_ID, LOCK>::current_size (void) +{ + return this->cur_size_; +} + +template <class EXT_ID, class INT_ID, class LOCK> size_t +ACE_Hash_Map_Manager<EXT_ID, INT_ID, LOCK>::total_size (void) +{ + return this->total_size_; +} + +template <class EXT_ID, class INT_ID, class LOCK> int +ACE_Hash_Map_Manager<EXT_ID, INT_ID, LOCK>::bind_i (const EXT_ID &ext_id, + const INT_ID &int_id) +{ + size_t loc = ext_id.hash () % this->total_size_; + + ACE_Hash_Map_Entry<EXT_ID, INT_ID> *temp = this->table_[loc]; + + assert (temp != 0); + + for (this->sentinel_->ext_id_ = ext_id; + temp->ext_id_ != ext_id; + temp = temp->next_) + continue; + + if (temp == this->sentinel_) + { + void *ptr; + // Not found. + ACE_ALLOCATOR_RETURN (ptr, + this->allocator_->malloc (sizeof (ACE_Hash_Map_Entry<EXT_ID, INT_ID>) ), + -1); + + this->table_[loc] = + new (ptr) ACE_Hash_Map_Entry<EXT_ID, INT_ID> (ext_id, int_id, this->table_[loc]); + + this->cur_size_++; + return 0; + } + else + return 1; +} + +template <class EXT_ID, class INT_ID, class LOCK> int +ACE_Hash_Map_Manager<EXT_ID, INT_ID, LOCK>::bind (const EXT_ID &ext_id, + const INT_ID &int_id) +{ + ACE_WRITE_GUARD_RETURN (LOCK, ace_mon, this->lock_, -1); + + return this->bind_i (ext_id, int_id); +} + +template <class EXT_ID, class INT_ID, class LOCK> int +ACE_Hash_Map_Manager<EXT_ID, INT_ID, LOCK>::trybind_i (const EXT_ID &ext_id, + INT_ID &int_id) +{ + size_t loc = ext_id.hash () % this->total_size_; + + ACE_Hash_Map_Entry<EXT_ID, INT_ID> *temp = this->table_[loc]; + + assert (temp != 0); + + for (this->sentinel_->ext_id_ = ext_id; + temp->ext_id_ != ext_id; + temp = temp->next_) + continue; + + if (temp == this->sentinel_) + { + // Not found. + void *ptr; + // Not found. + ACE_ALLOCATOR_RETURN (ptr, + this->allocator_->malloc (sizeof (ACE_Hash_Map_Entry<EXT_ID, INT_ID>) ), + -1); + + this->table_[loc] = + new (ptr) ACE_Hash_Map_Entry<EXT_ID, INT_ID> (ext_id, int_id, this->table_[loc]); + + this->cur_size_++; + return 0; + } + else + { + temp->int_id_ = int_id; + return 1; + } +} + +template <class EXT_ID, class INT_ID, class LOCK> int +ACE_Hash_Map_Manager<EXT_ID, INT_ID, LOCK>::trybind (const EXT_ID &ext_id, + INT_ID &int_id) +{ + ACE_WRITE_GUARD_RETURN (LOCK, ace_mon, this->lock_, -1); + + return this->trybind_i (ext_id, int_id); +} + +template <class EXT_ID, class INT_ID, class LOCK> int +ACE_Hash_Map_Manager<EXT_ID, INT_ID, LOCK>::unbind_i (const EXT_ID &ext_id, + INT_ID &int_id) +{ + size_t loc = ext_id.hash () % this->total_size_; + + ACE_Hash_Map_Entry<EXT_ID, INT_ID> *temp = this->table_[loc]; + ACE_Hash_Map_Entry<EXT_ID, INT_ID> *prev = 0; + + for (this->sentinel_->ext_id_ = ext_id; + temp->ext_id_ != ext_id; + temp = temp->next_) + prev = temp; + + if (temp == this->sentinel_) + { + errno = ENOENT; + return -1; + } + else if (prev == 0) + this->table_[loc] = this->table_[loc]->next_; + else + prev->next_ = temp->next_; + + int_id = temp->int_id_; + this->allocator_->free (temp); + this->cur_size_--; + return 0; +} + +template <class EXT_ID, class INT_ID, class LOCK> int +ACE_Hash_Map_Manager<EXT_ID, INT_ID, LOCK>::unbind_i (const EXT_ID &ext_id) +{ + INT_ID int_id; + + return this->unbind_i (ext_id, int_id); +} + +template <class EXT_ID, class INT_ID, class LOCK> int +ACE_Hash_Map_Manager<EXT_ID, INT_ID, LOCK>::unbind (const EXT_ID &ext_id, + INT_ID &int_id) +{ + ACE_WRITE_GUARD_RETURN (LOCK, ace_mon, this->lock_, -1); + + return this->unbind_i (ext_id, int_id); +} + +template <class EXT_ID, class INT_ID, class LOCK> int +ACE_Hash_Map_Manager<EXT_ID, INT_ID, LOCK>::unbind (const EXT_ID &ext_id) +{ + ACE_WRITE_GUARD_RETURN (LOCK, ace_mon, this->lock_, -1); + + return this->unbind_i (ext_id) == -1 ? -1 : 0; +} + +template <class EXT_ID, class INT_ID, class LOCK> int +ACE_Hash_Map_Manager<EXT_ID, INT_ID, LOCK>::shared_find (const EXT_ID &ext_id, + ACE_Hash_Map_Entry<EXT_ID, INT_ID> *&entry) +{ + size_t loc = ext_id.hash () % total_size_; + + ACE_Hash_Map_Entry<EXT_ID, INT_ID> *temp = this->table_[loc]; + + assert (temp != 0); + + for (this->sentinel_->ext_id_ = ext_id; + temp->ext_id_ != ext_id; + temp = temp->next_) + continue; + + if (temp != this->sentinel_) + { + entry = temp; + return 0; + } + else + { + errno = ENOENT; + return -1; + } +} + +template <class EXT_ID, class INT_ID, class LOCK> int +ACE_Hash_Map_Manager<EXT_ID, INT_ID, LOCK>::find_i (const EXT_ID &ext_id, + INT_ID &int_id) +{ + ACE_Hash_Map_Entry<EXT_ID, INT_ID> *entry; + + if (this->shared_find (ext_id, entry) == -1) + return -1; + else + { + int_id = entry->int_id_; + return 0; + } +} + +template <class EXT_ID, class INT_ID, class LOCK> int +ACE_Hash_Map_Manager<EXT_ID, INT_ID, LOCK>::find_i (const EXT_ID &ext_id) +{ + ACE_Hash_Map_Entry<EXT_ID, INT_ID> *entry; + + return this->shared_find (ext_id, entry); +} + +template <class EXT_ID, class INT_ID, class LOCK> int +ACE_Hash_Map_Manager<EXT_ID, INT_ID, LOCK>::find (const EXT_ID &ext_id, + INT_ID &int_id) +{ + ACE_READ_GUARD_RETURN (LOCK, ace_mon, this->lock_, -1); + + return this->find_i (ext_id, int_id); +} + +template <class EXT_ID, class INT_ID, class LOCK> int +ACE_Hash_Map_Manager<EXT_ID, INT_ID, LOCK>::find (const EXT_ID &ext_id) +{ + ACE_READ_GUARD_RETURN (LOCK, ace_mon, this->lock_, -1); + + return this->find_i (ext_id); +} + +template <class EXT_ID, class INT_ID, class LOCK> int +ACE_Hash_Map_Manager<EXT_ID, INT_ID, LOCK>::rebind_i (const EXT_ID &ext_id, + const INT_ID &int_id, + EXT_ID &old_ext_id, + INT_ID &old_int_id) +{ + ACE_Hash_Map_Entry<EXT_ID, INT_ID> *node; + + if (this->shared_find (ext_id, node) == -1) + return this->bind_i (ext_id, int_id); + else + { + old_ext_id = node->ext_id_; + old_int_id = node->int_id_; + node->ext_id_ = ext_id; + node->int_id_ = int_id; + return 1; + } +} + +template <class EXT_ID, class INT_ID, class LOCK> int +ACE_Hash_Map_Manager<EXT_ID, INT_ID, LOCK>::rebind (const EXT_ID &ext_id, + const INT_ID &int_id, + EXT_ID &old_ext_id, + INT_ID &old_int_id) +{ + ACE_WRITE_GUARD_RETURN (LOCK, ace_mon, this->lock_, -1); + + return this->rebind_i (ext_id, int_id, old_ext_id, old_int_id); +} + +template <class EXT_ID, class INT_ID, class LOCK> void +ACE_Hash_Map_Iterator<EXT_ID, INT_ID, LOCK>::dump (void) const +{ + + ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this)); + ACE_DEBUG ((LM_DEBUG, "next_ = %d", this->next_)); + ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP)); +} + +template <class EXT_ID, class INT_ID, class LOCK> +ACE_Hash_Map_Iterator<EXT_ID, INT_ID, LOCK>::ACE_Hash_Map_Iterator (ACE_Hash_Map_Manager<EXT_ID, INT_ID, LOCK> &mm) + : map_man_ (mm), + index_ (0), + next_ (this->map_man_.sentinel_) +{ + if (this->map_man_.table_ != 0) + this->advance (); +} + +template <class EXT_ID, class INT_ID, class LOCK> int +ACE_Hash_Map_Iterator<EXT_ID, INT_ID, LOCK>::next (ACE_Hash_Map_Entry<EXT_ID, INT_ID> *&mm) +{ + ACE_READ_GUARD_RETURN (LOCK, ace_mon, this->map_man_.lock_, -1); + + if (this->map_man_.table_ != 0 + && this->index_ < this->map_man_.total_size_ + && this->next_ != this->map_man_.sentinel_) + { + mm = this->next_; + return 1; + } + else + return 0; +} + +template <class EXT_ID, class INT_ID, class LOCK> int +ACE_Hash_Map_Iterator<EXT_ID, INT_ID, LOCK>::advance (void) +{ + ACE_READ_GUARD_RETURN (LOCK, ace_mon, this->map_man_.lock_, -1); + + if (this->next_->next_ != this->map_man_.sentinel_) + this->next_ = this->next_->next_; + else + while (this->index_++ < this->map_man_.total_size_) + if (this->map_man_.table_[this->index_ - 1] != this->map_man_.sentinel_) + { + this->next_ = this->map_man_.table_[this->index_ - 1]; + break; + } + + return 0; +} + diff --git a/ace/Hash_Map_Manager.h b/ace/Hash_Map_Manager.h new file mode 100644 index 00000000000..d46faf0469b --- /dev/null +++ b/ace/Hash_Map_Manager.h @@ -0,0 +1,268 @@ +/* -*- C++ -*- */ +// $Id$ + +// ============================================================================ +// +// = LIBRARY +// ace +// +// = FILENAME +// Hash_Map_Manager.h +// +// = AUTHOR +// Doug Schmidt +// +// ============================================================================ + +#if !defined (ACE_HASH_MAP_MANAGER_H) +#define ACE_HASH_MAP_MANAGER_H + +#include "ace/SString.h" +#include "ace/Malloc.h" + +template <class EXT_ID, class INT_ID> +class ACE_Hash_Map_Entry + // = TITLE + // Define an entry in the hash table. +{ +public: + // = Initialization and termination methods. + ACE_Hash_Map_Entry (void); + // Default constructor. + + ACE_Hash_Map_Entry (const EXT_ID &ext_id, + const INT_ID &int_id, + ACE_Hash_Map_Entry<EXT_ID, INT_ID> *ptr = 0); + // Constructor. + + ~ACE_Hash_Map_Entry (void); + // Destructor. + + EXT_ID ext_id_; + // Key used to look up an entry. + + INT_ID int_id_; + // The contents of the entry itself. + + ACE_Hash_Map_Entry<EXT_ID, INT_ID> *next_; + // Pointer to the next item in the bucket of overflow nodes. + + void dump (void) const; + // Dump the state of an object. +}; + +// Forward decl. +template <class EXT_ID, class INT_ID, class LOCK> +class ACE_Hash_Map_Iterator; + +template <class EXT_ID, class INT_ID, class LOCK> +class ACE_Hash_Map_Manager + // = TITLE + // Define a map abstraction (useful for managing connections and + // sessions). + // + // = DESCRIPTION + // This implementation of a map uses a hash table. Therefore, + // this class expects that the <EXT_ID> contains a method called + // <hash>. This class uses an ACE_Allocator to allocate memory + // The user can make this a persistant class by providing an + // ACE_Allocator with a persistable memory pool +{ + friend class ACE_Hash_Map_Iterator<EXT_ID, INT_ID, LOCK>; +public: + enum {DEFAULT_SIZE = ACE_DEFAULT_MAP_SIZE}; + + typedef ACE_Hash_Map_Entry<EXT_ID, INT_ID> ENTRY; + typedef ACE_Hash_Map_Iterator<EXT_ID, INT_ID, LOCK> ITERATOR; + + // = Initialization and termination methods. + + ACE_Hash_Map_Manager (size_t size, + ACE_Allocator *allocator = 0); + // Initialize a <Hash_Map_Manager> with size <length>. + + int open (size_t length = DEFAULT_SIZE, + ACE_Allocator *allocator = 0); + // Initialize a <Hash_Map_Manager> with size <length>. + + int close (void); + // Close down a <Hash_Map_Manager> and release dynamically allocated + // resources. + + ~ACE_Hash_Map_Manager (void); + // Initialize a <Hash_Map_Manager> with size <length>. + + + int trybind (const EXT_ID &ext_id, + INT_ID &int_id); + // Associate <ext_id> with <int_id> if and only if <ext_id> is not + // in the map. If <ext_id> is already in the map then the <int_id> + // parameter is overwritten with the existing value in the map + // Returns 0 if a new entry is bound successfully, returns 1 if an + // attempt is made to bind an existing entry, and returns -1 if + // failures occur. + + int bind (const EXT_ID &item, + const INT_ID &int_id); + // Associate <ext_id> with <int_id>. If <ext_id> is already in the + // map then the <ACE_Hash_Map_Entry> is not changed. Returns 0 if a + // new entry is bound successfully, returns 1 if an attempt is made + // to bind an existing entry, and returns -1 if failures occur. + + int rebind (const EXT_ID &ext_id, + const INT_ID &int_id, + EXT_ID &old_ext_id, + INT_ID &old_int_id); + // Associate <ext_id> with <int_id>. If <ext_id> is not in the map + // then behaves just like <bind>. Otherwise, store the old values + // of <ext_id> and <int_id> into the "out" parameters and rebind the + // new parameters. This is very useful if you need to have an + // atomic way of updating <ACE_Hash_Map_Entrys> and you also need full + // control over memory allocation. Returns 0 if a new entry is + // bound successfully, returns 1 if an existing entry was rebound, + // and returns -1 if failures occur. + + int find (const EXT_ID &item, + INT_ID &int_id); + // Locate <ext_id> and pass out parameter via <int_id>. If found, + // return 0, returns -1 if failure occurs. + + int find (const EXT_ID &ext_id); + // Returns 0 if the <ext_id> is in the mapping, otherwise -1. + + int unbind (const EXT_ID &ext_id); + // Unbind (remove) the <ext_id> from the map. Don't return the + // <int_id> to the caller (this is useful for collections where the + // <int_id>s are *not* dynamically allocated...) + + int unbind (const EXT_ID &ext_id, + INT_ID &int_id); + // Break any association of <ext_id>. Returns the value of <int_id> + // in case the caller needs to deallocate memory. + + size_t current_size (void); + // Return the current size of the map. + + size_t total_size (void); + // Return the total size of the map. + + void dump (void) const; + // Dump the state of an object. + +protected: + // = The following methods do the actual work. + + // These methods assume that the locks are held by the private + // methods. + + int bind_i (const EXT_ID &ext_id, const INT_ID &int_id); + // Performs the binding of <ext_id> to <int_id>. Must be + // called with locks held. + + int rebind_i (const EXT_ID &ext_id, const INT_ID &int_id, + EXT_ID &old_ext_id, INT_ID &old_int_id); + // Performs a rebinding of <ext_it> to <int_id>. Must be called + // with locks held. + + int find_i (const EXT_ID &ext_id, INT_ID &int_id); + // Performs a find of <int_id> using <ext_id> as the key. Must be + // called with locks held. + + int find_i (const EXT_ID &ext_id); + // Performs a find using <ext_id> as the key. Must be called with + // locks held. + + int unbind_i (const EXT_ID &ext_id, INT_ID &int_id); + // Performs an unbind of <int_id> using <ext_id> as the key. Must + // be called with locks held. + + int unbind_i (const EXT_ID &ext_id); + // Performs an unbind using <ext_id> as the key. Must be called + // with locks held. + + int trybind_i (const EXT_ID &ext_id, INT_ID &int_id); + // Performs a conditional bind of <int_id> using <ext_id> as the + // key. Must be called with locks held. + + int resize_i (size_t size); + // Resize the map. Must be called with locks held. + + int close_i (void); + // Close down a <Map_Manager>. Must be called with + // locks held. + + ACE_Allocator *allocator_; + // Pointer to a memory allocator. + + LOCK lock_; + // Synchronization variable for the MT_SAFE <ACE_Map_Manager>. + +private: + int shared_find (const EXT_ID &ext_id, ACE_Hash_Map_Entry<EXT_ID, INT_ID> *&); + // Returns the <ACE_Hash_Map_Entry> that corresponds to <ext_id>. + + ACE_Hash_Map_Entry<EXT_ID, INT_ID> **table_; + // Array of <ACE_Hash_Map_Entry> *s, each of which points to the + // beginning of a linked list of <EXT_ID>s that hash to that bucket. + + size_t total_size_; + // Total size of the hash table. + + size_t cur_size_; + // Current number of elements in the table. + + ACE_Hash_Map_Entry<EXT_ID, INT_ID> *sentinel_; + // Sentinel node that improves lookup time. +}; + +template <class EXT_ID, class INT_ID, class LOCK> +class ACE_Hash_Map_Iterator + // = TITLE + // Iterator for the ACE_Hash_Map_Manager. + // + // = DESCRIPTION +{ +public: + // = Initialization method. + ACE_Hash_Map_Iterator (ACE_Hash_Map_Manager<EXT_ID, INT_ID, LOCK> &mm); + + // = Iteration methods. + + int next (ACE_Hash_Map_Entry<EXT_ID, INT_ID> *&next_entry); + // Pass back the next <entry> that hasn't been seen in the Set. + // Returns 0 when all items have been seen, else 1. + + int advance (void); + // Move forward by one element in the set. + + void dump (void) const; + // Dump the state of an object. + + ACE_ALLOC_HOOK_DECLARE; + // Declare the dynamic allocation hooks. + +private: + ACE_Hash_Map_Manager<EXT_ID, INT_ID, LOCK> &map_man_; + // Map we are iterating over. + + size_t index_; + // Keeps track of how far we've advanced in the table. + + ACE_Hash_Map_Entry<EXT_ID, INT_ID> *next_; + // Keeps track of how far we've advanced in a linked list in each + // table slot. +}; + +#if defined (__ACE_INLINE__) +#include "ace/Hash_Map_Manager.i" +#endif /* __ACE_INLINE__ */ + +#if defined (ACE_TEMPLATES_REQUIRE_SOURCE) +#include "ace/Hash_Map_Manager.cpp" +#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */ + +#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA) +#pragma implementation ("Hash_Map_Manager.cpp") +#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */ + +#endif /* ACE_HASH_MAP_MANAGER_H */ diff --git a/ace/High_Res_Timer.h b/ace/High_Res_Timer.h index e7a40ba1dea..acd69d66ccb 100644 --- a/ace/High_Res_Timer.h +++ b/ace/High_Res_Timer.h @@ -1,7 +1,6 @@ /* -*- C++ -*- */ // $Id$ - // ============================================================================ // // = LIBRARY @@ -20,7 +19,7 @@ #include "ace/ACE.h" -#if defined (ACE_HAS_HI_RES_TIMER) || defined (ACE_HAS_AIX_HIRES_TIMER) +#if defined (ACE_HAS_HI_RES_TIMER) || defined (ACE_HAS_AIX_HI_RES_TIMER) class ACE_Export ACE_High_Res_Timer // = TITLE @@ -95,5 +94,5 @@ private: #include "ace/High_Res_Timer.i" #endif /* __ACE_INLINE__ */ -#endif /* ACE_HAS_HI_RES_TIMER || ACE_HAS_AIX_HIRES_TIMER */ +#endif /* ACE_HAS_HI_RES_TIMER || ACE_HAS_AIX_HI_RES_TIMER */ #endif /* ACE_HIGH_RES_TIMER_H */ diff --git a/ace/High_Res_Timer.i b/ace/High_Res_Timer.i index 7e7e5a35a73..d54a40d52b3 100644 --- a/ace/High_Res_Timer.i +++ b/ace/High_Res_Timer.i @@ -3,7 +3,7 @@ // High_Res_Timer.i -#if defined (ACE_HAS_HI_RES_TIMER) || defined (ACE_HAS_AIX_HIRES_TIMER) +#if defined (ACE_HAS_HI_RES_TIMER) || defined (ACE_HAS_AIX_HI_RES_TIMER) ACE_INLINE ACE_High_Res_Timer::ACE_High_Res_Timer (void) @@ -50,4 +50,4 @@ ACE_High_Res_Timer::elapsed_microseconds (hrtime_t &usecs) const usecs = (this->end_ - this->start_) / 1000; } -#endif /* ACE_HAS_HI_RES_TIMER || ACE_HAS_AIX_HIRES_TIMER */ +#endif /* ACE_HAS_HI_RES_TIMER || ACE_HAS_AIX_HI_RES_TIMER */ diff --git a/ace/Log_Record.cpp b/ace/Log_Record.cpp index a463981014f..5129f27d90c 100644 --- a/ace/Log_Record.cpp +++ b/ace/Log_Record.cpp @@ -66,7 +66,7 @@ ACE_Log_Record::round_up (void) ACE_Log_Record::ACE_Log_Record (void) : type_ (0), length_ (0), - time_stamp_ (0), + time_stamp_ (0L), pid_ (0) { // ACE_TRACE ("ACE_Log_Record::ACE_Log_Record"); diff --git a/ace/Map_Manager.cpp b/ace/Map_Manager.cpp index 8ef2d713b52..88968390863 100644 --- a/ace/Map_Manager.cpp +++ b/ace/Map_Manager.cpp @@ -34,7 +34,7 @@ ACE_Map_Manager<EXT_ID, INT_ID, LOCK>::dump (void) const ACE_TRACE ("ACE_Map_Manager<EXT_ID, INT_ID, LOCK>::dump"); ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this)); - ACE_DEBUG ((LM_DEBUG, "max_size_ = %d", this->max_size_)); + ACE_DEBUG ((LM_DEBUG, "total_size_ = %d", this->total_size_)); ACE_DEBUG ((LM_DEBUG, "\ncur_size_ = %d", this->cur_size_)); this->allocator_->dump (); this->lock_.dump (); @@ -46,7 +46,7 @@ ACE_Map_Manager<EXT_ID, INT_ID, LOCK>::ACE_Map_Manager (size_t size, ACE_Allocator *alloc) : search_structure_ (0), allocator_ (0), - max_size_ (0), + total_size_ (0), cur_size_ (0) { ACE_TRACE ("ACE_Map_Manager<EXT_ID, INT_ID, LOCK>::ACE_Map_Manager"); @@ -59,7 +59,7 @@ template <class EXT_ID, class INT_ID, class LOCK> ACE_Map_Manager<EXT_ID, INT_ID, LOCK>::ACE_Map_Manager (ACE_Allocator *alloc) : search_structure_ (0), allocator_ (0), - max_size_ (0), + total_size_ (0), cur_size_ (0) { ACE_TRACE ("ACE_Map_Manager<EXT_ID, INT_ID, LOCK>::ACE_Map_Manager"); @@ -96,39 +96,17 @@ ACE_Map_Manager<EXT_ID, INT_ID, LOCK>::~ACE_Map_Manager (void) this->close (); } -// Create a new search_structure of size SIZE. - -template <class EXT_ID, class INT_ID, class LOCK> int -ACE_Map_Manager<EXT_ID, INT_ID, LOCK>::open (size_t size, - ACE_Allocator *alloc) -{ - ACE_TRACE ("ACE_Map_Manager<EXT_ID, INT_ID, LOCK>::open"); - ACE_WRITE_GUARD_RETURN (LOCK, ace_mon, this->lock_, -1); - - if (alloc == 0) - alloc = ACE_Service_Config::alloc (); - - this->allocator_ = alloc; - - // If we need to grow buffer, then remove the existing buffer. - if (this->max_size_ < size) - return this->resize_i (size); - return 0; -} - template <class EXT_ID, class INT_ID, class LOCK> int ACE_Map_Manager<EXT_ID, INT_ID, LOCK>::resize_i (size_t size) { ACE_TRACE ("ACE_Map_Manager<EXT_ID, INT_ID, LOCK>::resize_i"); // If we need to grow buffer, then remove the existing buffer. - void *ptr = this->allocator_->malloc (size * sizeof (ACE_Map_Entry<EXT_ID, INT_ID>)); - - if (ptr == 0) - { - errno = ENOMEM; - return -1; - } + void *ptr; + + ACE_ALLOCATOR_RETURN (ptr, + this->allocator_->malloc (size * sizeof (ACE_Map_Entry<EXT_ID, INT_ID>)), + -1); size_t i; @@ -140,11 +118,11 @@ ACE_Map_Manager<EXT_ID, INT_ID, LOCK>::resize_i (size_t size) temp[i] = this->search_structure_[i]; // Structure assignment. } - this->max_size_ = size; + this->total_size_ = size; // Mark the newly allocated elements as being "free". - for (i = this->cur_size_; i < this->max_size_; i++) + for (i = this->cur_size_; i < this->total_size_; i++) { // Call the constructor for each element in the array. new (&(temp[i])) ACE_Map_Entry<EXT_ID, INT_ID>; @@ -157,6 +135,27 @@ ACE_Map_Manager<EXT_ID, INT_ID, LOCK>::resize_i (size_t size) return 0; } +// Create a new search_structure of size SIZE. + +template <class EXT_ID, class INT_ID, class LOCK> int +ACE_Map_Manager<EXT_ID, INT_ID, LOCK>::open (size_t size, + ACE_Allocator *alloc) +{ + ACE_TRACE ("ACE_Map_Manager<EXT_ID, INT_ID, LOCK>::open"); + ACE_WRITE_GUARD_RETURN (LOCK, ace_mon, this->lock_, -1); + + if (alloc == 0) + alloc = ACE_Service_Config::alloc (); + + this->allocator_ = alloc; + + // If we need to grow buffer, then remove the existing buffer. + if (this->total_size_ < size) + return this->resize_i (size); + else + return 0; +} + template <class EXT_ID, class INT_ID, class LOCK> int ACE_Map_Manager<EXT_ID, INT_ID, LOCK>::shared_find (const EXT_ID &ext_id, int &first_free) @@ -221,15 +220,11 @@ ACE_Map_Manager<EXT_ID, INT_ID, LOCK>::shared_bind (const EXT_ID &ext_id, return 0; } - // Check if we have reached max_size_ - else if (this->cur_size_ == this->max_size_) + // Check if we have reached total_size_ + else if (this->cur_size_ == this->total_size_) // We are out of room so grow the map - if (this->resize_i (this->max_size_ + DEFAULT_SIZE) == -1) - { - // Out of memory - errno = ENOMEM; - return -1; - } + if (this->resize_i (this->total_size_ + DEFAULT_SIZE) == -1) + return -1; // Insert at the end of the active portion. @@ -503,7 +498,7 @@ ACE_Map_Manager<EXT_ID, INT_ID, LOCK>::unbind (const EXT_ID &ext_id) return this->unbind_i (ext_id) == -1 ? -1 : 0; } -template <class EXT_ID, class INT_ID, class LOCK> int +template <class EXT_ID, class INT_ID, class LOCK> size_t ACE_Map_Manager<EXT_ID, INT_ID, LOCK>::current_size (void) { ACE_TRACE ("ACE_Map_Manager::current_size"); @@ -511,12 +506,12 @@ ACE_Map_Manager<EXT_ID, INT_ID, LOCK>::current_size (void) return this->cur_size_; } -template <class EXT_ID, class INT_ID, class LOCK> int +template <class EXT_ID, class INT_ID, class LOCK> size_t ACE_Map_Manager<EXT_ID, INT_ID, LOCK>::total_size (void) { ACE_TRACE ("ACE_Map_Manager::total_size"); ACE_WRITE_GUARD_RETURN (LOCK, ace_mon, this->lock_, -1); - return this->max_size_; + return this->total_size_; } ACE_ALLOC_HOOK_DEFINE(ACE_Map_Iterator) diff --git a/ace/Map_Manager.h b/ace/Map_Manager.h index 14b3bf18b98..ef965ff9943 100644 --- a/ace/Map_Manager.h +++ b/ace/Map_Manager.h @@ -1,7 +1,6 @@ /* -*- C++ -*- */ // $Id$ - // ============================================================================ // // = LIBRARY @@ -68,11 +67,10 @@ class ACE_Map_Manager friend class ACE_Map_Iterator<EXT_ID, INT_ID, LOCK>; friend class ACE_Map_Reverse_Iterator<EXT_ID, INT_ID, LOCK>; public: - + // = Traits. typedef ACE_Map_Entry<EXT_ID, INT_ID> ENTRY; typedef ACE_Map_Iterator<EXT_ID, INT_ID, LOCK> ITERATOR; typedef ACE_Map_Reverse_Iterator<EXT_ID, INT_ID, LOCK> REVERSE_ITERATOR; - // Traits enum {DEFAULT_SIZE = ACE_DEFAULT_MAP_SIZE}; @@ -80,7 +78,8 @@ public: ACE_Map_Manager (ACE_Allocator *allocator = 0); // Initialize a <Map_Manager> with the <DEFAULT_SIZE>. - ACE_Map_Manager (size_t size, ACE_Allocator *allocator = 0); + ACE_Map_Manager (size_t size, + ACE_Allocator *allocator = 0); // Initialize a <Map_Manager> with <size> entries. int open (size_t length = DEFAULT_SIZE, @@ -95,7 +94,8 @@ public: // Close down a <Map_Manager> and release dynamically allocated // resources. - int trybind (const EXT_ID &ext_id, INT_ID &int_id); + int trybind (const EXT_ID &ext_id, + INT_ID &int_id); // Associate <ext_id> with <int_id> if and only if <ext_id> is not // in the map. If <ext_id> is already in the map then the <int_id> // parameter is overwritten with the existing value in the map @@ -103,14 +103,17 @@ public: // attempt is made to bind an existing entry, and returns -1 if // failures occur. - int bind (const EXT_ID &ext_id, const INT_ID &int_id); + int bind (const EXT_ID &ext_id, + const INT_ID &int_id); // Associate <ext_id> with <int_id>. If <ext_id> is already in the // map then the <Map_Entry> is not changed. Returns 0 if a new // entry is bound successfully, returns 1 if an attempt is made to // bind an existing entry, and returns -1 if failures occur. - int rebind (const EXT_ID &ext_id, const INT_ID &int_id, - EXT_ID &old_ext_id, INT_ID &old_int_id); + int rebind (const EXT_ID &ext_id, + const INT_ID &int_id, + EXT_ID &old_ext_id, + INT_ID &old_int_id); // Associate <ext_id> with <int_id>. If <ext_id> is not in the // map then behaves just like <bind>. Otherwise, store the old // values of <ext_id> and <int_id> into the "out" parameters and @@ -127,19 +130,19 @@ public: int find (const EXT_ID &ext_id); // Returns 0 if the <ext_id> is in the mapping, otherwise -1. + int unbind (const EXT_ID &ext_id); + // Unbind (remove) the <ext_id> from the map. Don't return the + // <int_id> to the caller (this is useful for collections where the + // <int_id>s are *not* dynamically allocated...) + int unbind (const EXT_ID &ext_id, INT_ID &int_id); // Break any association of <ext_id>. Returns the value of <int_id> in // case the caller needs to deallocate memory. - int unbind (const EXT_ID &ext_id); - // Unbind (remove) the <ext_id> from the map. Don't return the <int_id> - // to the caller (this is useful for collections where the <int_id>s - // are *not* dynamically allocated...) - - int current_size (void); + size_t current_size (void); // Return the current size of the map. - int total_size (void); + size_t total_size (void); // Return the total size of the map. void dump (void) const; @@ -154,8 +157,10 @@ protected: // Implementation of the Map (should use hashing instead of // array...). - // = The following methods do the actual work and assume that - // the locks are held by the private methods. + // = The following methods do the actual work. + + // These methods assume that the locks are held by the private + // methods. int bind_i (const EXT_ID &ext_id, const INT_ID &int_id); // Performs the binding of <ext_id> to <int_id>. Must be @@ -197,7 +202,7 @@ protected: // Pointer to a memory allocator. LOCK lock_; - // Synchronization variable for the MT_SAFE ACE_Map_Manager. + // Synchronization variable for the MT_SAFE <ACE_Map_Manager>. private: @@ -216,7 +221,7 @@ private: // the <ext_id> was found so that this->unbind (<ext_id>, <int_id>) // can return it to the caller. Must be called with locks held. - size_t max_size_; + size_t total_size_; // Total number of elements in this->search_structure_. size_t cur_size_; @@ -82,10 +82,6 @@ // Default shared memory key #define ACE_DEFAULT_SHM_KEY 1234 -// Default address for shared memory mapped files and SYSV shared memory -// (defaults to 64 M). -#define ACE_DEFAULT_BASE_ADDR ((char *) (64 * 1024 * 1024)) - // Default segment size used by SYSV shared memory (128 K) #define ACE_DEFAULT_SEGMENT_SIZE 1024 * 128 @@ -200,6 +196,12 @@ typedef int key_t; #define ACE_INLINE #endif /* __ACE_INLINE__ */ +// Default address for shared memory mapped files and SYSV shared memory +// (defaults to 64 M). +#if !defined (ACE_DEFAULT_BASE_ADDR) +#define ACE_DEFAULT_BASE_ADDR ((char *) (64 * 1024 * 1024)) +#endif /* ACE_DEFAULT_BASE_ADDR */ + // 10 millisecond fudge factor to account for Solaris timers... #if !defined (ACE_TIMER_SKEW) #define ACE_TIMER_SKEW 1000 * 10 @@ -313,16 +315,17 @@ public: static const ACE_Time_Value zero; // Constant "0". - // = Initialization method. + // = Initialization methods. + ACE_Time_Value (long sec = 0, long usec = 0); - // Default constructor. + // Constructor (needed to avoid conflict with the <double> version). // = Methods for converting to/from various time formats. ACE_Time_Value (const struct timeval &t); - // Construct a Time_Value from a timeval. + // Construct the <ACE_Time_Value> from a <timeval>. ACE_Time_Value (const timestruc_t &t); - // Initializes the ACE_Time_Value object from a timestruc_t. + // Initializes the <ACE_Time_Value> object from a <timestruc_t>. ACE_Time_Value (const ACE_Time_Value &tv); // Copy constructor. @@ -3435,7 +3435,8 @@ ACE_OS::thr_join (ACE_thread_t waiter_id, } ACE_INLINE int -ACE_OS::thr_join (ACE_hthread_t thr_handle, void **status) +ACE_OS::thr_join (ACE_hthread_t thr_handle, + void **status) { // ACE_TRACE ("ACE_OS::thr_join"); thr_handle = thr_handle; @@ -3467,6 +3468,8 @@ ACE_OS::thr_join (ACE_hthread_t thr_handle, void **status) // ::taskSafe()/::taskUnsafe(). But, a task can only calls those // functions on itself. Until there's really a need . . . ACE_NOTSUP_RETURN (-1); +#else + ACE_NOTSUP_RETURN (-1); #endif /* ACE_HAS_STHREADS */ #else ACE_NOTSUP_RETURN (-1); @@ -3979,7 +3982,7 @@ ACE_OS::gettimeofday (void) tv.tv_usec = long ((_100ns - (tv.tv_sec * (10000 * 1000))) * 10); #endif -#elif defined (ACE_HAS_AIX_HIRES_TIMER) +#elif defined (ACE_HAS_AIX_HI_RES_TIMER) timebasestruct_t tb; ::read_real_time(&tb, TIMEBASE_SZ); @@ -5629,7 +5632,7 @@ ACE_OS::gethrtime (void) // ACE_TRACE ("ACE_OS::gethrtime"); #if defined (ACE_HAS_HI_RES_TIMER) ACE_OSCALL_RETURN (::gethrtime (), int, -1); -#elif defined (ACE_HAS_AIX_HIRES_TIMER) +#elif defined (ACE_HAS_AIX_HI_RES_TIMER) timebasestruct_t tb; ::read_real_time(&tb, TIMEBASE_SZ); diff --git a/ace/README b/ace/README index c3cbee0e217..3cc449eb6e1 100644 --- a/ace/README +++ b/ace/README @@ -11,7 +11,7 @@ Macro Description ----- ----------- ACE_HAS_64BIT_LONGS Platform has 64bit longs and 32bit ints... -ACE_HAS_AIX_HIRES_TIMER Platform has AIX4 ::read_real_time () +ACE_HAS_AIX_HI_RES_TIMER Platform has AIX4 ::read_real_time () ACE_HAS_ALLOCA Compiler/platform supports alloca() ACE_HAS_ALLOCA_H Compiler/platform has <alloca.h> ACE_HAS_AUTOMATIC_INIT_FINI Compiler/platform correctly calls init()/fini() for shared libraries diff --git a/ace/SString.h b/ace/SString.h index 00e706f5915..7e17cba8bee 100644 --- a/ace/SString.h +++ b/ace/SString.h @@ -1,7 +1,6 @@ /* -*- C++ -*- */ // $Id$ - // ============================================================================ // // = LIBRARY diff --git a/ace/config-aix-3.2.5.h b/ace/config-aix-3.2.5.h index 8cf5005e16c..8a819b780c9 100644 --- a/ace/config-aix-3.2.5.h +++ b/ace/config-aix-3.2.5.h @@ -8,6 +8,7 @@ #define MAXNAMELEN 1024 +#define ACE_DEFAULT_BASE_ADDR 0x80000000 #define ACE_HAS_2_PARAM_ASCTIME_R_AND_CTIME_R #define ACE_HAS_RECURSIVE_THR_EXIT_SEMANTICS #define ACE_HAS_CONSISTENT_SIGNAL_PROTOTYPES diff --git a/ace/config-aix-4.1.x.h b/ace/config-aix-4.1.x.h index ceeedaaf95f..3ac6f991f4c 100644 --- a/ace/config-aix-4.1.x.h +++ b/ace/config-aix-4.1.x.h @@ -7,12 +7,24 @@ #if !defined (ACE_CONFIG_H) #define ACE_CONFIG_H +#if !defined (msg_accrights) +#undef msg_control +#define msg_accrights msg_control +#endif /* msg_accrights */ + +#if !defined (msg_accrightslen) +#undef msg_controllen +#define msg_accrightslen msg_controllen +#endif /* msg_accrightslen */ + // Compiling for AIX. + #define AIX +#define ACE_DEFAULT_BASE_ADDR 0x80000000 #define ACE_HAS_RECURSIVE_THR_EXIT_SEMANTICS #define ACE_HAS_2_PARAM_ASCTIME_R_AND_CTIME_R -#define _BSD 43 -#define ACE_HAS_AIX_HIRES_TIMER +#define _BSD 44 +#define ACE_HAS_AIX_HI_RES_TIMER #define ACE_HAS_UNION_WAIT #define ACE_HAS_MULTICAST #define ACE_HAS_TID_T @@ -49,7 +61,6 @@ // This environment requires this thing #define _BSD_INCLUDES -#define COMPAT_43 // Compiler supports the getrusage() system call #define ACE_HAS_GETRUSAGE diff --git a/ace/config-aix-4.2.x.h b/ace/config-aix-4.2.x.h new file mode 100644 index 00000000000..9d2fc464728 --- /dev/null +++ b/ace/config-aix-4.2.x.h @@ -0,0 +1,127 @@ +// The following configuration file is designed to work for OS +// platforms running AIX 4.2.x using the IBM C++ compiler. + +#if !defined (ACE_CONFIG_H) +#define ACE_CONFIG_H + +// Compiling for AIX. +#define AIX +#define ACE_HAS_RECURSIVE_THR_EXIT_SEMANTICS +#define ACE_HAS_ONLY_TWO_PARAMS_FOR_ASCTIME_R_AND_CTIME_R +// Use BSD 4.4 socket definitions +#define _BSD 44 + +#define ACE_HAS_AIX_HI_RES_TIMER +#define ACE_DEFAULT_BASE_ADDR 0x80000000 +#define ACE_HAS_UNION_WAIT +#define ACE_HAS_MULTICAST +#define ACE_HAS_TID_T +#define ACE_HAS_SIGWAIT +#define ACE_HAS_H_ERRNO +#define ACE_LACKS_THREAD_PROCESS_SCOPING +#define ACE_LACKS_THREAD_STACK_ADDR +#define ACE_LACKS_CONDATTR_PSHARED +#define ACE_HAS_SIN_LEN +#define ACE_HAS_SYSV_IPC +#define ACE_HAS_STRUCT_NETDB_DATA +#define ACE_HAS_ALLOCA +#define ACE_HAS_REENTRANT_FUNCTIONS +#define ACE_HAS_SYSV_IPC +#define ACE_HAS_TLI +#define ACE_HAS_TLI_PROTOTYPES +#define ACE_HAS_TIUSER_H +#define ACE_TEMPLATES_REQUIRE_PRAGMA +#define ACE_HAS_THREAD_SPECIFIC_STORAGE +#define ACE_HAS_THREAD_SELF +#define ACE_HAS_AUTOMATIC_INIT_FINI +#define ACE_HAS_CHARPTR_DL +#define ACE_HAS_SVR4_DYNAMIC_LINKING +#define ACE_HAS_POSIX_TIME +#define ACE_HAS_SVR4_TIME +#define ACE_HAS_THREADS +#define ACE_MT_SAFE +#define ACE_HAS_UTIME +#define ACE_HAS_SELECT_H + +#define ACE_HAS_MSG +// #define ACE_LACKS_RECVMSG +// #define ACE_LACKS_SENDMSG + +// This environment requires this thing +#define _BSD_INCLUDES + +// Compiler supports the getrusage() system call +#define ACE_HAS_GETRUSAGE + +// Prototypes for both signal() and struct sigaction are consistent. +#define ACE_HAS_CONSISTENT_SIGNAL_PROTOTYPES + +// Compiler/platform has correctly prototyped header files. +#define ACE_HAS_CPLUSPLUS_HEADERS + +// Compiler/platform supports poll(). +#define ACE_HAS_POLL + +// Platform supports POSIX O_NONBLOCK semantics. +#define ACE_HAS_POSIX_NONBLOCK + +// Compiler/platform defines the sig_atomic_t typedef +#define ACE_HAS_SIG_ATOMIC_T + +// Compiler supports the ssize_t typedef. +#define ACE_HAS_SSIZE_T + +// Compiler supports stropts.h +#define ACE_HAS_STREAMS +// #define ACE_HAS_STREAM_PIPES + +// Defines the page size of the system. +#define ACE_PAGE_SIZE 4096 + +// Compiler/platform supports strerror (). +#define ACE_HAS_STRERROR + +// EYE the include file is there + +// AIX bzero() +#define ACE_HAS_STRINGS + +// ??? has the berkeley stuff +// #define ACE_HAS_SUNOS4_GETTIMEOFDAY +#define ACE_HAS_SVR4_GETTIMEOFDAY + +// Note, this only works if the flag is set above! +#define ACE_HAS_GETRUSAGE + +// EYE assume it does for now. +#define ACE_LACKS_PTHREAD_THR_SIGSETMASK +#define ACE_HAS_PTHREADS +#define ACE_PTHREADS_MAP + +// include there +#define ACE_HAS_TIMOD_H +#define ACE_HAS_TIUSER_H + +#if !defined (ACE_NTRACE) +#define ACE_NTRACE 1 +#endif /* ACE_NTRACE */ +#define ACE_HAS_STRBUF_T + +#define ACE_HAS_SIGINFO_T +#define ACE_LACKS_SIGINFO_H +#define ACE_HAS_UCONTEXT_T +#define ACE_HAS_RTLD_LAZY_V +#define ACE_HAS_SIZET_SOCKET_LEN + +// BSD 4.4 interface fixes nabbed from config-linux.h +#if !defined (msg_accrights) +#undef msg_control +#define msg_accrights msg_control +#endif /* msg_accrights */ + +#if !defined (msg_accrightslen) +#undef msg_controllen +#define msg_accrightslen msg_controllen +#endif /* msg_accrightslen */ + +#endif /* ACE_CONFIG_H */ diff --git a/ace/config-linux-lxpthreads.h b/ace/config-linux-lxpthreads.h index f65ddae8aaf..e5a3343e651 100644 --- a/ace/config-linux-lxpthreads.h +++ b/ace/config-linux-lxpthreads.h @@ -73,7 +73,7 @@ #define ACE_HAS_SIG_ATOMIC_T // Compiler/platform supports sys_siglist array. -#define ACE_HAS_SYS_SIGLIST +// #define ACE_HAS_SYS_SIGLIST // Compiler/platform defines a union semun for SysV shared memory. #define ACE_HAS_SEMUN diff --git a/ace/config-linux.h b/ace/config-linux.h index b3046e0b160..66147a5c995 100644 --- a/ace/config-linux.h +++ b/ace/config-linux.h @@ -55,7 +55,7 @@ #define ACE_HAS_SIG_ATOMIC_T // Compiler/platform supports sys_siglist array. -#define ACE_HAS_SYS_SIGLIST +// #define ACE_HAS_SYS_SIGLIST // Compiler/platform defines a union semun for SysV shared memory. #define ACE_HAS_SEMUN |