Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!gatech!uflorida!novavax!infocenter!mhoffman From: mhoffman@infocenter.UUCP (Mike Hoffman) Newsgroups: comp.unix.questions Subject: Re: process name from process id Message-ID: <3082@infocenter.UUCP> Date: 30 Jun 89 19:30:31 GMT References: <157@cerc.wvu.wvnet.edu.edu> Distribution: usa Organization: Gould CSD, Fort Lauderdale, FL Lines: 21 in article <157@cerc.wvu.wvnet.edu.edu>, kannan@cerc.wvu.wvnet.edu (R. Kannan) says: < Xref: gould comp.unix.questions:12137 comp.unix.wizards:14115 < < The main objective is to get the program file name that resulted < in the process. < < some_unknown_function ( getpid () ) => should return the name of the program < file that resulted int he calling process. Forgive me if I'm being dense, but isn't argv[0] the name of the called program?? If you use getpid() you must be looking for the identity of the program currently running, not some arbitrary process, so why not just set program_name = argv[0] ?? Michael J. Hoffman Manufacturing Engineering Encore Computer Corporation UUCP: {uunet,codas!novavax,sun,pur-ee}!gould!mhoffman Melbourne, Fl 32935 "My opinions are my own and are not to be employed with those of my confuser."