Skip to content
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

Compiling fails on Mac #53

Open
jospic opened this issue Sep 5, 2024 · 2 comments
Open

Compiling fails on Mac #53

jospic opened this issue Sep 5, 2024 · 2 comments

Comments

@jospic
Copy link

jospic commented Sep 5, 2024

Hi,
when I've tried to compiling on Mac get this error:

warning: 'syscall' is deprecated: first deprecated in macOS 10.12 - syscall(2) is unsupported; please switch to a supported interface.

I seems that fails on following function inside sqleet.c (at line 229298):

static size_t entropy(void *buf, size_t n)
{
    #if defined(__linux__) && defined(SYS_getrandom)
    if (syscall(SYS_getrandom, buf, n, 0) == n)
        return n;
    #elif defined(SYS_getentropy)
    if (syscall(SYS_getentropy, buf, n) == 0)
        return n;
    #endif
    return read_urandom(buf, n);
}

Any suggestions?
Thanks in advance.
-j

@utelle
Copy link
Contributor

utelle commented Sep 5, 2024

Hi, when I've tried to compiling on Mac get this error:

warning: 'syscall' is deprecated: first deprecated in macOS 10.12 - syscall(2) is unsupported; please switch to a supported interface.

I seems that fails on following function inside sqleet.c (at line 229298):

static size_t entropy(void *buf, size_t n)
{
    #if defined(__linux__) && defined(SYS_getrandom)
    if (syscall(SYS_getrandom, buf, n, 0) == n)
        return n;
    #elif defined(SYS_getentropy)
    if (syscall(SYS_getentropy, buf, n) == 0)
        return n;
    #endif
    return read_urandom(buf, n);
}

Any suggestions? Thanks in advance. -j

You may want to look at the modified implementation I use in my project SQLite3 Multiple Ciphers:

SQLite3MultipleCiphers/src/chacha20poly1305.c, lines 385-402.

@jospic
Copy link
Author

jospic commented Sep 5, 2024

Great, I will try...
Thanks!
-j

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

No branches or pull requests

2 participants