Bug 451001

Summary: use of undeclared identifier 'SOCK_CLOEXEC', 'dup3', 'pipe2'
Product: [Frameworks and Libraries] frameworks-kdesu Reporter: Yurii Kolesnykov <yurii.kolesnykov>
Component: generalAssignee: kdelibs bugs <kdelibs-bugs>
Status: REPORTED ---    
Severity: normal CC: winter, yurii.kolesnykov
Priority: NOR    
Version: 5.91.0   
Target Milestone: ---   
Platform: Homebrew (macOS)   
OS: macOS   
URL: https://invent.kde.org/packaging/homebrew-kde/-/issues/42
Latest Commit: Version Fixed In:
Sentry Crash Report:

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.