~ chicken-core (chicken-5) ffe889925894ed33bf6e3d486d6a3d59512c709a
commit ffe889925894ed33bf6e3d486d6a3d59512c709a
Author: Evan Hanson <evhan@foldling.org>
AuthorDate: Mon May 21 18:01:23 2018 +1200
Commit: felix <felix@call-with-current-continuation.org>
CommitDate: Mon May 21 11:31:24 2018 +0200
Move `current-process-id' to "chicken.process-context.posix"
This was moved in b47023ce, but belongs in the posix library with the
rest of the current-{process,user,group}-id procedures.
Signed-off-by: felix <felix@call-with-current-continuation.org>
diff --git a/library.scm b/library.scm
index 47648ea3..d05d85c2 100644
--- a/library.scm
+++ b/library.scm
@@ -5930,8 +5930,7 @@ static C_word C_fcall C_setenv(C_word x, C_word y) {
program-name executable-pathname
change-directory current-directory
get-environment-variable get-environment-variables
- set-environment-variable! unset-environment-variable!
- current-process-id)
+ set-environment-variable! unset-environment-variable!)
(import scheme)
(import chicken.base chicken.fixnum chicken.foreign)
@@ -6051,9 +6050,6 @@ static C_word C_fcall C_setenv(C_word x, C_word y) {
(##sys#check-list x 'command-line-arguments)
x) ) )
-(define current-process-id
- (foreign-lambda int "C_getpid"))
-
) ; chicken.process-context
diff --git a/posix-common.scm b/posix-common.scm
index 6b22a54b..49d801ce 100644
--- a/posix-common.scm
+++ b/posix-common.scm
@@ -497,6 +497,12 @@ EOF
fd) ) )
+;;; Access process ID:
+
+(set! chicken.process-context.posix#current-process-id
+ (foreign-lambda int "C_getpid"))
+
+
;;; Set or get current directory by file descriptor:
(set! chicken.process-context.posix#change-directory*
diff --git a/posix.scm b/posix.scm
index ba14855d..24998947 100644
--- a/posix.scm
+++ b/posix.scm
@@ -320,7 +320,7 @@
(module chicken.process-context.posix
(change-directory* set-root-directory!
current-effective-group-id current-effective-user-id
- current-group-id current-user-id
+ current-process-id current-group-id current-user-id
parent-process-id current-user-name
current-effective-user-name create-session
process-group-id user-information)
@@ -333,6 +333,7 @@
(define current-effective-user-id)
(define current-group-id)
(define current-user-id)
+(define current-process-id)
(define parent-process-id)
(define current-user-name)
(define current-effective-user-name)
diff --git a/types.db b/types.db
index 6ec5ad79..b84582b2 100644
--- a/types.db
+++ b/types.db
@@ -1922,7 +1922,6 @@
(chicken.process-context#program-name (#(procedure #:clean #:enforce) chicken.process-context#program-name (#!optional string) string))
(chicken.process-context#set-environment-variable! (#(procedure #:clean #:enforce) chicken.process-context#set-environment-variable! (string string) undefined))
(chicken.process-context#unset-environment-variable! (#(procedure #:clean #:enforce) chicken.process-context#unset-environment-variable! (string) undefined))
-(chicken.process-context#current-process-id (#(procedure #:clean) chicken.process-context#current-process-id () fixnum))
;; process-context.posix
@@ -1935,6 +1934,7 @@
(chicken.process-context.posix#current-group-id (#(procedure #:clean) chicken.process-context.posix#current-group-id () fixnum))
(chicken.process-context.posix#current-user-id (#(procedure #:clean) chicken.process-context.posix#current-user-id () fixnum))
(chicken.process-context.posix#current-user-name (#(procedure #:clean) chicken.process-context.posix#current-user-name () string))
+(chicken.process-context.posix#current-process-id (#(procedure #:clean) chicken.process-context.posix#current-process-id () fixnum))
(chicken.process-context.posix#parent-process-id (#(procedure #:clean) chicken.process-context.posix#parent-process-id () fixnum))
(chicken.process-context.posix#process-group-id (#(procedure #:clean #:enforce) chicken.process-context.posix#process-group-id () fixnum))
Trap