# HG changeset patch # User asl # Date 1236027250 0 # Node ID 2339c3df80dd70c9efe56ec32613b2c4b8d42c8d # Parent 3940c09dd3fe399c928a888f3401de355bb7d119 * src/file.cxx: add a chmod() call, implemented by calling cyg_fs_setinfo with parameter FS_INFO_CHMOD diff --git a/packages/io/fileio/current/ChangeLog b/packages/io/fileio/current/ChangeLog --- a/packages/io/fileio/current/ChangeLog +++ b/packages/io/fileio/current/ChangeLog @@ -1,3 +1,8 @@ +2008-11-18 Rutger Hofman + + * src/file.cxx: add a chmod() call, implemented by calling + cyg_fs_setinfo with parameter FS_INFO_CHMOD + 2008-12-11 Nick Garnett * src/fd.cxx (fp_ucount_dec, fd_close): Fix locking strategy so diff --git a/packages/io/fileio/current/include/fileio.h b/packages/io/fileio/current/include/fileio.h --- a/packages/io/fileio/current/include/fileio.h +++ b/packages/io/fileio/current/include/fileio.h @@ -161,6 +161,8 @@ struct cyg_fstab_entry #ifdef CYGSEM_FILEIO_INFO_DISK_USAGE #define FS_INFO_DISK_USAGE 6 /* get_disk_usage() */ #endif +#define FS_INFO_CHMOD 7 /* chmod() */ + //----------------------------------------------------------------------------- // Types for link() diff --git a/packages/io/fileio/current/src/file.cxx b/packages/io/fileio/current/src/file.cxx --- a/packages/io/fileio/current/src/file.cxx +++ b/packages/io/fileio/current/src/file.cxx @@ -41,6 +41,7 @@ // // Author(s): nickg // Contributors: nickg +// Contributors: rutger at cs dot vu dot nl: chmod() // Date: 2000-05-25 // Purpose: Fileio file operations // Description: These are the functions that operate on files as a whole, @@ -901,5 +902,19 @@ extern int access(const char *path, int FILEIO_RETURN(ret); } +//========================================================================== +// chmod + +__externC int chmod(const char *path, mode_t mode) +{ + int ret; + + FILEIO_ENTRY(); + + ret = cyg_fs_setinfo(path, FS_INFO_CHMOD, &mode, sizeof(mode)); + + FILEIO_RETURN(ret); +} + // ------------------------------------------------------------------------- // EOF file.cxx