aix

Need help in getting the process name based on the pid in aix

别等时光非礼了梦想. 提交于 2019-12-23 13:26:28
问题 I need to write a C program in AIX environment which will give me the process name. I can get the pid but not the process name based on the pid. Any specific system calls available in aix environment?? Thanks 回答1: getprocs is likely what you want. I created this under AIX 5.x. I have a little routine that cycles thru all processes and dumps their information. while ((numproc = getprocs(pinfo, sizeof(struct procsinfo), NULL, 0, &index, MAXPROCS)) > 0 ) { for (i = 0;i < numproc; i++) { /* skip

Crash when calling into C++ library from Perl using SWIG (AIX 5.1)

不羁的心 提交于 2019-12-23 12:33:58
问题 I'm trying to call into a C++ library from Perl on an AIX 5.1 machine. I've created a very simple test project to try to exercise this. My C++ shared library ( test.cpp ): #include <stdio.h> #include <iostream> void myfunc() { printf("in myfunc()\n"); std::cout << "in myfunc() also" << std::endl; } My SWIG interface file ( test.i ): %module test %{ void myfunc(); %} void myfunc(); I then build the shared object like so: swig -c++ -perl test.i g++ -c test_wrap.cxx -I/usr/opt/perl5/lib/5.6.0

Ghostscript works in command line, but does not work if executed from Java on AIX

我是研究僧i 提交于 2019-12-23 01:17:18
问题 Short Description I have to run Ghostscript on AIX. It works in command line : XXXXXXXX:i2zate:/home/i2zate>/usr/bin/gs -dFIXEDMEDIA -dPDFFitPage -dFirstPage=1 -dLastPage=1 -dBATCH -dNOPAUSE -dNOPROMPT -dSAFER -dMaxBitmap=500000000 -dAlignToPixels=0 -dGridFitTT=0 -dDEVICEWIDTH=90 -dDEVICEHEIGHT=120 -dORIENT1=true -sDEVICE=jpeg -dTextAlphaBits=4 -dGraphicsAlphaBits=4 -sOutputFile=1.jpg porsche.pdf GPL Ghostscript 8.70 (2009-07-31) Copyright (C) 2009 Artifex Software, Inc. All rights reserved.

Ghostscript works in command line, but does not work if executed from Java on AIX

*爱你&永不变心* 提交于 2019-12-23 01:17:13
问题 Short Description I have to run Ghostscript on AIX. It works in command line : XXXXXXXX:i2zate:/home/i2zate>/usr/bin/gs -dFIXEDMEDIA -dPDFFitPage -dFirstPage=1 -dLastPage=1 -dBATCH -dNOPAUSE -dNOPROMPT -dSAFER -dMaxBitmap=500000000 -dAlignToPixels=0 -dGridFitTT=0 -dDEVICEWIDTH=90 -dDEVICEHEIGHT=120 -dORIENT1=true -sDEVICE=jpeg -dTextAlphaBits=4 -dGraphicsAlphaBits=4 -sOutputFile=1.jpg porsche.pdf GPL Ghostscript 8.70 (2009-07-31) Copyright (C) 2009 Artifex Software, Inc. All rights reserved.

How do I add a comment (#) in front of a line after a key word search match

只谈情不闲聊 提交于 2019-12-22 20:45:14
问题 I have a crontab file contains many database names such as 10 06 1 * * script DEVE_DB1 10 06 1 * * script TEST_DB1 10 06 1 * * script PROD_DB1 .... I would like to add a comment, # , in front of TEST_DB1 in the entire file so that my cron job will not run all TEST_DB1 jobs. I found the following script on this site, sed -e '/TEST_DB1/, s/^/#/' but I get an error: sed: 0602-404 Function /TEST_DB1/, s/^/## / cannot be parsed. Any suggestions would be greatly appreciated. 回答1: Lose the comma

How can I generate call graphs for Perl modules and scripts?

孤人 提交于 2019-12-22 18:37:44
问题 I have a bunch of Perl scripts and Perl modules given to me by someone. I have a driver program that tests all these scripts and modules. I want to generate a call graph and see the flow. Is there something available for Perl for doing this? I'd like something like pycallgraph (for python). I am running all this in AIX. 回答1: Simon Cozens tells you how to do it in Profiling Perl on Perl.com. He uses a combination of Devel::DProf and GraphViz. 来源: https://stackoverflow.com/questions/1270477/how

How to see what /bin/sh points to

元气小坏坏 提交于 2019-12-22 08:44:50
问题 I was reading about the differences between /bin/sh and /bin/bash and came across this interesting question/answer: here I made a comment to the answer asking this same question in my title to which he replied with an updated answer: How can you find out what /bin/sh points to on your system? The complication is that /bin/sh could be a symbolic link or a hard link. If it's a symbolic link, a portable way to resolve it is: > % file -h /bin/sh > /bin/sh: symbolic link to bash If it's a hard

Substitute or workaround for asprintf on AIX

眉间皱痕 提交于 2019-12-21 03:43:10
问题 I'm trying to build python-kerberos on AIX. kerberospw.c uses a call to asprintf, but from what Google is telling me, asprintf does not exist on AIX. I saw http://www.koders.com/c/fidAA9B130D588302673A28B568430A83131B7734C0.aspx?s=windows.h, which looks like I could create a stand-in asprintf, but I don't know where this would go or how I would #include it in kerberospw.c. Is there a way I can use the koders.com example or some other code to "fake" asprintf? Can I just include the asprintf

Redirecting the shell output to a file [duplicate]

旧时模样 提交于 2019-12-20 04:50:57
问题 This question already has answers here : Redirect all output to file [duplicate] (10 answers) Closed 5 years ago . I am working on AIX 6 where I am running a java command on a Korn Shell and I am trying to debug the class loading issue. I put -verbose:class to print the class loaded and then >>/home/user/log.log to get the console out put in a file. The log.log file is got created but its of zero size. File is not containing any information and all the verbose details are ripping through the

Message “During startup program terminated with signal SIGKILL” from GDB

被刻印的时光 ゝ 提交于 2019-12-20 04:46:08
问题 I'm having trouble debugging a C++ program on AIX built with GNU tools. When the program runs outside the debugger: -bash-4.3$ ./cryptestcwd v Segmentation fault (core dumped) When the program runs under GDB, the debugger prints the message During startup program terminated with signal SIGKILL, Killed. and exits: An added wrinkle is, this only happens with an Autotools front-end. It does not happens with our regular GNUmakefile. We supply the same arguments to both Autotools and the