RTEMS Logo

RTEMS 4.7.2 On-Line Library


IMFS_fchmod() for Devices

PREV UP NEXT Bookshelf RTEMS Filesystem Design Guide

6.4.4.8: IMFS_fchmod() for Devices

Corresponding Structure Element:

IMFS_fchmod()

Arguments:

rtems_libio_t     *iop
mode_t             mode

File:

imfs_fchmod.c

Description:

This routine will obtain the pointer to the IMFS_jnode_t structure from the information currently in the file control block.

Based on configuration the routine will acquire the user ID from a call to getuid() or from the IMFS_jnode_t structure.

It then checks to see if we have the ownership rights to alter the mode of the file. If the caller does not, an error code is returned.

An additional test is performed to verify that the caller is not trying to alter the nature of the node. If the caller is attempting to alter more than the permissions associated with user group and other, an error is returned.

If all the preconditions are met, the user, group and other fields are set based on the mode calling parameter.


PREV UP NEXT Bookshelf RTEMS Filesystem Design Guide

Copyright © 1988-2004 OAR Corporation