fsys-set-options.lisp 1.2 KB

123456789101112131415161718192021222324252627282930
  1. (in-package :hurd-translator)
  2. (def-fsys-interface :fsys-set-options ((fsys port)
  3. (reply port)
  4. (reply-type msg-type-name)
  5. (data :pointer)
  6. (data-len msg-type-number)
  7. (do-children :boolean))
  8. (declare (ignore reply reply-type))
  9. (when (port-exists-p fsys)
  10. (let ((new-options (get-foreign-options data data-len)))
  11. (when do-children
  12. ;; Propagate options to children translators.
  13. (let (nodes-done)
  14. (bucket-iterate
  15. (port-bucket *translator*)
  16. (lambda (port)
  17. (when (typep port 'protid)
  18. (let ((node (get-node port)))
  19. (when (and (box-active-p (box node))
  20. (not (member node nodes-done)))
  21. (fsys-set-options (box-fetch-control (box node))
  22. :options new-options
  23. :do-children t)
  24. (push node nodes-done))))))))
  25. (set-options *translator* new-options))
  26. t))