Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/freebsd-ports
Path: blob/main/deskutils/cairo-dock/files/patch-src_gldit_cairo-dock-file-manager.c
28313 views
1
--- src/gldit/cairo-dock-file-manager.c.orig 2025-11-02 19:18:06 UTC
2
+++ src/gldit/cairo-dock-file-manager.c
3
@@ -22,7 +22,13 @@
4
#include <string.h> // memset
5
#include <sys/stat.h> // stat
6
#include <fcntl.h> // open
7
+#if defined (__FreeBSD__) || defined (__DragonFly__)
8
+#include <sys/types.h>
9
+#include <sys/socket.h>
10
+#include <sys/uio.h>
11
+#else
12
#include <sys/sendfile.h> // sendfile
13
+#endif
14
#include <errno.h> // errno
15
16
#include "gldi-config.h"
17
@@ -492,7 +498,7 @@ gboolean cairo_dock_copy_file (const gchar *cFilePath,
18
{
19
// perform in-kernel transfer (zero copy to user space)
20
int size;
21
- #ifdef __FreeBSD__
22
+ #if defined (__FreeBSD__) || defined (__DragonFly__)
23
size = sendfile (src_fd, dest_fd, 0, stat.st_size, NULL, NULL, 0);
24
#else // Linux >= 2.6.33 for being able to have a regular file as the output socket
25
size = sendfile (dest_fd, src_fd, NULL, stat.st_size); // note the inversion between both calls ^_^;
26
27