[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
05/14: build: syscalls: Add mkdtemp!
From: |
David Thompson |
Subject: |
05/14: build: syscalls: Add mkdtemp! |
Date: |
Tue, 30 Jun 2015 01:54:06 +0000 |
davexunit pushed a commit to branch wip-container
in repository guix.
commit a06507d635a5d8aba948630f8771959852517f63
Author: David Thompson <address@hidden>
Date: Wed Jun 24 20:50:34 2015 -0400
build: syscalls: Add mkdtemp!
* guix/build/syscalls.scm (mkdtemp!): New procedure.
---
guix/build/syscalls.scm | 18 +++++++++++++++++-
1 files changed, 17 insertions(+), 1 deletions(-)
diff --git a/guix/build/syscalls.scm b/guix/build/syscalls.scm
index 61877bf..d877a12 100644
--- a/guix/build/syscalls.scm
+++ b/guix/build/syscalls.scm
@@ -66,7 +66,9 @@
set-network-interface-flags
set-network-interface-address
set-network-interface-up
- configure-network-interface))
+ configure-network-interface
+
+ mkdtemp!))
;;; Commentary:
;;;
@@ -644,4 +646,18 @@ the same type as that returned by 'make-socket-address'."
(lambda ()
(close-port sock)))))
+(define mkdtemp!
+ (let* ((ptr (dynamic-func "mkdtemp" (dynamic-link)))
+ (proc (pointer->procedure '* ptr '(*))))
+ (lambda (tmpl)
+ "Create a new unique directory in the file system using the template
+string TMPL and return its file name. TMPL must end with 'XXXXXX'."
+ (let ((result (proc (string->pointer tmpl)))
+ (err (errno)))
+ (when (null-pointer? result)
+ (throw 'system-error "mkdtemp!" "mkdtemp ~S: ~A"
+ (list tmpl (strerror err))
+ (list err)))
+ (pointer->string result)))))
+
;;; syscalls.scm ends here
- branch wip-container created (now 53c036c), David Thompson, 2015/06/29
- 02/14: build: syscalls: Add setns syscall wrapper., David Thompson, 2015/06/29
- 04/14: build: syscalls: Add unmount flags., David Thompson, 2015/06/29
- 05/14: build: syscalls: Add mkdtemp!,
David Thompson <=
- 01/14: build: syscalls: Add clone syscall wrapper., David Thompson, 2015/06/29
- 06/14: build: syscalls: Add pivot-root., David Thompson, 2015/06/29
- 03/14: build: syscalls: Add additional mount flags., David Thompson, 2015/06/29
- 07/14: utils: Add call-with-temporary-directory., David Thompson, 2015/06/29
- 09/14: gnu: system: Move <file-system-mapping> into (gnu system file-systems)., David Thompson, 2015/06/29
- 12/14: gnu: system: Add Linux container file systems., David Thompson, 2015/06/29
- 10/14: gnu: system: Move file-system->spec to (gnu system file-systems)., David Thompson, 2015/06/29
- 13/14: scripts: system: Add 'container' subcommand., David Thompson, 2015/06/29
- 14/14: scripts: environment: Add --container option., David Thompson, 2015/06/29
- 08/14: gnu: build: Add Linux container module., David Thompson, 2015/06/29