Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!swrinde!elroy.jpl.nasa.gov!decwrl!pa.dec.com!news From: reising@colsw3.enet.dec.com (new to Ultrix) Newsgroups: comp.os.os9 Subject: Re: open() + sharable file = no disk Keywords: Sharable, open Message-ID: <1991Jun12.150304.23170@pa.dec.com> Date: 12 Jun 91 15:03:04 GMT References: <1991Jun11.012640.904@tkou02.enet.dec.com> <43@kilroy.chi.il.us> Sender: news@pa.dec.com (News) Reply-To: Reising@colsw3.enet.dec.com Distribution: usa Organization: Digital Equipment Corporation Lines: 43 In article <43@kilroy.chi.il.us>, ekuns@kilroy.chi.il.us (Eddie Kuns) writes: |>From: ekuns@kilroy.chi.il.us (Eddie Kuns) |>Subject: Re: open() + sharable file = no disk |>Date: Wed, 12 Jun 91 04:49:47 GMT-12303291:44 |> |>zambotti@wpowz.enet.dec.com (Walter Zambotti DEC) writes: |> |>#include |> |> .... |> |> /* open the active file in non-sharable mode, read-write */ |> activepath = open(NGROUPS, S_IREAD | S_IWRITE | S_ISHARE); |> if (activepath == 0) -----------------> ^^^-- should it be (activepath < 0) /* or == -1 */ ? |> { printf("readactive: can't open active file\n"); |> exit(0); |> } |> |>And this code works. (Other processes who open the file sleep until |>this process closes the file. They then awaken and can open the file.) |> |>I also use the Dev Sys RAM Disk, and haven't noticed any weird behavior |>with it. (The file I open above is not on the RAM disk.) |> |>My suggestion: If you're not using Carl Kreider's C library, you should |>get it. It may fix the above problem; it is much more capable, |>faster, and smaller. |> /jr -- ###################################################################### Josef Reisinger (Software Quality never goes out of style...) Digital Equipment Corporation D-5000 Koeln Stolberger Strasse reisinger@col01.enet.dec.com ! VAX/VMS via USA ...unido!decum!col01.enet!reisinger ! VAX/VMS in EUROPE ######################################################################