solaris

How does xterm's -S option (pass pseudo terminal name and descriptor) work in Linux ?

Greetings, while porting old Solaris 2.4 code to CentOS 5.3 I came across an invocation like /usr/bin/xterm -S%s%d ... where %s is a two-character digit sequence XX like 00, 01 and %d is a numeric file descriptor. This was apparently a way to tell xterm to use /dev/ttypXX (a pseudo terminal slave) but the code does not seem to bother ...

SWT Multiple Monitor Support on Solaris?

I am writing an application in Java using SWT. On our Solaris machines, we have multiple monitor setups, but they are treated in isolation by the operating system. This means I can't open the application and drag it to another monitor. The right-click context menu doesn't even allow me to change the monitor the application is displayed o...

Tomcat : French accents in a solaris directory

One of our client bought a publicity in a newspaper and added to his URL : http://www.website.com/publicité instead of "publicite" (without the accent)... I'm trying to make the corresponding directory under Solaris and it doesn't seems to work. I grabbed the "get" request and it looks like the "real" request is /publicit%C3%A9 We tried...

How can I manage use of a shared resource used by several Perl programs?

I am looking for a good way to manage the access to an external FTP server from various programs on a single server. Currently I am working with a lock file, so that only one process can use the ftp server at a time. What would be a good way to allow 2-3 parallel processes to access the ftp server simultaneously. Unfortunately the provi...

Mount notifications on Solaris - as normal user (not root)

Does anyone know of a good (i.e. efficient) way of getting notifications of filesystem mounts/unmounts and/or new/removed devices in Solaris (10), without requiring root? I'm trying to avoid simply polling /etc/mnttab for new/removed/changed entries, so my first prototype involved using sysevent_subscribe_event to listen for device eve...

Getting the index of the substring on solaris

Hi. How can I find the index of a substring which matches a regular expression on solaris10? ...

canonicalize a path name on solaris

On a GNU system I would just use readlink -f $SOME_PATH, but Solaris doesn't have readlink. I'd prefer something that works well in bash, but other programs are ok if needed. Edit: The best I've come up with so far uses cd and pwd, but requires some more hackery to deal with files and not just directories. cd -P "$*" REAL_PATH=`pwd` ...

Problems with variable in Unix Shell script

Hey all. I have trouble passing a variable from inside a loop. Code: # find all output.txt that has been modified last 24h ... PROCESSED=1 find ${PROCESSED_DIR} -mtime -1 -name "output.txt" | while read i do # .. and compare those with TMP_TXT if diff $i ${TMP_TXT} > /dev/null then # If both are same EXIT search...

Internal implementation of atomic_cas_64() on Solaris on Sparc?

On 64-bit Solaris on Sparc, is the atomic_cas_64() function call implemented using load-link/condition-store? If not, what if any API does Solaris offer for user-mode C code to utilize ll/sc? ...

for a function in binary without source code, is there any way to get the number of parameters

I don't have the source code but have the binary. With command "nm binary_name" I could know the functions inside the binary. Can I know how many parameters a function has? Under solaris, is there anyway to do that? e.g, if the function is: func1(a int,b int,c int), then there are 3 parameters. Thanks Daniel ...

nanoseconds to milliseconds - fast division by 1000000

Hi, I'm wanting to convert the output from gethrtime to milliseconds. The obvious way to do this is to divide by 1000000. However, I'm doing this quite often and wonder if it could become a bottleneck. Is there an optimized divide operation when dealing with numbers like 1000000? Note: Any code must be portable. I'm using gcc and thi...

Getting CPU usage stats from C on Solaris 10.

On Solaris 10, and in C, I'd like to regularly query numbers like The CPU usage for specific LWPs within that OS process. The memory usage for that OS process. I already know how to do the latter by opening /proc/pid/psinfo and reading from that (pr_rssize), but is there a way to implement the former? In the past I have forked off...

Solaris process hanging in exit

On Solaris 9 and 10, both x86 and Sparc, we have a process that is hanging during exit: fe0b5994 lwp_park (0, 0, 0) fe0b206c slow_lock (ff388908, fe080400, 0, 0, 98, fe0abe00) + 58 ff376aa8 __deregister_frame_info_bases (2a518, 1, 0, 2daf0, 0, ff376be4) + 4c 00014858 ???????? (0, ff000000, 0, 0, 0, 0) 00019920 _fini (0, 0, 210fc, fe2...

How set the From email address for mailx command?

I'm working on a korn shell script running on a Solaris server that will send out an email when and error condition is met. I'm sending the email via mailx. Question: How to I set the "From" email address on the mailx command? Current Code: echo ${msg_txt} | mailx -s "Script Failure" ${to_email} Note: The command works fine, ho...

How does one compile libqt4 OR wkhtmtltopdf for Solaris?

Anyone have REALLY specific and accurate information about which libraries I need in order to compile both libqt and wkhtmltopdf in Solaris? ...

Get call stack from any thread within C.

In C on Solaris 10, I'd like to get the call stack from an arbitrary thread within a process. I have many worker threads and one thread which monitors them all to detect tight loops and deadlocks. The function I'd like to implement is for the monitoring thread to print the call stack from the "hung" thread several times before it kills...

Solaris 5.10: How do I hide a JWindow button on the task bar?

I am using a JWindow object in my Java application to simulate a mouseover dropdown menu. When the user mouses over a JLabel, the window appears and remains until the mouse exits either the label or the newly visible window. My problem is that each time the user performs this action, a new entry in the task bar at the bottom of the scr...

What to expect and prepare for when moving from LAMP to SAMP

My company has a very real problem with patch management on our web servers. The public servers are out of date, and now management considers this a priority. However, rather than simply updating and patching the existing servers (and all the testing that goes along with that) they have embarked on the process of migration to Solaris s...

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...