uNetworking / uNetworking/uSockets

Consider `sendto$NOCANCEL` on macOS to avoid EINTR

Open
#174 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C
Stars
1.5k
Forks
307
PR merge metrics
No merged PRs in 30d

Description

darwin has a number of i/o functions that won't return EINTR

This line:
https://github.com/uNetworking/uSockets/blob/eab7df550a7ebc631e2adcff8b7364481661e879/src/bsd.c#L67

Could be:

        int ret = sendto$NOCANCEL(fd, packet_buffer->buf[i], packet_buffer->len[i], flags, (struct sockaddr *)&packet_buffer->addr[i], sizeof(struct sockaddr_in));

Though a macro might be nice here so it is less ugly

There are several of these

recvfrom$NOCANCEL
sendto$NOCANCEL
fcntl$NOCANCEL
sendmsg$NOCANCEL
recvmsg$NOCANCEL
connect$NOCANCEL
accept$NOCANCEL
accept4$NOCANCEL
open$NOCANCEL
close$NOCANCEL

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with src/bsd.c at the referenced line and inspect how the sendto call is used on macOS. Check the listed NOCANCEL variants and determine whether a macro can cover the relevant calls without affecting other platforms. Done means the applicable Darwin I/O calls avoid EINTR while preserving existing behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
c, macos
Domain
networking, operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.