readable.lisp 377 B

12345678910111213141516
  1. (in-package :hurd)
  2. (defcfun ("io_readable" %io-readable)
  3. err
  4. (file port)
  5. (amount :pointer))
  6. (defun io-readable (file)
  7. "Tells how much bytes are there left to be read from 'file'."
  8. (declare (type fixnum file))
  9. (with-foreign-pointer (amount (foreign-type-size 'vm-size))
  10. (select-error (%io-readable file amount)
  11. (mem-ref amount 'vm-size))))