- Corrected size of eflags.
[cake.git] / rom / dos / setconsoletask.c
blob96a37a525141cabdfa7e10d30b42f612b089b84b
1 /*
2 Copyright © 1995-2007, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc: Set the console handler for the current process.
6 Lang: english
7 */
8 #include "dos_intern.h"
9 #include <proto/exec.h>
11 /*****************************************************************************
13 NAME */
14 #include <dos/dosextens.h>
15 #include <proto/dos.h>
17 AROS_LH1(struct MsgPort *, SetConsoleTask,
19 /* SYNOPSIS */
20 AROS_LHA(struct MsgPort *, handler, D1),
22 /* LOCATION */
23 struct DosLibrary *, DOSBase, 86, Dos)
25 /* FUNCTION
26 Set the console handler for the current process, and return the
27 old handler.
29 INPUTS
30 handler - The new console handler for the process.
32 RESULT
33 The address of the old handler.
35 NOTES
36 The use of Task in the name is because historically filesystem
37 handlers were tasks (instead of Devices).
39 EXAMPLE
41 BUGS
43 SEE ALSO
44 GetConsoleTask()
46 INTERNALS
48 *****************************************************************************/
50 AROS_LIBFUNC_INIT
52 APTR old;
53 struct Process *pr;
55 pr = (struct Process *)FindTask(NULL);
56 old = pr->pr_ConsoleTask;
57 pr->pr_ConsoleTask = MKBADDR(handler);
59 return BADDR(old);
61 AROS_LIBFUNC_EXIT
62 } /* SetConsoleTask */