home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 11 Util / 11-Util.zip / kill9.zip / xfree86 / src / death / deathapi.c < prev    next >
C/C++ Source or Header  |  1996-06-29  |  931b  |  39 lines

  1. /* Copyright (C)1996 by Holger.Veit@gmd.de */
  2. /* This code may be freely used in own software */
  3.  
  4. #define INCL_DOS
  5. #define INCL_ERRORS
  6. #include <os2.h>
  7. #include <stdio.h>
  8.  
  9. #include "death.h"
  10.  
  11. APIRET death(PID pid)
  12. {
  13.     APIRET rc;
  14.     HFILE hfd;
  15.     ULONG action,plen;
  16.     USHORT param;
  17.  
  18.     if ((rc=DosOpen((PSZ)"/dev/fastio$", (PHFILE)&hfd, (PULONG)&action,
  19.         (ULONG)0, FILE_SYSTEM, FILE_OPEN,
  20.         OPEN_SHARE_DENYNONE|OPEN_FLAGS_NOINHERIT|OPEN_ACCESS_READONLY,
  21.         (ULONG)0))) {
  22.         fputs("Error opening fastio$ driver...\n",stderr);
  23.         fputs("Please install xf86sup.sys in config.sys!\n",stderr);
  24.         return rc;
  25.     }
  26.  
  27.     param = pid;
  28.  
  29.     if ((rc=DosDevIOCtl(hfd, (ULONG)0x76, (ULONG)0x65,
  30.         (PULONG*)¶m,sizeof(USHORT),&plen,
  31.         NULL, 0, NULL)) != 0) {
  32.         fputs("ioctl failed for fastio$ driver\n",stderr);
  33.                 DosClose(hfd);
  34.                 return rc;
  35.         }
  36.     DosClose(hfd);
  37.     return 0;
  38. }
  39.