Is the umask function a kernel function?
up vote
0
down vote
favorite
I assumed the umask()
function is a:
shell function containing a variable commonly referred to as file creation mask
but I was very wrong (and should improve this linked question) because umask()
is not a shell function and doesn't contain such variable.
If the umask()
function is not a "shell function" is it true to name it a "kernel function"?
umask
add a comment |
up vote
0
down vote
favorite
I assumed the umask()
function is a:
shell function containing a variable commonly referred to as file creation mask
but I was very wrong (and should improve this linked question) because umask()
is not a shell function and doesn't contain such variable.
If the umask()
function is not a "shell function" is it true to name it a "kernel function"?
umask
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I assumed the umask()
function is a:
shell function containing a variable commonly referred to as file creation mask
but I was very wrong (and should improve this linked question) because umask()
is not a shell function and doesn't contain such variable.
If the umask()
function is not a "shell function" is it true to name it a "kernel function"?
umask
I assumed the umask()
function is a:
shell function containing a variable commonly referred to as file creation mask
but I was very wrong (and should improve this linked question) because umask()
is not a shell function and doesn't contain such variable.
If the umask()
function is not a "shell function" is it true to name it a "kernel function"?
umask
umask
asked Nov 23 at 9:45
JohnDoea
551132
551132
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
up vote
1
down vote
accepted
There is no such thing as a "kernel function", unless you mean this.
umask(2) is a system call. And it was so since the dawn of time [1].
But it doesn't have to be that way -- you can implement it by having the actual bitmask be part of a chunk of memory that's always mapped at the same address and preserved through execve(2), and have the open(2), creat(2), etc userland wrappers pick it up from there. That would be just as POSIX-compliant.
[1] in the original implementation, the u.u_cmask
field that function sets is only used in a single place elsewhere -- in the "Make a new file" maknode() function.
add a comment |
up vote
1
down vote
The manual for umask says:
A child process created via fork(2) inherits its parent's umask. The
umask is left unchanged by execve(2).
Therefore because it persists after a call to exec (execve), it must be implemented in the kernel, as all exec calls replace the running program (except some structures stored in the kernel).
My dear ctrl+alt+delor, a user I most appreciate and a man of honor IMO, I had to choose the other answer as "correct" because it defined what I called a "kernel function" as a a "system call" which I get the impression is at least a bit more accurate. Please forgive me for this "swapping". I also upvoted your answer.
– JohnDoea
Nov 26 at 9:48
add a comment |
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
accepted
There is no such thing as a "kernel function", unless you mean this.
umask(2) is a system call. And it was so since the dawn of time [1].
But it doesn't have to be that way -- you can implement it by having the actual bitmask be part of a chunk of memory that's always mapped at the same address and preserved through execve(2), and have the open(2), creat(2), etc userland wrappers pick it up from there. That would be just as POSIX-compliant.
[1] in the original implementation, the u.u_cmask
field that function sets is only used in a single place elsewhere -- in the "Make a new file" maknode() function.
add a comment |
up vote
1
down vote
accepted
There is no such thing as a "kernel function", unless you mean this.
umask(2) is a system call. And it was so since the dawn of time [1].
But it doesn't have to be that way -- you can implement it by having the actual bitmask be part of a chunk of memory that's always mapped at the same address and preserved through execve(2), and have the open(2), creat(2), etc userland wrappers pick it up from there. That would be just as POSIX-compliant.
[1] in the original implementation, the u.u_cmask
field that function sets is only used in a single place elsewhere -- in the "Make a new file" maknode() function.
add a comment |
up vote
1
down vote
accepted
up vote
1
down vote
accepted
There is no such thing as a "kernel function", unless you mean this.
umask(2) is a system call. And it was so since the dawn of time [1].
But it doesn't have to be that way -- you can implement it by having the actual bitmask be part of a chunk of memory that's always mapped at the same address and preserved through execve(2), and have the open(2), creat(2), etc userland wrappers pick it up from there. That would be just as POSIX-compliant.
[1] in the original implementation, the u.u_cmask
field that function sets is only used in a single place elsewhere -- in the "Make a new file" maknode() function.
There is no such thing as a "kernel function", unless you mean this.
umask(2) is a system call. And it was so since the dawn of time [1].
But it doesn't have to be that way -- you can implement it by having the actual bitmask be part of a chunk of memory that's always mapped at the same address and preserved through execve(2), and have the open(2), creat(2), etc userland wrappers pick it up from there. That would be just as POSIX-compliant.
[1] in the original implementation, the u.u_cmask
field that function sets is only used in a single place elsewhere -- in the "Make a new file" maknode() function.
answered Nov 23 at 21:45
mosvy
4,941322
4,941322
add a comment |
add a comment |
up vote
1
down vote
The manual for umask says:
A child process created via fork(2) inherits its parent's umask. The
umask is left unchanged by execve(2).
Therefore because it persists after a call to exec (execve), it must be implemented in the kernel, as all exec calls replace the running program (except some structures stored in the kernel).
My dear ctrl+alt+delor, a user I most appreciate and a man of honor IMO, I had to choose the other answer as "correct" because it defined what I called a "kernel function" as a a "system call" which I get the impression is at least a bit more accurate. Please forgive me for this "swapping". I also upvoted your answer.
– JohnDoea
Nov 26 at 9:48
add a comment |
up vote
1
down vote
The manual for umask says:
A child process created via fork(2) inherits its parent's umask. The
umask is left unchanged by execve(2).
Therefore because it persists after a call to exec (execve), it must be implemented in the kernel, as all exec calls replace the running program (except some structures stored in the kernel).
My dear ctrl+alt+delor, a user I most appreciate and a man of honor IMO, I had to choose the other answer as "correct" because it defined what I called a "kernel function" as a a "system call" which I get the impression is at least a bit more accurate. Please forgive me for this "swapping". I also upvoted your answer.
– JohnDoea
Nov 26 at 9:48
add a comment |
up vote
1
down vote
up vote
1
down vote
The manual for umask says:
A child process created via fork(2) inherits its parent's umask. The
umask is left unchanged by execve(2).
Therefore because it persists after a call to exec (execve), it must be implemented in the kernel, as all exec calls replace the running program (except some structures stored in the kernel).
The manual for umask says:
A child process created via fork(2) inherits its parent's umask. The
umask is left unchanged by execve(2).
Therefore because it persists after a call to exec (execve), it must be implemented in the kernel, as all exec calls replace the running program (except some structures stored in the kernel).
answered Nov 23 at 10:08
ctrl-alt-delor
10.2k41955
10.2k41955
My dear ctrl+alt+delor, a user I most appreciate and a man of honor IMO, I had to choose the other answer as "correct" because it defined what I called a "kernel function" as a a "system call" which I get the impression is at least a bit more accurate. Please forgive me for this "swapping". I also upvoted your answer.
– JohnDoea
Nov 26 at 9:48
add a comment |
My dear ctrl+alt+delor, a user I most appreciate and a man of honor IMO, I had to choose the other answer as "correct" because it defined what I called a "kernel function" as a a "system call" which I get the impression is at least a bit more accurate. Please forgive me for this "swapping". I also upvoted your answer.
– JohnDoea
Nov 26 at 9:48
My dear ctrl+alt+delor, a user I most appreciate and a man of honor IMO, I had to choose the other answer as "correct" because it defined what I called a "kernel function" as a a "system call" which I get the impression is at least a bit more accurate. Please forgive me for this "swapping". I also upvoted your answer.
– JohnDoea
Nov 26 at 9:48
My dear ctrl+alt+delor, a user I most appreciate and a man of honor IMO, I had to choose the other answer as "correct" because it defined what I called a "kernel function" as a a "system call" which I get the impression is at least a bit more accurate. Please forgive me for this "swapping". I also upvoted your answer.
– JohnDoea
Nov 26 at 9:48
add a comment |
Thanks for contributing an answer to Unix & Linux Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f483636%2fis-the-umask-function-a-kernel-function%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown