Writing /dev/poll application in Solaris 8

Hi all,
I am trying to implement /dev/poll based polling in solaris 8 . I got the
sample code form solaris 2.8 man pages for /dev/poll .
I am able to compile the program but when I try to run it the ioctl
call fails giving an error of "Invalid Argument" .
What could be the reason for the ioctl faliure . Any help or pointers
will be greatly appreciated.
regards
Rajesh K
Section of the code .
nt i=0 ,a=0,clen;
int j=0,pret=0;
struct sockaddr_in serv , cli ;
struct pollfd pfd[2];
/* struct dvpoll dopoll;
dvpoll_t dopoll;
int wfd;
while(1)
dopoll.dp_timeout = -1;
dopoll.dp_nfds = 2;
dopoll.dp_fds =pfd ;
errno=0;
if((pret = ioctl(wfd ,DP_POLL ,&dopoll)) < 0)
perror("/dev/poll ioctl DP_POLL error");
printf(" Errno = %d \n",errno);
exit(0);
}

pfd is a array of pollfd structures and has been initialised to the
file descriptors that has to be polled. The write to /dev/poll of that structure is also successful.
It looks like that ioctl is not able to recogonise this device may have to configure its device number but how I dont know.

Similar Messages

  • Solaris 10 /dev/poll bug

    Solaris 10, at least on my T2000, seems to give me an EINVAL from the DP_POLL ioctl in a case where it shouldn't. The below example code should clarify:
    #include <stdio.h>
    #include <stdlib.h>
    #include <sys/types.h>
    #include <fcntl.h>
    #include <errno.h>
    #include <limits.h>
    #include <sys/resource.h>
    #include <sys/devpoll.h>
    This program demonstrates what seems to be a bug in the /dev/poll interface
    on Solaris 10 on our T2000. The man page says:
    EINVAL The request or arg parameter is not valid
    for this device, or field of the dvpoll
    struct pointed by arg is not valid (for
    example, dp_nfds is greater than
    {OPEN_MAX}).
    But in this case, we get EINVAL even though dp_nfds is not greater than
    OPEN_MAX.
    void fatal(const char *f)
    fprintf(stderr, "Unable to show problem: %s\n", f);
    exit(1);
    int main(void)
    struct rlimit r;
    struct pollfd pfd[256];
    struct dvpoll dp;
    int i;
    if(getrlimit(RLIMIT_NOFILE, &r)!=0) fatal("unable to get file limit");
    if(r.rlim_cur!=256) fatal("set fd limit to 256");
    if(OPEN_MAX!=256) fatal("OPEN_MAX must be 256");
    i=open("/dev/poll", O_RDWR);
    if(i<0) fatal("unable to open /dev/poll");
    dp.dp_timeout=0;
    dp.dp_nfds=256; /* Changing this to 255 fixes the problem */
    dp.dp_fds=pfd;
    if(ioctl(i, DP_POLL, &dp)==0) fatal("it does not appear on this system");
    printf("errno=%d - Why?\n", errno);
    Any ideas?

    I ran into the same problem. /dev/poll is too smart for its own good here. You can't monitor your /dev/poll file descriptor using /dev/poll, so the actual maximum number of file descriptors you can monitor is OPEN_MAX - 1. Solaris enforces that limit.
    This breaks other code out there too, e.g. the libevent library. Annoying even though it's arguably technically correct.

  • Solaris 10 on t1000 - write() to /dev/poll hangs on asm instrn

    hi,
    i've got a streaming server which uses /dev/poll and once in a while it hangs. upon debugging with dbx i found that sometimes it gets stuck inside the write() call to remove the fd from polled fd structure at the assembly instruction "ta 8" which is for a syscall, correct? and, sometimes it gets stuck inside sosendmsg() at "ta 8" too.
    this bug seems to reproduce intermittently only when the server is configured with 33 (the cpu has 32 coolthreads) worker pthreads each of which can add/remove fds from the poll device. each thread opens the /dev/poll seperately, so they have different fds to write to /dev/poll.
    the problem happens after all of the threads have started up, so it does not appear to be an issue with thread spawning. if the server is configured for lesser threads this behavior doesn't happen. i haven't increased the stress level on the server to say for certain that that is the case, but under the same load it doesn't happen.
    (1) the _write() call hang happens in the single thread that is responsible for handling all the incoming connections.
    (2) the sosendmsg() hang happens in any one of the 32 threads which handle all out-going data (streaming).
    hardware: t1000 with 8 cores (8G ram)
    compiler:s SUN C/C++ 5.8 2005/10/13
    application: helix server
    questions:
    (0) there is no need to lock the poll device even though mulltiple threads are writing to /dev/poll thru different fds, right?
    (1) is this a known bug?
    (2) how can i use dtrace (or any other tool) to probe beyond the syscall trap when the server hangs?
    here is the stack of the last frame in dbx for _write:
    0xff2412a4: _write       :      st       %o0, [%sp + 68]
    0xff2412a8: _write+0x0004:      mov      4, %g1
    => 0xff2412ac: _write+0x0008:      ta       8
    0xff2412b0: write+0x000c:      bcc,pt   %icc,write+0x20 ! 0xff2412c4
    0xff2412b4: _write+0x0010:      cmp      %o0, 91
    0xff2412b8: write+0x0014:      be,a,pn  %icc,write+0x4 ! 0xff2412a8
    0xff2412bc: _write+0x0018:      ld       [%sp + 68], %o0
    0xff2412c0: write+0x001c:      ba,a     cerror ! 0xff1a2380
    0xff2412c4: _write+0x0020:      retl    
    0xff2412c8: _write+0x0024:      nop     
    for sosendmsg:
    0xff240458: sosendmsg : st %o0, [%sp + 68]
    0xff24045c: sosendmsg+0x0004: mov 241, %g1
    0xff240460: sosendmsg+0x0008: ta 8
    => 0xff240464: sosendmsg+0x000c: bcc,pt %icc,_so_sendmsg+0x20 ! 0xff240478
    0xff240468: sosendmsg+0x0010: cmp %o0, 91
    0xff24046c: sosendmsg+0x0014: be,a,pn %icc,_so_sendmsg+0x4 ! 0xff24045c
    0xff240470: sosendmsg+0x0018: ld [%sp + 68], %o0
    0xff240474: sosendmsg+0x001c: ba,a _cerror        ! 0xff1a2380
    0xff240478: sosendmsg+0x0020: retl
    0xff24047c: sosendmsg+0x0024: nop
    any help is appreciated.
    sincerely,
    -atin

    hi,
    To look and see what the applications threads are doing once the application hangs
    as root run
    # mdb -k
    you should get a ">" prompt.
    then you could run..
    $<threadlist and look for your application process name amongst all the stack traces.
    or ::ps -t and find your process, that will list a load of kernel threads for your app.
    then you can do "threadpointer"::findstack for each of your threads eg
    here is ::ps output for vold
    R 342 1 342 342 0 0x4a014000 000006000987dbc0 vold
    T 0x300019c4cc0 <TS_SLEEP>
    T 0x300018ea380 <TS_SLEEP>
    T 0x300019dd960 <TS_SLEEP>
    T 0x30001152380 <TS_SLEEP>
    it has the 4 sleeping threads. lets see where they are stopped.
    0x300019c4cc0::findstackstack pointer for thread 300019c4cc0: 2a10116d061
    [ 000002a10116d061 cv_wait_sig_swap_core+0x11c() ]
    000002a10116d111 poll_common+0x4e8()
    000002a10116d201 pollsys+0xd8()
    000002a10116d2e1 syscall_trap32+0xcc()
    and so on for all four threads.
    that should give us an idea as to where in the devpoll code your thread is stopped
    but.. lets look at devpoll.c especially at where could dpwrite() block
    ah there is a comment saying that we wait for any other writers via dpwrite or any
    readers in dpioctl(), it keeps a reference count per fd that is opened into /dev/poll
    Is it possible that you have a thread in a longterm poll on the same fd as the blocking write, it looks like the write will block till the poll completes, pstack should give you the
    fd for each write/ioctl as the first argument.
    tim

  • Multithreaded behavior of new Solaris 8 /dev/poll

    When one thread is blocked in the ioctl for the /dev/poll device
    (to retrieve the fd's with events), a write from a different thread
    to add to the set appears to block indefinitely.
    I figured this ability (to add to the set from a different thread
    with no mutexing) was a great feature, but it looks like the
    write call blocks indefinitely. Before I invest in the unfortunate
    workaround, I wondered if anyone had dealt with this before.
    Thanks.

    I have not yet extracted a simple program, but the basics are:
    Thread one:
    fd1 = open()
    fd2 = open()
    fdp = open("/dev/poll"..)
    ioctl(fdp, DP_POLL, ...)
    Thread two (later):
    write(fdp, {struct with fd1, and POLLIN});
    ... much successful operation of the first thread receiving
    events from the ioctl, and properly "dispatching" them
    write(fdp, {struct fd1, and POLLREMOVE);
    It is this second write that hangs indefinitely.
    The only way I get it to NOT hang is by giving the
    ioctl(DP_POLL) in the first thread a timeout.
    When the ioctl returns due to timeout, the second thread that was hung in
    "write", finally returns.
    (my email is [email protected])
    Thanks for any ideas or help.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Solaris8 and 9 (possibly 7) /dev/poll driver bug report.

    Hello,
    I'd like to report a bug in the solaris 8 and 9 /dev/poll driver (poll(7d)).
    As i do not have a support account with sun or anything like that, there
    seems to be no other way to do that here (which is of course a very sad
    thing).
    Bug details:
    The /dev/poll device provides an ioctl-request (DP_ISPOLLED) for checking
    if a particular filedescriptor is currently in the set of monitored
    filedescriptors for that particular /dev/poll fd set (open /dev/poll fd).
    A quote from the documentation of the poll(7d) manual page taken from
    Solaris9:
    "DP_ISPOLLED ioctl allows you to query if a file descriptor is already in
    the monitored set represented by fd. The fd field of the pollfd structure
    indicates the file descriptor of interest. The DP_ISPOLLED ioctl returns 1
    if the file descriptor is in the set. The events field contains the
    currently polled events. The revents field contains 0. The ioctl returns 0
    if the file descriptor is not in the set. The pollfd structure pointed by
    pfd is not modified. The ioctl returns a -1 if the call fails."
    It says that when you query for an filedescriptor which is currently being
    monitored in the set, that it would return 1, and change the events field of
    the pollfd structure to the events it's currently monitoring that fd for.
    The revents field would be set to zero.
    However the only thing which actually happens here, is that FD_ISPOLLED
    returns 1 when the fd is in the set and 0 if not. When the fd is in the
    set, when FD_ISPOLLED returns 1, the events field remains unmodified, but
    the revents field gets changed.
    A small sample code to illustrate:
    #include <stdio.h>
    #include <unistd.h>
    #include <sys/types.h>
    #include <sys/stat.h>
    #include <fcntl.h>
    #include <sys/devpoll.h>
    main() {
    struct pollfd a;
    int dp_fd = open("/dev/poll", O_WRONLY);
    a.fd = 0; /* stdin */
    a.events = POLLIN; /* we monitor for readability, POLLIN=1 */
    a.revents = 0;
    write(dp_fd, &a, sizeof(a));
    a.fd = 0;
    a.events = 34; /* filled in with bogus number to show malfunctioning */
    a.revents = 0;
    printf("DP_ISPOLLED returns: %d\n", ioctl(dp_fd, DP_ISPOLLED, &a));
    printf("a.fd=%d, a.events=%hd, a.revents=%hd\n", a.fd, a.events,
    a.revents);
    According to the documentation of /dev/poll and namely DP_ISPOLLED this
    program is supposed to print the following:
    DP_ISPOLLED returns: 1
    a.fd=0, a.events=1, a.revents=0
    However it prints the following:
    DP_ISPOLLED returns: 1
    a.fd=0, a.events=34, a.revents=1
    You can take any number instead of '34' and it will simply remain untouched
    after the DP_ISPOLLED ioctl-request.
    I hope it's clear now that the solaris8 and solaris9 (and probably solaris7
    with /dev/poll patch too) DP_ISPOLLED implementation is broken.
    This bug is also easily illustrated by looking at the solaris8 kernel sourcecode:
    <snippet osnet_volume/usr/src/uts/common/io/devpoll.c:dpioctl()>
    case DP_ISPOLLED:
    pollfd_t pollfd;
    polldat_t *pdp;
    if (pollfd.fd < 0) {
    mutex_exit(&pcp->pc_lock);
    break;
    pdp = pcache_lookup_fd(pcp, pollfd.fd);
    if ((pdp != NULL) && (pdp->pd_fd == pollfd.fd) &&
    (pdp->pd_fp != NULL)) {
    pollfd.revents = pdp->pd_events;
    if (copyout(&pollfd, (caddr_t)arg,
    sizeof(pollfd_t))) {
    mutex_exit(&pcp->pc_lock);
    DP_REFRELE(dpep);
    return (set_errno(EFAULT));
    *rvalp = 1;
    </snippet>
    its' clearly visible that the code writes the current monitored events to
    the revents field:
    'pollfd.revents = pdp->pd_events;'
    and that it doesnt set revents to zero.
    It's funny to see that this has been like this since Solaris8 (possibly 7). That means nobody ever used DP_ISPOLLED that way or people were simply to lazy to file a bug report.
    Another funny thing related to this. is that Hewlett-Packard did seem to know about this. Since HP-UX11i version 1.6 they also support /dev/poll. From their manual page i ll quote some sentences from their WARNING session:
    "The ioctl(DP_ISPOLLED) system call also returns its result in the revents member of the pollfd structure, in order to be compatible with the implementation of the /dev/poll driver by some other vendors."
    Hopefully this will get fixed.
    I also like to reexpress my very negative feelings towards the fact that you're not able to file bug reports when you do not have a support contract. Ridiculous.
    Thanks,
    bighawk

    Have I mentioned how much i love my playbook now Great job on os 2.0

  • Migrating Legacy Applications to Solaris 10 Containers

    Hi, Good Day,
    We have some customers who are keen to migrate their legacy banking systems to run on Solaris 10 containers. We intend to assess the feasibility of the project.
    Kindly advice the considerations/potential pitfalls(if any) of running legacy Solaris 8 applications on Solaris 10 containers. Kindly advice those types of applications that cannot run on Solaris 10 containers?
    What kind of information should we extract from the customer to understand these considerations?
    Thank-you and Best Regards,
    Siong Guan

    Oracle migration workbench solve only the technical point of the migration. That won't solve the data mapping you have to define on your own.
    Data mapping is the most important task of a migration, totally depending of the source and target systems. You need expertise on both of them and discuss with the business and functional experts people.
    Then, and only after defining the data mapping, you can go for the technical migration.
    Nicolas.

  • Performance effects of writing code in Application Package

    Hi all,
    I just have this strange doubt about the performance of the system if we write the code in "Application Package". Writing code in application package is a good practice as it is good in trems of readability but I am wondering whether performance is effected apart from the advantages of reusability, readability etc.
    I have to create a application class object(Import as well) whenever I need to call a method in the class or any property,during this process the application class object has to be loaded which consumes component buffer which is considerable. So if I am calling in amethod which has say some 20 lines of code in a class of some 1000 odd lines of code. How best is to write that 20 lines of code directly rather than calling a method in the application class.
    Please give your views if my assumptions are wrong.
    Thanks
    Vamsi.

    You ask a good question and you are using a good thought process. It seems that if you write 20 lines of code inline, you will have less memory overhead and less CPU cycles (no construction overhead) than if you write that same 20 lines in an App Class and then create an instance of an object for each row. Is this true? I'm not sure, but using the debugger, etc, it seems logical. It seems logical enough for me to just assume that is the case. Besides performance, however, you have to think about upgrades. If you are modifying a delivered component, then it is usually preferable to write your code outside the delivered code, and then import that code using an App Class or FUNCLIB.
    I think there are some more important questions to answer:
    1. If you have an App Class with 1,000 lines of code and you are only using 20, then why are those 20 lines in the same class as the other 1,000 lines? It seems as though the "big" class with 1,000 lines should use the class that has only 20 (composition), but not be included in the class's code base. Classes should be small. A 1,000 line class is probably too complex and should be broken down anyway. A 1,000 line class may be necessary, but I would take a good look at it and consider refactoring.
    2. If you are iterating over rows and creating an instance for each row, only to execute a method, then perhaps you should consider creating an instance outside the loop and then just execute the method, passing in values, much as you would a Java static method. If you are using a field level event, like RowInit, then this isn't possible. It might be tempting to apply the same approach using component scoped variables, but I cringe at anything other than local scope. I would rather take the minimal performance hit of a small class than use a scope other than local.
    3. If you are only creating an object for the sole purpose of executing a method, then you may be using OOP wrong anyway, and may be better served by a FUNCLIB.
    These are just some thoughts I have. Properly designed App Classes make your PeopleCode easier to write and maintain, but won't add much, if anything to the the number of CPU cycles and memory consumption. In fact, some may argue that the discipline and design afforded by good OOP (composition, TDD, etc) would result in better performing programs.

  • Generating 32 bit applications on Solaris 9 / UltraSparc III+

    Hallo.
    I wish to generate some 32 bit applications on Solaris 9 and UltraSparc III+ platform. I need to do that as my process have to dinamically link a 32 bit shared object previosuly installed by another software (to be precise, the library is an "ELF 32-bit MSB dynamic lib SPARC Version 1, dynamically linked, not stripped").
    After my generation, some executables that runned perfectly on my previous UNIX SCO platform, now crash when exiting.
    Moreover I find out that my master process correctly launches the execution of a slave process (I traced the values of the paramters passed to the execv() system call) but the slave process immediatly exits because it gets wrong parameters (I found out that in the main() function within the slave program, the argc parameter is 0 (!!) that sounds really really strange!!)
    Is there anyone able to help me?
    For your information, when I compile my objects I use the following options:
    cc -g -xc99=none -xtarget=ultra -xchar -c <source>
    and when I link them I use the following:
    /usr/ccs/bin/ld -z defs -z verbose -dy -B dynamic -o <processname> <object list> <shared library> -lm -lc
    Doing so, both the master and slave process are "ELF 32-bit MSB executable SPARC32PLUS Version 1, V8+ Required, UltraSPARC1 Extensions Required, dynamically linked, not stripped"
    Thank you in advance!!
    Gianni

    Why do you want to make your own link lines?
    Use cc to link, not ld. You ask for trouble.
    I made the following program:
    int main(int argc, char **argv) { return argc;}
    % cc -c t.c
    Then used your link line to link it:
    % /usr/ccs/bin/ld -z defs -z verbose -dy -B dynamic -o a.out t.o -ln -lc
    % a.out
    Segmentation fault (core dumped)
    Use cc to link. Do not try to use ld. Or if you really, really think you have to use ld yourselves, run cc -### ... first to se what link line it uses, and try to make the variation you need yourselves. But all kind of options to ld can also be given to cc.

  • Technical query w.r.t running C++ applications on Solaris 9.

    Hi,
    We have an C++ application which is compiled with Sun compiler 5.3 which comes along with Forte6 Update2. The application is compiled and linked on Solaris 9 platform. Will there be any issues while running this application on Solaris 8? Are applications built on Solaris 9 safely run on Solaris 8?
    Thanks,
    Vinay

    Sun supports moving old programs and binary files forward from old Solaris and compiler versions to be used with newer Solaris and compiler versions, but not the reverse. (Supporting the reverse would mean never providing new or improved features.)
    If you build an application on one Solaris version, you can run it on that version or later versions. In general it will NOT run on earlier Solaris versions.
    SImilarly if you create an object file (.o, .a, .so) on one Solaris version, you cannot use that file on an earlier Solaris version.
    When you plan to deploy an application on different versions of Solaris, you must build the entire application, including shared libraries that are part of the application, on the earliest version of Solaris that you intend to support.

  • Compiling C++ application for Solaris 5.8

    Hi,
    How can we build/compile C++ application to be deployed on Solaris 5.8 OS? Which compiler should be used for the same?
    We are exploring how this can be done. Request your help to identify the mechanism in which we can achieve this.
    We explored following but it didnt worked -
    - Using Studio 12 we build application on Solaris 10 but it is giving error at execution time
    ld.so.1: ./distmgr: fatal: libCrun.so.1: version `SUNW_1.5' not found (required by file ./distmgr)
    Questions -
    - Is Studio 12 supported on Solaris 5.8?
    - If ready made binaries are not available of Studio 12 then can be build this for 5.8? IS the source code of Studio 12 available?
    - Can Studio 12 on Solaris 10 cross complie for OS Solaris 5.8
    Thanks and Regards,
    vinit.

    I strongly advise against using WS62. Studio 11 is superior to WS6u2 by any reasonable measure. Valid source code that compiled with older compilers should continue to work correctly with later compilers. Any problems are usually due to invalid code that was incorrectly accepted by the earlier compiler. In some cases we provide compiler options to reproduce the old compiler behavior, but it is better to fix the code so that it is valid and has well-defined semantics.
    Consider also whether you would wind up mixing binaries built by WS6u2 with binaries built by a later compiler. If so, you must use the later (or latest) compiler involved to perform any link steps. That is, steps that create shared libraries or executable programs.
    We strive to maintain forward binary compatibility, meaning old binaries can be linked into new programs, but there are some issues with C++ compilers older than Studio 7 that can cause compatibility problems when the code is mixed with C++ code from newer compilers. In the worst case, a multi-threaded program can compile and link, but fail at run time, depending on compilation options used with WS6u2. It is safer to rebuild such old binaries using the newer compiler. Binaries created by Studio 7 or later compilers should not have that problem.
    I'm sorry to have to list so many caveats, but continuing to use obsolete software creates its own problems. We bring out new versions and retire old software for good reasons.

  • Writing LabVIEW application on Solaris that invokes a function in a shared library

    In the "Call Library Function" Configure window I choose a Shared Library "xxx.so" file and select the Function Name "Foo" (written in C). It happens that function "Foo" calls another function "Bar" (also written in C) that resides in a different Shared Library (in /usr/dt/lib). After clicking "OK", a window comes up with the message "/xxx/xxx.so fatal relocation error ... symbol Bar: referenced symbol not found." Is there a way to get around this (such as search a list of libraries)? Combining the libraries is not an option; they are very large and belong to different software packages.

    Thanks for your quick response.
    Yes, usr/dt/lib is in the LD_LIBRARY_PATH environment variable. Is LabVIEW supposed to search LD_LIBRARY_PATH libraries in addition to the one I specify in the "Call Library Function" Configure window? That's what I would like it to do, but there still seems to be a problem. -j_b

  • Using getRuntime().exec() with Serlvet to run applications in Solaris

    I am currently doing a project which requires the execution of Solaris applications through the use of Java Servlet with this Runtime method - Runtime.getRuntime.exec()
    This means that if the client PC tries to access the servlet in the server PC, an application is supposed to be executed and launched on the server PC itself. Actually, the servlet part is not an issue as the main problem is the executing of applications in different platforms which is a big headache.
    When I tried running this program on a Windows 2000 machine, it works perfectly fine. However, when I tried it on a Solaris machine, nothing happens. And I mean nothing... no errors, no nothing. I really don't know what's wrong.
    Here's the code.
    public void doPost(HttpServletRequest request, HttpServletResponse response)
    throws ServletException, IOException
    response.setContentType("text/html");
    PrintWriter out = response.getWriter();
    Process process; Runtime runtime = Runtime.getRuntime();
    String com= "sh /opt/home/acrobat/";
    String program = request.getParameter("program");
    try
    process = runtime.exec(com);
    catch (Exception e)
    out.println(e);
    It works under Windows when com = "c:\winnt\system32\notepad.exe"
    When under Solaris, I have tried everything possible. For example, the launching of the application acrobat.
    com = "/opt/home/acrobat"
    com = "sh /opt/home/acrobat"I have also tried reading in the process and then printing it out. It doesn't work either. It only works when excuting commands like 'ls'
    BufferedReader read = new BufferedReader(new InputStreamReader(process.getInputStream()));Why is it such a breeze to execute prgrams under Windows while there are so many problems under Solaris.
    Can some experts please please PLEASE point out the errors and give me some advice and help to make this program work under Solaris! Please... I really need to do this!!
    My email address - [email protected]
    I appreciate it.
    By the way, I'm coding and compiling in a Windows 2000 machine before ftp'ing the .class file to the Solaris server machine to run.

    Hi!
    I'm no expert, but I think I remember doing something similar a few months ago, and I think the problem was that the UNIX server does not know which shell to use. The solution was this:
    Create a script that starts the program on the server, and be sure to include a first row saying:
    #!/bin/ksh
    to specify which shell to use (in this case Korn shell). Then call the script from Runtime.getRuntime().exec()

  • How to execute an application in Solaris using Runtime.getRuntime.exec() ?

    I am currently doing a project which requires the execution of Solaris applications through the use of Java Servlet with this Runtime method - Runtime.getRuntime.exec()
    This means that if the client PC tries to access the servlet in the server PC, an application is supposed to be executed and launched on the server PC itself. Actually, the servlet part is not an issue as the main problem is the executing of applications in different platforms which is a big headache.
    When I tried running this program on a Windows 2000 machine, it works perfectly fine. However, when I tried it on a Solaris machine, nothing happens. And I mean nothing... no errors, no nothing. I really don't know what's wrong.
    Here's the code.
    public void doPost(HttpServletRequest request, HttpServletResponse response)
         throws ServletException, IOException
         response.setContentType("text/html");
         PrintWriter out = response.getWriter();
              Process process;                                                       Runtime runtime = Runtime.getRuntime();
              String com= "sh /opt/home/acrobat/";
              String program = request.getParameter("program");
              try
                        process = runtime.exec(com);
              catch (Exception e)
                   out.println(e);
    It works under Windows when com = "c:\winnt\system32\notepad.exe"
    When under Solaris, I have tried everything possible. For example, the launching of the application acrobat.
    com = "/opt/home/acrobat"
    com = "sh /opt/home/acrobat"I have also tried reading in the process and then printing it out. It doesn't work either. It only works when excuting commands like 'ls'
    BufferedReader read = new BufferedReader(new InputStreamReader(process.getInputStream()));Why is it such a breeze to execute prgrams under Windows while there are so many problems under Solaris.
    Can some experts please please PLEASE point out the errors and give me some advice and help to make this program work under Solaris! Please... I really need to do this!!
    My email address - [email protected]
    I appreciate it.
    By the way, I'm coding and compiling in a Windows 2000 machine before ftp'ing the .class file to the Solaris server machine to run.

    it is possible that you are trying to run a program that is going to display a window on an X server, but you have not specified a display. You specifiy a display by setting the DISPLAY environment variable eg.
    setenv DISPLAY 10.0.0.1:0
    To check that runtime.exec is working you should try to run a program that does not reqire access to an X Server. Try something like
    cmd = "sh -c 'ls -l > ~/testlist.lst'";
    alternatively try this
    cmd = "sh -c 'export DISPLAY=127.0.0.1:0;xterm '"
    you will also need to permit access to the X server using the xhost + command

  • Signals in Multithreaded Application on Solaris 10.

    HI All,
    I need to know are the signal handlers are inherited by threads.
    Assume I have defined a signal handler (assume for SIGCHLD )in main function before the creation of threads, and after that I create 5 threads. Can anyone please tell me if the signal SIGCHLD comes to any of the 5 threads will it be handled as signal handler defined earlier.
    Any comments will be appreciated.
    Regards,
    Rahul.

    What do you mean by 'linux application'? Right now, you'd have to recompile the program from source on Solaris or install a precompiled Solaris package.
    After the release of project Janus, you might have some other choices to run Linux binaries directly on a Solaris (x86) machine.
    Darren

  • Migrate solaris 8 oracle applications to solaris 10 using oracle vm

    Hi,
    I have Oracle Applications 11.5.8 running on Solaris 8 on SPARC machine (the forms and concurrent servers) and Linux SLES9 for the Oracle 9i database server.
    I am exploring if it's possible to migrate the forms and concurrent tier from Solaris 8 on SPARC to a Solaris 10 Oracle VM running on x86 platform. That is, 1) install Oracle VM on x86 platform 2) install solaris 10 on the solaris container of this VM (solaris 8 not supported) 3) try to move forms and concurrent application tier to this solaris 10.
    Has anyone tried this before or know whether it can be done?

    Moderator Action:
    This thread has been moved from the Solaris On x86 forum space,
    to the Oracle Applications Server forum space,
    for closer topic alignment.

Maybe you are looking for

  • Writing and including our own customer data source to Crystal Report Design

    Hi, I need to create a Crystal Report based on a locally stored XML and schema. I can do this but the issue Iu2019m facing is that some tags used in the schema and the format is not supported by Crystal. So my plan is to write a database driver which

  • JPEGs stored on Fantom Drive will no longer open in Preview?

    Hello, I'm unable to view JPEGs in Preview after they have been stored on my external Fantom Titanium Hard Drive. When the photos are moved back onto my Powerbook, I get the following error message within Preview: "FILE ERROR Couldn't open the file.

  • Document library field

    Hi Team, Please refer the attached document. How to change the document owner field. is it possible to change or edit that. Thanks in advance regards, Shiny

  • Adobe Lens Profile Creator v 1.0.4- Does Not Work on a Mac

    Hi, I downloaded Adobe Lens Profile Creator v 1.0.4 and tried to install it on a mac and installation failed because of a corrupted dmg file. I tried it several times on 4 differnet macs with different Operating systems- and still got the same result

  • Shared VHDX with Windows 2012 R1. Any plans?

    Hi all, i have two servers connected to a SAN through SAS HBA adapters. I have Windows 2012 R1 Std, i want to use the Shared VHDX feuture (introduced with Windows 2012 R2...). Are there any plans to provide this feuture to those poor guys who already