-
Notifications
You must be signed in to change notification settings - Fork 1
Add support for Darwin / macOS #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
4c10010
e920e7f
441de7a
eb8dc1e
837d25f
c9c891b
bf8283a
f6cd3bc
d04a15a
dd14a87
3bdae24
d2034e5
44b1998
e1c159c
19d1d3e
5da02fe
7e6dad8
c450118
8a67a9a
65a2602
bdf0823
6a590c6
ea815b0
f7ee065
f18a138
b346ca9
d10a94f
0853b1f
2824fd2
be6a688
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,8 +3,9 @@ config.mk | |
| config.h | ||
| config.log | ||
|
|
||
| *.dSYM/** | ||
| *.o | ||
| *.So | ||
| *.soo | ||
| *.so | ||
|
|
||
| *.tar.xz | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1 @@ | ||
| # This space left intentionally blank | ||
|
|
||
| DHCPCD_SRCS+= dhcpcd-embedded.c |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -36,7 +36,7 @@ | |
| * On Linux use epoll(7) | ||
| * Everywhere else use ppoll(2) | ||
| */ | ||
| #ifdef BSD | ||
| #if defined(BSD) || defined(__APPLE__) | ||
| #include <sys/event.h> | ||
| #define USE_KQUEUE | ||
| #if defined(__NetBSD__) | ||
|
|
@@ -625,6 +625,8 @@ eloop_open(struct eloop *eloop) | |
| fd = kqueue1(O_CLOEXEC); | ||
| #elif defined(KQUEUE_CLOEXEC) | ||
| fd = kqueuex(KQUEUE_CLOEXEC); | ||
| #elif defined(USE_KQUEUE) && defined(__APPLE__) | ||
| fd = kqueue(); | ||
|
Comment on lines
+628
to
+633
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
# Verify that all fork() calls in the codebase are followed by exec() variants
# to confirm the CLOEXEC omission is safe
echo "=== Searching for fork() calls and their context ==="
rg -n -A10 '\bfork\s*\(\s*\)' --type=c
echo ""
echo "=== Checking for exec family calls ==="
rg -n '\b(execl|execle|execlp|execv|execve|execvp|execvpe)\s*\(' --type=cRepository: NetworkConfiguration/dhcpsd Length of output: 1449 🏁 Script executed: # Check if eloop.c exists and examine the file
find . -name "eloop.c" -type fRepository: NetworkConfiguration/dhcpsd Length of output: 84 🏁 Script executed: # Get more context around the fork() calls to see if exec is called
# Let's examine src/dhcpsd.c more closely around the fork calls
head -n 280 src/dhcpsd.c | tail -n 70Repository: NetworkConfiguration/dhcpsd Length of output: 1725 🏁 Script executed: # Search for exec calls more broadly (might be escaped or formatted differently)
rg -n 'exec' --type=c | head -20Repository: NetworkConfiguration/dhcpsd Length of output: 140 🏁 Script executed: # Read src/eloop.c lines 620-640 to see the full context
sed -n '620,640p' src/eloop.cRepository: NetworkConfiguration/dhcpsd Length of output: 675 macOS kqueue FD without CLOEXEC — unsafe assumption about fork/exec pattern. The comment contains two issues:
Since child processes inherit the kqueue FD without CLOEXEC, and no 🤖 Prompt for AI Agents |
||
| #elif defined(USE_KQUEUE) | ||
| int flags; | ||
|
|
||
|
|
@@ -871,7 +873,7 @@ eloop_waitfd(int fd) | |
| struct pollfd pfd = { .fd = fd, .events = POLLIN }; | ||
| int err; | ||
|
|
||
| err = ppoll(&pfd, 1, NULL, NULL); | ||
| err = poll(&pfd, 1, -1); | ||
| if (err == -1 || err == 0) | ||
| return err; | ||
|
|
||
|
|
@@ -1092,4 +1094,4 @@ eloop_start(struct eloop *eloop) | |
| } | ||
|
|
||
| return eloop->exitcode; | ||
| } | ||
| } | ||
Uh oh!
There was an error while loading. Please reload this page.