You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2020/06/29 13:17:32 UTC

[GitHub] [incubator-nuttx] Ouss4 commented on a change in pull request #1323: vfs: Add chmod/fchmod/utimes function prototype

Ouss4 commented on a change in pull request #1323:
URL: https://github.com/apache/incubator-nuttx/pull/1323#discussion_r446962986



##########
File path: include/sys/time.h
##########
@@ -349,6 +349,40 @@ int getitimer(int which, FAR struct itimerval *value);
 int setitimer(int which, FAR const struct itimerval *value,
               FAR struct itimerval *ovalue);
 
+/****************************************************************************
+ * Name: utimes
+ *
+ * Description:
+ * The utimes() function shall set the access and modification times of the
+ * file pointed to by the path argument to the value of the times argument.
+ * utimes() function allows time specifications accurate to the microsecond.
+
+ * For utimes(), the times argument is an array of timeval structures. The
+ * first array member represents the date and time of last access, and the
+ * second member represents the date and time of last modification. The times
+ * in the timeval structure are measured in seconds and microseconds since
+ * the Epoch, although rounding toward the nearest second may occur.
+
+ * If the times argument is a null pointer, the access and modification times
+ * of the file shall be set to the current time. The effective user ID of the
+ * process shall match the owner of the file, has write access to the file or
+ * appropriate privileges to use this call in this manner. Upon completion,
+ * utimes() shall mark the time of the last file status change, st_ctime, for
+ * update.
+ *
+ * Input Parameters:
+ *   path  - Specifies the file to be modified
+ *   times - Specifies the time value to set
+ *
+ * Returned Value:
+ *   Upon successful completion, 0 shall be returned. Otherwise, -1 shall be
+ *   returned and errno shall be set to indicate the error, and the file
+ *   times shall not be affected.
+ *
+ ****************************************************************************/
+
+int utimes(const char *path, const struct timeval times[2]);

Review comment:
       ```suggestion
   int utimes(FAR const char *path, const struct timeval times[2]);
   ```




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org