diff options
| author | Rob Pike <r@golang.org> | 2009-02-09 12:50:54 -0800 |
|---|---|---|
| committer | Rob Pike <r@golang.org> | 2009-02-09 12:50:54 -0800 |
| commit | cad7a3aefcdfed3176a64a16b2a6151b2fabfd4e (patch) | |
| tree | dbef29b455ee0a42d04436a8532b2caff8efc9b6 /src/lib/syscall | |
| parent | a948fdd6265d0ca2aa3d3d1dfef0670132eb4ef4 (diff) | |
| download | go-cad7a3aefcdfed3176a64a16b2a6151b2fabfd4e.tar.xz | |
simple accessors for Dir mode bits
R=rsc
DELTA=71 (71 added, 0 deleted, 0 changed)
OCL=24687
CL=24694
Diffstat (limited to 'src/lib/syscall')
| -rw-r--r-- | src/lib/syscall/types_amd64_darwin.go | 19 | ||||
| -rw-r--r-- | src/lib/syscall/types_amd64_linux.go | 18 |
2 files changed, 37 insertions, 0 deletions
diff --git a/src/lib/syscall/types_amd64_darwin.go b/src/lib/syscall/types_amd64_darwin.go index dedf63f363..101f223b85 100644 --- a/src/lib/syscall/types_amd64_darwin.go +++ b/src/lib/syscall/types_amd64_darwin.go @@ -69,6 +69,25 @@ const ( NAME_MAX = 255; ) +// Dir.Mode bits +const ( + S_IFMT = 0170000; /* type of file */ + S_IFIFO = 0010000; /* named pipe (fifo) */ + S_IFCHR = 0020000; /* character special */ + S_IFDIR = 0040000; /* directory */ + S_IFBLK = 0060000; /* block special */ + S_IFREG = 0100000; /* regular */ + S_IFLNK = 0120000; /* symbolic link */ + S_IFSOCK = 0140000; /* socket */ + S_IFWHT = 0160000; /* whiteout */ + S_ISUID = 0004000; /* set user id on execution */ + S_ISGID = 0002000; /* set group id on execution */ + S_ISVTX = 0001000; /* save swapped text even after use */ + S_IRUSR = 0000400; /* read permission, owner */ + S_IWUSR = 0000200; /* write permission, owner */ + S_IXUSR = 0000100; /* execute/search permission, owner */ +) + type Stat_t struct { Dev uint32; Mode uint16; diff --git a/src/lib/syscall/types_amd64_linux.go b/src/lib/syscall/types_amd64_linux.go index a83c8ef835..ebfe21c866 100644 --- a/src/lib/syscall/types_amd64_linux.go +++ b/src/lib/syscall/types_amd64_linux.go @@ -69,6 +69,24 @@ const ( NAME_MAX = 255; ) +// Dir.Mode bits +const ( + S_IFMT = 0170000; /* type of file */ + S_IFIFO = 0010000; /* named pipe (fifo) */ + S_IFCHR = 0020000; /* character special */ + S_IFDIR = 0040000; /* directory */ + S_IFBLK = 0060000; /* block special */ + S_IFREG = 0100000; /* regular */ + S_IFLNK = 0120000; /* symbolic link */ + S_IFSOCK = 0140000; /* socket */ + S_ISUID = 0004000; /* set user id on execution */ + S_ISGID = 0002000; /* set group id on execution */ + S_ISVTX = 0001000; /* save swapped text even after use */ + S_IRUSR = 0000400; /* read permission, owner */ + S_IWUSR = 0000200; /* write permission, owner */ + S_IXUSR = 0000100; /* execute/search permission, owner */ +) + type Stat_t struct { Dev uint64; Ino uint64; |
