-
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
Merged
Changes from 14 commits
Commits
Show all changes
30 commits
Select commit
Hold shift + click to select a range
4c10010
Add support for Darwin / macOS
rsmarples e920e7f
Add reallocarray
rsmarples 441de7a
Csat away a compile warning.
rsmarples eb8dc1e
Solve initgroups compile warning on all OS.
rsmarples 837d25f
Fixup xsetfd
rsmarples c9c891b
Remove debug
rsmarples bf8283a
lua: correct message type
rsmarples f6cd3bc
remove old svc_run
rsmarples d04a15a
Remove dup define
rsmarples dd14a87
lua: improve hostname lookup
rsmarples 3bdae24
lua: fix payload len guard
rsmarples d2034e5
lua: more fixes
rsmarples 44b1998
use blocking sockets
rsmarples e1c159c
Fix returning service data
rsmarples 19d1d3e
Abort eloop if service watcher fails.
rsmarples 5da02fe
Add macos to github actions
rsmarples 7e6dad8
Fix macos arm64
rsmarples c450118
Just build on latest OS
rsmarples 8a67a9a
Fix diagnostic message
rsmarples 65a2602
Use latest checkout
rsmarples bdf0823
Brew and pkgconf are already installed.
rsmarples 6a590c6
Latest checkout
rsmarples ea815b0
Don't exit on hangup as we already have
rsmarples f7ee065
eloop: rationalise not setting cloexec on macos
rsmarples f18a138
lua: ensure we have space to copyout hostname.
rsmarples b346ca9
Fix xsetfd, close eloop fd with epoll and correct a diagnositic message.
rsmarples d10a94f
Fix on bsd
rsmarples 0853b1f
Fix again, lol
rsmarples 2824fd2
reallocarray: fix errno and avoid div by zero.
rsmarples be6a688
Build on macos-15 and macos-26
rsmarples File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,60 @@ | ||
| /* $NetBSD: reallocarr.c,v 1.4 2015/08/20 20:08:04 joerg Exp $ */ | ||
|
|
||
| /*- | ||
| * Copyright (c) 2015 Joerg Sonnenberger <joerg@NetBSD.org>. | ||
| * All rights reserved. | ||
| * | ||
| * Redistribution and use in source and binary forms, with or without | ||
| * modification, are permitted provided that the following conditions | ||
| * are met: | ||
| * | ||
| * 1. Redistributions of source code must retain the above copyright | ||
| * notice, this list of conditions and the following disclaimer. | ||
| * 2. Redistributions in binary form must reproduce the above copyright | ||
| * notice, this list of conditions and the following disclaimer in | ||
| * the documentation and/or other materials provided with the | ||
| * distribution. | ||
| * | ||
| * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | ||
| * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | ||
| * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS | ||
| * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE | ||
| * COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, | ||
| * INCIDENTAL, SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING, | ||
| * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
| * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED | ||
| * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | ||
| * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT | ||
| * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | ||
| * SUCH DAMAGE. | ||
| */ | ||
|
|
||
| #include <errno.h> | ||
| #include <limits.h> | ||
| #include <stddef.h> | ||
| #include <stdint.h> | ||
| #include <stdlib.h> | ||
|
|
||
| /* | ||
| * To be clear, this is NetBSD's more refined reallocarr(3) function | ||
| * made to look like OpenBSD's more useable reallocarray(3) interface. | ||
| */ | ||
| #include "reallocarray.h" | ||
|
|
||
| #define SQRT_SIZE_MAX (((size_t)1) << (sizeof(size_t) * CHAR_BIT / 2)) | ||
| void * | ||
| reallocarray(void *ptr, size_t n, size_t size) | ||
| { | ||
|
|
||
| /* | ||
| * Try to avoid division here. | ||
| * | ||
| * It isn't possible to overflow during multiplication if neither | ||
| * operand uses any of the most significant half of the bits. | ||
| */ | ||
| if ((n | size) >= SQRT_SIZE_MAX && n > SIZE_MAX / size) { | ||
| errno = EOVERFLOW; | ||
|
coderabbitai[bot] marked this conversation as resolved.
Outdated
|
||
| return NULL; | ||
| } | ||
| return realloc(ptr, n * size); | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| /* $NetBSD: reallocarr.c,v 1.4 2015/08/20 20:08:04 joerg Exp $ */ | ||
|
|
||
| /*- | ||
| * Copyright (c) 2015 Joerg Sonnenberger <joerg@NetBSD.org>. | ||
| * All rights reserved. | ||
| * | ||
| * Redistribution and use in source and binary forms, with or without | ||
| * modification, are permitted provided that the following conditions | ||
| * are met: | ||
| * | ||
| * 1. Redistributions of source code must retain the above copyright | ||
| * notice, this list of conditions and the following disclaimer. | ||
| * 2. Redistributions in binary form must reproduce the above copyright | ||
| * notice, this list of conditions and the following disclaimer in | ||
| * the documentation and/or other materials provided with the | ||
| * distribution. | ||
| * | ||
| * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | ||
| * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | ||
| * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS | ||
| * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE | ||
| * COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, | ||
| * INCIDENTAL, SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING, | ||
| * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
| * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED | ||
| * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | ||
| * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT | ||
| * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | ||
| * SUCH DAMAGE. | ||
| */ | ||
|
|
||
| #ifndef REALLOCARRAY_H | ||
| #define REALLOCARRAY_H | ||
|
|
||
| #include <stddef.h> | ||
|
|
||
| void *reallocarray(void *, size_t, size_t); | ||
|
|
||
| #endif |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1 @@ | ||
| # This space left intentionally blank | ||
|
|
||
| DHCPCD_SRCS+= dhcpcd-embedded.c |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.