develooper Front page | perl.vmsperl | Postings from June 2002

Re: [PATCH: RC2] add getppid() to vmsperl

Thread Previous | Thread Next
June 24, 2002 09:38
Re: [PATCH: RC2] add getppid() to vmsperl
Message ID:

Craig Berry wrote:

!I just looked at a VAX C manual from ca. 1987 and it was present then.  In

!the version dependency tables in Appendix B of the Compaq C RTL Reference,

!it is claimed to be present for all VAX and Alpha versions of VMS.  So
!a bit funny that we never had it and I see not reason not to support it.
!I'll take your patch for a spin since extra testing at this late stage
!like a good idea.  We probably also need to tweak the list of supported
!functions in README.vms.

Thanks for digging through the history.

Interestingly, before editing I had run:

  $ search readme.vms getppid
  %SEARCH-I-NOMATCHES, no strings matched

But now that you mention it I think what needs editing is
So - would this be OK?  Should we incorporate any part of the SET NOON fix
that Martin just requested for (it seems important)?

diff -ru perl-5_8_0-RC2_orig/ perl-5_8_0-RC2/
--- perl-5_8_0-RC2_orig/     Sun Jun 23 20:19:11 2002
+++ perl-5_8_0-RC2/    Sun Jun 23 20:20:02 2002
@@ -3374,6 +3374,25 @@
 $ GOSUB inhdr
 $ i_unistd = tmp
+$! do we have getppid()?
+$ IF i_unistd .EQS. "define"
+$   OS
+$   WS "#include <stdio.h>"
+$   WS "#include <unistd.h>"
+$   WS "int main() {"
+$   WS "printf(""%d\n"",getppid());"
+$   WS "return(0);"
+$   WS "}"
+$   CS
+$   tmp = "getppid"
+$   GOSUB inlibc
+$   d_getppid = tmp
+$   d_getppid = "undef"
 $!: see if this is a libutil.h system
 $ tmp = "libutil.h"
@@ -5253,7 +5272,7 @@
 $ WC "d_getpgid='undef'"
 $ WC "d_getpgrp2='undef'"
 $ WC "d_getpgrp='undef'"
-$ WC "d_getppid='undef'"
+$ WC "d_getppid='" + d_getppid + "'"
 $ WC "d_getprior='undef'"
 $ WC "d_getprotoprotos='" + d_getprotoprotos + "'"
 $ WC "d_getprpwnam='undef'"
diff -ru perl-5_8_0-RC2_orig/pod/perlport.pod
--- perl-5_8_0-RC2_orig/pod/perlport.pod  Sun Jun 23 20:19:38 2002
+++ perl-5_8_0-RC2/pod/perlport.pod Sun Jun 23 20:20:20 2002
@@ -1584,7 +1584,10 @@

 =item getppid

-Not implemented. (S<Mac OS>, Win32, VMS, S<RISC OS>)
+Not implemented. (S<Mac OS>, Win32, older versions of VMS, S<RISC OS>)
+Returns 0 to indicate that the calling process does not have
+a parent process.  (Recent versions of VMS)

 =item getpriority WHICH,WHO

@@ -1794,7 +1797,7 @@

 =item setgrent

-Not implemented. (S<Mac OS>, MPE/iX, VMS, Win32, VMS, S<RISC OS>)
+Not implemented. (S<Mac OS>, MPE/iX, VMS, Win32, S<RISC OS>)

 =item setpgrp PID,PGRP

diff -ru perl-5_8_0-RC2_orig/vms/perlvms.pod perl-5_8_0-RC2/vms/perlvms.pod
--- perl-5_8_0-RC2_orig/vms/perlvms.pod   Mon Jun 24 12:28:06 2002
+++ perl-5_8_0-RC2/vms/perlvms.pod  Mon Jun 24 12:28:21 2002
@@ -359,11 +359,16 @@
 undefined behavior (rarely, we hope):

     chroot, dbmclose, dbmopen, flock,
-    getpgrp, getppid, getpriority, getgrent, getgrgid,
+    getpgrp, getpriority, getgrent, getgrgid,
     getgrnam, setgrent, endgrent, ioctl, link, lstat,
     msgctl, msgget, msgsend, msgrcv, readlink, semctl,
     semget, semop, setpgrp, setpriority, shmctl, shmget,
     shmread, shmwrite, socketpair, symlink, syscall
+If Perl is built on a C run time that does not support getppid
+(most do) then calling the following will produce a fatal error:
+    getppid

 The following functions are available on Perls compiled with Dec C
 5.2 or greater and running VMS 7.0 or greater:
End of Revised Patch.

Peter Prymmer

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About