--- pxz.c.orig 2014-10-18 17:06:27 UTC +++ pxz.c @@ -23,11 +23,17 @@ #include #include +#ifndef __FreeBSD__ #include +#endif #include #include #include +#ifdef __FreeBSD__ +#include +#else #include +#endif #include #include #include @@ -42,6 +48,10 @@ #include #endif +#ifdef __FreeBSD__ +#define error errc +#endif + #ifndef XZ_BINARY #define XZ_BINARY "xz" #endif @@ -121,6 +131,13 @@ const struct option long_opts[] = { { NULL, 0, NULL, 0 } }; +#ifdef __FreeBSD__ +static size_t __fpending (FILE *fp) +{ + return (fp->_p - fp->_bf._base); +} +#endif + void __attribute__((noreturn)) run_xz( char **argv ) { execvp(XZ_BINARY, argv); error(0, errno, "execution of "XZ_BINARY" binary failed");