summaryrefslogtreecommitdiff
path: root/com32/lib/readdir.c
blob: d59ad3a2f60973fa74037682ca92befb4c70ff43 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
/*
 * readdir.c
 */

#include <dirent.h>
#include <stdio.h>
#include <errno.h>

#include <com32.h>
#include <string.h>
#include <unistd.h>
#include <fcntl.h>
#include <stdlib.h>

struct dirent *readdir(DIR * dir)
{
    struct dirent *newde;
    com32sys_t regs;
    
    memset(&regs, 0, sizeof(regs));		
    regs.eax.w[0] = 0x0021;
    regs.esi.l = (uint32_t)dir;
    __com32.cs_intcall(0x22, &regs, &regs);
    newde = (struct dirent *)(regs.eax.l);

    return newde;
}