Changeset ae78b53 in mainline for uspace/lib/libc/generic/vfs.c


Ignore:
Timestamp:
2008-01-19T13:40:38Z (17 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
4bb31f7
Parents:
5973fd0
Message:

Introduce the notion of lflag (i.e. lookup flags) to support the ability to
limit the scope of VFS node types that can be opened by open() and opendir(). In
the future, lflag will also specify actions for VFS_LOOKUP handlers that will be
carried out in situations such as the VFS node is not found (e.g. implementation
of mkdir() and open() with O_CREAT in oflag).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/libc/generic/vfs.c

    r5973fd0 rae78b53  
    9696}
    9797
    98 
    99 int open(const char *path, int oflag, ...)
     98static int _open(const char *path, int lflag, int oflag, ...)
    10099{
    101100        int res;
     
    114113                }
    115114        }
    116         req = async_send_2(vfs_phone, VFS_OPEN, oflag, 0, &answer);
     115        req = async_send_3(vfs_phone, VFS_OPEN, lflag, oflag, 0, &answer);
    117116        rc = ipc_data_write_start(vfs_phone, path, strlen(path));
    118117        if (rc != EOK) {
     
    126125        futex_up(&vfs_phone_futex);
    127126        return (int) IPC_GET_ARG1(answer);
     127}
     128
     129int open(const char *path, int oflag, ...)
     130{
     131        return _open(path, L_FILE, oflag);
    128132}
    129133
     
    243247        if (!dirp)
    244248                return NULL;
    245         dirp->fd = open(dirname, 0);    /* TODO: must be a directory */
     249        dirp->fd = _open(dirname, L_DIRECTORY, 0);
    246250        if (dirp->fd < 0) {
    247251                free(dirp);
Note: See TracChangeset for help on using the changeset viewer.