Bug 14527 - Use of sendfile() on Solaris requires -lsendfile
Summary: Use of sendfile() on Solaris requires -lsendfile
Status: RESOLVED WORKSFORME
Alias: None
Product: Samba 4.1 and newer
Classification: Unclassified
Component: Build (show other bugs)
Version: 4.10.18
Hardware: Sparc Solaris
: P5 normal (vote)
Target Milestone: ---
Assignee: Samba QA Contact
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-10-08 12:44 UTC by Albert Chin (temp failure)
Modified: 2020-10-08 14:25 UTC (History)
0 users

See Also:


Attachments
Add -lsendfile for sendfile() (3.36 KB, patch)
2020-10-08 12:44 UTC, Albert Chin (temp failure)
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Albert Chin (temp failure) 2020-10-08 12:44:01 UTC
Created attachment 16276 [details]
Add -lsendfile for sendfile()

On Solaris 10/11, use of sendfile() in source3/lib/sendfile.c requires -lsendfile. From sendfile(3):
NAME
     sendfile - send files over sockets or copy files to files

SYNOPSIS
     cc [ flag... ] file... -lsendfile [ library... ]
     #include <sys/sendfile.h>

     ssize_t sendfile(int out_fd, int in_fd, off_t *off, size_t len);

Building source3/lib/sendfile.c for samba3util is done in source3/wscript_build. It seems this would be the ideal place to add -lsendfile. How is this done only for samba3util? I modified lib/replace/wscript to add -lsendfile but that is done for every shared library, something that seems less than ideal.
Comment 1 Björn Jacke 2020-10-08 14:25:11 UTC
this is fixed already:

commit b8bf7ef87e29daa18b079d221ffa3252d1719f2a
Author: Björn Jacke <bj@sernet.de>
Date:   Sun Feb 10 22:38:49 2019 +0100

    waf: add library dependency for sendfile on Solaris
    
    Signed-off-by: Bjoern Jacke <bjacke@samba.org>
    Reviewed-by: Andreas Schneider <asn@samba.org>

so I think, this is not a problem any more. You should use a more modern Samba version or backport that fix to your old version if you want to stick with that.