8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-01-23 02:03:04 +01:00

Cleanup - unsupported port HP10

This commit is contained in:
alexpeshkoff 2009-04-10 15:36:58 +00:00
parent 1b575e194e
commit 58bdb6c241
8 changed files with 11 additions and 151 deletions

View File

@ -86,13 +86,8 @@ FB_THREAD_ID getThreadId()
#endif
#ifdef USE_POSIX_THREADS
// The following is just a temp. decision.
#ifdef HP10
id = (FB_THREAD_ID) (pthread_self().field1);
#else
id = (FB_THREAD_ID) pthread_self();
#endif // HP10
#endif // USE_POSIX_THREADS
#endif
return id;
}

View File

@ -61,7 +61,7 @@
static const char* const COMMIT = "commit";
static const char* const ROLLBACK = "rollback";
#if defined AIX || defined AIX_PPC || defined SOLARIS || defined HP10 || defined HP11 || defined LINUX || defined DARWIN || defined FREEBSD || defined NETBSD || defined WIN_NT
#if defined AIX || defined AIX_PPC || defined SOLARIS || defined HP11 || defined LINUX || defined DARWIN || defined FREEBSD || defined NETBSD || defined WIN_NT
static const char* const OMITTED = "BY VALUE 0";
static const char* const BY_VALUE = "BY VALUE ";
static const char* const END_VALUE = "";
@ -156,7 +156,7 @@ static const char* const PUT_SEG_CALL_TEMPLATE = "%sCALL \"%s\" USING %s, %s%s%d
static const char* const SQLCODE_CALL_TEMPLATE = "CALL \"%s\" USING %s, BY REFERENCE SQLCODE";
#endif // GIVING_SUPPORTED
#if defined AIX || defined AIX_PPC || defined SOLARIS || defined HP10 || defined HP11
#if defined AIX || defined AIX_PPC || defined SOLARIS || defined HP11
static const char* const USAGE_COMP = " USAGE IS COMP";
#else
static const char* const USAGE_COMP = " USAGE IS COMP";

View File

@ -76,7 +76,7 @@
#endif
#ifdef GPRE_ADA
#if (defined HPUX && defined HP10) || defined SCO_UNIX
#if defined SCO_UNIX
#define ALSYS_ADA
#endif
#endif

View File

