diff options
author | Anoop C S <anoopcs@redhat.com> | 2019-09-27 11:19:37 +0530 |
---|---|---|
committer | Ralph Boehme <slow@samba.org> | 2019-10-08 08:38:32 +0000 |
commit | 5084a69de14f24e9d804998580eefcba773fdd5a (patch) | |
tree | b916c4c98de899dbf47e16c87c46e780ea558e5d /source3/wscript | |
parent | c9d302f20b066267a8fd2d7ce4dc171161c9c40c (diff) | |
download | samba-5084a69de14f24e9d804998580eefcba773fdd5a.tar.gz |
s3: VFS: Add SMB_VFS_FCNTL
Signed-off-by: Anoop C S <anoopcs@redhat.com>
Reviewed-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Diffstat (limited to 'source3/wscript')
-rw-r--r-- | source3/wscript | 109 |
1 files changed, 109 insertions, 0 deletions
diff --git a/source3/wscript b/source3/wscript index d45222625c4..e29bf657b5e 100644 --- a/source3/wscript +++ b/source3/wscript @@ -1119,6 +1119,115 @@ err: execute=True, msg="Checking whether fcntl lock supports open file description locks") + conf.CHECK_CODE(''' +#include <fcntl.h> +#include <unistd.h> +#include <stdlib.h> +#include <sys/socket.h> + +int main(void) +{ + int sockfd, ret; + struct f_owner_ex owner, get_owner; + + sockfd = socket(AF_UNIX, SOCK_STREAM, 0); + if (sockfd == -1) { + goto err; + } + + owner.type = F_OWNER_PID; + owner.pid = getpid(); + + ret = fcntl(sockfd, F_SETOWN_EX, &owner); + if (ret == -1) { + goto err; + } + + ret = fcntl(sockfd, F_GETOWN_EX, &get_owner); + if (ret == -1) { + goto err; + } + + if (get_owner.type != F_OWNER_PID) { + goto err; + } + + if (get_owner.pid != getpid()) { + goto err; + } + + close(sockfd); + exit(0); +err: + close(sockfd); + exit(1); +}''', + 'HAVE_F_OWNER_EX', + addmain=False, + execute=True, + msg="Checking whether fcntl supports flags to send direct I/O availability signals") + + conf.CHECK_CODE(''' +#include <fcntl.h> +#include <unistd.h> +#include <stdlib.h> +#include <stdint.h> + +#define DATA "hinttest.fcntl" + +int main(void) +{ + uint64_t *hint, get_hint; + int fd; + + fd = open(DATA, O_RDONLY | O_CREAT | O_EXCL); + if (fd == -1) { + goto err; + } + + *hint = RWH_WRITE_LIFE_SHORT; + int ret = fcntl(fd, F_SET_RW_HINT, hint); + if (ret == -1) { + goto err; + } + + ret = fcntl(fd, F_GET_RW_HINT, &get_hint); + if (ret == -1) { + goto err; + } + + if (get_hint != RWH_WRITE_LIFE_SHORT) { + goto err; + } + + *hint = RWH_WRITE_LIFE_EXTREME; + ret = fcntl(fd, F_SET_FILE_RW_HINT, hint); + if (ret == -1) { + goto err; + } + + ret = fcntl(fd, F_GET_FILE_RW_HINT, &get_hint); + if (ret == -1) { + goto err; + } + + if (get_hint != RWH_WRITE_LIFE_EXTREME) { + goto err; + } + + close(fd); + unlink(DATA); + exit(0); +err: + close(fd); + unlink(DATA); + exit(1); +}''', + 'HAVE_RW_HINTS', + addmain=False, + execute=True, + msg="Checking whether fcntl supports setting/geting hints") + conf.CHECK_STRUCTURE_MEMBER('struct stat', 'st_mtim.tv_nsec', define='HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC') # Linux, Solaris conf.CHECK_STRUCTURE_MEMBER('struct stat', 'st_mtimensec', |