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 07:28:17 UTC

[GitHub] [incubator-nuttx] xiaoxiang781216 opened a new pull request #1323: vfs: Add chmod/fchmod/utimes function prototype

xiaoxiang781216 opened a new pull request #1323:
URL: https://github.com/apache/incubator-nuttx/pull/1323


   but skip the implemenation because VFS layer doesn't support the time/mode change yet:
   https://pubs.opengroup.org/onlinepubs/009695399/functions/chmod.html
   https://pubs.opengroup.org/onlinepubs/009696699/functions/fchmod.html
   https://pubs.opengroup.org/onlinepubs/009695399/functions/utimes.html
   
   ## Summary
   It's hard to implement these functions now due to VFS layer lack the related abstraction.
   But some library(e.g. libcxx) don't call these functions in the most case, so the delcaration without implementation will make the library pass the build, and fail to link in the the special situation. 
   
   ## Impact
   No
   
   ## Testing
   
   


----------------------------------------------------------------
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



[GitHub] [incubator-nuttx] Ouss4 merged pull request #1323: vfs: Add chmod/fchmod/utimes function prototype

Posted by GitBox <gi...@apache.org>.
Ouss4 merged pull request #1323:
URL: https://github.com/apache/incubator-nuttx/pull/1323


   


----------------------------------------------------------------
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



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

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on pull request #1323:
URL: https://github.com/apache/incubator-nuttx/pull/1323#issuecomment-650984418


   https://github.com/apache/incubator-nuttx/pull/1280


----------------------------------------------------------------
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



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

Posted by GitBox <gi...@apache.org>.
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



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

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on a change in pull request #1323:
URL: https://github.com/apache/incubator-nuttx/pull/1323#discussion_r446974298



##########
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:
       Done.




----------------------------------------------------------------
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