-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
include/spawn.h: Add POSIX_SPAWN_SETSID definition #3672
Conversation
include/spawn.h
Outdated
@@ -53,6 +53,7 @@ | |||
#define POSIX_SPAWN_SETSCHEDULER (1 << 3) /* 1: Set task's scheduler policy */ | |||
#define POSIX_SPAWN_SETSIGDEF (1 << 4) /* 1: Set default signal actions */ | |||
#define POSIX_SPAWN_SETSIGMASK (1 << 5) /* 1: Set sigmask */ | |||
#define POSIX_SPAWN_SETSID (1 << 7) /* 1: Create the new session */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this flag is not supported by NuttX, I believe that the implementation should at least return the appropriate error code (e.g. ENOSYS
) when this flag is used by the API consumer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here is some reason I don't add the code to check the flag:
- NuttX doesn't support the session concept, so we can simply model that all processes share a global session and ignore the request safely.
- In the standard implementation, tty driver work with the scheduler do some special action for the different session, but the difference is very minor and NuttX actually treat that all processes are equal regarding the session. It isn't good to stop the program just because the minor(no for NuttX) difference.
@gustavonihei what do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, seems reasonable. On 2 I agree that would be a bad idea to stop the program for this reason.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we add a comment indicating that this flag (and possible others to come) are not from POSIX standard, or indicating where is it from?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com> Change-Id: I7ad654a1cb9b74a9f27f52c88fffa8b487a48f33
Summary
NuttX doesn't support session yet, but the definition can improve the compatibility.
Impact
Minor, new flag
Testing
Pass the build