2 Copyright © 1995-2003, The AROS Development Team. All rights reserved.
5 POSIX function opendir().
19 /*****************************************************************************
33 pathname - Path and filename of the directory you want to open.
36 NULL for error or a directory stream
45 open(), readdir(), closedir(), rewinddir(), seekdir(),
50 ******************************************************************************/
62 dir
= malloc(sizeof(DIR));
65 dir
->priv
= malloc(sizeof(struct FileInfoBlock
));
66 if (!dir
->priv
) goto err2
;
68 fd
= open(name
, O_RDONLY
);
69 desc
= __getfdesc(fd
);
72 if (!ExamineFH(desc
->fh
, dir
->priv
))
74 errno
= IoErr2errno(IoErr());
78 if (((struct FileInfoBlock
*)dir
->priv
)->fib_DirEntryType
<=0)
86 dir
->ent
.d_name
[NAME_MAX
] = '\0';