From 2a765ff2ef16a7c6ecd3ed2d023f5405d219f4cc Mon Sep 17 00:00:00 2001 From: Stelian Ionescu Date: Tue, 25 Jan 2011 20:17:29 +0100 Subject: [PATCH] Wrap lfp_openpt() instead of posix_openpt() and lfp_ptsname() instead of ptsname() --- src/syscalls/ffi-functions-unix.lisp | 14 ++++++++++---- src/syscalls/pkgdcl.lisp | 2 +- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/syscalls/ffi-functions-unix.lisp b/src/syscalls/ffi-functions-unix.lisp index dc51aed..a6d3103 100644 --- a/src/syscalls/ffi-functions-unix.lisp +++ b/src/syscalls/ffi-functions-unix.lisp @@ -471,8 +471,8 @@ Return two values: the file descriptor and the path of the temporary file." ;;; TTYs ;;;------------------------------------------------------------------------- -(defsyscall (posix-openpt "posix_openpt") :int - (flags :int)) +(defsyscall (openpt "lfp_openpt") :int + (flags :uint64)) (defsyscall (grantpt "grantpt") (:int :handle fd) @@ -482,9 +482,15 @@ Return two values: the file descriptor and the path of the temporary file." (:int :handle fd) (fd :int)) -(defsyscall (ptsname "ptsname") - (:string :handle fd) +(defsyscall (%ptsname "lfp_ptsname") + (:pointer :handle fd) (fd :int)) + +(defentrypoint ptsname (fd) + (let ((str (%ptsname fd))) + (unwind-protect + (nth-value 0 (foreign-string-to-lisp str)) + (foreign-free str)))) ;;;------------------------------------------------------------------------- diff --git a/src/syscalls/pkgdcl.lisp b/src/syscalls/pkgdcl.lisp index 62cde39..09e5f86 100644 --- a/src/syscalls/pkgdcl.lisp +++ b/src/syscalls/pkgdcl.lisp @@ -523,7 +523,7 @@ #:fd-nonblock-p #:fd-open-p) (:export ;; TTYs - #:posix-openpt + #:openpt #:grantpt #:unlockpt #:ptsname) -- 2.11.4.GIT