// Query the route manager for the route number
{
char buf[sizeof(int)+size];
+ uint32_t *type = (void*)buf;
// Open
fd = open("/Devices/ip/routes", 0);
}
// Make structure and ask
- *(int*)buf = AddressType;
- memcpy(&buf[sizeof(int)], Address, size);
+ *type = AddressType;
+ memcpy(type+1, Address, size);
routeNum = ioctl(fd, ioctl(fd, 3, "locate_route"), buf);
// Close
else {
ret->PortStr = NULL;
ret->PortNum = -1;
+ portlen = 0;
}
if(*tmp == '\0')
size_t tmp;
printf("URI_Read(File=%p, Bytes=%u, Buffer=%p)\n",
- File, Bytes, Buffer);
+ File, (unsigned int)Bytes, Buffer);
if(!File || !Buffer) return -1;
if(Bytes == 0) return 0;
if(Mode & URI_MODE_READ) smode |= OPENFLAG_READ;
if(Mode & URI_MODE_WRITE) smode |= OPENFLAG_WRITE;
- printf("URI_file_Open: open('%s', 0x%x)\n", Path, smode);
+// printf("URI_file_Open: open('%s', 0x%x)\n", Path, smode);
{
int ret;
ret = open(Path, smode);
}
size_t URI_file_Read(int Handle, size_t Bytes, void *Buffer)
{
- printf("URI_file_Read: (Handle=%i, Buffer=%p, Bytes=%i)\n",
- Handle, Buffer, Bytes);
+// printf("URI_file_Read: (Handle=%i, Buffer=%p, Bytes=%i)\n",
+// Handle, Buffer, (int)Bytes);
return read(Handle, Buffer, Bytes);
}
size_t URI_file_Write(int Handle, size_t Bytes, void *Buffer)