xref: /titanic_50/usr/src/lib/libast/common/man/modecanon.3 (revision b3700b074e637f8c6991b70754c88a2cfffb246b)
.fp 5 CW .. .nr ;G \\n(.f .Af "\\$1" "\\$2" "\\$3" "\\$4" "\\$5" "\\$6" "\\$7" "\\$8" "\\$9" \\*(;G .. .aF 5 \\n(.f "\\$1" "\\$2" "\\$3" "\\$4" "\\$5" "\\$6" "\\$7" .. .aF 5 1 "\\$1" "\\$2" "\\$3" "\\$4" "\\$5" "\\$6" "\\$7" .. .aF 1 5 "\\$1" "\\$2" "\\$3" "\\$4" "\\$5" "\\$6" "\\$7" ..

0

..

..

MODECANON 3
NAME
modecanon - canonical file mode representation
SYNOPSIS
#include <modex.h> int modei(int external); int modex(int internal);
DESCRIPTION
POSIX threw out the file type bit macros and replaced them with function-like macros that test file type. This is bad in many ways, the worst of which is that it provides no way for a user program to synthesize file types in the mode bits. pax (1), tar (1) and cpio (1) are examples of user programs that must convert between the internal mode representation and a private external representation. These routines provide a canonical external representation with macros to access and synthesize the bits in the external representation.

.L modei takes an external mode representation external and returns the equivalent internal representation.

.L modex takes an internal mode representation internal and returns the equivalent external representation.

The traditional bit access macro (\f5S_ prefix changes to \f5X_) are: .L X_IFMT , .L X_IFSOCK , .L X_IFLNK , .L X_IFCTG , .L X_IFREG , .L X_IFBLK , .L X_IFDIR , .L X_IFCHR , .L X_IFIFO , .L X_IPERM , .L X_ISUID , .L X_ISGID , .L X_ISVTX , .L X_IRUSR , .L X_IWUSR , .L X_IXUSR , .L X_IRGRP , .L X_IWGRP , .L X_IXGRP , .L X_IROTH , .L X_IWOTH , .L X_IXOTH , .L X_IRWXU , .L X_IRWXG and .L X_IRWXO . .LI X_ITYPE( mode ) returns the type bits for mode .

"SEE ALSO"
pax(1), stat(2)