summaryrefslogtreecommitdiff
path: root/os2/os2.c
diff options
context:
space:
mode:
authorLarry Wall <lwall@netlabs.com>1992-06-08 04:50:30 +0000
committerLarry Wall <lwall@netlabs.com>1992-06-08 04:50:30 +0000
commitee0007abcec11102eeaa49662e5ebb838e04aac6 (patch)
tree8bd2b45245f7c74167adac89abd7285c65989bfb /os2/os2.c
parent7b0cd887a13445cfae2c23db0b7efd05a47758e6 (diff)
downloadperl-ee0007abcec11102eeaa49662e5ebb838e04aac6.tar.gz
perl 4.0 patch 28: patch #20, continued
See patch #20.
Diffstat (limited to 'os2/os2.c')
-rw-r--r--os2/os2.c27
1 files changed, 20 insertions, 7 deletions
diff --git a/os2/os2.c b/os2/os2.c
index bd31a24afa..ee2226257e 100644
--- a/os2/os2.c
+++ b/os2/os2.c
@@ -1,4 +1,4 @@
-/* $RCSfile: os2.c,v $$Revision: 4.0.1.1 $$Date: 91/06/07 11:23:06 $
+/* $RCSfile: os2.c,v $$Revision: 4.0.1.2 $$Date: 92/06/08 14:32:30 $
*
* (C) Copyright 1989, 1990 Diomidis Spinellis.
*
@@ -6,6 +6,9 @@
* License or the Artistic License, as specified in the README file.
*
* $Log: os2.c,v $
+ * Revision 4.0.1.2 92/06/08 14:32:30 lwall
+ * patch20: new OS/2 support
+ *
* Revision 4.0.1.1 91/06/07 11:23:06 lwall
* patch4: new copyright notice
*
@@ -54,14 +57,15 @@ int syscall()
{ return -1; }
-/* extendd chdir() */
+/* extended chdir() */
int chdir(char *path)
{
if ( path[0] != 0 && path[1] == ':' )
- DosSelectDisk(toupper(path[0]) - '@');
+ if ( DosSelectDisk(toupper(path[0]) - '@') )
+ return -1;
- DosChDir(path, 0L);
+ return DosChDir(path, 0L);
}
@@ -102,6 +106,17 @@ int getppid(void)
}
+/* wait for specific pid */
+int wait4pid(int pid, int *status, int flags)
+{
+ RESULTCODES res;
+ int endpid, rc;
+ if ( DosCwait(DCWA_PROCESS, flags ? DCWW_NOWAIT : DCWW_WAIT,
+ &res, &endpid, pid) )
+ return -1;
+ *status = res.codeResult;
+ return endpid;
+}
/* kill */
int kill(int pid, int sig)
@@ -251,7 +266,7 @@ char *cmd;
usage(char *myname)
{
#ifdef MSDOS
- printf("\nUsage: %s [-acdnpsSvw] [-0[octal]] [-Dnumber] [-i[extension]] [-Idirectory]"
+ printf("\nUsage: %s [-acdnpPsSvw] [-0[octal]] [-Dnumber] [-i[extension]] [-Idirectory]"
#else
printf("\nUsage: %s [-acdnpPsSuUvw] [-Dnumber] [-i[extension]] [-Idirectory]"
#endif
@@ -262,9 +277,7 @@ usage(char *myname)
"\n -d run scripts under debugger"
"\n -n assume 'while (<>) { ...script... }' loop arround your script"
"\n -p assume loop like -n but print line also like sed"
-#ifndef MSDOS
"\n -P run script through C preprocessor befor compilation"
-#endif
"\n -s enable some switch parsing for switches after script name"
"\n -S look for the script using PATH environment variable");
#ifndef MSDOS