Subversion Repositories HelenOS

Rev

Rev 2693 | Rev 2699 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2693 Rev 2694
Line 31... Line 31...
31
 */
31
 */
32
/** @file
32
/** @file
33
 */
33
 */
34
 
34
 
35
#include <vfs.h>
35
#include <vfs.h>
-
 
36
#include <stdlib.h>
36
#include <unistd.h>
37
#include <unistd.h>
-
 
38
#include <dirent.h>
37
#include <fcntl.h>
39
#include <fcntl.h>
38
#include <ipc/ipc.h>
40
#include <ipc/ipc.h>
39
#include <ipc/services.h>
41
#include <ipc/services.h>
40
#include <async.h>
42
#include <async.h>
41
#include <atomic.h>
43
#include <atomic.h>
Line 233... Line 235...
233
    async_serialize_end();
235
    async_serialize_end();
234
    futex_up(&vfs_phone_futex);
236
    futex_up(&vfs_phone_futex);
235
    return (int) rc;
237
    return (int) rc;
236
}
238
}
237
 
239
 
-
 
240
DIR *opendir(const char *dirname)
-
 
241
{
-
 
242
    DIR *dirp = malloc(sizeof(DIR));
-
 
243
    if (!dirp)
-
 
244
        return NULL;
-
 
245
    dirp->fd = open(dirname, 0);    /* TODO: must be a directory */
-
 
246
    if (!dirp->fd) {
-
 
247
        free(dirp);
-
 
248
        return NULL;
-
 
249
    }
-
 
250
    dirp->pos = 0;
-
 
251
    return dirp;
-
 
252
}
-
 
253
 
-
 
254
struct dirent *readdir(DIR *dirp)
-
 
255
{
-
 
256
    return NULL;    /* TODO */ 
-
 
257
}
-
 
258
 
-
 
259
void rewinddir(DIR *dirp)
-
 
260
{
-
 
261
    dirp->pos = 0;
-
 
262
}
-
 
263
 
-
 
264
int closedir(DIR *dirp)
-
 
265
{
-
 
266
    (void) close(dirp->fd);
-
 
267
    free(dirp);
-
 
268
    return 0;
-
 
269
}
-
 
270
 
-
 
271
int close(int fildes)
-
 
272
{
-
 
273
    return 0;   /* TODO */
-
 
274
}
-
 
275
 
238
/** @}
276
/** @}
239
 */
277
 */