Xinus Xinus - 1 year ago 103
Linux Question

About POSIX naming convention

I am learning posix api. I could not get logic behind names used by posix api



What does What does
stand for? I can get
are for read and write. But what naming convention followed by POSIX ?

Its just an example. What about other names ? Just like Win32 follow Hungarian Notation for naming what does POSIX follow for their naming ? For standard like POSIX there must be documentation for it. Can somebody please link it.

thanks for any clue .

bta bta
Answer Source

The leading S_ is just to identify what structure/function the constant goes with.

From <sys/stat.h>, the constants S_IRUSR, S_IWUSR, etc are possible values for the st_mode member for struct stat (used in stat() and friends). All the members of struct stat start with the prefix st_, and there are several stat-related macros that also start with S_. The convention is merely there to make matching structure names, member names, and constants easier.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download