Skip to content

Commit

Permalink
Add Windows support for poll function
Browse files Browse the repository at this point in the history
  • Loading branch information
taylor-a-barnes committed Jun 27, 2024
1 parent b821e1c commit a732616
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion MDI_Library/mdi_tcp.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@
#include <sys/socket.h>
#include <netdb.h>
#include <unistd.h>
#include <poll.h>
#endif
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <signal.h>
#include <errno.h>
#include <poll.h>
#include "mdi.h"
#include "mdi_tcp.h"
#include "mdi_global.h"
Expand Down Expand Up @@ -474,7 +474,11 @@ int tcp_check_for_connection(int* flag) {

if ( this_code->intra_rank == 0 ) { // Running on rank 0

#ifdef _WIN32
ret = WSAPoll(&poll_args, 1, 0);
#else
ret = poll(&poll_args, 1, 0);
#endif
if (ret > 0) {
if ( poll_args.revents & POLLIN ) {
*flag = 1;
Expand Down

0 comments on commit a732616

Please sign in to comment.