You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by "xiaoxiang781216 (via GitHub)" <gi...@apache.org> on 2023/01/20 18:53:10 UTC

[GitHub] [nuttx] xiaoxiang781216 opened a new pull request, #8206: libc: Implement quick_exit and at_quick_exit

xiaoxiang781216 opened a new pull request, #8206:
URL: https://github.com/apache/nuttx/pull/8206

   ## Summary
   
   - libc: Flush all stream in _Exit 
   - libc: abort should always call exit not pthread_exit
   - libc: Move on_exit and __cxa_atexit in lib_atexit.c 
   - libc: Implement quick_exit and at_quick_exit 
   
   ## Impact
   
   New function
   _Exit and abort
   
   ## Testing
   
   Pass CI


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

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

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


[GitHub] [nuttx] pussuw commented on a diff in pull request #8206: libc: Implement quick_exit and at_quick_exit

Posted by "pussuw (via GitHub)" <gi...@apache.org>.
pussuw commented on code in PR #8206:
URL: https://github.com/apache/nuttx/pull/8206#discussion_r1084877025


##########
libs/libc/stdlib/lib_exit.c:
##########
@@ -46,22 +46,33 @@ FAR void *__dso_handle = &__dso_handle;
  * Public Functions
  ****************************************************************************/
 
-void exit(int status)
+void _Exit(int status)

Review Comment:
   I think flushing the streams here is not correct:
   
   The _Exit() and _exit() functions shall not call functions registered with atexit() nor any registered signal handlers. Open streams shall not be flushed.  Whether open streams are closed (without flushing) is implementation-defined. Finally, the calling process shall be terminated with the consequences described below.
   
   https://pubs.opengroup.org/onlinepubs/9699919799/functions/_Exit.html



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

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

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


[GitHub] [nuttx] xiaoxiang781216 commented on a diff in pull request #8206: libc: Implement quick_exit and at_quick_exit

Posted by "xiaoxiang781216 (via GitHub)" <gi...@apache.org>.
xiaoxiang781216 commented on code in PR #8206:
URL: https://github.com/apache/nuttx/pull/8206#discussion_r1085142515


##########
libs/libc/stdlib/lib_exit.c:
##########
@@ -46,22 +46,33 @@ FAR void *__dso_handle = &__dso_handle;
  * Public Functions
  ****************************************************************************/
 
-void exit(int status)
+void _Exit(int status)

Review Comment:
   You are right. the description in https://en.cppreference.com/w/c/program/_Exit isn't accuracy. The change is reverted.



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

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

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


[GitHub] [nuttx] pkarashchenko commented on a diff in pull request #8206: libc: Implement quick_exit and at_quick_exit

Posted by "pkarashchenko (via GitHub)" <gi...@apache.org>.
pkarashchenko commented on code in PR #8206:
URL: https://github.com/apache/nuttx/pull/8206#discussion_r1086403467


##########
libs/libc/stdlib/lib_atexit.c:
##########
@@ -181,3 +186,70 @@ int atexit(CODE void (*func)(void))
 {
   return atexit_register(ATTYPE_ATEXIT, func, NULL, NULL);
 }
+
+int at_quick_exit(CODE void (*func)(void))

Review Comment:
   Do we need to add a separate comment description for `at_quick_exit` or maybe modify existing description of `atexit`?



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

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

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


[GitHub] [nuttx] xiaoxiang781216 commented on pull request #8206: libc: Implement quick_exit and at_quick_exit

Posted by "xiaoxiang781216 (via GitHub)" <gi...@apache.org>.
xiaoxiang781216 commented on PR #8206:
URL: https://github.com/apache/nuttx/pull/8206#issuecomment-1401115322

   @acassis @pkarashchenko could you review this patchset? #8173 is waiting for it.


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

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

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


[GitHub] [nuttx] pussuw commented on a diff in pull request #8206: libc: Implement quick_exit and at_quick_exit

Posted by "pussuw (via GitHub)" <gi...@apache.org>.
pussuw commented on code in PR #8206:
URL: https://github.com/apache/nuttx/pull/8206#discussion_r1085151322


##########
libs/libc/stdlib/lib_exit.c:
##########
@@ -50,14 +50,25 @@ void exit(int status)
 {
   /* Run the registered exit functions */
 
-  atexit_call_exitfuncs(status);
+  atexit_call_exitfuncs(status, false);
 
   /* Flush all streams */
 
   fflush(NULL);
 
   /* Then perform the exit */
 
+  _Exit(status);

Review Comment:
   Maybe change this to back to _exit() ?



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

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

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


[GitHub] [nuttx] xiaoxiang781216 commented on a diff in pull request #8206: libc: Implement quick_exit and at_quick_exit

Posted by "xiaoxiang781216 (via GitHub)" <gi...@apache.org>.
xiaoxiang781216 commented on code in PR #8206:
URL: https://github.com/apache/nuttx/pull/8206#discussion_r1085277692


##########
libs/libc/stdlib/lib_exit.c:
##########
@@ -50,14 +50,25 @@ void exit(int status)
 {
   /* Run the registered exit functions */
 
-  atexit_call_exitfuncs(status);
+  atexit_call_exitfuncs(status, false);
 
   /* Flush all streams */
 
   fflush(NULL);
 
   /* Then perform the exit */
 
+  _Exit(status);

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.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

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


[GitHub] [nuttx] xiaoxiang781216 commented on a diff in pull request #8206: libc: Implement quick_exit and at_quick_exit

Posted by "xiaoxiang781216 (via GitHub)" <gi...@apache.org>.
xiaoxiang781216 commented on code in PR #8206:
URL: https://github.com/apache/nuttx/pull/8206#discussion_r1085142515


##########
libs/libc/stdlib/lib_exit.c:
##########
@@ -46,22 +46,33 @@ FAR void *__dso_handle = &__dso_handle;
  * Public Functions
  ****************************************************************************/
 
-void exit(int status)
+void _Exit(int status)

Review Comment:
   You are right. the description in https://en.cppreference.com/w/c/program/_Exit isn't accuracy.



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

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

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


[GitHub] [nuttx] xiaoxiang781216 commented on a diff in pull request #8206: libc: Implement quick_exit and at_quick_exit

Posted by "xiaoxiang781216 (via GitHub)" <gi...@apache.org>.
xiaoxiang781216 commented on code in PR #8206:
URL: https://github.com/apache/nuttx/pull/8206#discussion_r1086442989


##########
libs/libc/stdlib/lib_atexit.c:
##########
@@ -181,3 +186,70 @@ int atexit(CODE void (*func)(void))
 {
   return atexit_register(ATTYPE_ATEXIT, func, NULL, NULL);
 }
+
+int at_quick_exit(CODE void (*func)(void))

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.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

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


[GitHub] [nuttx] pkarashchenko merged pull request #8206: libc: Implement quick_exit and at_quick_exit

Posted by "pkarashchenko (via GitHub)" <gi...@apache.org>.
pkarashchenko merged PR #8206:
URL: https://github.com/apache/nuttx/pull/8206


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

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

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