puppy icon indicating copy to clipboard operation
puppy copied to clipboard

proctable does not fill in argument data anymore

Open egranata opened this issue 7 years ago • 1 comments

As part of fixing https://github.com/egranata/puppy/issues/57 proctable_syscall_handler has been hacked to read

#if 0
        if (p->args) {
            strncpy(&pi.args[0], p->args, sizeof(pi.args));
        } else {
            bzero(&pi.args[0], sizeof(pi.args));
        }
#endif

This should be undone and args filled correctly

egranata avatar Oct 27 '18 02:10 egranata

This is a bit tricky do to because argv is an array; passing a string to userland is relatively easy with a fixed-size buffer, but passing an array is not as obvious

One way to go about this is the UNIX style, where one does not get the individual argv items, but a "cmdline" (in UNIX, a file in /proc/pid) that is just a concatenated string (well, separated by \0 at the argv boundary, but that's not much different for the purposes of the implementation)

egranata avatar Nov 04 '18 22:11 egranata