Advertisement
Guest User

Untitled

a guest
Feb 18th, 2014
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.58 KB | None | 0 0
  1. /* DKM part */
  2. #include "vxWorks.h"
  3.  
  4. #define SYSCALL_GROUP  3  
  5.  
  6. #ifdef _WRS_KERNEL
  7. #include "ioLib.h"
  8. #include "iosLib.h"
  9. #include "stdlib.h"
  10. #include "stdio.h"
  11. #include "lstLib.h"
  12. #include "selectLib.h"
  13. #include "stat.h"
  14. #include "semLib.h"
  15. #include "intLib.h"
  16. #include "taskLib.h"
  17. #include "errnoLib.h"
  18. #include "string.h"
  19. #include "memLib.h"
  20. #include "semLib.h"
  21. #include "rngLib.h"
  22. #include "sigLib.h"
  23. #include "signal.h"
  24. #if (_WRS_VXWORKS_MAJOR >= 6)
  25. #include "syscallLib.h"
  26. #endif
  27.  
  28. struct redirectOutputArgs
  29.         {
  30.         const char *command;
  31.         };
  32.  
  33. #if (_WRS_VXWORKS_MAJOR >= 6)
  34. LOCAL int testSC(struct redirectOutputArgs * pArgs);
  35.  
  36. LOCAL _WRS_DATA_ALIGN_BYTES(16) SYSCALL_RTN_TBL_ENTRY ExampleSyscallTable [] =
  37.     {        /* handler  args  name  spare */
  38.     {(FUNCPTR) testSC, 0, "testSC", 0}  /* routine 0 */
  39.     };
  40.  
  41. #endif
  42.  
  43.  
  44. STATUS registerExample (void)
  45.     syscallGroupRegister (SYSCALL_GROUP, "Unix Pipe", 3,
  46.                     (SYSCALL_RTN_TBL_ENTRY *)&ExampleSyscallTable, TRUE)==ERROR)
  47.             {
  48.             printErr("loading failed-n");
  49.             }
  50.         else
  51.         {
  52.             printf("OK \n");
  53.         }
  54.  
  55.  
  56. #if (_WRS_VXWORKS_MAJOR >= 6)
  57. /*******************************************************************************
  58. *
  59. * testSC - test call handler
  60. */
  61.  
  62. LOCAL int testSC(struct redirectOutputArgs * pArgs)
  63.     {
  64.     return(redirectOutput(pArgs->command));
  65.     }
  66.  
  67. #endif
  68.  
  69. /* DKM part */
  70.  
  71. /* RTP part */
  72. #define SYSCALL_GROUP  3
  73. #include <syscall.h>
  74.  
  75. int redirectOutput(const char *command)
  76.     {
  77.     return syscall ((int)command, 0, 0, 0, 0, 0, 0, 0, SYSCALL_NUMBER(SYSCALL_GROUP,2));
  78.     }
  79.  
  80. /* RTP part */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement