Skip to content

Minor fixes for Darwin#57

Open
barracuda156 wants to merge 3 commits intojiixyj:masterfrom
barracuda156:darwin_fix
Open

Minor fixes for Darwin#57
barracuda156 wants to merge 3 commits intojiixyj:masterfrom
barracuda156:darwin_fix

Conversation

@barracuda156
Copy link

This addressed three issues:

  1. Darwin < 16 does not have clock_settime (even via legacy-support library which MacPorts and pkgsrc use).
  2. MSG_NOSIGNAL may not be defined on macOS (but apparently elsewhere too).
  3. NOTE_TRIGGER appears in later builds of 10.6 and is not supported prior to that.

With these, I can build the library on 10.6 powerpc.


/* macOS and Solaris do not have it */
#ifndef MSG_NOSIGNAL
#define MSG_NOSIGNAL 0

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MSG_NOSIGNAL should be defined as SO_NOSIGPIPE.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How sure are you? I have seen a fallback to 0 used elsewhere, like lpeterse/haskell-socket@0aa0db5

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The suggested behavior is better for macOS, but yeah, it needs to be wrapped in #ifdef __APPLE__ macros.

Copy link
Author

@barracuda156 barracuda156 Dec 6, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will try it then.

P. S. It should probably be included into legacysupport.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MSG_NOSIGNAL should be defined as SO_NOSIGPIPE.

Not correct -- SO_NOSIGPIPE is a socket option while MSG_NOSIGNAL is a flag for send.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants