lkml.org 
[lkml]   [2004]   [Aug]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: setproctitle
    * William Lee Irwin III <wli@holomorphy.com> dixit:
    >> The command-line arguments are being fetched from the process address
    >> space, i.e. simply editing argv[] in userspace will have the desired
    >> effect. Though this code is butt ugly.

    On Fri, Aug 20, 2004 at 06:20:27PM +0200, DervishD wrote:
    > The problem with this is that is non-portable. Not all Unices
    > (AFAIK) have this behaviour. The portable solution for changing
    > argv[0] is to use ONLY the space currently allocated to argv[0]. I
    > mean, you take argv[0], do a strlen() and overwrite only strlen bytes
    > of it. The problem with this is that you cannot write an arbitrary
    > string there. If all Unices provide 'setproctitle' that problem
    > dissapears.
    > Anyway is cool to know that, under Linux, I can change the
    > argv[0] with no problems.

    It is not portable behavior. It is a description of how to implement
    setproctitle(3) in Linux.


    -- wli
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

    \
     
     \ /
      Last update: 2005-03-22 14:05    [W:0.019 / U:51.544 seconds]
    ©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site