aix

How to find dll loaded by a process in AIX?

How to find which dynamic libs .so are loaded currently by a process, also those dll are dynamically loaded with dllopen. I want to debug a process to find out which libs its using currently. ...

How can I get the uptime of a IBM AIX box in seconds?

I'm writting a Perl script for which I need the uptime in seconds to do some calculation, in all the machine in the shop (i.e. linux, SunOS, and AIX). I have a way to get the uptime for linux (/proc/uptime), and SunOS (kstat -p unix:0:system_misc:boot_time), thanks to an another posting on this site, but I can find a good way of getting...

strndup call is currupting stack frames

Hi, I have seen a strange behavior with "strndup" call on AIX 5.3 and 6.1. If I call strndup with size more than the size of actual source string length, then there is a stack corruption after that call. Following is the sample code where this issue can come: int main () { char *dst_str = NULL; char src_str[1023] = "sample st...

GCC option to get statvfs64

Hi, I am using statvfs function call on AIX. And using GCC compiler. I would like statvfs call to resolve to statvfs64 by preprocessor. Ex: In Solaris, using "-D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64" flags with gcc i am resolved to statvfs64. Could you please help in getting the similar flags on AIX which resolves me to statvfs64...

Listing all shared memory segments used by a process on AIX5.3+

I would like to find all shared memory segments used by a given process. I am especially interested in figuring out the shmid so i can use it in calls to shmctl(). On Solaris i would just read /proc/$PID/map to figure out that information (field pr_shmid). The contents of that file are defined by struct prmap_t in sys/procfs. AIX also ...

AIX/UNIX: module has an invalid magic number

hi, On AIX, I am executing a script. In this script, it tries to load a 64 bit shared object lib ( .so file) . It fails to do so by giving the following error: The module has an invalid magic number. If I type "prtconf" it shows me that the system is 64 bit. Can anyone help? ...

On AIX, Can 64bit library load 32 bit library?

On AIX (5.3), I have two libraries one built with 64 bit mode, another built with 32 bit mode. Can 64bit library load 32 bit library? (using any flags or by some special configuration). Thanks & Regards, Thumbeti ...

Using 32 bit g++ to build 64bit binaries on AIX

I am trying to build a 64 bit binary from C++ code using 32bit g++ compiler. I am getting the following errors while building: ============================================================================= => /usr/local/bin/g++ -shared -maix64 -fPIC -Wl,-bM:SRE -Wl,-bnoentry -Wl,-bE:gcc_shr_lib.so.exp -o gcc_shr_lib.so gcc_shr_lib.o -L/u...

STL namespace problem in Netbeans 6.8 on AIX

I'm trying to use NetBeans 6.8 on an AIX OS for C++ development. I continue getting an error message for: using namespace std; even after adding the includes for the STL via options -- c/c++ -- code assistance The error says: "Unable to resolve identifier std" Is this a bug in the Netbeans 6.8 AIX version? Or am I missing som...

ClassCastException caused by bug in Just In Time ?

Given this piece of code : public static void writeFile(File file,List buffer)throws IOException{ File fic = new File(file.getCanonicalPath()); cat.debug("writing file : "+fic.getAbsolutePath()); FileOutputStream out = new FileOutputStream(fic); PrintStream ps = new PrintStream(out); for(int i=0;i<buffer.size();i++){...

enterprise compiler issue

I was trying to compile something on my pc with IBM XL C/C++ Enterprise Edition V8.0 for AIX I got a error like: "aaalib.c", line #... something else: It refered to a variable that isn't initialized here. It works fine when compiled with gcc in linux. But I still would like to know why or if anyone has experienced something similar....

python Illegal instruction on AIX5.2

hi,everyone: I run my python script functions like this: read from a text file, and store the data as dict. But when in the loop, an Illegal instruction occurs. why this happens? the code is like this: d={} datafile=open('a.txt') # a big text file for line in datafile: line=line.rstrip('\n') for token in line.split(): ...

Trying to test space in filesystem on Unix

I need to check if I Filesystem exists, and if it does exist there is 300 MB of space in it. What I have so far: if [ "$(df -m /opt/IBM | grep -vE '^Filesystem' | awk '{print ($3)}')" < "300" ] then echo "not enough space in the target filesystem" exit 1 fi This throws an error. I don't really know what I'm doing in shell. My highes...

"/bin/sh 'ls -l -R'" vs "/bin/sh -c 'ls -l -R'"

What is the difference between the following two commands, when run on AIX? /bin/sh 'ls -l -R' /bin/sh -c 'ls -l -R' ...

Sed script command truncating last line

I'm trying to remove the carriage returns (\r) from a file with the following command on AIX, but it's also removing my last line. Any suggestions? sed -e 's/\r\n/\n/g' ./excprule > ./excprule.tst Command sequence: dev1:> sed -e 's/\r\n/\n/g' ./test_file > ./test_file.tst dev1:> diff test_file.tst test_file diff: 0653-827 Missing n...

getting core file

Hello All I am running a Core JAVA application on AIX machine, and it creates a file named "core". My concern are 1. I am not able to open this "core" file in "Heap Analyzer" or "Thread Analyzer". 2. Which tools do I need to use, So that I can analyze this "core" file. 3. Could any one elaborate more about this file? why this "core" fil...

seting ODBC Datasource in IBM AIX server

Hi ..... I have develop IBM Message broker flow database application in windows xp environment. the database accessed using ODBC datasource. basically, I use compute node with esql programming to select query in database, and I set the datasource in the compute node properties. Now want to deployed my project to AIX server. but, I dont...

Problem with Initializing Consts

This code, when compiled in xlC 8.0 (on AIX 5.3), produces the wrong result. It should print 12345, but instead prints 804399880. Removing the const in front of result makes the code work correctly. Where is the bug? #include <stdio.h> #include <stdlib.h> #include <string> long int foo(std::string input) { return strtol(input....

AIX xlC cross-compilation/linkage for C++ not finding C symbols

I am attempting to cross-compile on AIX with the xlc/xlC compilers. The code compiles successfully when it uses the default settings on another machine. The code actually successfully compiles with the cross-compilation, but the problem comes from the linker. This is the command which links the objects together: $(CHILD_OS)/usr/vacpp/b...

When is a>a true ?

Right, I think I really am living a dream. I have the following piece of code which I compile and run on an AIX machine: AIX 3 5 PowerPC_POWER5 processor type IBM XL C/C++ for AIX, V10.1 Version: 10.01.0000.0003 #include <stdio.h> #include <math.h> #define RADIAN(x) ((x) * acos(0.0) / 90.0) double nearest_distance(double radius,doub...