X-Git-Url: https://jxself.org/git/?p=8sync.git;a=blobdiff_plain;f=8sync%2Fports.scm;fp=8sync%2Fports.scm;h=d7b82b8cdeb4fc078ec806197f990c353dd27425;hp=0000000000000000000000000000000000000000;hb=c7a6683e7ba2377909f37bc6dc11d49f43369191;hpb=d23b593a5810b38d2517a44c09d49b2835c59e16 diff --git a/8sync/ports.scm b/8sync/ports.scm new file mode 100644 index 0000000..d7b82b8 --- /dev/null +++ b/8sync/ports.scm @@ -0,0 +1,26 @@ +;;; 8sync --- Asynchronous programming for Guile +;;; Copyright © 2017 Christopher Allan Webber +;;; +;;; This file is part of 8sync. +;;; +;;; 8sync is free software: you can redistribute it and/or modify it +;;; under the terms of the GNU Lesser General Public License as +;;; published by the Free Software Foundation, either version 3 of the +;;; License, or (at your option) any later version. +;;; +;;; 8sync is distributed in the hope that it will be useful, +;;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU Lesser General Public License for more details. +;;; +;;; You should have received a copy of the GNU Lesser General Public +;;; License along with 8sync. If not, see . + + +(define-module (8sync ports) + #:export (set-port-nonblocking!)) + +(define (set-port-nonblocking! port) + "Do the usual song and dance to make this port nonblocking." + (let ((flags (fcntl port F_GETFL))) + (fcntl port F_SETFL (logior O_NONBLOCK flags))))