36
36
* Libpvm core for unix environment.
39
* Revision 1.69 2004/01/14 18:50:55 pvmsrc
40
* Added new AIX5* arches.
43
* Revision 1.68 2003/02/04 20:03:04 pvmsrc
44
* Got rid of Jigen's goofy my_errno...
45
* - never resolved anywhere...
48
* Revision 1.67 2002/04/16 15:06:01 pvmsrc
49
* WIN32 Fixes for Multiple Domains.
50
* - submitted by Jigen Zhou <jigen@icemcfd.com>.
53
* Revision 1.66 2002/02/18 19:18:33 pvmsrc
54
* Added "|| defined(IMA_SUN4SOL2)" to "const void *i, *j" #if
55
* for int_compare() / qsort()...
56
* (needed for sure for 64 bit) Solaris)
59
* Revision 1.65 2001/12/07 16:06:09 pvmsrc
60
* Oops! Some new Unix fixes & features break Windows (of course!).
61
* - #ifdef-ed away fcntl() calls for non-blocking sockets / stdin.
62
* (one for bug fix in lpvm.c, one for check_ext_input() in pvmd.c)
65
* Revision 1.64 2001/09/25 21:20:17 pvmsrc
66
* Minor TMPNAMFUN()/tmpnam() cleanup.
67
* - moved macro def to pvm3.h, renamed PVMTNPMAN().
68
* - same for LEN_OF_TMP_NAM -> PVMTMPNAMLEN.
69
* - mostly a huge waste of time, since *both* tmpnam() & mktemp()
70
* produce the same "dangerous" warning message in Linux/gcc...
74
* Revision 1.63 2001/09/25 17:28:09 pvmsrc
75
* Fixed leftover tmpnam() usage -> use TMPNAMFUN() instead...
76
* - also got rid of "double" call to tmpnam()...
79
* Revision 1.62 2001/05/11 19:40:50 pvmsrc
80
* Fixed direct-routing bug, removed blocking socket deadlock.
81
* - fix submitted by Kamil Iskra <kamil@wins.uva.nl> (as well as
82
* <jc@esi.fr>, Dick van Albada <dick@wins.uva.nl>, and
83
* Zeger Hendrikse <zegerh@wins.uva.nl>).
86
* Revision 1.61 2001/05/11 19:21:29 pvmsrc
87
* Added "&& errno != EAGAIN" to select() return code check in mxfer().
88
* - reported by "Johannes Hennecke" <Johannes.Hennecke@ELSA.de>
91
* Revision 1.60 2001/05/11 17:32:26 pvmsrc
92
* Eliminated references to sys_errlist & sys_nerr.
93
* - unnecessary, and we're whacking that crap anyway.
96
* Revision 1.59 2001/02/07 23:14:04 pvmsrc
97
* First Half of CYGWIN Check-ins...
100
* Revision 1.58 2000/06/15 17:51:49 pvmsrc
101
* Fixed bug in WIN32 direct routing.
102
* - stupid #endif in the wrong place, pvm_fd_add() call whacked.
103
* - turned back on direct routing default and setopt.
106
* Revision 1.57 2000/02/17 23:12:10 pvmsrc
107
* *** Changes for new BEOLIN port ***
108
* - MPP-like, similar to SP2, etc.
109
* - submitted by Paul Springer <pls@smokeymt.jpl.nasa.gov>.
110
* - format-checked & cleaned up by Jeembo... :-)
113
* Revision 1.56 2000/02/16 21:59:40 pvmsrc
114
* Fixed up #include <sys/types.h> stuff...
115
* - use <bsd/sys/types.h> for IMA_TITN...
116
* - #include before any NEEDMENDIAN #includes...
119
* Revision 1.55 2000/02/07 22:22:07 pvmsrc
120
* Hack to help with select()/fd_sets in WIN32:
121
* - fd_set is *NOT* a bit field in WIN32, is a circular buffer.
122
* - must check for !FD_ISSET() before FD_SET() else duplicate
123
* entries possible, and fd_set buffer overflow/overwrite.
124
* - similary, FD_ISSET() check before FD_CLR().
125
* - patch submitted by "Bruce W. Church" <bwc1@cornell.edu>.
128
* Revision 1.54 1999/11/08 17:44:29 pvmsrc
129
* SGI compiler cleanup.
39
132
* Revision 1.53 1999/07/08 18:59:53 kohl
40
133
* Fixed "Log" keyword placement.
41
134
* - indent with " * " for new CVS.
664
772
int sets; /* which sets */
667
776
if (fd < 0 || fd >= FD_SETSIZE) {
668
777
pvmlogprintf("pvm_fd_delete() bad fd %d\n", fd);
673
FD_CLR(fd, &pvmrfds);
783
if ( FD_ISSET(fd, &pvmrfds) ) {
784
FD_CLR(fd, &pvmrfds);
676
FD_CLR(fd, &pvmwfds);
791
if ( FD_ISSET(fd, &pvmwfds) ) {
792
FD_CLR(fd, &pvmwfds);
678
FD_CLR(fd, &pvmefds);
798
if ( FD_ISSET(fd, &pvmefds) ) {
799
FD_CLR(fd, &pvmefds);
681
807
/* if this was highest, may have to adjust nfds to new highest */
683
808
if (fd + 1 == pvmnfds)
684
809
while (pvmnfds > 0) {
686
811
if (FD_ISSET(pvmnfds, &pvmrfds)
688
|| FD_ISSET(pvmnfds, &pvmefds)
689
|| FD_ISSET(pvmnfds, &pvmwfds)
813
|| FD_ISSET(pvmnefds, &pvmefds)
814
|| FD_ISSET(pvmnwfds, &pvmwfds)
1881
2011
if (setsockopt(s, IPPROTO_TCP, TCP_NODELAY,
1882
2012
(char*)&n, sizeof(int)) == -1)
1883
2013
pvmlogperror("mxfer() setsockopt");
1884
#if (!defined(IMA_RS6K)) && (!defined(IMA_AIX46K))
2014
#if (!defined(IMA_RS6K)) \
2015
&& (!defined(IMA_AIX46K)) && (!defined(IMA_AIX46K64)) \
2016
&& (!defined(IMA_AIX56K)) && (!defined(IMA_AIX56K64))
1886
2018
if (setsockopt(s, SOL_SOCKET, SO_SNDBUF,
1887
2019
(char*)&n, sizeof(int)) == -1
1888
2020
|| setsockopt(s, SOL_SOCKET, SO_RCVBUF,
1889
2021
(char*)&n, sizeof(n)) == -1)
1890
pvmlogperror("mxfer() setsockopt SO_SNDBUF");
2023
"mxfer() setsockopt SO_SNDBUF");
1892
2025
#ifndef NOUNIXDOM
2326
2481
if (setsockopt(s, IPPROTO_TCP, TCP_NODELAY,
2327
2482
(char*)&l, sizeof(int)) == -1)
2328
2483
pvmlogperror("mroute() setsockopt");
2329
#if (!defined(IMA_RS6K)) && (!defined(IMA_AIX46K))
2484
#if (!defined(IMA_RS6K)) \
2485
&& (!defined(IMA_AIX46K)) && (!defined(IMA_AIX46K64)) \
2486
&& (!defined(IMA_AIX56K)) && (!defined(IMA_AIX56K64))
2331
2488
if (setsockopt(s, SOL_SOCKET, SO_SNDBUF,
2332
2489
(char*)&l, sizeof(l)) == -1
3105
3276
pvm_upkint(&i, 1, 1); /* XXX data signature */
3107
3278
pvm_upkstr(buf);
3281
if (gethostname(namebuf, sizeof(namebuf)-1) == -1) {
3282
pvmlogerror("pvmbeatask() can't gethostname()\n");
3283
hex_inadport(buf, &pvmourinet);
3285
/* got name, now get addr */
3286
if (!(hostaddr = gethostbyname( namebuf ))) {
3287
pvmlogprintf( "pvmbeatask() can't gethostbyname() for %s\n",
3289
hex_inadport(buf, &pvmourinet);
3291
/* got addr, now save it */
3292
BCOPY( hostaddr->h_addr_list[0],
3293
(char*)&pvmourinet.sin_addr,
3294
sizeof(struct in_addr));
3108
3298
hex_inadport(buf, &pvmourinet);
3109
3301
pvmourinet.sin_family = AF_INET;
3110
3302
pvmourinet.sin_port = 0;