2 Copyright © 1995-2014, The AROS Development Team. All rights reserved.
6 #include <exec/types.h>
7 #include <dos/dosextens.h>
9 #include <dos/notify.h>
10 #include <proto/exec.h>
11 #include <proto/dos.h>
15 int main(int argc
, char **argv
)
17 struct NotifyRequest
*nr
;
23 printf("usage: %s filename\n", argv
[0]);
27 port
= CreateMsgPort();
29 nr
= AllocVec(sizeof(struct NotifyRequest
) + strlen(argv
[1]) + 1, MEMF_PUBLIC
| MEMF_CLEAR
);
30 nr
->nr_Name
= (STRPTR
) (((UBYTE
*) nr
) + sizeof(struct NotifyRequest
));
32 CopyMem(argv
[1], nr
->nr_Name
, strlen(argv
[1]) + 1);
34 nr
->nr_Flags
= NRF_SEND_MESSAGE
;
35 nr
->nr_stuff
.nr_Msg
.nr_Port
= port
;
37 if (StartNotify(nr
) == DOSFALSE
)
39 printf("StartNotify failed: %ld\n", (long)IoErr());
44 Wait((1L << port
->mp_SigBit
) | SIGBREAKF_CTRL_C
);
53 printf("CTRL-C received\n");