[GHC] #9143: feature request: way to set actual program argv

GHC ghc-devs at haskell.org
Sun Nov 16 18:44:57 UTC 2014


#9143: feature request: way to set actual program argv
-------------------------------------+-------------------------------------
              Reporter:  joeyhess    |            Owner:  simonmar
                  Type:  feature     |           Status:  closed
  request                            |        Milestone:
              Priority:  normal      |          Version:  7.8.2
             Component:  Runtime     |         Keywords:
  System                             |     Architecture:  Unknown/Multiple
            Resolution:  wontfix     |       Difficulty:  Moderate (less
      Operating System:  Linux       |  than a day)
       Type of failure:              |       Blocked By:
  None/Unknown                       |  Related Tickets:
             Test Case:              |
              Blocking:              |
Differential Revisions:              |
-------------------------------------+-------------------------------------

Comment (by joeyhess):

 prctl can be used to set the name of a thread. This does not change the
 process name as displayed by ps. (The stackoverflow article is apparently
 wrong or out of date or something -- try the sample program there and
 you'll see it does not change the display in ps, although
 /proc/pid/task/tid/comm will be changed.)

 At least on linux when using libbsd's setproctitle, it requires
 setproctitle_init to first be called and passed the original argv. The
 libbsd-ctor arranges for this to be done at program startup. So, I was
 able to get that to work by passing these options to ghc: -lbsd-ctor
 -optl-u -optllibbsd_init_func -lbsd

 On linux, using a not very widely used libbsd, and needing linker options
 to make it work, seems like a rather long way around..

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/9143#comment:2>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list