[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

args to fchmod() and chmod()

From: Terrence Enger
Subject: args to fchmod() and chmod()
Date: Mon, 20 Jan 2003 08:58:28 -0500

Greetings, all.

I notice that cvs in several places executes fchmod() or chmod(), and that
in some cases the new mode argument is the mode returned from an earlier
call to stat().  This value typically includes the file type.  

On most platforms this causes no problem, but OS/400 complains that "the
value specified for the argument is not correct".  Indeed, the
documentation of chmod() at lists the bits
which it can change and specifies that errno=EINVAL is a possible result,
so I think that OS/400 is arguably correct.

Does anybody forsee possible bad results from masking the mode argument
down to the valid bits?  Would the "official" cvs be willing to accept a
patch to this effect?

If this is a good idea, perhaps some expert can answer a couple of questions:
(*)     Where should I define the valid bits?  Would anybody volunteer to help
me with the configuration tools?  Would anybody be willing to take over
that part of the work?
(*)     sys/stat.h on different platforms define different subsets of the bits
named in the Posix specification.  In light experimentation on the
platforms I have readily available, I have not seen any unnamed bit affect
the value of the mode returned from stat().  How can I best define the
valid bits portably?

Thank you, all, for your attention.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]