sunos

how to get the command line args passed to a running process on unix/linux systems?

On SunOS there is pargs command that prints the command line aruguments passed to the running process. Is there is any similar command on other Unix environments? ...

Java memory allocation performance (SunOS vs Windows)

I have a very simple unit test that just allocates a lot of Strings: public class AllocationSpeedTest extends TestCase { public void testAllocation() throws Exception { for (int i = 0; i < 1000; i++) { long startTime = System.currentTimeMillis(); String a = "dummy"; for (int j = 0; j < 1000; j++) { a ...

C++ app on SunOS has a memory leak. How to find it?

Hi, i just landed on SunOS: $ uname -a SunOS sunfi95 5.9 Generic_122300-13 sun4u sparc SUNW,Sun-Fire-880 and have Sun studio: $ CC -V CC: Sun C++ 5.8 2005/10/13 How I can find memleaks in code? (dbx is not a option in this case). Valgrind does not work on sparc systems, only one solution that cross my mind is to use some smart lib...

How can I use Solaris::Kstat on Solaris 5.10?

Hi, I am looking to find the SunOS system details using Kstat. I have found Solaris::Kstat module in CPAN but this only supports Solaris 2.5.1, 2.6 & 2.7. The Sun developer's site mentions a Sun::Solaris::Kstat which I have not found in CPAN. Can anyone please help me with the Perl scripting to find details from kstat on Solaris 5.10. ...

Getting the uptime of a SunOS UNIX box in seconds only

How do I determine the uptime on a SunOS UNIX box in seconds only? On Linux, I could simply cat /proc/uptime & take the first argument: cat /proc/uptime | awk '{print $1}' I'm trying to do the same on a SunOS UNIX box, but there is no /proc/uptime. There is an uptime command which presents the following output: $ uptime 12:13pm up ...

How to convert netstat -in output on Sunos

On Sunos netstat -in gives me below output. Name Mtu Net/Dest Address Ipkts Ierrs Opkts Oerrs Collis Queue lo0 832 127.0.0.0 127.0.0.1 20026 0 20026 0 0 0 nxge0 100 192.168.0.0 192.168.0.31 40957 0 465768 0 0 0 Is it possible to change the input/output values to volume i.e. i...

How do I make a hash with the output of kstat -p using Perl?

I am working so some stuffs where I need to get some information using kstat -p. So I am thinking to create a hash variable with all output of kstat -p. Sample output from kstat -p cpu_stat:0:cpu_stat0:user 18804249 To access values @{$kstat->{cpu_stat}{0}{cpu_stat0}}{qw(user)}; I have also looked at CPAN for any available m...

Counting program unaligned address accesses on Sun OS, AIX

How to count program unaligned address accesses on Sun OS and AIX. Or how to measure time to system handling this exception on Sun OS and AIX ? ...

Compiling boost on Sunos

I have just started with using boost libraries. For one of our projects i want to compile Boost 1.39.0 on Sun OS using sun compiler. However if i compile it using steps mentioned in http://www.boost.org/doc/libs/1_39_0/more/getting_started/unix-variants.html, not all of the targets are compiled. Can someone provide resources which would ...

Makefile error: Unexpected end of line seen

Trying to install Git, I ran configure and make, but got the following error message: make: Fatal error in reader: Makefile, line 221: Unexpected end of line seen The Makefile looks like: 218: GIT-VERSION-FILE: FORCE 219: @$(SHELL_PATH) ./GIT-VERSION-GEN 220: -include GIT-VERSION-FILE 221: 222: uname_S := $(s...

On solaris, is there a command to get the Ethernet Card MAC Address without being root

On Solaris, is there a command that I can run to get the MAC address of an ethernet card without running "/sbin/ifconfig -a" as root. Running /sbin/ifconfig -a as a non root user leaves out the MAC address - go figure! Thanks, Paul ...

C++ std::stringstream seemingly causes thread to hang or die under SunOS

I have an application developed under Linux with GCC 4.2 which makes quite heavy use of stringstreams to wrap and unwrap data being sent over the wire. (Because the Grid API I'm using demands it). Under Linux everything is fine but when I deploy to SunOS (v5.10 running SPARC) and compile with GCC 3.4.6 the app hangs when it reaches the p...

How to capture shift-tab in vim

I want to use shift-tab for auto completion and shifting code blocks visually. I have been referring to Make_Shift-Tab_work . That link talks about mapping ^[[Z to shift-tab . But i don't get ^[[Z when i press shift-tab. i just get a normal tab in that case. It then talks about using xmodmap -pke | grep 'Tab' to map tab keys. Accordin...

How can I wrap an executable on UNIX (SunOS) so that it is never run more than once at the same time?

I have an executable (no source) that I need to wrap, to make sure that it is not called more than once at a time. I immediately think of some sort of queue wrapper, but how do I actually make it so that my wrapper is called instead of the executable itself? Is there a better way to do this? The solution needs to be invisible because the...

Different search paths for tclsh

Any one knows how can I invoke the tclsh in the Tcl code due to different paths to tclsh in various platforms (Linux, SUN)? For example in SUN: #!/usr/bin/sun/tclsh in Linux: #!/usr/bin/linux/tclsh How can I use the same Tcl code and execute it in the above two paths? ...

UNIX programming

Hi i want to convert UNIX date to normal date (YYYY-MM-DD) 22222,0,0,0,14387 33333,0,0,0,14170 44444,0,0,0,14244 55555,0,0,0,14190 66666,0,0,0,14528 77777,0,0,0,14200 88888,0,0,0,0 99999,0,0,0,0 here 5th column represents UNIX date i want to convert into 22222,0,0,0,2009-05-23 and similarly remaining rows can any body help me ...

Strangeness using /usr/xpg4/bin/tr and /usr/bin/tr on Solaris 9

Hi all, I have a file looking like this, "xxxxxx" "yyyyyy" "aaaaaa" "cccccc" "bbbbbb" "eeeeee" "oooooo" "zzzzzz" Wanting to replace each \n in this file I use: tr '\n' ',' < INPUT > OUTPUT Which works fine. The output is to be expected: "xxxxxx","yyyyyy","aaaaaa","cccccc".... However I can't do any manipulation using sed or aw...

How to link non thread-safe library so each thread will have its own global variables from it?

I have a program that I link with many libraries. I run my application on profiler and found out that most of the time is spent in "waiting" state after some network requests. Those requests are effect of my code calling sleeping_function() from external library. I call this function in a loop which executes many, many times so all waiti...

In which order does the linker process the library directories?

It is possible that more than one instance of the library exists in the search path during compilation. In what order will linker process directories included in the search path? The platform in question is Sun OS. ...