summaryrefslogtreecommitdiffstats
path: root/tapset/inode.stp
diff options
context:
space:
mode:
Diffstat (limited to 'tapset/inode.stp')
-rw-r--r--tapset/inode.stp10
1 files changed, 9 insertions, 1 deletions
diff --git a/tapset/inode.stp b/tapset/inode.stp
index 56340d0..39c34b6 100644
--- a/tapset/inode.stp
+++ b/tapset/inode.stp
@@ -12,6 +12,14 @@ function inode_uid:string(_ino:long)
CATCH_DEREF_FAULT();
%}
+function inode_mode:long(_ino:long)
+%{
+ struct inode *inode = (struct inode *)(long) kread(&(THIS->_ino));
+
+ THIS->__retvalue = inode->i_mode;
+
+ CATCH_DEREF_FAULT();
+%}
function file_modes:string(_m:long)
%{
@@ -44,7 +52,7 @@ function file_modes:string(_m:long)
cc = strlen(buf);
}
if (cc)
- snprintf(THIS->__retvalue, MAXSTRINGLEN, "mode 0%o (%s)", _mod, buf);
+ snprintf(THIS->__retvalue, MAXSTRINGLEN, "0%o (%s)", _mod, buf);
else
snprintf(THIS->__retvalue, MAXSTRINGLEN, "mode 0%o", _mod);