1 (defpackage "SB-POSIX-TESTS"
2 (:use "COMMON-LISP" "SB-RT"))
4 (in-package "SB-POSIX-TESTS")
6 (defvar *test-directory*
7 (ensure-directories-exist
8 (merge-pathnames (make-pathname :directory '(:relative "test-lab"))
9 (make-pathname :directory
10 (pathname-directory *load-truename*)))))
12 (defvar *current-directory* *default-pathname-defaults*)
14 (defvar *this-file* *load-truename*)
16 (eval-when (:compile-toplevel :load-toplevel)
17 (defconstant +mode-rwx-all+
18 (logior sb-posix::s-irusr sb-posix::s-iwusr sb-posix::s-ixusr
21 sb-posix::s-irgrp sb-posix::s-iwgrp sb-posix::s-ixgrp
22 sb-posix::s-iroth sb-posix::s-iwoth sb-posix::s-ixoth))))
24 (defmacro define-eacces-test (name form &rest values)
28 (when (= (sb-posix:geteuid) 0)
29 (return-from ,name (values ,@values)))
34 (sb-posix:chdir *test-directory*)
38 (sb-posix:chdir (namestring *test-directory*))
46 (sb-posix:chdir #p"/")
50 (sb-posix:chdir *current-directory*)
54 (sb-posix:chdir "/../")
58 (sb-posix:chdir #p"/../")
62 (sb-posix:chdir (make-pathname :directory '(:absolute :up)))
65 (deftest chdir.error.1
66 (let ((dne (make-pathname :directory '(:relative "chdir.does-not-exist"))))
68 (sb-posix:chdir (merge-pathnames dne *test-directory*))
69 (sb-posix:syscall-error (c)
70 (sb-posix:syscall-errno c))))
73 (deftest chdir.error.2
75 (sb-posix:chdir *this-file*)
76 (sb-posix:syscall-error (c)
77 (sb-posix:syscall-errno c)))
84 (let ((dne (make-pathname :directory '(:relative "mkdir.does-not-exist.1"))))
86 (sb-posix:mkdir (merge-pathnames dne *test-directory*) 0)
87 ;; FIXME: no delete-directory in CL, but using our own operators
88 ;; is probably not ideal
89 (ignore-errors (sb-posix:rmdir (merge-pathnames dne *test-directory*)))))
93 (let ((dne (make-pathname :directory '(:relative "mkdir.does-not-exist.2"))))
95 (sb-posix:mkdir (namestring (merge-pathnames dne *test-directory*)) 0)
96 (ignore-errors (sb-posix:rmdir (merge-pathnames dne *test-directory*)))))
99 (deftest mkdir.error.1
101 (sb-posix:mkdir *test-directory* 0)
102 (sb-posix:syscall-error (c)
103 (sb-posix:syscall-errno c)))
106 (deftest mkdir.error.2
108 (sb-posix:mkdir #-win32 "/" #+win32 "C:/" 0)
109 (sb-posix:syscall-error (c)
110 (sb-posix:syscall-errno c)))
118 (define-eacces-test mkdir.error.3
119 (let* ((dir (merge-pathnames
120 (make-pathname :directory '(:relative "mkdir.error.3"))
122 (dir2 (merge-pathnames
123 (make-pathname :directory '(:relative "does-not-exist"))
125 (sb-posix:mkdir dir 0)
127 (sb-posix:mkdir dir2 0)
128 (sb-posix:syscall-error (c)
130 (sb-posix:syscall-errno c))
132 (sb-posix:rmdir dir2)
138 (let ((dne (make-pathname :directory '(:relative "rmdir.does-not-exist.1"))))
139 (ensure-directories-exist (merge-pathnames dne *test-directory*))
140 (sb-posix:rmdir (merge-pathnames dne *test-directory*)))
144 (let ((dne (make-pathname :directory '(:relative "rmdir.does-not-exist.2"))))
145 (ensure-directories-exist (merge-pathnames dne *test-directory*))
146 (sb-posix:rmdir (namestring (merge-pathnames dne *test-directory*))))
149 (deftest rmdir.error.1
150 (let ((dne (make-pathname :directory '(:relative "rmdir.dne.error.1"))))
152 (sb-posix:rmdir (merge-pathnames dne *test-directory*))
153 (sb-posix:syscall-error (c)
154 (sb-posix:syscall-errno c))))
157 (deftest rmdir.error.2
159 (sb-posix:rmdir *this-file*)
160 (sb-posix:syscall-error (c)
161 (sb-posix:syscall-errno c)))
167 (deftest rmdir.error.3
169 (sb-posix:rmdir #-win32 "/" #+win32 "C:/")
170 (sb-posix:syscall-error (c)
171 (sb-posix:syscall-errno c)))
179 (deftest rmdir.error.4
180 (let* ((dir (ensure-directories-exist
182 (make-pathname :directory '(:relative "rmdir.error.4"))
184 (file (make-pathname :name "foo" :defaults dir)))
185 (with-open-file (s file :direction :output :if-exists nil)
186 (write "" :stream s))
189 (sb-posix:syscall-error (c)
192 (let ((errno (sb-posix:syscall-errno c)))
193 ;; documented by POSIX
194 (or (= errno sb-posix::eexist) (= errno sb-posix::enotempty))))))
197 (define-eacces-test rmdir.error.5
198 (let* ((dir (merge-pathnames
199 (make-pathname :directory '(:relative "rmdir.error.5"))
201 (dir2 (merge-pathnames
202 (make-pathname :directory '(:relative "unremovable"))
204 (sb-posix:mkdir dir +mode-rwx-all+)
205 (sb-posix:mkdir dir2 +mode-rwx-all+)
206 (sb-posix:chmod dir 0)
208 (sb-posix:rmdir dir2)
209 (sb-posix:syscall-error (c)
210 (sb-posix:chmod dir (logior sb-posix::s-iread sb-posix::s-iwrite sb-posix::s-iexec))
211 (sb-posix:rmdir dir2)
213 (sb-posix:syscall-errno c))
215 (sb-posix:chmod dir (logior sb-posix::s-iread sb-posix::s-iwrite sb-posix::s-iexec))
221 (let* ((stat (sb-posix:stat *test-directory*))
222 (mode (sb-posix::stat-mode stat)))
223 ;; FIXME: Ugly ::s everywhere
224 (logand mode (logior sb-posix::s-iread sb-posix::s-iwrite sb-posix::s-iexec)))
225 #.(logior sb-posix::s-iread sb-posix::s-iwrite sb-posix::s-iexec))
229 (let* ((stat (sb-posix:stat "/"))
230 (mode (sb-posix::stat-mode stat)))
231 ;; it's logically possible for / to be writeable by others... but
232 ;; if it is, either someone is playing with strange security
233 ;; modules or they want to know about it anyway.
234 (logand mode sb-posix::s-iwoth))
238 (let* ((now (get-universal-time))
239 ;; FIXME: (encode-universal-time 00 00 00 01 01 1970)
240 (unix-now (- now 2208988800))
241 (stat (sb-posix:stat *test-directory*))
242 (atime (sb-posix::stat-atime stat)))
243 ;; FIXME: breaks if mounted noatime :-(
244 #+nil (< (- atime unix-now) 10)
245 (< (- atime unix-now) 10))
250 (let* ((stat (sb-posix:stat (make-pathname :directory '(:absolute :up))))
251 (mode (sb-posix::stat-mode stat)))
252 ;; it's logically possible for / to be writeable by others... but
253 ;; if it is, either someone is playing with strange security
254 ;; modules or they want to know about it anyway.
255 (logand mode sb-posix::s-iwoth))
258 ;; Test that stat can take a second argument.
261 (let* ((stat-1 (sb-posix:stat "/"))
262 (inode-1 (sb-posix:stat-ino stat-1))
263 (stat-2 (sb-posix:stat "/bin/sh"
265 (inode-2 (sb-posix:stat-ino stat-2)))
268 (/= inode-1 inode-2)))
274 (let* ((stat-1 (sb-posix:stat "/"))
275 (mode-1 (sb-posix:stat-mode stat-1))
276 (stat-2 (sb-posix:stat "C:\\CONFIG.SYS"
278 (mode-2 (sb-posix:stat-mode stat-2)))
285 ;;; FIXME: add tests for carrying a stat structure around in the
286 ;;; optional argument to SB-POSIX:STAT
288 (deftest stat.error.1
289 (handler-case (sb-posix:stat "")
290 (sb-posix:syscall-error (c)
291 (sb-posix:syscall-errno c)))
294 (define-eacces-test stat.error.2
295 (let* ((dir (merge-pathnames
296 (make-pathname :directory '(:relative "stat.error.2"))
298 (file (merge-pathnames
299 (make-pathname :name "unstatable")
301 (sb-posix:mkdir dir +mode-rwx-all+)
302 (with-open-file (s file :direction :output)
303 (write "" :stream s))
304 (sb-posix:chmod dir 0)
307 (sb-posix:syscall-error (c)
308 (sb-posix:chmod dir (logior sb-posix::s-iread sb-posix::s-iwrite sb-posix::s-iexec))
309 (sb-posix:unlink file)
311 (sb-posix:syscall-errno c))
313 (sb-posix:chmod dir (logior sb-posix::s-iread sb-posix::s-iwrite sb-posix::s-iexec))
314 (sb-posix:unlink file)
320 (defmacro with-stat-mode ((mode pathname) &body body)
321 (let ((stat (gensym)))
322 `(let* ((,stat (sb-posix:stat ,pathname))
323 (,mode (sb-posix::stat-mode ,stat)))
326 (defmacro with-lstat-mode ((mode pathname) &body body)
327 (let ((stat (gensym)))
328 `(let* ((,stat (sb-posix:lstat ,pathname))
329 (,mode (sb-posix::stat-mode ,stat)))
333 (with-stat-mode (mode *test-directory*)
334 (sb-posix:s-isreg mode))
338 (with-stat-mode (mode *test-directory*)
339 (sb-posix:s-isdir mode))
343 (with-stat-mode (mode *test-directory*)
344 (sb-posix:s-ischr mode))
348 (with-stat-mode (mode *test-directory*)
349 (sb-posix:s-isblk mode))
353 (with-stat-mode (mode *test-directory*)
354 (sb-posix:s-isfifo mode))
359 (with-stat-mode (mode *test-directory*)
360 (sb-posix:s-issock mode))
365 (let ((link-pathname (make-pathname :name "stat-mode.7"
366 :defaults *test-directory*)))
369 (sb-posix:symlink *test-directory* link-pathname)
370 (with-lstat-mode (mode link-pathname)
371 (sb-posix:s-islnk mode)))
372 (ignore-errors (sb-posix:unlink link-pathname))))
376 (let ((pathname (make-pathname :name "stat-mode.8"
377 :defaults *test-directory*)))
380 (with-open-file (out pathname :direction :output)
381 (write-line "test" out))
382 (with-stat-mode (mode pathname)
383 (sb-posix:s-isreg mode)))
384 (ignore-errors (delete-file pathname))))
387 ;;; see comment in filename's designator definition, in macros.lisp
388 (deftest filename-designator.1
389 (let ((file (format nil "~A/[foo].txt" (namestring *test-directory*))))
390 ;; creat() with a string as argument
391 (let ((fd (sb-posix:creat file sb-posix:s-iwrite)))
394 ;; if this test fails, it will probably be with
395 ;; "System call error 2 (No such file or directory)"
396 (let ((*default-pathname-defaults* *test-directory*))
397 (sb-posix:unlink (car (directory "*.txt")))))
401 (let ((name (merge-pathnames "open-test.txt" *test-directory*)))
405 (sb-posix:creat name (logior sb-posix:s-iwrite sb-posix:s-iread)))
406 (let ((fd (sb-posix:open name sb-posix::o-rdonly)))
407 (ignore-errors (sb-posix:close fd))
409 (ignore-errors (sb-posix:unlink name))))
412 #-hpux ; fix: cant handle c-vargs
413 (deftest open.error.1
414 (handler-case (sb-posix:open *test-directory* sb-posix::o-wronly)
415 (sb-posix:syscall-error (c)
416 (sb-posix:syscall-errno c)))
422 #-(or (and x86-64 (or linux sunos)) win32)
424 (let ((fd (sb-posix:open "/dev/null" sb-posix::o-nonblock)))
425 (= (sb-posix:fcntl fd sb-posix::f-getfl) sb-posix::o-nonblock))
427 ;; On AMD64/Linux O_LARGEFILE is always set, even though the whole
428 ;; flag makes no sense.
429 #+(and x86-64 (or linux sunos))
431 (let ((fd (sb-posix:open "/dev/null" sb-posix::o-nonblock)))
432 (/= 0 (logand (sb-posix:fcntl fd sb-posix::f-getfl)
433 sb-posix::o-nonblock)))
436 #-(or hpux win32) ; fix: cant handle c-vargs
437 (deftest fcntl.flock.1
438 (locally (declare (sb-ext:muffle-conditions sb-ext:compiler-note))
439 (let ((flock (make-instance 'sb-posix:flock
440 :type sb-posix:f-wrlck
441 :whence sb-posix:seek-set
443 (pathname "fcntl.flock.1")
446 (with-open-file (f pathname :direction :output)
447 (write-line "1234567890" f)
448 (assert (zerop (sb-posix:fcntl f sb-posix:f-setlk flock)))
449 (let ((pid (sb-posix:fork)))
452 (multiple-value-bind (nope error)
453 (ignore-errors (sb-posix:fcntl f sb-posix:f-setlk flock))
456 (cond ((not (null nope)) 1)
457 ((= (sb-posix:syscall-errno error) sb-posix:eagain)
460 :recklessly-p t #| don't delete the file |#)))
463 (sb-posix:wexitstatus
465 1 (sb-posix:waitpid pid 0))))
466 (throw 'test nil))))))
472 (deftest fcntl.flock.2
473 (locally (declare (sb-ext:muffle-conditions sb-ext:compiler-note))
474 (let ((flock (make-instance 'sb-posix:flock
475 :type sb-posix:f-wrlck
476 :whence sb-posix:seek-set
478 (pathname "fcntl.flock.2")
481 (with-open-file (f pathname :direction :output)
482 (write-line "1234567890" f)
483 (assert (zerop (sb-posix:fcntl f sb-posix:f-setlk flock)))
484 (let ((ppid (sb-posix:getpid))
485 (pid (sb-posix:fork)))
487 (let ((r (sb-posix:fcntl f sb-posix:f-getlk flock)))
490 (cond ((not (zerop r)) 1)
491 ((= (sb-posix:flock-pid flock) ppid) 42)
493 :recklessly-p t #| don't delete the file |#))
496 (sb-posix:wexitstatus
498 1 (sb-posix:waitpid pid 0))))
499 (throw 'test nil))))))
504 (let ((dir (sb-posix:opendir "/")))
505 (unwind-protect (sb-alien:null-alien dir)
506 (unless (sb-alien:null-alien dir)
507 (sb-posix:closedir dir))))
511 (let ((dir (sb-posix:opendir "/")))
514 (loop for dirent = (sb-posix:readdir dir)
515 until (sb-alien:null-alien dirent)
516 when (not (stringp (sb-posix:dirent-name dirent)))
517 do (return-from dir-loop nil)
519 (sb-posix:closedir dir)))
523 (deftest readdir/dirent-name
524 (let ((dir (sb-posix:opendir *current-directory*)))
526 (equal (sort (loop for entry = (sb-posix:readdir dir)
527 until (sb-alien:null-alien entry)
528 collect (sb-posix:dirent-name entry))
530 (sort (append '("." "..")
532 (let ((string (enough-namestring p *current-directory*)))
533 (if (pathname-name p)
535 (subseq string 0 (1- (length string))))))
536 (directory (make-pathname
539 :defaults *current-directory*))))
541 (sb-posix:closedir dir)))
546 ;; make sure that we found something
547 (not (sb-posix:getpwuid 0))
552 ;; make sure that we found something
553 (not (sb-posix:getpwnam "root"))
557 (deftest pwent.non-existing
558 ;; make sure that we get something sensible, not an error
559 (handler-case (progn (sb-posix:getpwnam "almost-certainly-does-not-exist")
566 ;; make sure that we found something
567 (not (sb-posix:getgrgid 0))
572 ;; make sure that we found something
573 (not (sb-posix:getgrnam "sys"))
577 (deftest grent.non-existing
578 ;; make sure that we get something sensible, not an error
579 (handler-case (progn (sb-posix:getgrnam "almost-certainly-does-not-exist")
585 ;; Requires root or special group + plus a sensible thing on the port
586 (deftest cfget/setispeed.1
587 (with-open-file (s "/dev/ttyS0")
588 (let* ((termios (sb-posix:tcgetattr s))
589 (old (sb-posix:cfgetispeed termios))
590 (new (if (= old sb-posix:b2400)
593 (sb-posix:cfsetispeed new termios)
594 (sb-posix:tcsetattr 0 sb-posix:tcsadrain termios)
595 (setf termios (sb-posix:tcgetattr s))
596 (= new (sb-posix:cfgetispeed termios))))
600 ;; Requires root or special group + a sensible thing on the port
601 (deftest cfget/setospeed.1
602 (with-open-file (s "/dev/ttyS0" :direction :output :if-exists :append)
603 (let* ((termios (sb-posix:tcgetattr s))
604 (old (sb-posix:cfgetospeed termios))
605 (new (if (= old sb-posix:b2400)
608 (sb-posix:cfsetospeed new termios)
609 (sb-posix:tcsetattr 0 sb-posix:tcsadrain termios)
610 (setf termios (sb-posix:tcgetattr 0))
611 (= new (sb-posix:cfgetospeed termios))))
617 (plusp (sb-posix:time))
622 (let ((file (merge-pathnames #p"utimes.1" *test-directory*))
623 (atime (random (1- (expt 2 31))))
624 (mtime (random (1- (expt 2 31)))))
625 (with-open-file (stream file
627 :if-exists :supersede
628 :if-does-not-exist :create)
629 (princ "Hello, utimes" stream))
630 (sb-posix:utime file atime mtime)
631 (let* ((stat (sb-posix:stat file)))
633 (list (= (sb-posix:stat-atime stat) atime)
634 (= (sb-posix:stat-mtime stat) mtime))))
641 (let ((link-pathname (make-pathname :name "readlink.1"
642 :defaults *test-directory*)))
643 (sb-posix:symlink "/" link-pathname)
645 (sb-posix:readlink link-pathname)
646 (ignore-errors (sb-posix:unlink link-pathname))))
649 ;; Same thing, but with a very long link target (which doesn't have
650 ;; to exist). This tests the array adjustment in the wrapper,
651 ;; provided that the target's length is long enough.
652 #-hpux ; arg2 to readlink is 80, and arg0 is larger than that
654 (let ((target-pathname (make-pathname
655 :name (make-string 255 :initial-element #\a)
656 :directory '(:absolute)))
657 (link-pathname (make-pathname :name "readlink.2"
658 :defaults *test-directory*)))
659 (sb-posix:symlink target-pathname link-pathname)
661 (sb-posix:readlink link-pathname)
662 (ignore-errors (sb-posix:unlink link-pathname))))
663 #.(concatenate 'string "/" (make-string 255 :initial-element #\a)))
665 ;; The error tests are in the order of exposition from SUSv3.
666 (deftest readlink.error.1
667 (let* ((subdir-pathname (merge-pathnames
669 :directory '(:relative "readlink.error.1"))
671 (link-pathname (make-pathname :name "readlink.error.1"
672 :defaults subdir-pathname)))
673 (sb-posix:mkdir subdir-pathname #o777)
674 (sb-posix:symlink "/" link-pathname)
675 (sb-posix:chmod subdir-pathname 0)
677 (handler-case (sb-posix:readlink link-pathname)
678 (sb-posix:syscall-error (c)
679 (sb-posix:syscall-errno c)))
681 (sb-posix:chmod subdir-pathname #o777)
682 (sb-posix:unlink link-pathname)
683 (sb-posix:rmdir subdir-pathname))))
685 (deftest readlink.error.2
686 (let* ((non-link-pathname (make-pathname :name "readlink.error.2"
687 :defaults *test-directory*))
688 (fd (sb-posix:open non-link-pathname sb-posix::o-creat)))
690 (handler-case (sb-posix:readlink non-link-pathname)
691 (sb-posix:syscall-error (c)
692 (sb-posix:syscall-errno c)))
695 (sb-posix:unlink non-link-pathname))))
697 ;; Skipping EIO, ELOOP
698 (deftest readlink.error.3
699 (let* ((link-pathname (make-pathname :name "readlink.error.3"
700 :defaults *test-directory*))
701 (bogus-pathname (merge-pathnames
704 :directory '(:relative "readlink.error.3"))
706 (sb-posix:symlink link-pathname link-pathname)
708 (handler-case (sb-posix:readlink bogus-pathname)
709 (sb-posix:syscall-error (c)
710 (sb-posix:syscall-errno c)))
711 (ignore-errors (sb-posix:unlink link-pathname))))
713 ;; Note: PATH_MAX and NAME_MAX need not be defined, and may vary, so
714 ;; failure of this test is not too meaningful.
715 (deftest readlink.error.4
717 (make-pathname :name (make-string 257 ;NAME_MAX plus some, maybe
718 :initial-element #\a))))
719 (handler-case (sb-posix:readlink pathname)
720 (sb-posix:syscall-error (c)
721 (sb-posix:syscall-errno c))))
722 #.sb-posix:enametoolong)
723 (deftest readlink.error.5
724 (let ((string (format nil "~v{/A~}" 2049 ;PATH_MAX/2 plus some, maybe
726 (handler-case (sb-posix:readlink string)
727 (sb-posix:syscall-error (c)
728 (sb-posix:syscall-errno c))))
729 #.sb-posix:enametoolong)
730 (deftest readlink.error.6
731 (let ((no-such-pathname (make-pathname :name "readlink.error.6"
732 :defaults *test-directory*)))
733 (handler-case (sb-posix:readlink no-such-pathname)
734 (sb-posix:syscall-error (c)
735 (sb-posix:syscall-errno c))))
737 (deftest readlink.error.7
738 (let* ((non-link-pathname (make-pathname :name "readlink.error.7"
739 :defaults *test-directory*))
740 (impossible-pathname (merge-pathnames
743 '(:relative "readlink.error.7")
744 :name "readlink.error.7")
746 (fd (sb-posix:open non-link-pathname sb-posix::o-creat)))
748 (handler-case (sb-posix:readlink impossible-pathname)
749 (sb-posix:syscall-error (c)
750 (sb-posix:syscall-errno c)))
753 (sb-posix:unlink non-link-pathname))))
758 ;; FIXME: something saner, please
759 (equal (sb-unix::posix-getcwd) (sb-posix:getcwd))
764 (multiple-value-bind (fd temp)
765 (sb-posix:mkstemp (make-pathname
768 :defaults *test-directory*))
769 (let ((pathname (sb-ext:parse-native-namestring temp)))
771 (values (integerp fd) (pathname-name pathname))
772 (delete-file temp))))
775 ;#-(or win32 sunos hpux)
776 ;;;; mkdtemp is unimplemented on at least Solaris 10
778 ;;; But it is implemented on OpenSolaris 2008.11
781 (sb-ext:parse-native-namestring
782 (sb-posix:mkdtemp (make-pathname
785 :defaults *test-directory*))
787 *default-pathname-defaults*
790 (values (let* ((xxx (car (last (pathname-directory pathname))))
791 (p (position #\. xxx)))
792 (and p (subseq xxx 0 p)))
793 (pathname-name pathname)
794 (pathname-type pathname))
795 (sb-posix:rmdir pathname)))
800 (let ((pathname (sb-ext:parse-native-namestring
801 (sb-posix:mktemp #p"mktemp.XXXXXX"))))
802 (values (equal "mktemp" (pathname-name pathname))
803 (not (equal "XXXXXX" (pathname-type pathname)))))
807 (deftest mkstemp.null-terminate
808 (let* ((default (make-pathname :directory '(:absolute "tmp")))
809 (filename (namestring (make-pathname :name "mkstemp-1"
812 ;; The magic 64 is the filename length that happens to
813 ;; trigger the no null termination bug at least on my
814 ;; machine on a certain build.
815 (n (- 64 (length (sb-ext:string-to-octets filename)))))
816 (multiple-value-bind (fd temp)
817 (sb-posix:mkstemp (make-pathname
819 :type (format nil "~AXXXXXX"
820 (make-string n :initial-element #\x))
822 (let ((pathname (sb-ext:parse-native-namestring temp)))
824 (values (integerp fd) (pathname-name pathname))
825 (delete-file temp)))))
829 (let ((name1 "ASLIFJLSDKFJKAHGSDKLJH")
830 (name2 "KJHFKLJDSHIUYHBSDNFCBH"))
831 (values (sb-posix:getenv name1)
832 (sb-posix:getenv name1)
834 (sb-posix:putenv (concatenate 'string name1 "=name1,test1"))
836 (sb-posix:getenv name1))
838 (sb-posix:setenv name1 "name1,test2" 0)
840 (sb-posix:getenv name1))
842 (sb-posix:setenv name2 "name2,test1" 0)
844 (sb-posix:getenv name2))
846 (sb-posix:setenv name2 "name2,test2" 1)
848 (sb-posix:getenv name2))))