Skip to content

Commit a6645a7

Browse files
committed
fix macos building
Signed-off-by: Di Wang <[email protected]>
1 parent 4a0a8ef commit a6645a7

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

prov/tcp/Makefile.include

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,8 @@ prov_install_man_pages += man/man7/fi_tcp.7
3535

3636
endif HAVE_TCP
3737

38+
if MACOS
39+
AM_CPPFLAGS += -DMACOS
40+
endif MACOS
41+
3842
prov_dist_man_pages += man/man7/fi_tcp.7

prov/tcp/src/xnet_ep.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,8 +189,13 @@ xnet_enable_keepalive(struct xnet_ep *ep)
189189
return -ofi_sockerr();
190190
}
191191

192+
#ifdef MACOS
193+
ret = setsockopt(ep->bsock.sock, IPPROTO_TCP, TCP_KEEPALIVE, (const void *)&idle_time,
194+
sizeof(idle_time));
195+
#else
192196
ret = setsockopt(ep->bsock.sock, IPPROTO_TCP, TCP_KEEPIDLE, (const void *)&idle_time,
193197
sizeof(idle_time));
198+
#endif
194199
if (ret) {
195200
ret = -ofi_sockerr();
196201
FI_WARN(&xnet_prov, FI_LOG_EP_CTRL, "set TCP_KEEPIDLE failed %d", ret);

0 commit comments

Comments
 (0)