help-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: libtrivfs/glibc questions


From: Farid Hajji
Subject: Re: libtrivfs/glibc questions
Date: Wed, 3 Jan 2001 17:17:12 +0100

Hello,

> can anybody please explain me what this 'data_len' parameter in
> trivfs_S_io_read() trans/hello.c is for?
> Where does it come from?
/* Read data from an IO object.  If OFFSet is -1, read from the object
   maintained file pointer.  If the object is not seekable, OFFSet is
   ignored.  The amount desired to be read is in AMOUNT.  */
error_t
trivfs_S_io_read (struct trivfs_protid *cred,
                  mach_port_t reply, mach_msg_type_name_t reply_type,
                  vm_address_t *data, mach_msg_type_number_t *data_len,
                  off_t offs, mach_msg_type_number_t amount)

While AMOUNT is the number of bytes requested, *DATA_LEN is the number of
bytes that were actually read/copied in the buffer *DATA. AMOUNT and
*DATA_LEN need not be the same everytime: E.g. attempting to read past
the end of the (virtual) file will result in *DATA_LEN < AMOUNT, possibly
even *DATA_LEN == 0.

> And some more general questions:
> 
> If i have a trivfs translator, who exactly calls (for example)
> libtrivfs_S_io_read()?
Hmmm... I'm not sure if the following is correct, but let's guess:

$(HURD_SRC)/hurd/io.defs specifies 'routine io_read' and other RPCs
that are used to request service from a file object. Somehow, the RPC
is used down the path:
  $(GLIBC_SRC)/sysdeps/mach/hurd/read.c:read()
  $(GLIBC_SRC)/sysdeps/mach/hurd/pread.c:pread()
  $(GLIBC_SRC)/hurd/fd-read.c:_hurd_fd_read()
  .../__io_read() a.k.a. io_read()
  <??? multiplexed ???>
  -> $(HURD_SRC)/libdiskfs/io-read.c:diskfs_S_io_read()
  -> $(HURD_SRC)/libnetfs/io-read.c:netfs_S_io_read()
  -> $(HURD_SRC)/libtrivfs/io-read.c:trivfs_S_io_read()
  -> ...
I'm not sure about the ??? part. Please fill in the blanks if
you know an answer.

-Farid.

-- 
Farid Hajji -- Unix Systems and Network Admin | Phone: +49-2131-67-555
Broicherdorfstr. 83, D-41564 Kaarst, Germany  | farid.hajji@ob.kamp.net
- - - - - - - - - - - - - - - - - - - - - - - + - - - - - - - - - - - -
Murphy's Law fails only when you try to demonstrate it, and thus succeeds.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]