librelist archives

« back to archive

Patch: userspace utils under FreeBSD

Patch: userspace utils under FreeBSD

From:
Philippe Michaud-Boudreault
Date:
2012-08-26 @ 02:57
Only in danrl-lanyfs-utils-d33c19c-new/bin/: .detectfs.c.swp
Only in danrl-lanyfs-utils-d33c19c-new/bin/: .mkfs.c.swp
diff -crB danrl-lanyfs-utils-d33c19c/bin/detectfs.c 
danrl-lanyfs-utils-d33c19c-new/bin/detectfs.c
*** danrl-lanyfs-utils-d33c19c/bin/detectfs.c	2012-08-08 08:27:00.000000000 -0400
--- danrl-lanyfs-utils-d33c19c-new/bin/detectfs.c	2012-08-25 
22:43:28.608272508 -0400
***************
*** 35,43 ****
  #include <stddef.h>
  #include <stdio.h>
  #include <stdlib.h>
- #include <byteswap.h>
  #include <stdarg.h>		/* va_*(), vprintf() */
  
  #include "lanyfs.h"
  
   /* gettext support, e.g. for i18n */
--- 35,53 ----
  #include <stddef.h>
  #include <stdio.h>
  #include <stdlib.h>
  #include <stdarg.h>		/* va_*(), vprintf() */
  
+ #ifdef __FreeBSD__
+ #include <sys/endian.h>
+ #define bswap_16(x) __bswap16(x)
+ #define bswap_64(x) __bswap64(x)
+ #define off64_t off_t
+ #define fseeko64 fseeko
+ #define ftello64 ftello
+ #else
+ #include <byteswap.h>
+ #endif
+ 
  #include "lanyfs.h"
  
   /* gettext support, e.g. for i18n */
diff -crB danrl-lanyfs-utils-d33c19c/bin/mkfs.c 
danrl-lanyfs-utils-d33c19c-new/bin/mkfs.c
*** danrl-lanyfs-utils-d33c19c/bin/mkfs.c	2012-08-08 08:27:00.000000000 -0400
--- danrl-lanyfs-utils-d33c19c-new/bin/mkfs.c	2012-08-25 22:40:48.685965622 -0400
***************
*** 39,45 ****
--- 39,55 ----
  #include <string.h>
  #include <unistd.h>		/* getopt() */
  #include <time.h>		/* timestamp creation */
+ 
+ #ifdef __FreeBSD__
+ #include <sys/endian.h>
+ #define bswap_16(x) __bswap16(x)
+ #define bswap_64(x) __bswap64(x)
+ #define off64_t off_t
+ #define fseeko64 fseeko
+ #define ftello64 ftello
+ #else
  #include <byteswap.h>
+ #endif
  
  #include "lanyfs.h"
  

Re: [lanyfs] Patch: userspace utils under FreeBSD

From:
Dan Luedtke
Date:
2012-08-26 @ 16:22
On Sat, 2012-08-25 at 22:57 -0400, Philippe Michaud-Boudreault wrote:
> Hi, I made a few modifications to allow the userspace bins to compile
> under FreeBSD.
I added the changes to the official repo.
Thanks to Philippe for providing the patch.

The code for the utilities is now dual-licensed to make it easier for
the *BSD folks to redistribute it.

HTH

Dan

-- 
Dan Luedtke
http://www.danrl.de