| Server IP : 82.208.35.60 / Your IP : 216.73.216.238 Web Server : Apache/2.4.55 (FreeBSD) OpenSSL/1.1.1q-freebsd PHP/7.3.31 System : FreeBSD server7.d2m.cz 12.4-RELEASE-p9 FreeBSD 12.4-RELEASE-p9 GENERIC amd64 User : studiokobylisy_cz ( 1008) PHP Version : 7.3.31 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /usr/ports/sysutils/toybox/files/ |
Upload File : |
--- lib/portability.c.orig 2022-08-13 14:55:14 UTC
+++ lib/portability.c
@@ -625,6 +625,17 @@ int get_block_device_size(int fd, unsigned long long*
*size = lab.d_secsize * lab.d_nsectors;
return status;
}
+#elif defined(__FreeBSD__)
+#include <sys/disk.h>
+int get_block_device_size(int fd, unsigned long long* size)
+{
+ off_t sz = 0;
+ if (ioctl(fd, DIOCGMEDIASIZE, &sz) >= 0) {
+ *size = sz;
+ return 1;
+ }
+ return 0;
+}
#endif
// Return bytes copied from in to out. If bytes <0 copy all of in to out.