1 #include <exec/types.h>
2 #include <dos/dosextens.h>
4 #include <dos/notify.h>
5 #include <proto/exec.h>
10 int main(int argc
, char **argv
) {
11 struct NotifyRequest
*nr
;
15 printf("usage: %s filename\n", argv
[0]);
19 port
= CreateMsgPort();
21 nr
= AllocVec(sizeof(struct NotifyRequest
) + strlen(argv
[1]) + 1, MEMF_PUBLIC
| MEMF_CLEAR
);
22 nr
->nr_Name
= (STRPTR
) (((UBYTE
*) nr
) + sizeof(struct NotifyRequest
));
24 CopyMem(argv
[1], nr
->nr_Name
, strlen(argv
[1]) + 1);
26 nr
->nr_Flags
= NRF_SEND_MESSAGE
;
27 nr
->nr_stuff
.nr_Msg
.nr_Port
= port
;
29 if (StartNotify(nr
) == DOSFALSE
) {
30 printf("StartNotify failed: %ld\n", IoErr());
35 ReplyMsg(GetMsg(port
));