AIX equivalent to /proc/self/cmdline to get process name from C++ program
Hi,
I'm porting some old C++ code (that I didn't write) from Linux to AIX and have run into a problem in getting the process name from within the code when it is run on AIX. Basically the code is getting the process name so it can then return it to the rest of the code as argv[0]. This code is trying to name logfiles using the process name and is called by many other classes.
The OS is: powerpc-ibm-aix5.3.0.0
The gcc is: gcc version 4.2.0
The code is below:
I intially added "|| _AIX" to the linux block above but since AIX doesn't have /proc/self it failed and all my logfiles are named unknown*. I have tried several different separate blocks for AIX, but after hours of searching for how to get the process name I've hit a wall. I am able to compile, but always get an undefined error on the link. How do I duplicate the above blocks used for linux and (ancient hp block) for AIX?
Hi Team,
I am very new to this forum and hope someone will help me in resolving the issue.
I am new to Pro C also.
I made some changes to the existing Pro C program and want to run the program with the changes.
But I am unable to neither compile nor run the program.
Please do the... (2 Replies)
I need to log the size of physical/virtual memory consumed by any given given process using c/c++ code running on solaris and aix without using the proc filesystem. Please advise. (1 Reply)
Hello
I am writing a script that will first execute ps to get the list of processes running, and the go into the /proc folder for each PID listed and gather relevant information.
I looked through the contents of a particular process in the /proc folder and I can't find where I can locate... (2 Replies)
Hi all,
I'm reading <advanced bash scripting> and there is a example to kill a background process in a limited time,as shown below:
#! /bin/bash
#set -n
TIMEOUT=$1
count=0
hanging_jobs & {
while ((count < TIMEOUT));do
eval ' && ((count = TIMEOUT))'
((count++))
sleep 1... (6 Replies)
hi,
i need to compile a proc program, say prog.pc
can we compile this program in the unix environment? does this need a make file? can anyone help me on this since i am new to this area.
Thanks in advance. (1 Reply)
I have a java command line program from a vendor without source code, but it's too much work to run on a PC window, therefore I'm think to create a GUI wrapper or web interface calling that java cmdline program. But I'm a newbie in java world
- How convert a java command line program into a web... (0 Replies)
hi friends,
I am trying to automate the daily monitoring process of UNIX server and it's processes. the script are below
i executed the above script using ksh -x monitortest1.sh in root login . It shows error at some lines .
1. i logged in using root ,but it... (8 Replies)
I am linking my compiled proC file with other C files and getting following error.
ld: 0711-711 ERROR: Input file /opt/orabase/oracle/product/10.2.0/db_1/lib/libirc.a is empty.
The file is being ignored.
I used following command to compile my proC code.
proc iname=dbConnect.pc code=ANSI_C... (0 Replies)
Hi,
I am new to Linux programming. As part of learning, I need to create a *.c program where we call certain /proc files (i.e. such as meminfo, version, uptime, etc...) from our program. Can anyone point me to a simple program on how one would do this (i.e. can you directly call uptime() or... (4 Replies)