Added kernel module for starting the usb stack at boot time. It's not activated thoug...
[cake.git] / rom / dos / isfilesystem.c
blob23492b5a3c6436db47c1b90ff6b03dd4bb0f79f3
1 /*
2 Copyright © 1995-2008, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc: Check if a device is a filesystem.
6 Lang: English
7 */
8 #include <proto/exec.h>
9 #include <dos/dosextens.h>
10 #include <dos/filesystem.h>
11 #include <proto/utility.h>
12 #include "dos_intern.h"
13 #include <string.h>
15 # define DEBUG 0
16 # include <aros/debug.h>
18 /*****************************************************************************
20 NAME */
21 #include <proto/dos.h>
23 AROS_LH1(BOOL, IsFileSystem,
25 /* SYNOPSIS */
26 AROS_LHA(CONST_STRPTR, devicename, D1),
28 /* LOCATION */
29 struct DosLibrary *, DOSBase, 118, Dos)
31 /* FUNCTION
32 Query the device whether it is a filesystem.
34 INPUTS
35 devicename - Name of the device to query.
37 RESULT
38 TRUE if the device is a filesystem, FALSE otherwise.
40 NOTES
41 DF0:, HD0:, ... are filesystems.
42 CON:, PIPE:, AUX:, ... are not
44 In AmigaOS if devicename contains no ":" then result
45 is always TRUE. Also volume and assign names return
46 TRUE.
48 EXAMPLE
50 BUGS
52 SEE ALSO
54 INTERNALS
56 *****************************************************************************/
58 AROS_LIBFUNC_INIT
60 struct IOFileSys iofs;
61 LONG err;
63 /* console is never a filesystem */
64 if (Stricmp(devicename, "CONSOLE:") == 0 || Stricmp(devicename, "*") == 0)
65 return FALSE;
67 InitIOFS(&iofs, FSA_IS_FILESYSTEM, DOSBase);
68 err = DoIOFS(&iofs, NULL, devicename, DOSBase);
70 /* XXX if err is ERROR_ACTION_NOT_KNOWN, we should try to lock the
71 * root. if we can get a lock, then it's a filesystem */
73 if (err != 0)
74 return FALSE;
76 return iofs.io_Union.io_IS_FILESYSTEM.io_IsFilesystem;
78 AROS_LIBFUNC_EXIT
79 } /* IsFilesystem */