why are some stat.h "S_*" perm macros not exported via uapi?

Robert P. J. Day rpjday at crashcourse.ca
Tue Jan 1 04:41:30 EST 2019

On Mon, 31 Dec 2018, valdis.kletnieks at vt.edu wrote:

> On Mon, 31 Dec 2018 14:53:30 -0500, "Robert P. J. Day" said:
> >   #define S_IRWXUGO       (S_IRWXU|S_IRWXG|S_IRWXO)
> >   #define S_IRUGO         (S_IRUSR|S_IRGRP|S_IROTH)
> >   #define S_IWUGO         (S_IWUSR|S_IWGRP|S_IWOTH)
> >   #define S_IXUGO         (S_IXUSR|S_IXGRP|S_IXOTH)
> Can you give an actual non-contrived example of code where one of
> these would be preferable to inline coding the mask? And do you plan
> to include all the various combos? And why should that be done in
> the uapi headers, rather than glibc/musl/other_c_lib providing it?

... snip ...

  i am not *defending* the above macros, simply pointing out that,
unlike all the other simpler macros that *are* exported via uapi,
these are left all by their lonesome in kernel space. i'm just
wondering if there's a reason for that.



Robert P. J. Day                                 Ottawa, Ontario, CANADA

Twitter:                                       http://twitter.com/rpjday
LinkedIn:                               http://ca.linkedin.com/in/rpjday

More information about the Kernelnewbies mailing list