version 1.11, 2003/08/14 22:01:27
|
version 1.18, 2005/02/05 22:59:24
|
|
|
//%///////////////////////////////////////////////////////////////////////////// |
//%2005//////////////////////////////////////////////////////////////////////// |
// | // |
// Copyright (c) 2000, 2001, 2002 BMC Software, Hewlett-Packard Company, IBM, |
// Copyright (c) 2000, 2001, 2002 BMC Software; Hewlett-Packard Development |
// The Open Group, Tivoli Systems |
// Company, L.P.; IBM Corp.; The Open Group; Tivoli Systems. |
|
// Copyright (c) 2003 BMC Software; Hewlett-Packard Development Company, L.P.; |
|
// IBM Corp.; EMC Corporation, The Open Group. |
|
// Copyright (c) 2004 BMC Software; Hewlett-Packard Development Company, L.P.; |
|
// IBM Corp.; EMC Corporation; VERITAS Software Corporation; The Open Group. |
|
// Copyright (c) 2005 Hewlett-Packard Development Company, L.P.; IBM Corp.; |
|
// EMC Corporation; VERITAS Software Corporation; The Open Group. |
// | // |
// Permission is hereby granted, free of charge, to any person obtaining a copy | // Permission is hereby granted, free of charge, to any person obtaining a copy |
// of this software and associated documentation files (the "Software"), to | // of this software and associated documentation files (the "Software"), to |
|
|
{ | { |
#ifdef PEGASUS_OS_TYPE_WINDOWS | #ifdef PEGASUS_OS_TYPE_WINDOWS |
return ::recv(socket, (char*)ptr, size, 0); | return ::recv(socket, (char*)ptr, size, 0); |
#elif defined(PEGASUS_OS_ZOS) |
|
int i=::read(socket, (char*)ptr, size); |
|
__atoe_l((char *)ptr,size); |
|
return i; |
|
#else | #else |
|
#if defined (__GNUC__) && !defined(PEGASUS_OS_SOLARIS) && !defined(PEGASUS_OS_DARWIN) && !defined(PEGASUS_OS_LSB) |
#if defined (__GNUC__) |
|
int ccode = TEMP_FAILURE_RETRY(::read(socket, (char*)ptr, size)); | int ccode = TEMP_FAILURE_RETRY(::read(socket, (char*)ptr, size)); |
return ccode; | return ccode; |
#else | #else |
|
|
{ | { |
#ifdef PEGASUS_OS_TYPE_WINDOWS | #ifdef PEGASUS_OS_TYPE_WINDOWS |
return ::send(socket, (const char*)ptr, size, 0); | return ::send(socket, (const char*)ptr, size, 0); |
#elif defined(PEGASUS_OS_ZOS) |
|
char * ptr2 = (char *)malloc(size); |
|
int i; |
|
memcpy(ptr2,ptr,size); |
|
__etoa_l(ptr2,size); |
|
i = ::write(socket, ptr2, size); |
|
free(ptr2); |
|
return i; |
|
#else | #else |
#if (__GNUC__) |
#if (__GNUC__) && !defined(PEGASUS_OS_SOLARIS) && !defined(PEGASUS_OS_DARWIN) && !defined(PEGASUS_OS_LSB) |
int ccode = TEMP_FAILURE_RETRY(::write(socket, (char*)ptr, size)); | int ccode = TEMP_FAILURE_RETRY(::write(socket, (char*)ptr, size)); |
return ccode; | return ccode; |
#else | #else |
|
|
#ifdef PEGASUS_OS_TYPE_WINDOWS | #ifdef PEGASUS_OS_TYPE_WINDOWS |
closesocket(socket); | closesocket(socket); |
#else | #else |
#if (__GNUC__) |
#if (__GNUC__) && !defined(PEGASUS_OS_SOLARIS) && !defined(PEGASUS_OS_DARWIN) && !defined(PEGASUS_OS_LSB) |
TEMP_FAILURE_RETRY(::close(socket)); | TEMP_FAILURE_RETRY(::close(socket)); |
#else | #else |
::close(socket); | ::close(socket); |
|
|
#ifdef PEGASUS_OS_TYPE_WINDOWS | #ifdef PEGASUS_OS_TYPE_WINDOWS |
return closesocket(socket); | return closesocket(socket); |
#else | #else |
#if (__GNUC__) |
#if (__GNUC__) && !defined(PEGASUS_OS_SOLARIS) && !defined(PEGASUS_OS_DARWIN) && !defined(PEGASUS_OS_LSB) |
int ccode = TEMP_FAILURE_RETRY(::close(socket)); | int ccode = TEMP_FAILURE_RETRY(::close(socket)); |
return ccode; | return ccode; |
#else | #else |