2 * Ullrich von Bassewitz, 2012-05-30. Based on code by Groepaz.
15 DIR* __fastcall__ opendir (const char*)
17 unsigned char buf[32];
21 /* Setup file name and offset */
26 /* Open the directory on disk for reading */
27 d.fd = open (d.name, O_RDONLY);
30 /* Skip the disk header */
31 if (_dirread (&d, buf, 32)) {
33 /* Allocate memory for the DIR structure returned */
34 dir = malloc (sizeof (*dir));
36 /* Copy the contents of d */
38 memcpy (dir, &d, sizeof (d));
40 /* Set an appropriate error code */