On 19/11/2021 7:53 a.m., Tracey Emery wrote:
On Fri, Nov 19, 2021 at 07:14:04AM -0800, Steve Williams wrote:
Stuart,

You are absolutely amazing!   I have no idea how you find time to respond to
all these requests and still manage to accomplish what you do.

Thanks very much for the pointer to a WIP port.  I'll have a look at it.

Cheers,
Steve Williams

On 19/11/2021 12:21 a.m., Stuart Henderson wrote:
zoneminder has fallback code, they just unconditionally include
zm_sendfile.h even where sendfile was not detected, and that has a hard
#error. See
https://github.com/jasperla/openbsd-wip/tree/master/multimedia/zoneminder,
there is a patch for this.

--
   Sent from a phone, apologies for poor formatting.


On 19 November 2021 05:31:32 George Koehler <kern...@gmail.com> wrote:

On Thu, 18 Nov 2021 18:04:26 -0800
Steve Williams <st...@williamsitconsulting.com> wrote:

Hi,

I'm trying to compile a Linux/FreeBSD application (zoneminder) under
OpenBSD 7.0.

I'm slowly working through it but have gotten stuck at the point where
it has a dependency on sendfile(2) which OpenBSD doesn't have.

Doing some research, I found one reference that sosplice(2) might be
able to be used in place of sendfile. Elsewhere, I have found reference
to a "simple-sendfile" package, but that doesn't seem to exist.
Linux sendfile(2) and FreeBSD sendfile(2) are different functions.
simple_sendfile() is a function in lang/ruby that wraps FreeBSD's
sendfile to act like Linux's.  simple_sendfile() is not for OpenBSD.

Linux: https://man7.org/linux/man-pages/man2/sendfile.2.html
FreeBSD: https://www.freebsd.org/cgi/man.cgi?query=sendfile
simple_sendfile: 
https://github.com/ruby/ruby/blob/0db68f023372b634603c74fca94588b457be084c/io.c#L11320

OpenBSD's SO_SPLICE can only "splice together two TCP or UDP sockets",
says setsockopt(2).  You can't SO_SPLICE if your code copies a regular
file to a socket.

Is this an issue people have already resolved with other ports?  Or is
it a deal breaker?

I guess the devil is in the details, but I thought I'd reach out here
first in case there's already a good solution to this.
Check what your code does if sendfile fails.  If it falls back to a
read/write loop, then you might patch it to skip sendfile.  If it
doesn't have a read/write loop, then you might need to add one.

--George

Thanks,
Steve Williams

If you want a zoneminder that is currently working in OpenBSD, go here:
https://github.com/basepr1me/openbsd-ports-mystuff/tree/master/multimedia/zoneminder

I haven't touched it for awhile and the README still needs updated, but
that is running at my house right now. It uses httpd outside of chroot.
Everything works as intended for me.

The README file that is there is full of notes that might be able to get
you through a setup. Ian was working on an updated README, but he hasn't
finished.

I haven't looked at newer versions.

Hi Tracey,

Thanks very much for that!  I'll have a look as it's more contemporary than the port that Stuart pointed to.

I'll have a look :)

Cheers,
Steve W.

Reply via email to