Change timestamps I/O function handler


int (*utime) ( resmgr_context_t *ctp,
              io_utime_t *msg,
              RESMGR_OCB_T *ocb ) 



Default handler:


Helper functions:

Client function: utime()



Data structure:

struct _io_utime {
    uint16_t                    type;
    uint16_t                    combine_len;
    int32_t                     cur_flag;
    struct __utimbuf32          times;

struct _io_utime64 {
    uint16_t                    type;
    uint16_t                    combine_len;
    int32_t                     cur_flag;
    int64_t                     atime_s;
    int64_t                     atime_ns;
    int64_t                     mtime_s;
    int64_t                     mtime_ns;

typedef union {
    struct _io_utime            i;
    struct _io_utime            i64;
} io_utime_t;


Changes the access and modification times to either “now” (if they are zero) or the specified values. Note that this message handler may be required to modify the IOFUNC_ATTR_* flags in the attribute structure as per POSIX rules. You'll almost never use this outcall yourself, but will instead use the POSIX-layer helper function.


The status via the helper macro _RESMGR_STATUS().

Referenced by:

resmgr_io_funcs_t I/O table

Permission checking:

The default implementation iofunc_utime_default() calls the helper function iofunc_utime() to check that the entry is either owned by the current user or the current user has write access to it. The helper also checks for a read-only filesystem. The owner of the entity is allowed to set arbitrary times, while a user with write permission only is only allowed to set the current time (cur_flag is 1).