EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  <20132014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024  Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  <20132014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Re: sscan/ saveData problem with RW permission, and not an NFS issue
From: Andrew Johnson <[email protected]>
To: [email protected]
Date: Tue, 16 Apr 2013 10:31:57 -0500
Hi Tim,

On 2013-04-16 Tim Mooney wrote:
> Thanks for the information.  I haven't tested sscan on vxWorks 6.9, though
> I'm told it works on vxWorks 6.8.  I don't think creat() uses O_RDRW as a
> file-permission mask, and I don't understand why open() would work while
> creat() does not.  I'm ok with making this change, but I'd like to
> understand it better first.

I don't think there's going to be any difference in the behavior between 
VxWorks 6.8 and 6.9.  This is one of those things that I believe Wind River 
got wrong very early in the life of VxWorks and it has never been fixed 
properly.  This is from the documentation for creat():

    The parameter mode is set to O_RDONLY (0), O_WRONLY (1), or O_RDWR (2)
    for the duration of time the file is open. On NFS and POSIX compliant
    file systems such as HRFS, mode refers instead to the UNIX style file
    permission bits.

They even say that the second argument has a different meaning on different 
file-systems, which means there is /no/ way to write code using this routine 
that works properly on all file-systems, because you have to know what kind of 
file-system it is to give the right parameter.

I recommend that creat() not be used in code that runs on vxWorks, and that 
all calls to it be replaced with the equivalent open() call instead.  The 
Linux man-page for creat() says:

    creat() is equivalent to open() with flags equal to
    O_CREAT|O_WRONLY|O_TRUNC.

You will also need to add the mode parameter 0666.

- Andrew
-- 
It is difficult to get a man to understand something, when his salary
depends upon his not understanding it. -- Upton Sinclair

References:
Re: sscan/ saveData problem with RW permission, and not an NFS issue Tim Mooney

Navigate by Date:
Prev: Re: sscan/ saveData problem with RW permission, and not an NFS issue Tim Mooney
Next: EPICS UTC Time conversion Eric Norum
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  <20132014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: Re: sscan/ saveData problem with RW permission, and not an NFS issue Tim Mooney
Next: RE: sscan/ saveData problem with RW permission, and not an NFS issue Vesna Samardzic-Boban
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  <20132014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 20 Apr 2015 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·