size_t sos_read(void *vData, long int position, size_t count, void *handle) { size_t i; char *realdata = vData; for (i = 0; i < count; i++) // Fix this to use your syscall realdata[i] = L4_KDB_ReadChar_Blocked(); return count; }
static size_t l4kdb_read(void *data, long int position, size_t count, void *handle /*unused*/) { size_t i; char *realdata = data; for (i = 0; i < count; i++) realdata[i] = L4_KDB_ReadChar_Blocked(); return count; }
IDL4_INLINE CORBA_boolean File_Read_implementation(CORBA_Object _caller, const Capability_t *cap, const CORBA_unsigned_long offset, byteseq_t *seq, CORBA_unsigned_long *size, idl4_server_environment *_env) { HpfCapability *hcap = (HpfCapability *) cap; unsigned char **buffer = &seq->_buffer; seq->_length = *size; if (!HPF_CAP_CAN_WRITE(*hcap) || !hpf_capability_check(hcap, my_secret)) { return 0; } int i; for (i = 0; i < *size; i++) { // int x = getc(); int x = L4_KDB_ReadChar_Blocked(); if (x == '\r') x = '\n'; putc(x); (*buffer)[i] = x; } return 1; }