add packaging
[platform/upstream/db4.git] / os_vxworks / os_vx_abs.c
1 /*-
2  * See the file LICENSE for redistribution information.
3  *
4  * Copyright (c) 1997-2009 Oracle.  All rights reserved.
5  *
6  * $Id$
7  */
8
9 #include "db_config.h"
10
11 #include "db_int.h"
12 #include "iosLib.h"
13
14 /*
15  * __os_abspath --
16  *      Return if a path is an absolute path.
17  */
18 int
19 __os_abspath(path)
20         const char *path;
21 {
22         DEV_HDR *dummy;
23         char *ptail;
24
25         /*
26          * VxWorks devices can be rooted at any name at all.
27          * Use iosDevFind() to see if name matches any of our devices.
28          */
29         if ((dummy = iosDevFind(path, (const char**)&ptail)) == NULL)
30                 return (0);
31         /*
32          * If the routine used a device, then ptail points to the
33          * rest and we are an abs path.
34          */
35         if (ptail != path)
36                 return (1);
37         /*
38          * If the path starts with a '/', then we are an absolute path,
39          * using the host machine, otherwise we are not.
40          */
41         return (path[0] == '/');
42 }