svn commit: r195979 - in projects/libprocstat: sys/kern sys/sys
usr.bin/fstat
Stanislav Sedov
stas at FreeBSD.org
Thu Jul 30 20:16:35 UTC 2009
Author: stas
Date: Thu Jul 30 20:16:34 2009
New Revision: 195979
URL: http://svn.freebsd.org/changeset/base/195979
Log:
- Return additional file descriptor flags to be more feature complete with
the KVM-based version.
Modified:
projects/libprocstat/sys/kern/kern_descrip.c
projects/libprocstat/sys/sys/user.h
projects/libprocstat/usr.bin/fstat/libprocstat.c
projects/libprocstat/usr.bin/fstat/libprocstat.h
Modified: projects/libprocstat/sys/kern/kern_descrip.c
==============================================================================
--- projects/libprocstat/sys/kern/kern_descrip.c Thu Jul 30 18:53:06 2009 (r195978)
+++ projects/libprocstat/sys/kern/kern_descrip.c Thu Jul 30 20:16:34 2009 (r195979)
@@ -2902,13 +2902,20 @@ export_fd_for_sysctl(void *data, int typ
int kf_fflag;
} fflags_table[] = {
{ FREAD, KF_FLAG_READ },
- { FWRITE , KF_FLAG_WRITE },
- { FAPPEND , KF_FLAG_APPEND },
- { FASYNC , KF_FLAG_ASYNC },
- { FFSYNC , KF_FLAG_FSYNC },
- { FNONBLOCK , KF_FLAG_NONBLOCK },
- { O_DIRECT , KF_FLAG_DIRECT },
- { FHASLOCK , KF_FLAG_HASLOCK }
+ { FWRITE, KF_FLAG_WRITE },
+ { FAPPEND, KF_FLAG_APPEND },
+ { FASYNC, KF_FLAG_ASYNC },
+ { FFSYNC, KF_FLAG_FSYNC },
+ { FNONBLOCK, KF_FLAG_NONBLOCK },
+ { O_DIRECT, KF_FLAG_DIRECT },
+ { FHASLOCK, KF_FLAG_HASLOCK },
+ { O_SHLOCK, KF_FLAG_SHLOCK },
+ { O_EXLOCK, KF_FLAG_EXLOCK },
+ { O_NOFOLLOW, KF_FLAG_NOFOLLOW },
+ { O_CREAT, KF_FLAG_CREAT },
+ { O_TRUNC, KF_FLAG_TRUNC },
+ { O_EXCL, KF_FLAG_EXCL },
+ { O_EXEC, KF_FLAG_EXEC }
};
#define NFFLAGS (sizeof(fflags_table) / sizeof(*fflags_table))
struct vnode *vp;
Modified: projects/libprocstat/sys/sys/user.h
==============================================================================
--- projects/libprocstat/sys/sys/user.h Thu Jul 30 18:53:06 2009 (r195978)
+++ projects/libprocstat/sys/sys/user.h Thu Jul 30 20:16:34 2009 (r195979)
@@ -287,6 +287,13 @@ struct user {
#define KF_FLAG_NONBLOCK 0x00000020
#define KF_FLAG_DIRECT 0x00000040
#define KF_FLAG_HASLOCK 0x00000080
+#define KF_FLAG_SHLOCK 0x00000100
+#define KF_FLAG_EXLOCK 0x00000200
+#define KF_FLAG_NOFOLLOW 0x00000400
+#define KF_FLAG_CREAT 0x00000800
+#define KF_FLAG_TRUNC 0x00001000
+#define KF_FLAG_EXCL 0x00002000
+#define KF_FLAG_EXEC 0x00004000
/*
* Old format. Has variable hidden padding due to alignment.
Modified: projects/libprocstat/usr.bin/fstat/libprocstat.c
==============================================================================
--- projects/libprocstat/usr.bin/fstat/libprocstat.c Thu Jul 30 18:53:06 2009 (r195978)
+++ projects/libprocstat/usr.bin/fstat/libprocstat.c Thu Jul 30 20:16:34 2009 (r195979)
@@ -491,11 +491,17 @@ kinfo_fflags2fst(int kfflags)
{ KF_FLAG_WRITE, PS_FST_FFLAG_WRITE },
{ KF_FLAG_NONBLOCK, PS_FST_FFLAG_NONBLOCK },
{ KF_FLAG_APPEND, PS_FST_FFLAG_APPEND },
- { KF_FLAG_HASLOCK, PS_FST_FFLAG_SHLOCK }, /* XXX: which lock? */
+ { KF_FLAG_HASLOCK, PS_FST_FFLAG_HASLOCK },
{ KF_FLAG_ASYNC, PS_FST_FFLAG_ASYNC },
{ KF_FLAG_FSYNC, PS_FST_FFLAG_SYNC },
{ KF_FLAG_DIRECT, PS_FST_FFLAG_DIRECT },
- /* XXX: other types? */
+ { KF_FLAG_SHLOCK, PS_FST_FFLAG_SHLOCK },
+ { KF_FLAG_EXLOCK, PS_FST_FFLAG_EXLOCK },
+ { KF_FLAG_NOFOLLOW, PS_FST_FFLAG_NOFOLLOW },
+ { KF_FLAG_CREAT, PS_FST_FFLAG_CREAT },
+ { KF_FLAG_TRUNC, PS_FST_FFLAG_TRUNC },
+ { KF_FLAG_EXCL, PS_FST_FFLAG_EXCL },
+ { KF_FLAG_EXEC, PS_FST_FFLAG_EXEC }
};
#define NKFFLAGS (sizeof(kfflags2fst) / sizeof(*kfflags2fst))
unsigned int i;
Modified: projects/libprocstat/usr.bin/fstat/libprocstat.h
==============================================================================
--- projects/libprocstat/usr.bin/fstat/libprocstat.h Thu Jul 30 18:53:06 2009 (r195978)
+++ projects/libprocstat/usr.bin/fstat/libprocstat.h Thu Jul 30 20:16:34 2009 (r195979)
@@ -86,6 +86,7 @@
#define PS_FST_FFLAG_EXCL 0x0800
#define PS_FST_FFLAG_DIRECT 0x1000
#define PS_FST_FFLAG_EXEC 0x2000
+#define PS_FST_FFLAG_HASLOCK 0x4000
struct procstat {
int type;
More information about the svn-src-projects
mailing list