lkml.org 
[lkml]   [2000]   [Mar]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: 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/

\
 
 \ /
  Last update: 2005-03-22 13:56    [W:0.406 / U:0.188 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site