Do not try to get stack pointer from invalid ESP field, which coincidentally
[AROS.git] / rom / dos / selectoutput.c
blob88934e90c2fc66baf66a933ed9df37bedb153d8b
1 /*
2 Copyright © 1995-2007, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc:
6 Lang: english
7 */
8 #include <proto/exec.h>
9 #include "dos_intern.h"
11 /*****************************************************************************
13 NAME */
14 #include <proto/dos.h>
16 AROS_LH1(BPTR, SelectOutput,
18 /* SYNOPSIS */
19 AROS_LHA(BPTR, fh, D1),
21 /* LOCATION */
22 struct DosLibrary *, DOSBase, 50, Dos)
24 /* FUNCTION
25 Sets the current output stream returned by Output() to a new
26 value. Returns the old output stream.
28 INPUTS
29 fh - New output stream.
31 RESULT
32 Old output stream handle.
34 NOTES
36 EXAMPLE
38 BUGS
40 SEE ALSO
42 INTERNALS
44 *****************************************************************************/
46 AROS_LIBFUNC_INIT
48 BPTR old;
50 /* Get pointer to process structure */
51 struct Process *me=(struct Process *)FindTask(NULL);
53 /* Nothing spectacular */
54 old=me->pr_COS;
55 me->pr_COS=fh;
56 return old;
57 AROS_LIBFUNC_EXIT
58 } /* SelectOutput */