From a8f3424b25cbbc585126420bcc1434c4a2398588 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Mon, 2 May 2016 08:59:57 +0200 Subject: syscalls: Wrap TCSA* constants in 'tcsetattr-action' macro. * guix/build/syscalls.scm (tcsetattr-action): New macro. (TCSANOW, TCSADRAIN, TCSAFLUSH): Remove. (tcsetattr): Adjust docstring accordingly. * tests/syscalls.scm ("tcsetattr"): Adjust accordingly. --- guix/build/syscalls.scm | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'guix/build/syscalls.scm') diff --git a/guix/build/syscalls.scm b/guix/build/syscalls.scm index 4e543d70d8..a9cd6e93c8 100644 --- a/guix/build/syscalls.scm +++ b/guix/build/syscalls.scm @@ -110,9 +110,7 @@ termios-input-speed termios-output-speed local-flags - TCSANOW - TCSADRAIN - TCSAFLUSH + tcsetattr-action tcgetattr tcsetattr @@ -1059,9 +1057,11 @@ given an integer, returns the list of names of the constants that are or'd." (define EXTPROC #o0200000)) ;; "Actions" values for 'tcsetattr'. -(define TCSANOW 0) -(define TCSADRAIN 1) -(define TCSAFLUSH 2) +(define-bits tcsetattr-action + %unused-tcsetattr-action->symbols + (define TCSANOW 0) + (define TCSADRAIN 1) + (define TCSAFLUSH 2)) (define-record-type (termios input-flags output-flags control-flags local-flags @@ -1107,8 +1107,8 @@ given an integer, returns the list of names of the constants that are or'd." (define tcsetattr (let ((proc (syscall->procedure int "tcsetattr" (list int int '*)))) (lambda (fd actions termios) - "Use TERMIOS for the tty at FD. ACTIONS is one of 'TCSANOW', -'TCSADRAIN', or 'TCSAFLUSH'; see tcsetattr(3) for details." + "Use TERMIOS for the tty at FD. ACTIONS is one of of the values +produced by 'tcsetattr-action'; see tcsetattr(3) for details." (define bv (make-bytevector sizeof-termios)) -- cgit v1.2.3