From: Stelian Ionescu Date: Thu, 18 Jul 2013 13:34:12 +0000 (+0200) Subject: Add ISYS:MKOSTEMP X-Git-Tag: v0.8.1~52 X-Git-Url: https://repo.or.cz/w/iolib.git/commitdiff_plain/71181a99431bf9dd0863b711a30faa75cce6cdb7 Add ISYS:MKOSTEMP --- diff --git a/src/syscalls/ffi-functions-unix.lisp b/src/syscalls/ffi-functions-unix.lisp index a52ecd4..ada7ba7 100644 --- a/src/syscalls/ffi-functions-unix.lisp +++ b/src/syscalls/ffi-functions-unix.lisp @@ -333,6 +333,18 @@ Return two values: the file descriptor and the path of the temporary file." (let ((template (concatenate 'string template "XXXXXX"))) (with-sstring-to-cstring (ptr template) (values (%mkstemp ptr) (cstring-to-sstring ptr))))) + +(defsyscall (%mkostemp "lfp_mkostemp") :int + (template :pointer) + (flags :uint64)) + +(defentrypoint mkostemp (&optional (template "") (flags 0)) + "Generate a unique temporary filename from TEMPLATE. +FLAGS are used to open the temporary file. +Return two values: the file descriptor and the path of the temporary file." + (let ((template (concatenate 'string template "XXXXXX"))) + (with-sstring-to-cstring (ptr template) + (values (%mokstemp ptr) (cstring-to-sstring ptr))))) ;;;------------------------------------------------------------------------- diff --git a/src/syscalls/pkgdcl.lisp b/src/syscalls/pkgdcl.lisp index 23907f6..16a145f 100644 --- a/src/syscalls/pkgdcl.lisp +++ b/src/syscalls/pkgdcl.lisp @@ -506,7 +506,8 @@ #:lstat #:sync #:fsync - #:mkstemp) + #:mkstemp + #:mkostemp) (:export ;; Directories #:mkdir #:rmdir