d2d93749ec3c7646861ea4a20713ae5bfcebfc73
[AROS.git] / rom / dos / currentdir.c
blobd2d93749ec3c7646861ea4a20713ae5bfcebfc73
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 <aros/debug.h>
10 #include "dos_intern.h"
12 /*****************************************************************************
14 NAME */
15 #include <proto/dos.h>
17 AROS_LH1(BPTR, CurrentDir,
19 /* SYNOPSIS */
20 AROS_LHA(BPTR, lock, D1),
22 /* LOCATION */
23 struct DosLibrary *, DOSBase, 21, Dos)
25 /* FUNCTION
26 Sets a new directory as the current directory. Returns the old one.
27 0 is valid in both cases and represents the boot filesystem.
29 INPUTS
30 lock - Lock for the new current directory.
32 RESULT
33 Old current directory.
35 NOTES
37 EXAMPLE
39 BUGS
41 SEE ALSO
43 INTERNALS
45 *****************************************************************************/
47 AROS_LIBFUNC_INIT
49 /* Get pointer to process structure */
50 struct Process *me=(struct Process *)FindTask(NULL);
51 BPTR old;
53 ASSERT_VALID_PROCESS(me);
55 ASSERT_VALID_PTR_OR_NULL(BADDR(lock));
57 /* Nothing spectacular */
58 old=me->pr_CurrentDir;
59 me->pr_CurrentDir=lock;
60 ASSERT_VALID_PTR_OR_NULL(BADDR(old));
61 return old;
62 AROS_LIBFUNC_EXIT
63 } /* CurrentDir */