VirtualBox

Ignore:
Timestamp:
Jul 5, 2010 10:23:45 AM (15 years ago)
Author:
vboxsync
Message:

crOpenGL: enable new tracking code for solaris

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/GuestHost/OpenGL/util/process.c

    r15532 r30598  
    146146        if (!tmp)
    147147                return;
    148 
    149148        /* pipe output of ps to temp file */
     149#ifndef SunOS
    150150        sprintf(command, "ps > %s", tmp);
     151#else
     152        sprintf(command, "ps -e -o 'pid tty time comm'> %s", tmp);
     153#endif
    151154        system(command);
    152155
     
    154157        f = fopen(tmp, "r");
    155158        if (f) {
    156                 char buffer[1000], cmd[1000];
     159                char buffer[1000], cmd[1000], *psz, *pname;
    157160                while (!feof(f)) {
    158161                        int id;
     
    160163                        sscanf(buffer, "%d %*s %*s %999s", &id, cmd);
    161164                        if (id == pid) {
    162                                 crStrncpy(name, cmd, maxLen);
     165                                for (pname=psz=&cmd[0]; *psz!=0; psz++)
     166                                {
     167                                        switch (*psz)
     168                                        {
     169                                                case '/':
     170                                                pname = psz+1;
     171                                                break;
     172                                        }
     173                                }
     174                                crStrncpy(name, pname, maxLen);
    163175                                break;
    164176                        }
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette