[build] check for pread(), pwrite(), splice()

This commit is contained in:
Glenn Strauss 2021-09-21 08:46:27 -04:00
parent 9f62f1b196
commit 5cab11b7ea
6 changed files with 14 additions and 3 deletions

View File

@ -445,13 +445,15 @@ if 1:
'port_create',
'posix_fadvise',
'prctl',
'pread',
'pwrite',
'select',
'send_file',
'sendfile',
'sendfile64',
'sigaction',
'signal',
'socket',
'splice',
'srandom',
'stat',
'strchr',

View File

@ -1512,12 +1512,15 @@ AC_CHECK_FUNCS([\
pipe2 \
poll \
port_create \
pread \
pwrite \
select \
send_file \
sendfile \
sendfile64 \
sigaction \
signal \
splice \
srandom \
strerror_r \
timegm \

View File

@ -186,6 +186,7 @@ check_function_exists(poll HAVE_POLL)
check_function_exists(port_create HAVE_PORT_CREATE)
check_function_exists(prctl HAVE_PRCTL)
check_function_exists(pread HAVE_PREAD)
check_function_exists(pwrite HAVE_PWRITE)
check_function_exists(posix_fadvise HAVE_POSIX_FADVISE)
check_function_exists(select HAVE_SELECT)
check_function_exists(sendfile HAVE_SENDFILE)
@ -195,6 +196,7 @@ check_function_exists(sendfilev HAVE_SENDFILEV)
check_function_exists(sigaction HAVE_SIGACTION)
check_function_exists(signal HAVE_SIGNAL)
check_function_exists(sigtimedwait HAVE_SIGTIMEDWAIT)
check_function_exists(splice HAVE_SPLICE)
check_function_exists(srandom HAVE_SRANDOM)
check_function_exists(strerror_r HAVE_STRERROR_R)
check_function_exists(strptime HAVE_STRPTIME)

View File

@ -1160,7 +1160,7 @@ ssize_t
chunkqueue_write_chunk_to_pipe (const int fd, chunkqueue * const restrict cq, log_error_st * const restrict errh)
{
/*(note: expects non-empty cq->first)*/
#ifdef SPLICE_F_NONBLOCK /* splice() temp files to pipe on Linux */
#ifdef HAVE_SPLICE /* splice() temp files to pipe on Linux */
chunk * const c = cq->first;
if (c->type == FILE_CHUNK) {
loff_t abs_offset = c->offset;

View File

@ -140,6 +140,7 @@
#cmakedefine HAVE_PORT_CREATE
#cmakedefine HAVE_PRCTL
#cmakedefine HAVE_PREAD
#cmakedefine HAVE_PWRITE
#cmakedefine HAVE_POSIX_FADVISE
#cmakedefine HAVE_SELECT
#cmakedefine HAVE_SENDFILE
@ -149,6 +150,7 @@
#cmakedefine HAVE_SIGACTION
#cmakedefine HAVE_SIGNAL
#cmakedefine HAVE_SIGTIMEDWAIT
#cmakedefine HAVE_SPLICE
#cmakedefine HAVE_STRERROR_R
#cmakedefine HAVE_STRPTIME
#cmakedefine HAVE_SYSLOG

View File

@ -137,9 +137,10 @@ conf_data.set('HAVE_PATHCONF', compiler.has_function('pathconf', args: defs))
conf_data.set('HAVE_PIPE2', compiler.has_function('pipe2', args: defs))
conf_data.set('HAVE_POLL', compiler.has_function('poll', args: defs))
conf_data.set('HAVE_PORT_CREATE', compiler.has_function('port_create', args: defs))
conf_data.set('HAVE_POSIX_FADVISE', compiler.has_function('posix_fadvise', args: defs))
conf_data.set('HAVE_PRCTL', compiler.has_function('prctl', args: defs))
conf_data.set('HAVE_PREAD', compiler.has_function('pread', args: defs))
conf_data.set('HAVE_POSIX_FADVISE', compiler.has_function('posix_fadvise', args: defs))
conf_data.set('HAVE_PWRITE', compiler.has_function('pwrite', args: defs))
conf_data.set('HAVE_SELECT', compiler.has_function('select', args: defs))
conf_data.set('HAVE_SENDFILE', compiler.has_function('sendfile', args: defs))
conf_data.set('HAVE_SEND_FILE', compiler.has_function('send_file', args: defs))
@ -148,6 +149,7 @@ conf_data.set('HAVE_SENDFILEV', compiler.has_function('sendfilev', args: defs))
conf_data.set('HAVE_SIGACTION', compiler.has_function('sigaction', args: defs))
conf_data.set('HAVE_SIGNAL', compiler.has_function('signal', args: defs))
conf_data.set('HAVE_SIGTIMEDWAIT', compiler.has_function('sigtimedwait', args: defs))
conf_data.set('HAVE_SPLICE', compiler.has_function('splice', args: defs))
conf_data.set('HAVE_SRANDOM', compiler.has_function('srandom', args: defs))
conf_data.set('HAVE_STRERROR_R', compiler.has_function('strerror_r', args: defs))
conf_data.set('HAVE_STRPTIME', compiler.has_function('strptime', args: defs))