diff options
author | Larry Wall <lwall@jpl-devvax.jpl.nasa.gov> | 1990-10-19 13:31:07 +0000 |
---|---|---|
committer | Larry Wall <lwall@jpl-devvax.jpl.nasa.gov> | 1990-10-19 13:31:07 +0000 |
commit | e5d73d7778736a8bd9f7f44aad5289ad2c783a16 (patch) | |
tree | 756f3b46679d7ac7f679ae75de0329852e1155b2 /doio.c | |
parent | 20188a906a3fc8fea4839293454a6ca32aa362cc (diff) | |
download | perl-e5d73d7778736a8bd9f7f44aad5289ad2c783a16.tar.gz |
perl 3.0 patch #37 (combined patch)
I tried to take the strlen of an integer on systems without wait4()
or waitpid(). For some reason this didn't work too well...
In hash.c there was a call to dbm_nextkey() which needed to be
ifdefed on old dbm systems.
A pattern such as /foo.*bar$/ was wrongly optimized to do
tail matching on "foo". This was a longstanding bug that
was unmasked by patch 36.
Some systems have some SYS V IPC but not all of it. Configure
now figures this out.
Patch 36 put the user's PATH in front of Configures, but to make
it work right I needed to change all calls of loc to ./loc in
Configure.
$cryptlib needed to be mentioned in the Makefile.
Apollo 10.3 and Sun 3.5 have some compilation problems, so I
mentioned them in README.
Cray has weird restrictions on setjmp locations--you can't say
if (result = setjmp(...))
Random typos and cleanup.
Diffstat (limited to 'doio.c')
-rw-r--r-- | doio.c | 53 |
1 files changed, 52 insertions, 1 deletions
@@ -1,4 +1,4 @@ -/* $Header: doio.c,v 3.0.1.11 90/10/15 16:16:11 lwall Locked $ +/* $Header: doio.c,v 3.0.1.12 90/10/20 02:04:18 lwall Locked $ * * Copyright (c) 1989, Larry Wall * @@ -6,6 +6,9 @@ * as specified in the README file that comes with the perl 3.0 kit. * * $Log: doio.c,v $ + * Revision 3.0.1.12 90/10/20 02:04:18 lwall + * patch37: split out separate Sys V IPC features + * * Revision 3.0.1.11 90/10/15 16:16:11 lwall * patch29: added SysV IPC * patch29: file - didn't auto-close cleanly @@ -85,10 +88,16 @@ #ifdef SYSVIPC #include <sys/ipc.h> +#ifdef IPCMSG #include <sys/msg.h> +#endif +#ifdef IPCSEM #include <sys/sem.h> +#endif +#ifdef IPCSHM #include <sys/shm.h> #endif +#endif #ifdef I_PWD #include <pwd.h> @@ -2341,12 +2350,22 @@ int *arglast; errno = 0; switch (optype) { +#ifdef IPCMSG case O_MSGGET: return msgget(key, flags); +#endif +#ifdef IPCSEM case O_SEMGET: return semget(key, n, flags); +#endif +#ifdef IPCSHM case O_SHMGET: return shmget(key, n, flags); +#endif +#if !defined(IPCMSG) || !defined(IPCSEM) || !defined(IPCSHM) + default: + fatal("%s not implemented", opname[optype]); +#endif } return -1; /* should never happen */ } @@ -2372,14 +2391,19 @@ int *arglast; switch (optype) { +#ifdef IPCMSG case O_MSGCTL: if (cmd == IPC_STAT || cmd == IPC_SET) infosize = sizeof(struct msqid_ds); break; +#endif +#ifdef IPCSHM case O_SHMCTL: if (cmd == IPC_STAT || cmd == IPC_SET) infosize = sizeof(struct shmid_ds); break; +#endif +#ifdef IPCSEM case O_SEMCTL: if (cmd == IPC_STAT || cmd == IPC_SET) infosize = sizeof(struct semid_ds); @@ -2392,6 +2416,11 @@ int *arglast; infosize = semds.sem_nsems * sizeof(ushort); } break; +#endif +#if !defined(IPCMSG) || !defined(IPCSEM) || !defined(IPCSHM) + default: + fatal("%s not implemented", opname[optype]); +#endif } if (infosize) @@ -2419,15 +2448,21 @@ int *arglast; errno = 0; switch (optype) { +#ifdef IPCMSG case O_MSGCTL: ret = msgctl(id, cmd, a); break; +#endif +#ifdef IPCSEM case O_SEMCTL: ret = semctl(id, n, cmd, a); break; +#endif +#ifdef IPCSHM case O_SHMCTL: ret = shmctl(id, cmd, a); break; +#endif } if (getinfo && ret >= 0) { astr->str_cur = infosize; @@ -2440,6 +2475,7 @@ int do_msgsnd(arglast) int *arglast; { +#ifdef IPCMSG register STR **st = stack->ary_array; register int sp = arglast[0]; STR *mstr; @@ -2456,12 +2492,16 @@ int *arglast; } errno = 0; return msgsnd(id, mbuf, msize, flags); +#else + fatal("msgsnd not implemented"); +#endif } int do_msgrcv(arglast) int *arglast; { +#ifdef IPCMSG register STR **st = stack->ary_array; register int sp = arglast[0]; STR *mstr; @@ -2486,12 +2526,16 @@ int *arglast; mstr->str_ptr[sizeof(long)+ret] = '\0'; } return ret; +#else + fatal("msgrcv not implemented"); +#endif } int do_semop(arglast) int *arglast; { +#ifdef IPCSEM register STR **st = stack->ary_array; register int sp = arglast[0]; STR *opstr; @@ -2509,6 +2553,9 @@ int *arglast; } errno = 0; return semop(id, opbuf, opsize/sizeof(struct sembuf)); +#else + fatal("semop not implemented"); +#endif } int @@ -2516,6 +2563,7 @@ do_shmio(optype, arglast) int optype; int *arglast; { +#ifdef IPCSHM register STR **st = stack->ary_array; register int sp = arglast[0]; STR *mstr; @@ -2558,6 +2606,9 @@ int *arglast; bzero(shm + mpos + n, msize - n); } return shmdt(shm); +#else + fatal("shm I/O not implemented"); +#endif } #endif /* SYSVIPC */ |