summaryrefslogtreecommitdiff
path: root/net/glusterfs/files/patch-libglusterfs_src_syscall.c
diff options
context:
space:
mode:
authorTimur I. Bakeyev <timur@FreeBSD.org>2020-09-26 21:09:13 +0000
committerTimur I. Bakeyev <timur@FreeBSD.org>2020-09-26 21:09:13 +0000
commit93be2a4f8f0ccd7433e0ed30759a5f569cd30aad (patch)
treed49363764963fce8a491dc1ac11c3b104bf2ce38 /net/glusterfs/files/patch-libglusterfs_src_syscall.c
parentupdate to 3.34.0 (diff)
An update to the net/glusterfs port:
- System call fixes backported from upstream - Adding missing scripts to the SHEBANG_FILES list - Correct a bug with extended attributes - Fix detection of the PACKAGE_VERSION and generation of the correct API version PR: 249492 Submitted by: maintainer Reported by: timur
Notes
Notes: svn path=/head/; revision=550225
Diffstat (limited to 'net/glusterfs/files/patch-libglusterfs_src_syscall.c')
-rw-r--r--net/glusterfs/files/patch-libglusterfs_src_syscall.c64
1 files changed, 57 insertions, 7 deletions
diff --git a/net/glusterfs/files/patch-libglusterfs_src_syscall.c b/net/glusterfs/files/patch-libglusterfs_src_syscall.c
index a674d3b9218d..ad4c70893dbd 100644
--- a/net/glusterfs/files/patch-libglusterfs_src_syscall.c
+++ b/net/glusterfs/files/patch-libglusterfs_src_syscall.c
@@ -1,20 +1,70 @@
---- libglusterfs/src/syscall.c.orig 2020-05-18 20:57:54 UTC
+--- libglusterfs/src/syscall.c.orig 2020-08-04 12:41:32 UTC
+++ libglusterfs/src/syscall.c
-@@ -485,7 +485,7 @@ sys_lsetxattr(const char *path, const char *name, cons
+@@ -13,6 +13,10 @@
+ #include "glusterfs/mem-pool.h"
+ #include "glusterfs/libglusterfs-messages.h"
+
++#ifdef __FreeBSD__
++#include <sys/sysctl.h>
++#include <signal.h>
++#endif
+ #include <sys/types.h>
+ #include <utime.h>
+ #include <sys/time.h>
+@@ -506,9 +510,17 @@ sys_lsetxattr(const char *path, const char *name, cons
#endif
-
+
#ifdef GF_BSD_HOST_OS
- return FS_RET_CHECK0(
-+ return FS_RET_CHECK(
++ ssize_t ret = FS_RET_CHECK(
extattr_set_link(path, EXTATTR_NAMESPACE_USER, name, value, size),
errno);
++ /* On BSD extattr_set_link returns the number of bytes written/read on
++ * success. Force this to be 0 if it was successful so the result remains
++ * compatible with other platform expectations.
++ */
++ if(ret > 0) {
++ ret = 0;
++ }
++ return ret;
#endif
-@@ -603,7 +603,7 @@ sys_fsetxattr(int filedes, const char *name, const voi
+
+ #ifdef GF_SOLARIS_HOST_OS
+@@ -624,9 +636,17 @@ sys_fsetxattr(int filedes, const char *name, const voi
#endif
-
+
#ifdef GF_BSD_HOST_OS
- return FS_RET_CHECK0(
-+ return FS_RET_CHECK(
++ ssize_t ret = FS_RET_CHECK(
extattr_set_fd(filedes, EXTATTR_NAMESPACE_USER, name, value, size),
errno);
++ /* On BSD extattr_set_fd returns the number of bytes written/read on
++ * success. Force this to be 0 if it was successful so the result remains
++ * compatible with other platform expectations.
++ */
++ if(ret > 0) {
++ ret = 0;
++ }
++ return ret;
#endif
+
+ #ifdef GF_SOLARIS_HOST_OS
+@@ -854,3 +874,18 @@ sys_copy_file_range(int fd_in, off64_t *off_in, int fd
+ #endif /* HAVE_COPY_FILE_RANGE_SYS */
+ #endif /* HAVE_COPY_FILE_RANGE */
+ }
++
++#ifdef __FreeBSD__
++int
++sys_kill(pid_t pid, int sig)
++{
++ return FS_RET_CHECK0(kill(pid, sig), errno);
++}
++
++int
++sys_sysctl(const int *name, u_int namelen, void *oldp, size_t *oldlenp,
++ const void *newp, size_t newlen)
++{
++ return FS_RET_CHECK0(sysctl(name, namelen, oldp, oldlenp, newp, newlen), errno);
++}
++#endif