home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / LIBSRC.ZOO / libsrc / local / setprty.c < prev    next >
Text File  |  1992-04-05  |  360b  |  22 lines

  1. #include <errno.h>
  2.  
  3. unsigned long Dos32SetPriority() asm ("Dos32SetPriority");
  4.  
  5. int setpriority (int which, int who, int prio)
  6. {
  7.    unsigned long rc;
  8.  
  9.    if (prio > 20) prio = 20;
  10.    else if (prio < -20) prio = -20;
  11.  
  12.    rc = Dos32SetPriority (0, 2, prio, 0);
  13.  
  14.    if (rc) {
  15.       errno = EINVAL;
  16.       return (-1);
  17.    }
  18.  
  19.    return (0);
  20. }
  21.  
  22.