*/
#include <stdlib.h>
#include <stdio.h>
-#include <unistd.h>
#include <acess/sys.h>
#define PCI_BASE "/Devices/pci"
// === CODE ===
int main(int argc, char *argv[])
{
- int fd = open(PCI_BASE, OPENFLAG_READ);
+ int fd = _SysOpen(PCI_BASE, OPENFLAG_READ);
char name[256];
- while( SysReadDir(fd, name) )
+ while( _SysReadDir(fd, name) )
{
if(name[0] == '.') continue ;
show_device(fd, name, 0);
}
+ _SysClose(fd);
+
return 0;
}
printf("%s - ERR (open failure)\n", File);
return ;
}
- rv = read(fd, &pciinfo, sizeof(pciinfo));
+ rv = _SysRead(fd, &pciinfo, sizeof(pciinfo));
if( rv != sizeof(pciinfo) ) {
printf("%s - ERR (read %i < %i)\n", File, rv, sizeof(pciinfo));
- close(fd);
+ _SysClose(fd);
return ;
}
uint32_t class_if = pciinfo.revclass >> 8;
printf("\n");
}
- close(fd);
+ _SysClose(fd);
}