Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* DKM part */
- #include "vxWorks.h"
- #define SYSCALL_GROUP 3
- #ifdef _WRS_KERNEL
- #include "ioLib.h"
- #include "iosLib.h"
- #include "stdlib.h"
- #include "stdio.h"
- #include "lstLib.h"
- #include "selectLib.h"
- #include "stat.h"
- #include "semLib.h"
- #include "intLib.h"
- #include "taskLib.h"
- #include "errnoLib.h"
- #include "string.h"
- #include "memLib.h"
- #include "semLib.h"
- #include "rngLib.h"
- #include "sigLib.h"
- #include "signal.h"
- #if (_WRS_VXWORKS_MAJOR >= 6)
- #include "syscallLib.h"
- #endif
- struct redirectOutputArgs
- {
- const char *command;
- };
- #if (_WRS_VXWORKS_MAJOR >= 6)
- LOCAL int testSC(struct redirectOutputArgs * pArgs);
- LOCAL _WRS_DATA_ALIGN_BYTES(16) SYSCALL_RTN_TBL_ENTRY ExampleSyscallTable [] =
- { /* handler args name spare */
- {(FUNCPTR) testSC, 0, "testSC", 0} /* routine 0 */
- };
- #endif
- STATUS registerExample (void)
- syscallGroupRegister (SYSCALL_GROUP, "Unix Pipe", 3,
- (SYSCALL_RTN_TBL_ENTRY *)&ExampleSyscallTable, TRUE)==ERROR)
- {
- printErr("loading failed-n");
- }
- else
- {
- printf("OK \n");
- }
- #if (_WRS_VXWORKS_MAJOR >= 6)
- /*******************************************************************************
- *
- * testSC - test call handler
- */
- LOCAL int testSC(struct redirectOutputArgs * pArgs)
- {
- return(redirectOutput(pArgs->command));
- }
- #endif
- /* DKM part */
- /* RTP part */
- #define SYSCALL_GROUP 3
- #include <syscall.h>
- int redirectOutput(const char *command)
- {
- return syscall ((int)command, 0, 0, 0, 0, 0, 0, 0, SYSCALL_NUMBER(SYSCALL_GROUP,2));
- }
- /* RTP part */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement