[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
05/13: build: syscalls: Add mkdtemp!
From: |
David Thompson |
Subject: |
05/13: build: syscalls: Add mkdtemp! |
Date: |
Fri, 26 Jun 2015 00:27:33 +0000 |
davexunit pushed a commit to branch wip-container
in repository guix.
commit 542b36c5b79fb6d92afb47471a23b2e91b5088b7
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 f89cf7e..b6e60c9 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:
;;;
@@ -639,4 +641,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 bfd304b), David Thompson, 2015/06/25
- 01/13: build: syscalls: Add clone syscall wrapper., David Thompson, 2015/06/25
- 04/13: build: syscalls: Add unmount flags., David Thompson, 2015/06/25
- 02/13: build: syscalls: Add setns syscall wrapper., David Thompson, 2015/06/25
- 03/13: build: syscalls: Add additional mount flags., David Thompson, 2015/06/25
- 05/13: build: syscalls: Add mkdtemp!,
David Thompson <=
- 06/13: build: syscalls: Add pivot-root., David Thompson, 2015/06/25
- 07/13: utils: Add call-with-temporary-directory., David Thompson, 2015/06/25
- 09/13: gnu: Add Linux container system script., David Thompson, 2015/06/25
- 10/13: gnu: system: Do not activate firmware when activating a container., David Thompson, 2015/06/25
- 08/13: gnu: Add Linux container module., David Thompson, 2015/06/25
- 11/13: gnu: system: Add operating-system-derivation/container., David Thompson, 2015/06/25
- 12/13: scripts: system: Add 'container' subcommand., David Thompson, 2015/06/25
- 13/13: scripts: environment: Add --container option., David Thompson, 2015/06/25