HP3000-L Archives

March 1998, Week 1

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Mark Bixby <[log in to unmask]>
Reply To:
Date:
Fri, 6 Mar 1998 10:10:32 -0800
Content-Type:
text/plain
Parts/Attachments:
text/plain (57 lines)
Raymond Roesch writes:
> What can I do when this script reports the following error.
>
> shell/iX>/PERL/PUB/src/perl5.004_04-mpe/eg/sysvipc/ipcsem s
> Can't get semaphore: No such file or directory
> shell/iX>
> shell/iX> cat /PERL/PUB/src/perl5.004_04-mpe/eg/sysvipc/ipcsem

...deletia...

When you do "ipcsem s" (send/client), you are trying to send a signal to a
semaphore that has been previously created by "ipcsem r" (receive/server).

So doing "ipcsem s" first will fail as quoted above because the semaphore
doesn't exist yet.

You want to do "ipcsem r" first to create and wait on the semaphore.

First we'll list the existing semaphores on the machine:

picard:/PERL/PUB/src/perl5.004_04-mpe/eg/sysvipc$ callci ipcs.hpbin.sys -s
Semaphores:
T       ID        KEY        MODE    OWNER    GROUP
s     8193 0x01090522 --ra-r--r--  MANAGER     SYS

Then we'll try to create a new one and wait:

picard:/PERL/PUB/src/perl5.004_04-mpe/eg/sysvipc$ ./ipcsem r
semaphore id: 24578
Can't wait for semaphore: Invalid argument

Hmmm....  The create seemed to work, but calling semop() to wait is failing.
Let's verify that the semaphore was actually created:

picard:/PERL/PUB/src/perl5.004_04-mpe/eg/sysvipc$ callci ipcs.hpbin.sys -s
Semaphores:
T       ID        KEY        MODE    OWNER    GROUP
s     8193 0x01090522 --ra-r--r--  MANAGER     SYS
s    24578 0x00001234 --ra-r--r--      MGR     PERL
picard:/PERL/PUB/src/perl5.004_04-mpe/eg/sysvipc$

Yes, it was.

Unfortunately nothing I've ported so far has used semaphores, and I don't
know why semop() is failing here with EINVAL (bogus semaphore ID).

You might want to re-write the Perl ipcsem script into a C program to see if
you can duplicate the problem.  Let me know if you are able to get it working
in C.  If it works in C, then there's some Perl porting issue that I'll need
to investigate.
--
Mark Bixby                      E-mail: [log in to unmask]
Coast Community College Dist.   Web: http://www.cccd.edu/~markb/
District Information Services   1370 Adams Ave, Costa Mesa, CA, USA 92626-5429
Technical Support               Voice: +1 714 438-4647
"You can tune a file system, but you can't tune a fish." - tunefs(1M)

ATOM RSS1 RSS2