grub2: bring back build of aros-side grub2 tools
[AROS.git] / rom / dos / duplock.c
blob576c36c38652730f8a7d23e53fa9ada0990279cf
1 /*
2 Copyright © 1995-2007, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc: dos.library function DupLock()
6 Lang: english
7 */
9 #include <aros/debug.h>
10 #include <proto/exec.h>
11 #include "dos_intern.h"
13 /*****************************************************************************
15 NAME */
16 #include <proto/dos.h>
18 AROS_LH1(BPTR, DupLock,
20 /* SYNOPSIS */
21 AROS_LHA(BPTR, lock, D1),
23 /* LOCATION */
24 struct DosLibrary *, DOSBase, 16, Dos)
26 /* FUNCTION
27 Clone a lock on a file or directory. This will only work on shared
28 locks.
30 INPUTS
31 lock - Old lock.
33 RESULT
34 The new lock or NULL in case of an error. IoErr() will give additional
35 information in that case.
37 NOTES
39 EXAMPLE
41 BUGS
43 SEE ALSO
45 INTERNALS
47 *****************************************************************************/
49 AROS_LIBFUNC_INIT
51 struct FileLock *fl = (struct FileLock *)BADDR(lock);
52 BPTR ret;
54 if (lock == BNULL)
55 return BNULL;
56 ret = (BPTR)dopacket1(DOSBase, NULL, fl->fl_Task, ACTION_COPY_DIR, lock);
57 D(bug("[DupLock] %x -> %x\n", fl, BADDR(ret)));
58 return ret;
60 AROS_LIBFUNC_EXIT
61 } /* DupLock */