Skip to content
Snippets Groups Projects
Commit 69a7380a authored by pw's avatar pw
Browse files

1) unix-getpgrp no longer takes an argument on FreeBSD, and maybe never

did on other platforms. This (no arg) version seems posix compliant.

2) add unix-setpgid which seems to be superseding unix-setpgrp in BSD
and is also posix compliant. May not be available on all platforms.
parent 7250ce1f
No related branches found
No related tags found
No related merge requests found
......@@ -5,7 +5,7 @@
;;; Carnegie Mellon University, and has been placed in the public domain.
;;;
(ext:file-comment
"$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/exports.lisp,v 1.161 1999/03/04 12:32:44 pw Exp $")
"$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/exports.lisp,v 1.162 1999/03/08 18:03:18 pw Exp $")
;;;
;;; **********************************************************************
;;;
......@@ -219,7 +219,8 @@
"UNIX-IOCTL" "UNIX-ISATTY" "UNIX-LINK" "UNIX-LISTEN" "UNIX-LSEEK"
"UNIX-LSTAT" "UNIX-MKDIR" "UNIX-OPEN" "UNIX-PATHNAME" "UNIX-PID"
"UNIX-PIPE" "UNIX-READ" "UNIX-READLINK" "UNIX-RECV" "UNIX-RENAME"
"UNIX-RMDIR" "UNIX-SELECT" "UNIX-SEND" "UNIX-SETPGRP"
"UNIX-RMDIR" "UNIX-SELECT" "UNIX-SEND"
"UNIX-SETPGID" "UNIX-SETPGRP"
"UNIX-SETREGID" "UNIX-SETREUID" "UNIX-SOCKET" "UNIX-STAT"
"UNIX-SYMLINK" "UNIX-SYNC"
"UNIX-TIMES" "UNIX-TRUNCATE" "UNIX-TTYNAME"
......
......@@ -5,7 +5,7 @@
;;; Carnegie Mellon University, and has been placed in the public domain.
;;;
(ext:file-comment
"$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/unix.lisp,v 1.62 1998/10/04 07:38:29 dtc Exp $")
"$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/unix.lisp,v 1.63 1999/03/08 18:03:19 pw Exp $")
;;;
;;; **********************************************************************
;;;
......@@ -157,6 +157,7 @@
#-hpux unix-utimes #-(or svr4 hpux) unix-setreuid
#-(or svr4 hpux) unix-setregid
unix-getpid unix-getppid
#+(or svr4 freebsd)unix-setpgid
unix-getgid unix-getegid unix-getpgrp unix-setpgrp unix-getuid
unix-getpagesize unix-gethostname unix-gethostid unix-fork
unix-current-directory unix-isatty unix-ttyname unix-execve
......@@ -2058,20 +2059,29 @@
;;; As usual, if the process-id is 0, it refers to the current
;;; process.
(defun unix-getpgrp (pid)
"Unix-getpgrp returns the group-id of the process associated
with pid."
(int-syscall ("getpgrp" int) pid))
(defun unix-getpgrp ()
"Unix-getpgrp returns the group-id of the calling process."
(int-syscall ("getpgrp")))
;;; Unix-setpgrp sets the group-id of the process specified by
;;; "pid" to the value of "pgrp". The process must either have
;;; the same effective user-id or be a super-user process.
;;; setpgrp(int int)[freebsd] is identical to setpgid and is retained
;;; for backward compatibility. setpgrp(void)[solaris] is being phased
;;; out in favor of setsid().
(defun unix-setpgrp (pid pgrp)
"Unix-setpgrp sets the process group on the process pid to
pgrp. NIL and an error number is returned upon failure."
pgrp. NIL and an error number are returned upon failure."
(void-syscall (#-svr4 "setpgrp" #+svr4 "setpgid" int int) pid pgrp))
(defun unix-setpgid (pid pgrp)
"Unix-setpgid sets the process group of the process pid to
pgrp. If pgid is equal to pid, the process becomes a process
group leader. NIL and an error number are returned upon failure."
(void-syscall ("setpgid" int int) pid pgrp))
(def-alien-routine ("getuid" unix-getuid) int
"Unix-getuid returns the real user-id associated with the
current process.")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment