Hi, Steve Williams wrote on Thu, Nov 18, 2021 at 06:04:26PM -0800:
> 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. Judging from the Linux manual page https://man.bsd.lv/Linux-5.13/sendfile you should be able to trivially implement a replacement function for sendfile(2) using lseek(2), read(2), and write(2). Of course, that will be slower than doing the copying inside the kernel as sendfile(2) does. But it should get you going in order to make the program run at all. Try that unless somebody else has a better idea. > Doing some research, I found one reference that sosplice(2) might be > able to be used in place of sendfile. A system call soplice(2) does not exist. The sosplice(9) manual page describes kernel internals, so to implement sendfile(2) based on sosplice(9), you would have to do some real kernel hacking. Given the questions you are asking, you are clearly not up to that, and even if you were - hacking up the kernel just to port some software is usually not the best idea. Yours, Ingo