diff --git a/gtests/net/packetdrill/run_system_call.c b/gtests/net/packetdrill/run_system_call.c index 01e0a80d85970ad535da19dfccf787fef8bbb067..b8f88c6b09ccb6115c41cf3456611fa39f4ab72e 100644 --- a/gtests/net/packetdrill/run_system_call.c +++ b/gtests/net/packetdrill/run_system_call.c @@ -76,7 +76,7 @@ struct sctp_tlv { u32 sn_length; }; #endif -#if defined(__FreeBSD__) || defined(linux) || (defined(__APPLE__) && defined(HAVE_SCTP)) || defined(__SunOS_5_11) +#if defined(__FreeBSD__) || defined(linux) || (defined(__APPLE__) && defined(HAVE_SCTP) && defined(MSG_NOTIFICATION)) || defined(__SunOS_5_11) static int check_sctp_notification(struct socket *socket, struct iovec *iov, struct expression *iovec_expr, char **error); static int parse_expression_to_sctp_initmsg(struct expression *expr, struct sctp_initmsg *init, @@ -2458,7 +2458,7 @@ static int syscall_recvmsg(struct state *state, struct syscall_spec *syscall, expected_msg_flags, msg->msg_flags); goto error_out; } -#if defined(__FreeBSD__) || defined(linux) || (defined(__APPLE__) && defined(HAVE_SCTP)) || defined(__SunOS_5_11) +#if defined(__FreeBSD__) || defined(linux) || (defined(__APPLE__) && defined(HAVE_SCTP) && defined(MSG_NOTIFICATION)) || defined(__SunOS_5_11) if (msg->msg_flags & MSG_NOTIFICATION) { struct socket *socket = find_socket_by_script_fd(state, script_fd); if (check_sctp_notification(socket, msg->msg_iov, msg_expression->value.msghdr->msg_iov, error)) @@ -6522,10 +6522,12 @@ static int syscall_sctp_recvv(struct state *state, struct syscall_spec *syscall, asprintf(error, "sctp_recvv flags bad return value. expected %d, actual %d", script_flags, flags); goto error_out; +#if defined(MSG_NOTIFICATION) } else if (flags & MSG_NOTIFICATION) { struct socket *socket = find_socket_by_script_fd(state, script_fd); if (check_sctp_notification(socket, iov, iovec_expr_list, error)) goto error_out; +#endif } } free(from); diff --git a/gtests/net/packetdrill/symbols_darwin.c b/gtests/net/packetdrill/symbols_darwin.c index 9e6b035a9f6ce3259cce67e9dd6bc43f9e4a0057..fe3c75b817240b548c3e4540f13b5517b44863e8 100644 --- a/gtests/net/packetdrill/symbols_darwin.c +++ b/gtests/net/packetdrill/symbols_darwin.c @@ -495,7 +495,9 @@ struct int_symbol platform_symbols_table[] = { { MSG_HAVEMORE, "MSG_HAVEMORE" }, { MSG_RCVMORE, "MSG_RCVMORE" }, { MSG_NEEDSA, "MSG_NEEDSA" }, - +#if defined(MSG_NOTIFICATION) + { MSG_NOTIFICATION, "MSG_NOTIFICATION" }, +#endif /* /usr/include/sys/filio.h */ { FIOCLEX, "FIOCLEX" }, { FIONCLEX, "FIONCLEX" },