Usenet comp.unix.osf.osf1 (1992-2004)
 help / color / mirror / Atom feed
* DEC Unix equivalent for VMS' SYS$ENQ()
@ 2000-05-05  4:00 Lee Newman
  2000-05-06  4:00 ` Adam Price
  2000-05-09  4:00 ` Bob Koehler
  0 siblings, 2 replies; 3+ messages in thread
From: Lee Newman @ 2000-05-05  4:00 UTC (permalink / raw)


Being new to the world of Unix, I have a newbie-style question...is there
anything in Digital Unix equivalent to the VMS system routine SYS$ENQ()?
If there is no comparable system routine, how do people implement that type
of functionality?  Thanks in advance...

Lee Newman, ewn@psulias.psu.edu



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: DEC Unix equivalent for VMS' SYS$ENQ()
  2000-05-05  4:00 DEC Unix equivalent for VMS' SYS$ENQ() Lee Newman
@ 2000-05-06  4:00 ` Adam Price
  2000-05-09  4:00 ` Bob Koehler
  1 sibling, 0 replies; 3+ messages in thread
From: Adam Price @ 2000-05-06  4:00 UTC (permalink / raw)



Lee Newman wrote in message <8evf01$1hde@r02n01.cac.psu.edu>...
>Being new to the world of Unix, I have a newbie-style question...is there
>anything in Digital Unix equivalent to the VMS system routine SYS$ENQ()?
>If there is no comparable system routine, how do people implement that type
>of functionality?  Thanks in advance...

What does SYS$ENQ() do?
This is a unix group, and not all of us are familiar with VMS system internals.
You might try asking in comp.sys.dec where many people who are knowledgeable
about such cross platform issues tend to hang out.

Adam Price
PS Cross posted to comp.unix.tru64 since comp.unix.osf1 is a defunct group
and will be removed on May 29th. Followups set to comp.unix.tru64








^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: DEC Unix equivalent for VMS' SYS$ENQ()
  2000-05-05  4:00 DEC Unix equivalent for VMS' SYS$ENQ() Lee Newman
  2000-05-06  4:00 ` Adam Price
@ 2000-05-09  4:00 ` Bob Koehler
  1 sibling, 0 replies; 3+ messages in thread
From: Bob Koehler @ 2000-05-09  4:00 UTC (permalink / raw)


In article <8evf01$1hde@r02n01.cac.psu.edu>, ewn@psulias.psu.edu (Lee Newman) writes:
> Being new to the world of Unix, I have a newbie-style question...is there
> anything in Digital Unix equivalent to the VMS system routine SYS$ENQ()?
> If there is no comparable system routine, how do people implement that type
> of functionality?  Thanks in advance...
> 

There is no distributed lock manager in most UNIX, so you can't count on
having cluser-wide locks.  Tru64 is an exception to this, but I've never
seen the API documentation.  Somebody who has will proably chime in.

A feature of UNIX file systems is that creat() is atomic.  This was not
orginally documented anywhere but has always been true and so much code
depends on it a vendor would be nuts to alter it.  Since there are no
versions in order to create a file you must be able to delete any
existing file by the same name.  In UNIX delete is a part of write
access.  So if you creat() a file with no write access (mode in
UNIX-speak) you can use it to represent a lock until you change chmod()
to include write, that is further attempts to creat() that file will
fail.  Programs call creat() specifying no write access, on success this
indicates you have the lock.  Failure indicates someone else has the
lock.  When you're done with the lock you chmod() to give write access,
then attempt to remove() the file.  Ignore failure of remove() as some
waiting process may creat() after you chmod() but before you remove().

NFS should honor the atomiticity of creat().

The file system also has advisory locks, implemented by flock() and
such.  Since they are advisory, it means programs can choose to ignore
them.  Some UNIX also impliment mandatory locks in their file systems. 
All file system locks  over NFS are advisory.

Your mileage will vary, as of course all UNIX are different.  When you 
absolutely positivley have to be sure your data is right you pay someone
like Oracle big bucks to provide capabilities UNIX doesn't come with,
whether you need all the power of a DBMS or not.

If your using SYS$ENQ for non file system related things in VMS, you'll
have to change your thinking to survive in UNIX.  In UNIX if it isn't a
file it can't be important, so many things your used to having in VMS
will somehow be done via the file system.

----------------------------------------------------------------------
Bob Koehler                     | Computer Sciences Corporation
Hubble Space Telescope Payload  | Federal Sector, Civil Group
 Flight Software Team           | please remove ".aspm" when replying



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2000-05-09  4:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2000-05-05  4:00 DEC Unix equivalent for VMS' SYS$ENQ() Lee Newman
2000-05-06  4:00 ` Adam Price
2000-05-09  4:00 ` Bob Koehler

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox