Paste number 144695: eject

Paste number 144695: eject
Pasted by: civodul
When:7 years, 7 months ago
Share:Tweet this! | http://paste.lisp.org/+33NB
Channel:None
Paste contents:
Raw Source | XML | Display As
(use-modules (system foreign))

(define %ioctl
  (@@ (guix build syscalls) %ioctl))
(define errno
  (@@ (guix build syscalls) errno))

(define CDROMEJECT                                ;<linux/cdrom.h>
  #x5309)

(let* ((cd  (open-fdes "/dev/sr0" O_RDONLY))
       (ret (%ioctl cd CDROMEJECT %null-pointer))
       (err (errno)))
  (close-fdes cd)
  (unless (zero? err)
    (error "eject" (strerror err))))

This paste has no annotations.

Colorize as:
Show Line Numbers

Lisppaste pastes can be made by anyone at any time. Imagine a fearsomely comprehensive disclaimer of liability. Now fear, comprehensively.