Re: Stop using direct syscall(2) from perl(1)

2023-08-17 Thread George Koehler
On Thu, 3 Aug 2023 18:43:21 -0700 Andrew Hewus Fresh wrote: > Here's a new version, I think I addressed all of the feedback I got, > although may have missed something. ok gkoehler@ You sent this new version 2 weeks ago, but I didn't build it until yesterday. syscall_emulator.t passes on

Re: Stop using direct syscall(2) from perl(1)

2023-08-03 Thread Andrew Hewus Fresh
On Sun, Jul 09, 2023 at 01:29:58PM -0700, Andrew Hewus Fresh wrote: > Here is a patch to replace perl(1)'s use of syscall(2) with a dispatcher > that will call the libc function instead. > > I have to do some work on style before this is ready to commit, but it > should be ready for some testing.

Re: Stop using direct syscall(2) from perl(1)

2023-07-22 Thread George Koehler
On Thu, 20 Jul 2023 19:32:33 -0700 Andrew Hewus Fresh wrote: > On Mon, Jul 17, 2023 at 11:54:18PM -0400, George Koehler wrote: > > How to pread($fd, $buf, 4, 16)? > > > > 1. syscall(169, $fd, $buf, 4, 0, 16) > > 2. syscall(169, $fd, $buf, 4, 0, 0, 16) > > 3. syscall(169, $fd, $buf, 4,

Re: Stop using direct syscall(2) from perl(1)

2023-07-21 Thread Philip Guenther
On Thu, Jul 20, 2023 at 10:59 PM Theo de Raadt wrote: > Andrew Hewus Fresh wrote: > > > One thing to note, on the advice of miod@, I adjusted the mapping of > > size_t from u_int to u_long, but that means we no longer recognize > > getlogin_r. When I asked, miod@ suggested that syscalls.master

Re: Stop using direct syscall(2) from perl(1)

2023-07-20 Thread Theo de Raadt
Andrew Hewus Fresh wrote: > One thing to note, on the advice of miod@, I adjusted the mapping of > size_t from u_int to u_long, but that means we no longer recognize > getlogin_r. When I asked, miod@ suggested that syscalls.master was > confused. > > $ grep getlogin_r

Re: Stop using direct syscall(2) from perl(1)

2023-07-20 Thread Andrew Hewus Fresh
Here's a new patch, mostly for sthen@'s obvious fix, although I have added some of gkoehler@'s suggestions, although I have some questions and comments inline. I am looking at some of the other suggestions, but they showed up while I was testing this set. One thing to note, on the advice of

Re: Stop using direct syscall(2) from perl(1)

2023-07-19 Thread Marc Espie
On Sun, Jul 09, 2023 at 01:29:58PM -0700, Andrew Hewus Fresh wrote: > Here is a patch to replace perl(1)'s use of syscall(2) with a dispatcher > that will call the libc function instead. > > I have to do some work on style before this is ready to commit, but it > should be ready for some testing.

Re: Stop using direct syscall(2) from perl(1)

2023-07-19 Thread Theo de Raadt
-my $sb = "\0\0\0\0"; +my $sb = "\0" x 4096; That's pretty terrible. Does this language not have types?

Re: Stop using direct syscall(2) from perl(1)

2023-07-19 Thread George Koehler
On Sun, 9 Jul 2023 13:29:58 -0700 Andrew Hewus Fresh wrote: > +syscall_emulator.h Emulator to dispatch syscalls to libc This got installed as /usr/libdata/perl5/powerpc64-openbsd/CORE/syscall_emulator.h ExtUtils::MakeMaker is using cc -DHAS_SYSCALL_EMULATOR to build my XS module; the

Re: Stop using direct syscall(2) from perl(1)

2023-07-17 Thread George Koehler
On Sun, 9 Jul 2023 13:29:58 -0700 Andrew Hewus Fresh wrote: > + case SYS_truncate: > + { > + const char * path = va_arg(args, const char *); > + off_t length = va_arg(args, off_t); > + ret = truncate(path, length); > + } > +

Re: Stop using direct syscall(2) from perl(1)

2023-07-13 Thread Stuart Henderson
On 2023/07/13 00:57, George Koehler wrote: > On Sun, 9 Jul 2023 13:29:58 -0700 > Andrew Hewus Fresh wrote: > > > Here is a patch to replace perl(1)'s use of syscall(2) with a dispatcher > > that will call the libc function instead. > > patch(1) didn't "chmod +x gen_syscall_emulator.pl", but I

Re: Stop using direct syscall(2) from perl(1)

2023-07-12 Thread George Koehler
On Sun, 9 Jul 2023 13:29:58 -0700 Andrew Hewus Fresh wrote: > Here is a patch to replace perl(1)'s use of syscall(2) with a dispatcher > that will call the libc function instead. patch(1) didn't "chmod +x gen_syscall_emulator.pl", but I needed to do so to get around this this error, $ make -f

Stop using direct syscall(2) from perl(1)

2023-07-09 Thread Andrew Hewus Fresh
Here is a patch to replace perl(1)'s use of syscall(2) with a dispatcher that will call the libc function instead. I have to do some work on style before this is ready to commit, but it should be ready for some testing. I don't currently plan on committing syscall_emulator.c because we need to