Bug 451001 - use of undeclared identifier 'SOCK_CLOEXEC', 'dup3', 'pipe2'
Summary: use of undeclared identifier 'SOCK_CLOEXEC', 'dup3', 'pipe2'
Status: REPORTED
Alias: None
Product: frameworks-kdesu
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: 5.91.0
Platform: Homebrew (macOS) macOS
: NOR normal
Target Milestone: ---
Assignee: kdelibs bugs
URL: https://invent.kde.org/packaging/home...
Keywords:
Depends on:
Blocks:
 
Reported: 2022-03-01 12:48 UTC by Yurii Kolesnykov
Modified: 2022-03-01 13:48 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Yurii Kolesnykov 2022-03-01 12:48:03 UTC
SUMMARY
kdesu stopped to build under macOS after this MR: https://invent.kde.org/frameworks/kdesu/-/merge_requests/14

STEPS TO REPRODUCE
1. Try to build kdesu on macOS

OBSERVED RESULT
/tmp/kf5-kdesu-20220301-88703-7d14qt/kdesu-5.91.0/src/kdesud/kdesud.cpp:255:44: error: use of undeclared identifier 'SOCK_CLOEXEC'
    sockfd = socket(PF_UNIX, SOCK_STREAM | SOCK_CLOEXEC, 0);
                                           ^
/tmp/kf5-kdesu-20220301-88703-7d14qt/kdesu-5.91.0/src/kdesud/kdesud.cpp:355:18: error: use of undeclared identifier 'dup3'
        sockfd = dup3(sockfd, 3, O_CLOEXEC);
                 ^
/tmp/kf5-kdesu-20220301-88703-7d14qt/kdesu-5.91.0/src/kdesud/kdesud.cpp:391:5: error: use of undeclared identifier 'pipe2'
    pipe2(pipeOfDeath, O_CLOEXEC);

EXPECTED RESULT
Should build.

SOFTWARE/OS VERSIONS
macOS: 12.3
KDE Frameworks Version: 5.91
Qt Version: 5.15.2
Comment 1 Allen Winter 2022-03-01 13:16:47 UTC
I've been informed that kdesu is not intended to be built for Mac or Windows.
It's for Linux and *BSD only.
Comment 2 Yurii Kolesnykov 2022-03-01 13:37:42 UTC
How many *BSDs have all of this syscalls except FreeBSD?
Comment 3 Yurii Kolesnykov 2022-03-01 13:40:30 UTC
And macOS is largely derived from original BSD with some later updates and backports.