@ -172,47 +172,7 @@ void ThreadStart::start(ThreadEntryPoint* routine,
pthread_attr_t pattr;
int state;
#if defined(HP10)
state = pthread_attr_create(&pattr);
if (state)
Firebird::system_call_failed::raise("pthread_attr_create", state);
/* The default HP's stack size is too small. HP's documentation
says it is "machine specific". My test showed it was less
than 64K. We definitly need more stack to be able to execute
concurrently many (at least 100) copies of the same request
(like, for example in case of recursive stored prcedure).
The following code sets threads stack size up to 256K if the
default stack size is less than this number
*/
const long stack_size = pthread_attr_getstacksize(pattr);
if (stack_size == -1)
Firebird::system_call_failed::raise("pthread_attr_getstacksize");
if (stack_size < 0x40000L) {
state = pthread_attr_setstacksize(&pattr, 0x40000L);
if (state)
Firebird::system_call_failed::raise("pthread_attr_setstacksize", state);
}
/* HP's Posix threads implementation does not support
bound attribute. It just a user level library.
*/
state = pthread_create(&thread, pattr, THREAD_ENTRYPOINT, THREAD_ARG);
if (state)
Firebird::system_call_failed::raise("pthread_create", state);
if (!thd_id)
{
state = pthread_detach(&thread);
if (state)
Firebird::system_call_failed::raise("pthread_detach", state);
}
state = pthread_attr_delete(&pattr);
if (state)
Firebird::system_call_failed::raise("pthread_attr_delete", state);
#elif defined (LINUX) || defined (FREEBSD)
#if defined (LINUX) || defined (FREEBSD)
if (state = pthread_create(&thread, NULL, THREAD_ENTRYPOINT, THREAD_ARG))
Firebird::system_call_failed::raise("pthread_create", state);
if (!thd_id)

View File

@ -228,8 +228,6 @@ static void stuff_stack_trace(const jrd_req*);
#if (defined SUPERSERVER) && (defined WIN_NT || defined SOLARIS_MT)
const int MAX_CLONES = 750;
#elif defined (HP10) && defined (SUPERSERVER)
const int MAX_CLONES = 110;
#else
const int MAX_CLONES = 1000;
#endif

View File

@ -123,11 +123,9 @@ const char* MTAB = "/etc/mtab";
#endif //NO_NFS
#ifdef HPUX
#if !(defined HP10 || defined HP11)
#if defined(HPUX) && (!defined HP11)
#include <cluster.h>
#endif
#endif
#ifndef MAXHOSTLEN
#define MAXHOSTLEN 64
@ -200,11 +198,9 @@ static void share_name_from_unc(tstring&, LPREMOTE_NAME_INFO);
static bool get_full_path(const tstring&, tstring&);
#endif
#ifdef HPUX
#if !(defined HP10 || defined HP11)
#if defined(HPUX) && (!defined HP11)
static bool get_server(tstring&, tstring&);
#endif
#endif
#ifndef NO_NFS
@ -292,7 +288,7 @@ bool ISC_analyze_nfs(tstring& expanded_filename, tstring& node_name)
expanded_filename.replace(0, len, max_path);
node_name = max_node;
}
#if defined(HPUX) && (!(defined HP10 || defined HP11))
#if defined(HPUX) && (!defined HP11)
else
{
flag = get_server(expanded_filename, node_name);
@ -1562,8 +1558,7 @@ bool Mnt::get()
}
#endif // GET_MOUNTS
#ifdef HPUX
#if !(defined HP10 || defined HP11)
#if defined(HPUX) && (!defined HP11)
static bool get_server(tstring&, tstring& node_name)
{
/**************************************
@ -1594,7 +1589,6 @@ static bool get_server(tstring&, tstring& node_name)
node_name = cnode->cnode_name;
return true;
}
#endif
#endif // HPUX
#endif // NO_NFS
} // anonymous namespace

View File

@ -1344,18 +1344,10 @@ int ISC_event_post(event_t* event)
const int ret = pthread_cond_broadcast(event->event_cond);
PTHREAD_ERROR(pthread_mutex_unlock(event->event_mutex));
if (ret)
#ifdef HP10
{
fb_assert(ret == -1);
gds__log ("ISC_event_post: pthread_cond_broadcast failed with errno = %d", errno);
return FB_FAILURE;
}
#else
{
gds__log ("ISC_event_post: pthread_cond_broadcast failed with errno = %d", ret);
return FB_FAILURE;
}
#endif /* HP10 */
return FB_SUCCESS;
}
@ -1409,14 +1401,10 @@ int ISC_event_wait(event_t* event,
{
ret = pthread_cond_timedwait(event->event_cond, event->event_mutex, &timer);
#ifdef HP10
if ((ret == -1) && (errno == EAGAIN))
#else
#if (defined LINUX || defined DARWIN || defined HP11 || defined FREEBSD)
if (ret == ETIMEDOUT)
#else
if (ret == ETIME)
#endif
#endif
{
@ -2160,28 +2148,8 @@ UCHAR* ISC_map_file(ISC_STATUS* status_vector,
Let's find out what the problem is by getting the
system-imposed limits.
*/
#ifdef HP10
struct pst_ipcinfo pst;
if (pstat_getipc(&pst, sizeof(struct pst_ipcinfo), 1, 0) == -1) {
error(status_vector, "pstat_getipc", errno);
fclose(fp);
return NULL;
}
if ((length < pst.psi_shmmin) || (length > pst.psi_shmmax)) {
/* If pstat_getipc did not return an error "errno"
is still EINVAL, exactly what we want.
*/
error(status_vector, "shmget", errno);
fclose(fp);
return NULL;
}
#endif /* HP10 */
/* If we are here then the shared memory segment already
If we are here then the shared memory segment already
exists and the "length" we specified in shmget() is
bigger than the size of the existing segment.
@ -3054,10 +3022,6 @@ int ISC_mutex_init(struct mtx* mutex)
state = pthread_mutex_init(mutex->mtx_mutex, &mattr);
pthread_mutexattr_destroy(&mattr);
}
#ifdef HP10
if (state != 0)
state = errno;
#endif
return state;
}
@ -3090,18 +3054,8 @@ int ISC_mutex_lock(struct mtx* mutex)
* Sieze a mutex.
*
**************************************/
#ifdef HP10
int state = pthread_mutex_lock(mutex->mtx_mutex);
if (!state)
return 0;
fb_assert(state == -1); /* if state is not 0, it should be -1 */
return errno;
#else
return pthread_mutex_lock(mutex->mtx_mutex);
#endif /* HP10 */
}
@ -3117,34 +3071,8 @@ int ISC_mutex_lock_cond(struct mtx* mutex)
* Conditionally sieze a mutex.
*
**************************************/
#ifdef HP10
int state = pthread_mutex_trylock(mutex->mtx_mutex);
/* HP's interpretation of return codes is different than Solaris
(and Posix Standard?). Usually in case of error they return
-1 and set errno to whatever error number is.
pthread_mutex_trylock() is a special case:
return errno description
1 Success
0 mutex has alreary been locked. Could not get it
-1 EINVAL invalid value of mutex
*/
if (!state)
return -99; /* we did not get the mutex for it had already */
/* been locked, let's return something which is */
/* not zero and negative (errno values are positive) */
if (state == 1)
return 0;
fb_assert(state == -1); /* if state is not 0 or 1, it should be -1 */
return errno;
#else
return pthread_mutex_trylock(mutex->mtx_mutex);
#endif /* HP10 */
}
@ -3160,18 +3088,8 @@ int ISC_mutex_unlock(struct mtx* mutex)
* Release a mutex.
*
**************************************/
#ifdef HP10
int state = pthread_mutex_unlock(mutex->mtx_mutex);
if (!state)
return 0;
fb_assert(state == -1); /* if state is not 0, it should be -1 */
return errno;
#else
return pthread_mutex_unlock(mutex->mtx_mutex);
#endif /* HP10 */
}
#endif // USE_SYS5SEMAPHORE

View File

@ -68,12 +68,7 @@
#include "../jrd/isc_version.h"
#ifdef HPUX
#ifdef HP10
#define FB_PLATFORM "HU"
#endif /* HP10 */
#ifdef HP11
#define FB_PLATFORM "HU"
#endif /* HP11 */
#define FB_PLATFORM "HU"
#endif
#ifdef sun