Update time stamps
#include <sys/iofunc.h>
int iofunc_utime( resmgr_context_t* ctp,
io_utime_t* msg,
iofunc_ocb_t* ocb,
iofunc_attr_t* attr );
libc
Use the -l c option to qcc to link against this library. This library is usually included automatically.
The iofunc_utime() helper function examines the flags member in the passed attr structure and sets the IOFUNC_ATTR_ATIME and IOFUNC_ATTR_MTIME bits if requested.
The function sets the IOFUNC_ATTR_CTIME and IOFUNC_ATTR_DIRTY_TIME bits. It then calls iofunc_time_update() to update the file times.
io_utime_t structure
The io_utime_t structure holds the _IO_UTIME or _IO_UTIME64 message received by the resource manager:
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;
The I/O message structures are unions of an input message (coming to the resource manager) and an output or reply message (going back to the client). In this case, there's only an input message, i or i64, that contains the following members:
If the access or modification time is zero, the time is set to the current time.
| Safety: | |
|---|---|
| Cancellation point | No |
| Interrupt handler | No |
| Signal handler | Yes |
| Thread | Yes |