Messages in this thread | | | Date | Tue, 7 Mar 2000 01:00:16 +0100 | From | Jamie Lokier <> | Subject | Re: If something is not stated in POSIX we should not bother even if 90%+ of Linux system out there using it ?? |
| |
Khimenko Victor wrote:
> GLibC does not have setproctitle(3) so they used some > hackish implementation bundled with that programs. Unfortunatelly this > implementation depended on subtle bug in Linux procfs that was there for ages: > cmdline will always return FULL first argument of program even if program > messed with it's arguments and so even this first argument will not fit in > interval from arg_start to arg_end. IMO we do not need "Windows way" (to put > bug back just to make programs happy; since expansion of command line was > done over environment such solutions can not be called even remotely "sane" > anyway). But we can (and IMNSHO should!) make "proper" implementation of > setproctitle(3) in glibc instead: too many important programs using it. > We need some support in kernel though. I cooked up patch (see below). There > are two new syscalls: setenviron(2) and setarguments(2). One for use in > setenv(3)/unsetenv(3) and one for setproctitle(3).
Why do you need extra syscalls? What is wrong with procfs simply reading argv[0] and printing the string that currently points to?
Then a program can implement setproctitle(3) by simply changing argv[0], and setting argv[1] to 0.
-- Jamie
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/
| |